diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ba83f8d..e1f03ad 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,658 +1,1466 @@ lockVersion: 2.0.0 id: 32d162bd-5d3c-4bae-bce8-143fcab0e56e management: - docChecksum: 41c0262ad846794c25bcac117519320e + docChecksum: f5fb49c650f0b24e378f83b41c734d6d docVersion: "2018-02-08" - speakeasyVersion: 1.310.0 - generationVersion: 2.347.4 - releaseVersion: 0.0.2 - configChecksum: b8cb78230a4ba4fadf85903d4670c731 + speakeasyVersion: 1.455.3 + generationVersion: 2.479.3 + releaseVersion: 3.0.0-alpha + configChecksum: 47496c6825d6ac0a363894947066f7c0 + repoURL: https://github.com/goshippo/shippo-php-sdk.git + installationURL: https://github.com/goshippo/shippo-php-sdk + published: true features: php: - core: 3.3.5 + constsAndDefaults: 0.2.0 + core: 3.7.4 flattening: 2.81.1 - globalSecurity: 2.81.6 - globalSecurityFlattening: 0.1.0 + globalSecurity: 2.81.7 + globalSecurityFlattening: 0.1.1 globalServerURLs: 2.82.1 - globals: 2.82.1 + globals: 2.82.2 includes: 2.81.1 + methodArguments: 0.1.0 nameOverrides: 2.81.2 + nullables: 1.0.0 + responseFormat: 0.1.0 + unions: 0.1.4 + webhooks: 1.0.0 generatedFiles: - - src/SDKConfiguration.php - - src/Addresses.php - - src/Batches.php - - src/CarrierAccounts.php - - src/CustomsDeclarations.php - - src/CustomsItems.php - - src/RatesAtCheckout.php - - src/Manifests.php - - src/Orders.php - - src/CarrierParcelTemplates.php - - src/Parcels.php - - src/Pickups.php - - src/Rates.php - - src/Refunds.php - - src/ServiceGroups.php - - src/Shipments.php - - src/TrackingStatus.php - - src/Transactions.php - - src/UserParcelTemplates.php - - src/ShippoAccounts.php - - src/Webhooks.php - - src/ShippoSDK.php - - src/ShippoSDKBuilder.php + - .gitattributes + - CONTRIBUTING.md + - USAGE.md - composer.json - - phpstan.neon - - pint.json - - rector.php - - src/Utils/EnumHandler.php - - src/Utils/FormMetadata.php - - src/Utils/Headers.php - - src/Utils/JSON.php - - src/Utils/MixedJSONHandler.php - - src/Utils/MultipartMetadata.php - - src/Utils/ParamsMetadata.php - - src/Utils/PathParameters.php - - src/Utils/QueryParameters.php - - src/Utils/RequestBodies.php - - src/Utils/RequestMetadata.php - - src/Utils/Security.php - - src/Utils/SecurityClient.php - - src/Utils/SecurityMetadata.php - - src/Utils/SpeakeasyMetadata.php - - src/Utils/Utils.php - - src/Models/Operations/ListAddressesRequest.php - - src/Models/Operations/ListAddressesResponse.php - - src/Models/Operations/CreateAddressRequest.php - - src/Models/Operations/CreateAddressResponse.php - - src/Models/Operations/GetAddressRequest.php - - src/Models/Operations/GetAddressResponse.php - - src/Models/Operations/ValidateAddressRequest.php - - src/Models/Operations/ValidateAddressResponse.php - - src/Models/Operations/CreateBatchRequest.php - - src/Models/Operations/CreateBatchResponse.php - - src/Models/Operations/GetBatchRequest.php - - src/Models/Operations/GetBatchResponse.php - - src/Models/Operations/AddShipmentsToBatchRequest.php - - src/Models/Operations/AddShipmentsToBatchResponse.php - - src/Models/Operations/PurchaseBatchRequest.php - - src/Models/Operations/PurchaseBatchResponse.php - - src/Models/Operations/RemoveShipmentsFromBatchRequest.php - - src/Models/Operations/RemoveShipmentsFromBatchResponse.php - - src/Models/Operations/ListCarrierAccountsRequest.php - - src/Models/Operations/ListCarrierAccountsResponse.php - - src/Models/Operations/CreateCarrierAccountRequest.php - - src/Models/Operations/CreateCarrierAccountResponse.php - - src/Models/Operations/GetCarrierAccountRequest.php - - src/Models/Operations/GetCarrierAccountResponse.php - - src/Models/Operations/UpdateCarrierAccountRequest.php - - src/Models/Operations/UpdateCarrierAccountResponse.php - - src/Models/Operations/InitiateOauth2SigninRequest.php - - src/Models/Operations/InitiateOauth2SigninCarrierAccountsResponseResponseBody.php - - src/Models/Operations/InitiateOauth2SigninCarrierAccountsResponseBody.php - - src/Models/Operations/InitiateOauth2SigninResponseBody.php - - src/Models/Operations/InitiateOauth2SigninResponse.php - - src/Models/Operations/RegisterCarrierAccountRequest.php - - src/Models/Operations/RegisterCarrierAccountResponse.php - - src/Models/Operations/Carrier.php - - src/Models/Operations/GetCarrierRegistrationStatusRequest.php - - src/Models/Operations/GetCarrierRegistrationStatusResponse.php - - src/Models/Operations/ListCustomsDeclarationsRequest.php - - src/Models/Operations/ListCustomsDeclarationsResponse.php - - src/Models/Operations/CreateCustomsDeclarationRequest.php - - src/Models/Operations/CreateCustomsDeclarationResponse.php - - src/Models/Operations/GetCustomsDeclarationRequest.php - - src/Models/Operations/GetCustomsDeclarationResponse.php - - src/Models/Operations/ListCustomsItemsRequest.php - - src/Models/Operations/ListCustomsItemsResponse.php - - src/Models/Operations/CreateCustomsItemRequest.php - - src/Models/Operations/CreateCustomsItemResponse.php - - src/Models/Operations/GetCustomsItemRequest.php - - src/Models/Operations/GetCustomsItemResponse.php - - src/Models/Operations/CreateLiveRateRequest.php - - src/Models/Operations/CreateLiveRateResponse.php - - src/Models/Operations/GetDefaultParcelTemplateRequest.php - - src/Models/Operations/GetDefaultParcelTemplateResponse.php - - src/Models/Operations/UpdateDefaultParcelTemplateRequest.php - - src/Models/Operations/UpdateDefaultParcelTemplateResponse.php - - src/Models/Operations/DeleteDefaultParcelTemplateRequest.php - - src/Models/Operations/DeleteDefaultParcelTemplateResponse.php - - src/Models/Operations/ListManifestsRequest.php - - src/Models/Operations/ListManifestsResponse.php - - src/Models/Operations/CreateManifestRequest.php - - src/Models/Operations/CreateManifestResponse.php - - src/Models/Operations/GetManifestRequest.php - - src/Models/Operations/GetManifestResponse.php - - src/Models/Operations/ListOrdersRequest.php - - src/Models/Operations/ListOrdersResponse.php - - src/Models/Operations/CreateOrderRequest.php - - src/Models/Operations/CreateOrderResponse.php - - src/Models/Operations/GetOrderRequest.php - - src/Models/Operations/GetOrderResponse.php - - src/Models/Operations/IncludeT.php - - src/Models/Operations/ListCarrierParcelTemplatesRequest.php - - src/Models/Operations/ListCarrierParcelTemplatesResponse.php - - src/Models/Operations/GetCarrierParcelTemplateRequest.php - - src/Models/Operations/GetCarrierParcelTemplateResponse.php - - src/Models/Operations/ListParcelsRequest.php - - src/Models/Operations/ListParcelsResponse.php - - src/Models/Operations/CreateParcelRequest.php - - src/Models/Operations/CreateParcelResponse.php - - src/Models/Operations/GetParcelRequest.php - - src/Models/Operations/GetParcelResponse.php - - src/Models/Operations/CreatePickupRequest.php - - src/Models/Operations/CreatePickupResponse.php - - src/Models/Operations/GetRateRequest.php - - src/Models/Operations/GetRateResponse.php - - src/Models/Operations/ListShipmentRatesRequest.php - - src/Models/Operations/ListShipmentRatesResponse.php - - src/Models/Operations/ListShipmentRatesByCurrencyCodeRequest.php - - src/Models/Operations/ListShipmentRatesByCurrencyCodeResponse.php - - src/Models/Operations/CreateRefundRequest.php - - src/Models/Operations/CreateRefundResponse.php - - src/Models/Operations/ListRefundsRequest.php - - src/Models/Operations/ListRefundsResponse.php - - src/Models/Operations/GetRefundRequest.php - - src/Models/Operations/GetRefundResponse.php - - src/Models/Operations/ListServiceGroupsRequest.php - - src/Models/Operations/ListServiceGroupsResponse.php - - src/Models/Operations/CreateServiceGroupRequest.php - - src/Models/Operations/CreateServiceGroupResponse.php - - src/Models/Operations/UpdateServiceGroupRequest.php - - src/Models/Operations/UpdateServiceGroupResponse.php - - src/Models/Operations/DeleteServiceGroupRequest.php - - src/Models/Operations/DeleteServiceGroupResponse.php - - src/Models/Operations/ListShipmentsRequest.php - - src/Models/Operations/ListShipmentsResponse.php - - src/Models/Operations/CreateShipmentRequest.php - - src/Models/Operations/CreateShipmentResponse.php - - src/Models/Operations/GetShipmentRequest.php - - src/Models/Operations/GetShipmentResponse.php - - src/Models/Operations/CreateTrackRequest.php - - src/Models/Operations/CreateTrackResponse.php - - src/Models/Operations/GetTrackRequest.php - - src/Models/Operations/GetTrackResponse.php - - src/Models/Operations/ListTransactionsRequest.php - - src/Models/Operations/ListTransactionsResponse.php - - src/Models/Operations/CreateTransactionRequest.php - - src/Models/Operations/CreateTransactionResponse.php - - src/Models/Operations/GetTransactionRequest.php - - src/Models/Operations/GetTransactionResponse.php - - src/Models/Operations/ListUserParcelTemplatesRequest.php - - src/Models/Operations/ListUserParcelTemplatesResponse.php - - src/Models/Operations/CreateUserParcelTemplateRequest.php - - src/Models/Operations/CreateUserParcelTemplateResponse.php - - src/Models/Operations/DeleteUserParcelTemplateRequest.php - - src/Models/Operations/DeleteUserParcelTemplateResponse.php - - src/Models/Operations/GetUserParcelTemplateRequest.php - - src/Models/Operations/GetUserParcelTemplateResponse.php - - src/Models/Operations/UpdateUserParcelTemplateRequest.php - - src/Models/Operations/UpdateUserParcelTemplateResponse.php - - src/Models/Operations/ListShippoAccountsRequest.php - - src/Models/Operations/ListShippoAccountsResponse.php - - src/Models/Operations/CreateShippoAccountRequest.php - - src/Models/Operations/CreateShippoAccountResponse.php - - src/Models/Operations/GetShippoAccountRequest.php - - src/Models/Operations/GetShippoAccountResponse.php - - src/Models/Operations/UpdateShippoAccountRequest.php - - src/Models/Operations/UpdateShippoAccountResponse.php - - src/Models/Operations/CreateWebhookResponse.php - - src/Models/Operations/ListWebhooksResponse.php - - src/Models/Operations/GetWebhookRequest.php - - src/Models/Operations/GetWebhookResponse.php - - src/Models/Operations/UpdateWebhookRequest.php - - src/Models/Operations/UpdateWebhookResponse.php - - src/Models/Operations/DeleteWebhookRequest.php - - src/Models/Operations/DeleteWebhookResponse.php - - src/Models/Components/AddressPaginatedList.php - - src/Models/Components/Address.php - - src/Models/Components/AddressValidationResults.php - - src/Models/Components/AddressValidationResultsMessage.php - - src/Models/Components/AddressCreateRequest.php - - src/Models/Components/ObjectResults.php - - src/Models/Components/BatchStatus.php - - src/Models/Components/Batch.php - - src/Models/Components/BatchShipmentPaginatedList.php - - src/Models/Components/Status.php - - src/Models/Components/BatchShipment.php - - src/Models/Components/LabelFileTypeEnum.php - - src/Models/Components/BatchCreateRequest.php - - src/Models/Components/BatchShipmentCreateRequest.php - - src/Models/Components/ShipmentCreateRequest.php - - src/Models/Components/AncillaryEndorsement.php - - src/Models/Components/DangerousGoodsCode.php - - src/Models/Components/PreferredDeliveryTimeframe.php - - src/Models/Components/SignatureConfirmation.php - - src/Models/Components/ShipmentExtra.php - - src/Models/Components/UPSReferenceFields.php - - src/Models/Components/RmaNumber.php - - src/Models/Components/PoNumber.php - - src/Models/Components/ShipmentExtraLasershipAttributesEnum.php - - src/Models/Components/InvoiceNumber.php - - src/Models/Components/Provider.php - - src/Models/Components/Insurance.php - - src/Models/Components/DryIce.php - - src/Models/Components/DepartmentNumber.php - - src/Models/Components/DangerousGoodsObject.php - - src/Models/Components/DangerousGoodsLithiumBatteries.php - - src/Models/Components/DangerousGoodsBiologicalMaterial.php - - src/Models/Components/CustomerReference.php - - src/Models/Components/PaymentMethod.php - - src/Models/Components/Cod.php - - src/Models/Components/Type.php - - src/Models/Components/Billing.php - - src/Models/Components/RecipientType.php - - src/Models/Components/Alcohol.php - - src/Models/Components/CarrierAccountPaginatedList.php - - src/Models/Components/CarrierAccountWithExtraInfoType.php - - src/Models/Components/CarrierAccountWithExtraInfoStatus.php - - src/Models/Components/Authentication.php - - src/Models/Components/ObjectInfo.php - - src/Models/Components/CarrierAccountWithExtraInfo.php - - src/Models/Components/CarrierAccountServiceLevel.php - - src/Models/Components/CarriersEnum.php - - src/Models/Components/CarrierAccount.php - - src/Models/Components/ConnectExistingOwnAccountRequest.php - - src/Models/Components/CarrierAccountBase.php - - src/Models/Components/CarrierAccountRegistrationStatus.php - - src/Models/Components/CustomsDeclarationPaginatedList.php - - src/Models/Components/CustomsDeclaration.php - - src/Models/Components/ObjectStateEnum.php - - src/Models/Components/CustomsInvoicedCharges.php - - src/Models/Components/CustomsExporterIdentification.php - - src/Models/Components/CustomsTaxIdentificationType.php - - src/Models/Components/CustomsTaxIdentification.php - - src/Models/Components/CustomsDeclarationCreateRequest.php - - src/Models/Components/CustomsDeclarationNonDeliveryOptionEnum.php - - src/Models/Components/CustomsItemCreateRequest.php - - src/Models/Components/WeightUnitEnum.php - - src/Models/Components/CustomsDeclarationIncotermEnum.php - - src/Models/Components/CustomsDeclarationEelPfcEnum.php - - src/Models/Components/CustomsDeclarationContentsTypeEnum.php - - src/Models/Components/AddressImporter.php - - src/Models/Components/CustomsDeclarationB13AFilingOptionEnum.php - - src/Models/Components/CustomsItemPaginatedList.php - - src/Models/Components/CustomsItem.php - - src/Models/Components/LiveRatePaginatedList.php - - src/Models/Components/LiveRate.php - - src/Models/Components/LiveRateCreateRequest.php - - src/Models/Components/LineItem.php - - src/Models/Components/DefaultParcelTemplate.php - - src/Models/Components/UserParcelTemplate.php - - src/Models/Components/CarrierParcelTemplate.php - - src/Models/Components/DistanceUnitEnum.php - - src/Models/Components/DefaultParcelTemplateUpdateRequest.php - - src/Models/Components/ManifestPaginatedList.php - - src/Models/Components/ManifestStatus.php - - src/Models/Components/Manifest.php - - src/Models/Components/ManifestCreateRequest.php - - src/Models/Components/OrderPaginatedList.php - - src/Models/Components/ShopApp.php - - src/Models/Components/Order.php - - src/Models/Components/OrderStatusEnum.php - - src/Models/Components/OrderCreateRequest.php - - src/Models/Components/LineItemBase.php - - src/Models/Components/CarrierParcelTemplateList.php - - src/Models/Components/ParcelPaginatedList.php - - src/Models/Components/ObjectState.php - - src/Models/Components/Parcel.php - - src/Models/Components/ParcelExtra.php - - src/Models/Components/ParcelInsuranceProvider.php - - src/Models/Components/ParcelInsurance.php - - src/Models/Components/PickupStatus.php - - src/Models/Components/Pickup.php - - src/Models/Components/BuildingLocationType.php - - src/Models/Components/BuildingType.php - - src/Models/Components/Location.php - - src/Models/Components/AddressCompleteCreateRequest.php - - src/Models/Components/PickupBase.php - - src/Models/Components/Attributes.php - - src/Models/Components/Rate.php - - src/Models/Components/ParentServicelevel.php - - src/Models/Components/ServiceLevelWithParent.php - - src/Models/Components/ResponseMessage.php - - src/Models/Components/RatePaginatedList.php - - src/Models/Components/RefundStatus.php - - src/Models/Components/Refund.php - - src/Models/Components/RefundRequestBody.php - - src/Models/Components/RefundPaginatedList.php - - src/Models/Components/ServiceGroup.php - - src/Models/Components/ServiceGroupTypeEnum.php - - src/Models/Components/ServiceGroupCreateRequest.php - - src/Models/Components/ServiceGroupAccountAndServiceLevel.php - - src/Models/Components/ServiceGroupUpdateRequest.php - - src/Models/Components/ShipmentPaginatedList.php - - src/Models/Components/ShipmentStatus.php - - src/Models/Components/Shipment.php - - src/Models/Components/Track.php - - src/Models/Components/TrackingStatus.php - - src/Models/Components/TrackingStatusSubstatus.php - - src/Models/Components/TrackingStatusEnum.php - - src/Models/Components/TrackingStatusLocationBase.php - - src/Models/Components/TracksRequest.php - - src/Models/Components/TransactionPaginatedList.php - - src/Models/Components/CreatedBy.php - - src/Models/Components/Transaction.php - - src/Models/Components/TransactionStatusEnum.php - - src/Models/Components/UserParcelTemplateList.php - - src/Models/Components/UserParcelTemplateUpdateRequest.php - - src/Models/Components/ShippoAccountPaginatedList.php - - src/Models/Components/ShippoAccount.php - - src/Models/Components/ShippoAccountUpdateRequest.php - - src/Models/Components/Webhook.php - - src/Models/Components/WebhookUpdateRequest.php - - src/Models/Components/WebhookEventTypeEnum.php - - src/Models/Components/WebhookPaginatedList.php - - src/Models/Components/Security.php - - src/Models/Components/AddressValidationResultsMessageCodeEnum.php - - src/Models/Components/AddressValidationResultsMessageSourceEnum.php - - src/Models/Components/ServiceLevel.php - - docs/Models/Operations/ListAddressesRequest.md - - docs/Models/Operations/ListAddressesResponse.md - - docs/Models/Operations/CreateAddressRequest.md - - docs/Models/Operations/CreateAddressResponse.md - - docs/Models/Operations/GetAddressRequest.md - - docs/Models/Operations/GetAddressResponse.md - - docs/Models/Operations/ValidateAddressRequest.md - - docs/Models/Operations/ValidateAddressResponse.md - - docs/Models/Operations/CreateBatchRequest.md - - docs/Models/Operations/CreateBatchResponse.md - - docs/Models/Operations/GetBatchRequest.md - - docs/Models/Operations/GetBatchResponse.md - - docs/Models/Operations/AddShipmentsToBatchRequest.md - - docs/Models/Operations/AddShipmentsToBatchResponse.md - - docs/Models/Operations/PurchaseBatchRequest.md - - docs/Models/Operations/PurchaseBatchResponse.md - - docs/Models/Operations/RemoveShipmentsFromBatchRequest.md - - docs/Models/Operations/RemoveShipmentsFromBatchResponse.md - - docs/Models/Operations/ListCarrierAccountsRequest.md - - docs/Models/Operations/ListCarrierAccountsResponse.md - - docs/Models/Operations/CreateCarrierAccountRequest.md - - docs/Models/Operations/CreateCarrierAccountResponse.md - - docs/Models/Operations/GetCarrierAccountRequest.md - - docs/Models/Operations/GetCarrierAccountResponse.md - - docs/Models/Operations/UpdateCarrierAccountRequest.md - - docs/Models/Operations/UpdateCarrierAccountResponse.md - - docs/Models/Operations/InitiateOauth2SigninRequest.md - - docs/Models/Operations/InitiateOauth2SigninCarrierAccountsResponseResponseBody.md - - docs/Models/Operations/InitiateOauth2SigninCarrierAccountsResponseBody.md - - docs/Models/Operations/InitiateOauth2SigninResponseBody.md - - docs/Models/Operations/InitiateOauth2SigninResponse.md - - docs/Models/Operations/RegisterCarrierAccountRequest.md - - docs/Models/Operations/RegisterCarrierAccountResponse.md - - docs/Models/Operations/Carrier.md - - docs/Models/Operations/GetCarrierRegistrationStatusRequest.md - - docs/Models/Operations/GetCarrierRegistrationStatusResponse.md - - docs/Models/Operations/ListCustomsDeclarationsRequest.md - - docs/Models/Operations/ListCustomsDeclarationsResponse.md - - docs/Models/Operations/CreateCustomsDeclarationRequest.md - - docs/Models/Operations/CreateCustomsDeclarationResponse.md - - docs/Models/Operations/GetCustomsDeclarationRequest.md - - docs/Models/Operations/GetCustomsDeclarationResponse.md - - docs/Models/Operations/ListCustomsItemsRequest.md - - docs/Models/Operations/ListCustomsItemsResponse.md - - docs/Models/Operations/CreateCustomsItemRequest.md - - docs/Models/Operations/CreateCustomsItemResponse.md - - docs/Models/Operations/GetCustomsItemRequest.md - - docs/Models/Operations/GetCustomsItemResponse.md - - docs/Models/Operations/CreateLiveRateRequest.md - - docs/Models/Operations/CreateLiveRateResponse.md - - docs/Models/Operations/GetDefaultParcelTemplateRequest.md - - docs/Models/Operations/GetDefaultParcelTemplateResponse.md - - docs/Models/Operations/UpdateDefaultParcelTemplateRequest.md - - docs/Models/Operations/UpdateDefaultParcelTemplateResponse.md - - docs/Models/Operations/DeleteDefaultParcelTemplateRequest.md - - docs/Models/Operations/DeleteDefaultParcelTemplateResponse.md - - docs/Models/Operations/ListManifestsRequest.md - - docs/Models/Operations/ListManifestsResponse.md - - docs/Models/Operations/CreateManifestRequest.md - - docs/Models/Operations/CreateManifestResponse.md - - docs/Models/Operations/GetManifestRequest.md - - docs/Models/Operations/GetManifestResponse.md - - docs/Models/Operations/ListOrdersRequest.md - - docs/Models/Operations/ListOrdersResponse.md - - docs/Models/Operations/CreateOrderRequest.md - - docs/Models/Operations/CreateOrderResponse.md - - docs/Models/Operations/GetOrderRequest.md - - docs/Models/Operations/GetOrderResponse.md - - docs/Models/Operations/IncludeT.md - - docs/Models/Operations/ListCarrierParcelTemplatesRequest.md - - docs/Models/Operations/ListCarrierParcelTemplatesResponse.md - - docs/Models/Operations/GetCarrierParcelTemplateRequest.md - - docs/Models/Operations/GetCarrierParcelTemplateResponse.md - - docs/Models/Operations/ListParcelsRequest.md - - docs/Models/Operations/ListParcelsResponse.md - - docs/Models/Operations/CreateParcelRequest.md - - docs/Models/Operations/CreateParcelResponse.md - - docs/Models/Operations/GetParcelRequest.md - - docs/Models/Operations/GetParcelResponse.md - - docs/Models/Operations/CreatePickupRequest.md - - docs/Models/Operations/CreatePickupResponse.md - - docs/Models/Operations/GetRateRequest.md - - docs/Models/Operations/GetRateResponse.md - - docs/Models/Operations/ListShipmentRatesRequest.md - - docs/Models/Operations/ListShipmentRatesResponse.md - - docs/Models/Operations/ListShipmentRatesByCurrencyCodeRequest.md - - docs/Models/Operations/ListShipmentRatesByCurrencyCodeResponse.md - - docs/Models/Operations/CreateRefundRequest.md - - docs/Models/Operations/CreateRefundResponse.md - - docs/Models/Operations/ListRefundsRequest.md - - docs/Models/Operations/ListRefundsResponse.md - - docs/Models/Operations/GetRefundRequest.md - - docs/Models/Operations/GetRefundResponse.md - - docs/Models/Operations/ListServiceGroupsRequest.md - - docs/Models/Operations/ListServiceGroupsResponse.md - - docs/Models/Operations/CreateServiceGroupRequest.md - - docs/Models/Operations/CreateServiceGroupResponse.md - - docs/Models/Operations/UpdateServiceGroupRequest.md - - docs/Models/Operations/UpdateServiceGroupResponse.md - - docs/Models/Operations/DeleteServiceGroupRequest.md - - docs/Models/Operations/DeleteServiceGroupResponse.md - - docs/Models/Operations/ListShipmentsRequest.md - - docs/Models/Operations/ListShipmentsResponse.md - - docs/Models/Operations/CreateShipmentRequest.md - - docs/Models/Operations/CreateShipmentResponse.md - - docs/Models/Operations/GetShipmentRequest.md - - docs/Models/Operations/GetShipmentResponse.md - - docs/Models/Operations/CreateTrackRequest.md - - docs/Models/Operations/CreateTrackResponse.md - - docs/Models/Operations/GetTrackRequest.md - - docs/Models/Operations/GetTrackResponse.md - - docs/Models/Operations/ListTransactionsRequest.md - - docs/Models/Operations/ListTransactionsResponse.md - - docs/Models/Operations/CreateTransactionRequest.md - - docs/Models/Operations/CreateTransactionResponse.md - - docs/Models/Operations/GetTransactionRequest.md - - docs/Models/Operations/GetTransactionResponse.md - - docs/Models/Operations/ListUserParcelTemplatesRequest.md - - docs/Models/Operations/ListUserParcelTemplatesResponse.md - - docs/Models/Operations/CreateUserParcelTemplateRequest.md - - docs/Models/Operations/CreateUserParcelTemplateResponse.md - - docs/Models/Operations/DeleteUserParcelTemplateRequest.md - - docs/Models/Operations/DeleteUserParcelTemplateResponse.md - - docs/Models/Operations/GetUserParcelTemplateRequest.md - - docs/Models/Operations/GetUserParcelTemplateResponse.md - - docs/Models/Operations/UpdateUserParcelTemplateRequest.md - - docs/Models/Operations/UpdateUserParcelTemplateResponse.md - - docs/Models/Operations/ListShippoAccountsRequest.md - - docs/Models/Operations/ListShippoAccountsResponse.md - - docs/Models/Operations/CreateShippoAccountRequest.md - - docs/Models/Operations/CreateShippoAccountResponse.md - - docs/Models/Operations/GetShippoAccountRequest.md - - docs/Models/Operations/GetShippoAccountResponse.md - - docs/Models/Operations/UpdateShippoAccountRequest.md - - docs/Models/Operations/UpdateShippoAccountResponse.md - - docs/Models/Operations/CreateWebhookResponse.md - - docs/Models/Operations/ListWebhooksResponse.md - - docs/Models/Operations/GetWebhookRequest.md - - docs/Models/Operations/GetWebhookResponse.md - - docs/Models/Operations/UpdateWebhookRequest.md - - docs/Models/Operations/UpdateWebhookResponse.md - - docs/Models/Operations/DeleteWebhookRequest.md - - docs/Models/Operations/DeleteWebhookResponse.md - - docs/Models/Components/AddressPaginatedList.md - docs/Models/Components/Address.md + - docs/Models/Components/AddressCompleteCreateRequest.md + - docs/Models/Components/AddressCreateRequest.md + - docs/Models/Components/AddressFrom.md + - docs/Models/Components/AddressImporter.md + - docs/Models/Components/AddressPaginatedList.md + - docs/Models/Components/AddressReturn.md + - docs/Models/Components/AddressTo.md - docs/Models/Components/AddressValidationResults.md - docs/Models/Components/AddressValidationResultsMessage.md - - docs/Models/Components/AddressCreateRequest.md - - docs/Models/Components/ObjectResults.md - - docs/Models/Components/BatchStatus.md + - docs/Models/Components/AddressValidationResultsMessageCodeEnum.md + - docs/Models/Components/AddressValidationResultsMessageSourceEnum.md + - docs/Models/Components/Alcohol.md + - docs/Models/Components/AncillaryEndorsement.md + - docs/Models/Components/Attributes.md + - docs/Models/Components/Authentication.md - docs/Models/Components/Batch.md - - docs/Models/Components/BatchShipmentPaginatedList.md - - docs/Models/Components/Status.md - - docs/Models/Components/BatchShipment.md - - docs/Models/Components/LabelFileTypeEnum.md - docs/Models/Components/BatchCreateRequest.md + - docs/Models/Components/BatchShipment.md - docs/Models/Components/BatchShipmentCreateRequest.md - - docs/Models/Components/ShipmentCreateRequest.md - - docs/Models/Components/AncillaryEndorsement.md - - docs/Models/Components/DangerousGoodsCode.md - - docs/Models/Components/PreferredDeliveryTimeframe.md - - docs/Models/Components/SignatureConfirmation.md - - docs/Models/Components/ShipmentExtra.md - - docs/Models/Components/UPSReferenceFields.md - - docs/Models/Components/RmaNumber.md - - docs/Models/Components/PoNumber.md - - docs/Models/Components/ShipmentExtraLasershipAttributesEnum.md - - docs/Models/Components/InvoiceNumber.md - - docs/Models/Components/Provider.md - - docs/Models/Components/Insurance.md - - docs/Models/Components/DryIce.md - - docs/Models/Components/DepartmentNumber.md - - docs/Models/Components/DangerousGoodsObject.md - - docs/Models/Components/DangerousGoodsLithiumBatteries.md - - docs/Models/Components/DangerousGoodsBiologicalMaterial.md - - docs/Models/Components/CustomerReference.md - - docs/Models/Components/PaymentMethod.md - - docs/Models/Components/Cod.md - - docs/Models/Components/Type.md + - docs/Models/Components/BatchShipmentPaginatedList.md + - docs/Models/Components/BatchStatus.md - docs/Models/Components/Billing.md - - docs/Models/Components/RecipientType.md - - docs/Models/Components/Alcohol.md + - docs/Models/Components/BuildingLocationType.md + - docs/Models/Components/BuildingType.md + - docs/Models/Components/CarrierAccount.md + - docs/Models/Components/CarrierAccountBase.md + - docs/Models/Components/CarrierAccountBaseParameters.md + - docs/Models/Components/CarrierAccountCanadaPostCreateParameters.md + - docs/Models/Components/CarrierAccountCanadaPostCreateRequest.md + - docs/Models/Components/CarrierAccountChronopostCreateRequest.md + - docs/Models/Components/CarrierAccountChronopostCreateRequestParameters.md + - docs/Models/Components/CarrierAccountColissimoCreateRequest.md + - docs/Models/Components/CarrierAccountColissimoCreateRequestParameters.md + - docs/Models/Components/CarrierAccountCorreosCreateRequest.md + - docs/Models/Components/CarrierAccountCorreosCreateRequestParameters.md + - docs/Models/Components/CarrierAccountDHLExpressCreateRequest.md + - docs/Models/Components/CarrierAccountDHLExpressCreateRequestParameters.md + - docs/Models/Components/CarrierAccountDPDUKCreateRequest.md + - docs/Models/Components/CarrierAccountDPDUKCreateRequestParameters.md + - docs/Models/Components/CarrierAccountDeutschePostCreateRequest.md + - docs/Models/Components/CarrierAccountDeutschePostCreateRequestParameters.md + - docs/Models/Components/CarrierAccountDpdDeCreateRequest.md + - docs/Models/Components/CarrierAccountDpdDeCreateRequestParameters.md + - docs/Models/Components/CarrierAccountFedExCreateRequest.md + - docs/Models/Components/CarrierAccountFedExCreateRequestParameters.md + - docs/Models/Components/CarrierAccountHermesUKCreateRequest.md + - docs/Models/Components/CarrierAccountHermesUKCreateRequestParameters.md + - docs/Models/Components/CarrierAccountMondialRelayCreateRequest.md + - docs/Models/Components/CarrierAccountMondialRelayCreateRequestParameters.md - docs/Models/Components/CarrierAccountPaginatedList.md - - docs/Models/Components/CarrierAccountWithExtraInfoType.md - - docs/Models/Components/CarrierAccountWithExtraInfoStatus.md - - docs/Models/Components/Authentication.md - - docs/Models/Components/ObjectInfo.md - - docs/Models/Components/CarrierAccountWithExtraInfo.md + - docs/Models/Components/CarrierAccountParameters.md + - docs/Models/Components/CarrierAccountPosteItalianeCreateRequest.md + - docs/Models/Components/CarrierAccountPosteItalianeCreateRequestParameters.md + - docs/Models/Components/CarrierAccountRegistrationStatus.md + - docs/Models/Components/CarrierAccountSendleCreateRequest.md + - docs/Models/Components/CarrierAccountSendleCreateRequestParameters.md - docs/Models/Components/CarrierAccountServiceLevel.md + - docs/Models/Components/CarrierAccountUPSCreateRequest.md + - docs/Models/Components/CarrierAccountUPSCreateRequestParameters.md + - docs/Models/Components/CarrierAccountUSPSCreateRequest.md + - docs/Models/Components/CarrierAccountUSPSCreateRequestParameters.md + - docs/Models/Components/CarrierAccountWithExtraInfo.md + - docs/Models/Components/CarrierAccountWithExtraInfoStatus.md + - docs/Models/Components/CarrierAccountWithExtraInfoType.md + - docs/Models/Components/CarrierParcelTemplate.md + - docs/Models/Components/CarrierParcelTemplateList.md - docs/Models/Components/CarriersEnum.md - - docs/Models/Components/CarrierAccount.md + - docs/Models/Components/Cod.md - docs/Models/Components/ConnectExistingOwnAccountRequest.md - - docs/Models/Components/CarrierAccountBase.md - - docs/Models/Components/CarrierAccountRegistrationStatus.md - - docs/Models/Components/CustomsDeclarationPaginatedList.md + - docs/Models/Components/ConnectExistingOwnAccountRequestParameters.md + - docs/Models/Components/CoreRate.md + - docs/Models/Components/CreatedBy.md + - docs/Models/Components/CustomerReference.md - docs/Models/Components/CustomsDeclaration.md - - docs/Models/Components/ObjectStateEnum.md - - docs/Models/Components/CustomsInvoicedCharges.md - - docs/Models/Components/CustomsExporterIdentification.md - - docs/Models/Components/CustomsTaxIdentificationType.md - - docs/Models/Components/CustomsTaxIdentification.md + - docs/Models/Components/CustomsDeclarationAddress.md + - docs/Models/Components/CustomsDeclarationB13AFilingOptionEnum.md + - docs/Models/Components/CustomsDeclarationContentsTypeEnum.md - docs/Models/Components/CustomsDeclarationCreateRequest.md + - docs/Models/Components/CustomsDeclarationCreateRequestAddress.md + - docs/Models/Components/CustomsDeclarationCreateRequestType.md + - docs/Models/Components/CustomsDeclarationDutiesPayor.md + - docs/Models/Components/CustomsDeclarationEelPfcEnum.md + - docs/Models/Components/CustomsDeclarationIncotermEnum.md - docs/Models/Components/CustomsDeclarationNonDeliveryOptionEnum.md + - docs/Models/Components/CustomsDeclarationPaginatedList.md + - docs/Models/Components/CustomsDeclarationType.md + - docs/Models/Components/CustomsExporterIdentification.md + - docs/Models/Components/CustomsInvoicedCharges.md + - docs/Models/Components/CustomsItem.md - docs/Models/Components/CustomsItemCreateRequest.md - - docs/Models/Components/WeightUnitEnum.md - - docs/Models/Components/CustomsDeclarationIncotermEnum.md - - docs/Models/Components/CustomsDeclarationEelPfcEnum.md - - docs/Models/Components/CustomsDeclarationContentsTypeEnum.md - - docs/Models/Components/AddressImporter.md - - docs/Models/Components/CustomsDeclarationB13AFilingOptionEnum.md - docs/Models/Components/CustomsItemPaginatedList.md - - docs/Models/Components/CustomsItem.md - - docs/Models/Components/LiveRatePaginatedList.md - - docs/Models/Components/LiveRate.md - - docs/Models/Components/LiveRateCreateRequest.md - - docs/Models/Components/LineItem.md + - docs/Models/Components/CustomsTaxIdentification.md + - docs/Models/Components/CustomsTaxIdentificationType.md + - docs/Models/Components/DangerousGoodsBiologicalMaterial.md + - docs/Models/Components/DangerousGoodsCode.md + - docs/Models/Components/DangerousGoodsLithiumBatteries.md + - docs/Models/Components/DangerousGoodsObject.md - docs/Models/Components/DefaultParcelTemplate.md - - docs/Models/Components/UserParcelTemplate.md - - docs/Models/Components/CarrierParcelTemplate.md - - docs/Models/Components/DistanceUnitEnum.md - docs/Models/Components/DefaultParcelTemplateUpdateRequest.md - - docs/Models/Components/ManifestPaginatedList.md - - docs/Models/Components/ManifestStatus.md + - docs/Models/Components/DepartmentNumber.md + - docs/Models/Components/DistanceUnitEnum.md + - docs/Models/Components/DryIce.md + - docs/Models/Components/DutiesPayor.md + - docs/Models/Components/FedExConnectExistingOwnAccountParameters.md + - docs/Models/Components/InstantTransactionCreateRequest.md + - docs/Models/Components/Insurance.md + - docs/Models/Components/InvoiceNumber.md + - docs/Models/Components/LabelFileType.md + - docs/Models/Components/LabelFileTypeEnum.md + - docs/Models/Components/Latitude.md + - docs/Models/Components/LineItem.md + - docs/Models/Components/LineItemBase.md + - docs/Models/Components/LiveRate.md + - docs/Models/Components/LiveRateCreateRequest.md + - docs/Models/Components/LiveRateCreateRequestAddressFrom.md + - docs/Models/Components/LiveRateCreateRequestAddressTo.md + - docs/Models/Components/LiveRateCreateRequestParcel.md + - docs/Models/Components/LiveRatePaginatedList.md + - docs/Models/Components/Location.md + - docs/Models/Components/Longitude.md - docs/Models/Components/Manifest.md - docs/Models/Components/ManifestCreateRequest.md - - docs/Models/Components/OrderPaginatedList.md - - docs/Models/Components/ShopApp.md + - docs/Models/Components/ManifestCreateRequestAddressFrom.md + - docs/Models/Components/ManifestPaginatedList.md + - docs/Models/Components/ManifestStatus.md + - docs/Models/Components/ObjectInfo.md + - docs/Models/Components/ObjectResults.md + - docs/Models/Components/ObjectState.md + - docs/Models/Components/ObjectStateEnum.md - docs/Models/Components/Order.md - - docs/Models/Components/OrderStatusEnum.md - docs/Models/Components/OrderCreateRequest.md - - docs/Models/Components/LineItemBase.md - - docs/Models/Components/CarrierParcelTemplateList.md - - docs/Models/Components/ParcelPaginatedList.md - - docs/Models/Components/ObjectState.md + - docs/Models/Components/OrderPaginatedList.md + - docs/Models/Components/OrderShopAppEnum.md + - docs/Models/Components/OrderStatusEnum.md + - docs/Models/Components/Parameters.md - docs/Models/Components/Parcel.md + - docs/Models/Components/ParcelCreateFromTemplateRequest.md + - docs/Models/Components/ParcelCreateRequest.md - docs/Models/Components/ParcelExtra.md - - docs/Models/Components/ParcelInsuranceProvider.md - docs/Models/Components/ParcelInsurance.md - - docs/Models/Components/PickupStatus.md + - docs/Models/Components/ParcelInsuranceProvider.md + - docs/Models/Components/ParcelPaginatedList.md + - docs/Models/Components/ParcelTemplateAramexAustraliaEnum.md + - docs/Models/Components/ParcelTemplateCouriersPleaseEnum.md + - docs/Models/Components/ParcelTemplateDHLeCommerceEnum.md + - docs/Models/Components/ParcelTemplateDPDUKEnum.md + - docs/Models/Components/ParcelTemplateEnumSet.md + - docs/Models/Components/ParcelTemplateFedExEnum.md + - docs/Models/Components/ParcelTemplateUPSEnum.md + - docs/Models/Components/ParcelTemplateUSPSEnum.md + - docs/Models/Components/Parcels.md + - docs/Models/Components/PaymentMethod.md - docs/Models/Components/Pickup.md - - docs/Models/Components/BuildingLocationType.md - - docs/Models/Components/BuildingType.md - - docs/Models/Components/Location.md - - docs/Models/Components/AddressCompleteCreateRequest.md - docs/Models/Components/PickupBase.md - - docs/Models/Components/Attributes.md + - docs/Models/Components/PickupStatus.md + - docs/Models/Components/PoNumber.md + - docs/Models/Components/PreferredDeliveryTimeframe.md + - docs/Models/Components/Provider.md - docs/Models/Components/Rate.md - - docs/Models/Components/ParentServicelevel.md - - docs/Models/Components/ServiceLevelWithParent.md - - docs/Models/Components/ResponseMessage.md - docs/Models/Components/RatePaginatedList.md - - docs/Models/Components/RefundStatus.md + - docs/Models/Components/RecipientType.md - docs/Models/Components/Refund.md - - docs/Models/Components/RefundRequestBody.md - docs/Models/Components/RefundPaginatedList.md + - docs/Models/Components/RefundRequestBody.md + - docs/Models/Components/RefundStatus.md + - docs/Models/Components/ResponseMessage.md + - docs/Models/Components/ReturnServiceType.md + - docs/Models/Components/RmaNumber.md + - docs/Models/Components/Security.md - docs/Models/Components/ServiceGroup.md - - docs/Models/Components/ServiceGroupTypeEnum.md - - docs/Models/Components/ServiceGroupCreateRequest.md - docs/Models/Components/ServiceGroupAccountAndServiceLevel.md + - docs/Models/Components/ServiceGroupCreateRequest.md + - docs/Models/Components/ServiceGroupTypeEnum.md - docs/Models/Components/ServiceGroupUpdateRequest.md + - docs/Models/Components/ServiceLevel.md + - docs/Models/Components/ServiceLevelAPCPostalEnum.md + - docs/Models/Components/ServiceLevelAPGEnum.md + - docs/Models/Components/ServiceLevelAirterraEnum.md + - docs/Models/Components/ServiceLevelAramexAustraliaEnum.md + - docs/Models/Components/ServiceLevelAsendiaEnum.md + - docs/Models/Components/ServiceLevelAustraliaPostEnum.md + - docs/Models/Components/ServiceLevelBetterTrucksEnum.md + - docs/Models/Components/ServiceLevelCDLEnum.md + - docs/Models/Components/ServiceLevelCanadaPostEnum.md + - docs/Models/Components/ServiceLevelChronopostEnum.md + - docs/Models/Components/ServiceLevelColissimoEnum.md + - docs/Models/Components/ServiceLevelCorreosEspanaEnum.md + - docs/Models/Components/ServiceLevelCouriersPleaseEnum.md + - docs/Models/Components/ServiceLevelDHLExpressEnum.md + - docs/Models/Components/ServiceLevelDHLGermanyEnum.md + - docs/Models/Components/ServiceLevelDHLeCommerceEnum.md + - docs/Models/Components/ServiceLevelDPDDEEnum.md + - docs/Models/Components/ServiceLevelDPDUKEnum.md + - docs/Models/Components/ServiceLevelDeutschePostEnum.md + - docs/Models/Components/ServiceLevelEnumSet.md + - docs/Models/Components/ServiceLevelEvriUKEnum.md + - docs/Models/Components/ServiceLevelFedExEnum.md + - docs/Models/Components/ServiceLevelGLSUSEnum.md + - docs/Models/Components/ServiceLevelGlobegisticsEnum.md + - docs/Models/Components/ServiceLevelJitsuEnum.md + - docs/Models/Components/ServiceLevelLSOEnum.md + - docs/Models/Components/ServiceLevelLasershipEnum.md + - docs/Models/Components/ServiceLevelMondialRelayEnum.md + - docs/Models/Components/ServiceLevelOnTracEnum.md + - docs/Models/Components/ServiceLevelParcelforceEnum.md + - docs/Models/Components/ServiceLevelPostItalianeEnum.md + - docs/Models/Components/ServiceLevelPurolatorEnum.md + - docs/Models/Components/ServiceLevelRoyalMailEnum.md + - docs/Models/Components/ServiceLevelSendleEnum.md + - docs/Models/Components/ServiceLevelSwyftEnum.md + - docs/Models/Components/ServiceLevelUDSEnum.md + - docs/Models/Components/ServiceLevelUPSEnum.md + - docs/Models/Components/ServiceLevelUSPSEnum.md + - docs/Models/Components/ServiceLevelVehoEnum.md + - docs/Models/Components/ServiceLevelWithParent.md + - docs/Models/Components/ServiceLevelePostGlobalEnum.md + - docs/Models/Components/Shipment.md + - docs/Models/Components/ShipmentCreateRequest.md + - docs/Models/Components/ShipmentCreateRequestCustomsDeclaration.md + - docs/Models/Components/ShipmentExtra.md + - docs/Models/Components/ShipmentExtraLasershipAttributesEnum.md + - docs/Models/Components/ShipmentExtraReturnServiceTypeLasershipEnum.md + - docs/Models/Components/ShipmentExtraReturnServiceTypeUPSEnum.md - docs/Models/Components/ShipmentPaginatedList.md - docs/Models/Components/ShipmentStatus.md - - docs/Models/Components/Shipment.md + - docs/Models/Components/ShippoAccount.md + - docs/Models/Components/ShippoAccountPaginatedList.md + - docs/Models/Components/ShippoAccountUpdateRequest.md + - docs/Models/Components/SignatureConfirmation.md + - docs/Models/Components/Status.md - docs/Models/Components/Track.md - docs/Models/Components/TrackingStatus.md - - docs/Models/Components/TrackingStatusSubstatus.md - docs/Models/Components/TrackingStatusEnum.md - docs/Models/Components/TrackingStatusLocationBase.md + - docs/Models/Components/TrackingStatusSubstatus.md - docs/Models/Components/TracksRequest.md - - docs/Models/Components/TransactionPaginatedList.md - - docs/Models/Components/CreatedBy.md - docs/Models/Components/Transaction.md + - docs/Models/Components/TransactionCreateRequest.md + - docs/Models/Components/TransactionPaginatedList.md + - docs/Models/Components/TransactionRate.md - docs/Models/Components/TransactionStatusEnum.md + - docs/Models/Components/Transactions.md + - docs/Models/Components/Type.md + - docs/Models/Components/UPSConnectExistingOwnAccountParameters.md + - docs/Models/Components/UPSReferenceFields.md + - docs/Models/Components/UserParcelTemplate.md + - docs/Models/Components/UserParcelTemplateCreateRequest.md - docs/Models/Components/UserParcelTemplateList.md - docs/Models/Components/UserParcelTemplateUpdateRequest.md - - docs/Models/Components/ShippoAccountPaginatedList.md - - docs/Models/Components/ShippoAccount.md - - docs/Models/Components/ShippoAccountUpdateRequest.md + - docs/Models/Components/UserParcelTemplateWithCarrierTemplateCreateRequest.md + - docs/Models/Components/UserParcelTemplateWithoutCarrierTemplateCreateRequest.md - docs/Models/Components/Webhook.md - - docs/Models/Components/WebhookUpdateRequest.md - docs/Models/Components/WebhookEventTypeEnum.md - docs/Models/Components/WebhookPaginatedList.md - - docs/Models/Components/Security.md - - docs/Models/Components/AddressValidationResultsMessageCodeEnum.md - - docs/Models/Components/AddressValidationResultsMessageSourceEnum.md - - docs/Models/Components/ServiceLevel.md - - docs/sdks/shipposdk/README.md + - docs/Models/Components/WebhookPayload.md + - docs/Models/Components/WebhookPayloadBatch.md + - docs/Models/Components/WebhookPayloadTrack.md + - docs/Models/Components/WebhookPayloadTransaction.md + - docs/Models/Components/WebhookUpdateRequest.md + - docs/Models/Components/WeightUnitEnum.md + - docs/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseBody.md + - docs/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBody.md + - docs/Models/Errors/InitiateOauth2SigninResponseBody.md + - docs/Models/Operations/AddShipmentsToBatchRequest.md + - docs/Models/Operations/Carrier.md + - docs/Models/Operations/CreateAddressRequest.md + - docs/Models/Operations/CreateBatchRequest.md + - docs/Models/Operations/CreateCarrierAccountRequest.md + - docs/Models/Operations/CreateCustomsDeclarationRequest.md + - docs/Models/Operations/CreateCustomsItemRequest.md + - docs/Models/Operations/CreateLiveRateRequest.md + - docs/Models/Operations/CreateManifestRequest.md + - docs/Models/Operations/CreateOrderRequest.md + - docs/Models/Operations/CreateParcelRequest.md + - docs/Models/Operations/CreateParcelRequestBody.md + - docs/Models/Operations/CreatePickupRequest.md + - docs/Models/Operations/CreateRefundRequest.md + - docs/Models/Operations/CreateServiceGroupRequest.md + - docs/Models/Operations/CreateShipmentRequest.md + - docs/Models/Operations/CreateShippoAccountRequest.md + - docs/Models/Operations/CreateTrackRequest.md + - docs/Models/Operations/CreateTransactionRequest.md + - docs/Models/Operations/CreateTransactionRequestBody.md + - docs/Models/Operations/CreateUserParcelTemplateRequest.md + - docs/Models/Operations/DeleteDefaultParcelTemplateRequest.md + - docs/Models/Operations/DeleteServiceGroupRequest.md + - docs/Models/Operations/DeleteUserParcelTemplateRequest.md + - docs/Models/Operations/DeleteWebhookRequest.md + - docs/Models/Operations/GetAddressRequest.md + - docs/Models/Operations/GetBatchRequest.md + - docs/Models/Operations/GetCarrierAccountRequest.md + - docs/Models/Operations/GetCarrierParcelTemplateRequest.md + - docs/Models/Operations/GetCarrierRegistrationStatusRequest.md + - docs/Models/Operations/GetCustomsDeclarationRequest.md + - docs/Models/Operations/GetCustomsItemRequest.md + - docs/Models/Operations/GetDefaultParcelTemplateRequest.md + - docs/Models/Operations/GetManifestRequest.md + - docs/Models/Operations/GetOrderRequest.md + - docs/Models/Operations/GetParcelRequest.md + - docs/Models/Operations/GetRateRequest.md + - docs/Models/Operations/GetRefundRequest.md + - docs/Models/Operations/GetShipmentRequest.md + - docs/Models/Operations/GetShippoAccountRequest.md + - docs/Models/Operations/GetTrackRequest.md + - docs/Models/Operations/GetTransactionRequest.md + - docs/Models/Operations/GetUserParcelTemplateRequest.md + - docs/Models/Operations/GetWebhookRequest.md + - docs/Models/Operations/IncludeT.md + - docs/Models/Operations/InitiateOauth2SigninRequest.md + - docs/Models/Operations/InitiateOauth2SigninResponse.md + - docs/Models/Operations/ListAddressesRequest.md + - docs/Models/Operations/ListCarrierAccountsRequest.md + - docs/Models/Operations/ListCarrierParcelTemplatesRequest.md + - docs/Models/Operations/ListCustomsDeclarationsRequest.md + - docs/Models/Operations/ListCustomsItemsRequest.md + - docs/Models/Operations/ListManifestsRequest.md + - docs/Models/Operations/ListOrdersRequest.md + - docs/Models/Operations/ListParcelsRequest.md + - docs/Models/Operations/ListRefundsRequest.md + - docs/Models/Operations/ListServiceGroupsRequest.md + - docs/Models/Operations/ListShipmentRatesByCurrencyCodeRequest.md + - docs/Models/Operations/ListShipmentRatesRequest.md + - docs/Models/Operations/ListShipmentsRequest.md + - docs/Models/Operations/ListShippoAccountsRequest.md + - docs/Models/Operations/ListTransactionsRequest.md + - docs/Models/Operations/ListUserParcelTemplatesRequest.md + - docs/Models/Operations/PurchaseBatchRequest.md + - docs/Models/Operations/RegisterCarrierAccountRequest.md + - docs/Models/Operations/RegisterCarrierAccountRequestBody.md + - docs/Models/Operations/RemoveShipmentsFromBatchRequest.md + - docs/Models/Operations/UpdateCarrierAccountRequest.md + - docs/Models/Operations/UpdateDefaultParcelTemplateRequest.md + - docs/Models/Operations/UpdateServiceGroupRequest.md + - docs/Models/Operations/UpdateShippoAccountRequest.md + - docs/Models/Operations/UpdateUserParcelTemplateRequest.md + - docs/Models/Operations/UpdateWebhookRequest.md + - docs/Models/Operations/ValidateAddressRequest.md - docs/sdks/addresses/README.md - docs/sdks/batches/README.md - docs/sdks/carrieraccounts/README.md + - docs/sdks/carrierparceltemplates/README.md - docs/sdks/customsdeclarations/README.md - docs/sdks/customsitems/README.md - - docs/sdks/ratesatcheckout/README.md - docs/sdks/manifests/README.md - docs/sdks/orders/README.md - - docs/sdks/carrierparceltemplates/README.md - docs/sdks/parcels/README.md - docs/sdks/pickups/README.md - docs/sdks/rates/README.md + - docs/sdks/ratesatcheckout/README.md - docs/sdks/refunds/README.md - docs/sdks/servicegroups/README.md - docs/sdks/shipments/README.md + - docs/sdks/shippo/README.md + - docs/sdks/shippoaccounts/README.md - docs/sdks/trackingstatus/README.md - docs/sdks/transactions/README.md - docs/sdks/userparceltemplates/README.md - - docs/sdks/shippoaccounts/README.md - docs/sdks/webhooks/README.md - - USAGE.md - - .gitattributes + - phpstan.neon + - phpunit.xml + - pint.json + - rector.php + - src/Addresses.php + - src/Batches.php + - src/CarrierAccounts.php + - src/CarrierParcelTemplates.php + - src/CustomsDeclarations.php + - src/CustomsItems.php + - src/Hooks/AfterErrorContext.php + - src/Hooks/AfterErrorHook.php + - src/Hooks/AfterSuccessContext.php + - src/Hooks/AfterSuccessHook.php + - src/Hooks/BeforeRequestContext.php + - src/Hooks/BeforeRequestHook.php + - src/Hooks/Credentials.php + - src/Hooks/ErrorResponseContext.php + - src/Hooks/FailEarlyException.php + - src/Hooks/HookContext.php + - src/Hooks/Hooks.php + - src/Hooks/SDKHooks.php + - src/Hooks/SDKInitHook.php + - src/Hooks/SDKRequestContext.php + - src/Hooks/Session.php + - src/Hooks/TokenResponse.php + - src/Manifests.php + - src/Models/Components/Address.php + - src/Models/Components/AddressCompleteCreateRequest.php + - src/Models/Components/AddressCreateRequest.php + - src/Models/Components/AddressImporter.php + - src/Models/Components/AddressPaginatedList.php + - src/Models/Components/AddressValidationResults.php + - src/Models/Components/AddressValidationResultsMessage.php + - src/Models/Components/AddressValidationResultsMessageCodeEnum.php + - src/Models/Components/AddressValidationResultsMessageSourceEnum.php + - src/Models/Components/Alcohol.php + - src/Models/Components/AncillaryEndorsement.php + - src/Models/Components/Attributes.php + - src/Models/Components/Authentication.php + - src/Models/Components/Batch.php + - src/Models/Components/BatchCreateRequest.php + - src/Models/Components/BatchShipment.php + - src/Models/Components/BatchShipmentCreateRequest.php + - src/Models/Components/BatchShipmentPaginatedList.php + - src/Models/Components/BatchStatus.php + - src/Models/Components/Billing.php + - src/Models/Components/BuildingLocationType.php + - src/Models/Components/BuildingType.php + - src/Models/Components/CarrierAccount.php + - src/Models/Components/CarrierAccountBase.php + - src/Models/Components/CarrierAccountCanadaPostCreateParameters.php + - src/Models/Components/CarrierAccountCanadaPostCreateRequest.php + - src/Models/Components/CarrierAccountChronopostCreateRequest.php + - src/Models/Components/CarrierAccountChronopostCreateRequestParameters.php + - src/Models/Components/CarrierAccountColissimoCreateRequest.php + - src/Models/Components/CarrierAccountColissimoCreateRequestParameters.php + - src/Models/Components/CarrierAccountCorreosCreateRequest.php + - src/Models/Components/CarrierAccountCorreosCreateRequestParameters.php + - src/Models/Components/CarrierAccountDHLExpressCreateRequest.php + - src/Models/Components/CarrierAccountDHLExpressCreateRequestParameters.php + - src/Models/Components/CarrierAccountDPDUKCreateRequest.php + - src/Models/Components/CarrierAccountDPDUKCreateRequestParameters.php + - src/Models/Components/CarrierAccountDeutschePostCreateRequest.php + - src/Models/Components/CarrierAccountDeutschePostCreateRequestParameters.php + - src/Models/Components/CarrierAccountDpdDeCreateRequest.php + - src/Models/Components/CarrierAccountDpdDeCreateRequestParameters.php + - src/Models/Components/CarrierAccountFedExCreateRequest.php + - src/Models/Components/CarrierAccountFedExCreateRequestParameters.php + - src/Models/Components/CarrierAccountHermesUKCreateRequest.php + - src/Models/Components/CarrierAccountHermesUKCreateRequestParameters.php + - src/Models/Components/CarrierAccountMondialRelayCreateRequest.php + - src/Models/Components/CarrierAccountMondialRelayCreateRequestParameters.php + - src/Models/Components/CarrierAccountPaginatedList.php + - src/Models/Components/CarrierAccountPosteItalianeCreateRequest.php + - src/Models/Components/CarrierAccountPosteItalianeCreateRequestParameters.php + - src/Models/Components/CarrierAccountRegistrationStatus.php + - src/Models/Components/CarrierAccountSendleCreateRequest.php + - src/Models/Components/CarrierAccountSendleCreateRequestParameters.php + - src/Models/Components/CarrierAccountServiceLevel.php + - src/Models/Components/CarrierAccountUPSCreateRequest.php + - src/Models/Components/CarrierAccountUPSCreateRequestParameters.php + - src/Models/Components/CarrierAccountUSPSCreateRequest.php + - src/Models/Components/CarrierAccountUSPSCreateRequestParameters.php + - src/Models/Components/CarrierAccountWithExtraInfo.php + - src/Models/Components/CarrierAccountWithExtraInfoStatus.php + - src/Models/Components/CarrierAccountWithExtraInfoType.php + - src/Models/Components/CarrierParcelTemplate.php + - src/Models/Components/CarrierParcelTemplateList.php + - src/Models/Components/CarriersEnum.php + - src/Models/Components/Cod.php + - src/Models/Components/ConnectExistingOwnAccountRequest.php + - src/Models/Components/CoreRate.php + - src/Models/Components/CreatedBy.php + - src/Models/Components/CustomerReference.php + - src/Models/Components/CustomsDeclaration.php + - src/Models/Components/CustomsDeclarationAddress.php + - src/Models/Components/CustomsDeclarationB13AFilingOptionEnum.php + - src/Models/Components/CustomsDeclarationContentsTypeEnum.php + - src/Models/Components/CustomsDeclarationCreateRequest.php + - src/Models/Components/CustomsDeclarationCreateRequestAddress.php + - src/Models/Components/CustomsDeclarationCreateRequestType.php + - src/Models/Components/CustomsDeclarationDutiesPayor.php + - src/Models/Components/CustomsDeclarationEelPfcEnum.php + - src/Models/Components/CustomsDeclarationIncotermEnum.php + - src/Models/Components/CustomsDeclarationNonDeliveryOptionEnum.php + - src/Models/Components/CustomsDeclarationPaginatedList.php + - src/Models/Components/CustomsDeclarationType.php + - src/Models/Components/CustomsExporterIdentification.php + - src/Models/Components/CustomsInvoicedCharges.php + - src/Models/Components/CustomsItem.php + - src/Models/Components/CustomsItemCreateRequest.php + - src/Models/Components/CustomsItemPaginatedList.php + - src/Models/Components/CustomsTaxIdentification.php + - src/Models/Components/CustomsTaxIdentificationType.php + - src/Models/Components/DangerousGoodsBiologicalMaterial.php + - src/Models/Components/DangerousGoodsCode.php + - src/Models/Components/DangerousGoodsLithiumBatteries.php + - src/Models/Components/DangerousGoodsObject.php + - src/Models/Components/DefaultParcelTemplate.php + - src/Models/Components/DefaultParcelTemplateUpdateRequest.php + - src/Models/Components/DepartmentNumber.php + - src/Models/Components/DistanceUnitEnum.php + - src/Models/Components/DryIce.php + - src/Models/Components/DutiesPayor.php + - src/Models/Components/FedExConnectExistingOwnAccountParameters.php + - src/Models/Components/InstantTransactionCreateRequest.php + - src/Models/Components/Insurance.php + - src/Models/Components/InvoiceNumber.php + - src/Models/Components/LabelFileType.php + - src/Models/Components/LabelFileTypeEnum.php + - src/Models/Components/LineItem.php + - src/Models/Components/LineItemBase.php + - src/Models/Components/LiveRate.php + - src/Models/Components/LiveRateCreateRequest.php + - src/Models/Components/LiveRatePaginatedList.php + - src/Models/Components/Location.php + - src/Models/Components/Manifest.php + - src/Models/Components/ManifestCreateRequest.php + - src/Models/Components/ManifestPaginatedList.php + - src/Models/Components/ManifestStatus.php + - src/Models/Components/ObjectInfo.php + - src/Models/Components/ObjectResults.php + - src/Models/Components/ObjectState.php + - src/Models/Components/ObjectStateEnum.php + - src/Models/Components/Order.php + - src/Models/Components/OrderCreateRequest.php + - src/Models/Components/OrderPaginatedList.php + - src/Models/Components/OrderShopAppEnum.php + - src/Models/Components/OrderStatusEnum.php + - src/Models/Components/Parcel.php + - src/Models/Components/ParcelCreateFromTemplateRequest.php + - src/Models/Components/ParcelCreateRequest.php + - src/Models/Components/ParcelExtra.php + - src/Models/Components/ParcelInsurance.php + - src/Models/Components/ParcelInsuranceProvider.php + - src/Models/Components/ParcelPaginatedList.php + - src/Models/Components/ParcelTemplateAramexAustraliaEnum.php + - src/Models/Components/ParcelTemplateCouriersPleaseEnum.php + - src/Models/Components/ParcelTemplateDHLeCommerceEnum.php + - src/Models/Components/ParcelTemplateDPDUKEnum.php + - src/Models/Components/ParcelTemplateFedExEnum.php + - src/Models/Components/ParcelTemplateUPSEnum.php + - src/Models/Components/ParcelTemplateUSPSEnum.php + - src/Models/Components/PaymentMethod.php + - src/Models/Components/Pickup.php + - src/Models/Components/PickupBase.php + - src/Models/Components/PickupStatus.php + - src/Models/Components/PoNumber.php + - src/Models/Components/PreferredDeliveryTimeframe.php + - src/Models/Components/Provider.php + - src/Models/Components/Rate.php + - src/Models/Components/RatePaginatedList.php + - src/Models/Components/RecipientType.php + - src/Models/Components/Refund.php + - src/Models/Components/RefundPaginatedList.php + - src/Models/Components/RefundRequestBody.php + - src/Models/Components/RefundStatus.php + - src/Models/Components/ResponseMessage.php + - src/Models/Components/RmaNumber.php + - src/Models/Components/Security.php + - src/Models/Components/ServiceGroup.php + - src/Models/Components/ServiceGroupAccountAndServiceLevel.php + - src/Models/Components/ServiceGroupCreateRequest.php + - src/Models/Components/ServiceGroupTypeEnum.php + - src/Models/Components/ServiceGroupUpdateRequest.php + - src/Models/Components/ServiceLevel.php + - src/Models/Components/ServiceLevelAPCPostalEnum.php + - src/Models/Components/ServiceLevelAPGEnum.php + - src/Models/Components/ServiceLevelAirterraEnum.php + - src/Models/Components/ServiceLevelAramexAustraliaEnum.php + - src/Models/Components/ServiceLevelAsendiaEnum.php + - src/Models/Components/ServiceLevelAustraliaPostEnum.php + - src/Models/Components/ServiceLevelBetterTrucksEnum.php + - src/Models/Components/ServiceLevelCDLEnum.php + - src/Models/Components/ServiceLevelCanadaPostEnum.php + - src/Models/Components/ServiceLevelChronopostEnum.php + - src/Models/Components/ServiceLevelColissimoEnum.php + - src/Models/Components/ServiceLevelCorreosEspanaEnum.php + - src/Models/Components/ServiceLevelCouriersPleaseEnum.php + - src/Models/Components/ServiceLevelDHLExpressEnum.php + - src/Models/Components/ServiceLevelDHLGermanyEnum.php + - src/Models/Components/ServiceLevelDHLeCommerceEnum.php + - src/Models/Components/ServiceLevelDPDDEEnum.php + - src/Models/Components/ServiceLevelDPDUKEnum.php + - src/Models/Components/ServiceLevelDeutschePostEnum.php + - src/Models/Components/ServiceLevelEvriUKEnum.php + - src/Models/Components/ServiceLevelFedExEnum.php + - src/Models/Components/ServiceLevelGLSUSEnum.php + - src/Models/Components/ServiceLevelGlobegisticsEnum.php + - src/Models/Components/ServiceLevelJitsuEnum.php + - src/Models/Components/ServiceLevelLSOEnum.php + - src/Models/Components/ServiceLevelLasershipEnum.php + - src/Models/Components/ServiceLevelMondialRelayEnum.php + - src/Models/Components/ServiceLevelOnTracEnum.php + - src/Models/Components/ServiceLevelParcelforceEnum.php + - src/Models/Components/ServiceLevelPostItalianeEnum.php + - src/Models/Components/ServiceLevelPurolatorEnum.php + - src/Models/Components/ServiceLevelRoyalMailEnum.php + - src/Models/Components/ServiceLevelSendleEnum.php + - src/Models/Components/ServiceLevelSwyftEnum.php + - src/Models/Components/ServiceLevelUDSEnum.php + - src/Models/Components/ServiceLevelUPSEnum.php + - src/Models/Components/ServiceLevelUSPSEnum.php + - src/Models/Components/ServiceLevelVehoEnum.php + - src/Models/Components/ServiceLevelWithParent.php + - src/Models/Components/ServiceLevelePostGlobalEnum.php + - src/Models/Components/Shipment.php + - src/Models/Components/ShipmentCreateRequest.php + - src/Models/Components/ShipmentExtra.php + - src/Models/Components/ShipmentExtraLasershipAttributesEnum.php + - src/Models/Components/ShipmentExtraReturnServiceTypeLasershipEnum.php + - src/Models/Components/ShipmentExtraReturnServiceTypeUPSEnum.php + - src/Models/Components/ShipmentPaginatedList.php + - src/Models/Components/ShipmentStatus.php + - src/Models/Components/ShippoAccount.php + - src/Models/Components/ShippoAccountPaginatedList.php + - src/Models/Components/ShippoAccountUpdateRequest.php + - src/Models/Components/SignatureConfirmation.php + - src/Models/Components/Status.php + - src/Models/Components/Track.php + - src/Models/Components/TrackingStatus.php + - src/Models/Components/TrackingStatusEnum.php + - src/Models/Components/TrackingStatusLocationBase.php + - src/Models/Components/TrackingStatusSubstatus.php + - src/Models/Components/TracksRequest.php + - src/Models/Components/Transaction.php + - src/Models/Components/TransactionCreateRequest.php + - src/Models/Components/TransactionPaginatedList.php + - src/Models/Components/TransactionStatusEnum.php + - src/Models/Components/Transactions.php + - src/Models/Components/Type.php + - src/Models/Components/UPSConnectExistingOwnAccountParameters.php + - src/Models/Components/UPSReferenceFields.php + - src/Models/Components/UserParcelTemplate.php + - src/Models/Components/UserParcelTemplateList.php + - src/Models/Components/UserParcelTemplateUpdateRequest.php + - src/Models/Components/UserParcelTemplateWithCarrierTemplateCreateRequest.php + - src/Models/Components/UserParcelTemplateWithoutCarrierTemplateCreateRequest.php + - src/Models/Components/Webhook.php + - src/Models/Components/WebhookEventTypeEnum.php + - src/Models/Components/WebhookPaginatedList.php + - src/Models/Components/WebhookPayloadBatch.php + - src/Models/Components/WebhookPayloadTrack.php + - src/Models/Components/WebhookPayloadTransaction.php + - src/Models/Components/WebhookUpdateRequest.php + - src/Models/Components/WeightUnitEnum.php + - src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseBody.php + - src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseBodyThrowable.php + - src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBody.php + - src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBodyThrowable.php + - src/Models/Errors/InitiateOauth2SigninResponseBody.php + - src/Models/Errors/InitiateOauth2SigninResponseBodyThrowable.php + - src/Models/Errors/SDKError.php + - src/Models/Operations/AddShipmentsToBatchRequest.php + - src/Models/Operations/Carrier.php + - src/Models/Operations/CreateAddressRequest.php + - src/Models/Operations/CreateBatchRequest.php + - src/Models/Operations/CreateCarrierAccountRequest.php + - src/Models/Operations/CreateCustomsDeclarationRequest.php + - src/Models/Operations/CreateCustomsItemRequest.php + - src/Models/Operations/CreateLiveRateRequest.php + - src/Models/Operations/CreateManifestRequest.php + - src/Models/Operations/CreateOrderRequest.php + - src/Models/Operations/CreateParcelRequest.php + - src/Models/Operations/CreatePickupRequest.php + - src/Models/Operations/CreateRefundRequest.php + - src/Models/Operations/CreateServiceGroupRequest.php + - src/Models/Operations/CreateShipmentRequest.php + - src/Models/Operations/CreateShippoAccountRequest.php + - src/Models/Operations/CreateTrackRequest.php + - src/Models/Operations/CreateTransactionRequest.php + - src/Models/Operations/CreateUserParcelTemplateRequest.php + - src/Models/Operations/DeleteDefaultParcelTemplateRequest.php + - src/Models/Operations/DeleteServiceGroupRequest.php + - src/Models/Operations/DeleteUserParcelTemplateRequest.php + - src/Models/Operations/DeleteWebhookRequest.php + - src/Models/Operations/GetAddressRequest.php + - src/Models/Operations/GetBatchRequest.php + - src/Models/Operations/GetCarrierAccountRequest.php + - src/Models/Operations/GetCarrierParcelTemplateRequest.php + - src/Models/Operations/GetCarrierRegistrationStatusRequest.php + - src/Models/Operations/GetCustomsDeclarationRequest.php + - src/Models/Operations/GetCustomsItemRequest.php + - src/Models/Operations/GetDefaultParcelTemplateRequest.php + - src/Models/Operations/GetManifestRequest.php + - src/Models/Operations/GetOrderRequest.php + - src/Models/Operations/GetParcelRequest.php + - src/Models/Operations/GetRateRequest.php + - src/Models/Operations/GetRefundRequest.php + - src/Models/Operations/GetShipmentRequest.php + - src/Models/Operations/GetShippoAccountRequest.php + - src/Models/Operations/GetTrackRequest.php + - src/Models/Operations/GetTransactionRequest.php + - src/Models/Operations/GetUserParcelTemplateRequest.php + - src/Models/Operations/GetWebhookRequest.php + - src/Models/Operations/IncludeT.php + - src/Models/Operations/InitiateOauth2SigninRequest.php + - src/Models/Operations/InitiateOauth2SigninResponse.php + - src/Models/Operations/ListAddressesRequest.php + - src/Models/Operations/ListCarrierAccountsRequest.php + - src/Models/Operations/ListCarrierParcelTemplatesRequest.php + - src/Models/Operations/ListCustomsDeclarationsRequest.php + - src/Models/Operations/ListCustomsItemsRequest.php + - src/Models/Operations/ListManifestsRequest.php + - src/Models/Operations/ListOrdersRequest.php + - src/Models/Operations/ListParcelsRequest.php + - src/Models/Operations/ListRefundsRequest.php + - src/Models/Operations/ListServiceGroupsRequest.php + - src/Models/Operations/ListShipmentRatesByCurrencyCodeRequest.php + - src/Models/Operations/ListShipmentRatesRequest.php + - src/Models/Operations/ListShipmentsRequest.php + - src/Models/Operations/ListShippoAccountsRequest.php + - src/Models/Operations/ListTransactionsRequest.php + - src/Models/Operations/ListUserParcelTemplatesRequest.php + - src/Models/Operations/PurchaseBatchRequest.php + - src/Models/Operations/RegisterCarrierAccountRequest.php + - src/Models/Operations/RemoveShipmentsFromBatchRequest.php + - src/Models/Operations/UpdateCarrierAccountRequest.php + - src/Models/Operations/UpdateDefaultParcelTemplateRequest.php + - src/Models/Operations/UpdateServiceGroupRequest.php + - src/Models/Operations/UpdateShippoAccountRequest.php + - src/Models/Operations/UpdateUserParcelTemplateRequest.php + - src/Models/Operations/UpdateWebhookRequest.php + - src/Models/Operations/ValidateAddressRequest.php + - src/Orders.php + - src/Parcels.php + - src/Pickups.php + - src/Rates.php + - src/RatesAtCheckout.php + - src/Refunds.php + - src/SDKConfiguration.php + - src/ServiceGroups.php + - src/Shipments.php + - src/Shippo.php + - src/ShippoAccounts.php + - src/ShippoBuilder.php + - src/TrackingStatus.php + - src/Transactions.php + - src/UserParcelTemplates.php + - src/Utils/BigDecimalHandler.php + - src/Utils/BigIntHandler.php + - src/Utils/DateHandler.php + - src/Utils/DateTimeHandler.php + - src/Utils/DefaultRequest.php + - src/Utils/DefaultResponse.php + - src/Utils/DefaultStream.php + - src/Utils/DefaultUri.php + - src/Utils/EnumHandler.php + - src/Utils/FormMetadata.php + - src/Utils/Headers.php + - src/Utils/JSON.php + - src/Utils/MixedJSONHandler.php + - src/Utils/MultipartMetadata.php + - src/Utils/ParamsMetadata.php + - src/Utils/PathParameters.php + - src/Utils/PhpDocTypeParser.php + - src/Utils/QueryParameters.php + - src/Utils/RequestBodies.php + - src/Utils/RequestMetadata.php + - src/Utils/Security.php + - src/Utils/SecurityClient.php + - src/Utils/SecurityMetadata.php + - src/Utils/ServerDetails.php + - src/Utils/SpeakeasyMetadata.php + - src/Utils/UnionHandler.php + - src/Utils/Utils.php + - src/Webhooks.php +examples: + batch: {} + track: + speakeasy-default-track: + requestBody: + application/json: {"data": {"address_from": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "address_to": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "carrier": "usps", "messages": [""], "metadata": "Order 000123", "original_eta": "2021-07-23T00:00:00Z", "servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express", "parent_servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express"}}, "tracking_history": [{"location": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "object_created": "2023-07-25T17:47:12.180Z", "object_id": "", "object_updated": "2023-02-21T22:35:19.645Z", "status": "DELIVERED", "substatus": {"code": "information_received", "text": "Information about the package received.", "action_required": true}, "status_date": "2016-07-23T00:00:00Z", "status_details": "Your shipment has been delivered at the destination mailbox."}], "tracking_number": "9205590164917312751089", "tracking_status": {"location": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "object_created": "2024-05-20T11:37:56.914Z", "object_id": "", "object_updated": "2023-06-07T16:48:30.895Z", "status": "DELIVERED", "substatus": {"code": "information_received", "text": "Information about the package received.", "action_required": true}, "status_date": "2016-07-23T00:00:00Z", "status_details": "Your shipment has been delivered at the destination mailbox."}}} + transaction: + speakeasy-default-transaction: + requestBody: + application/json: {"data": {"created_by": {"first_name": "Shwan", "last_name": "Ippotle", "username": "shippotle@shippo.com"}, "label_file_type": "PDF_4x6", "label_url": "https://shippo-delivery.s3.amazonaws.com/70ae8117ee1749e393f249d5b77c45e0.pdf?Signature=vDw1ltcyGveVR1OQoUDdzC43BY8%3D&Expires=1437093830&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA", "messages": [], "object_id": "915d94940ea54c3a80cbfa328722f5a1", "object_owner": "shippotle@shippo.com", "parcel": "e94c7fdfdc7b495dbb390a28d929d90a", "qr_code_url": "https://shippo-delivery.s3.amazonaws.com/96_qr_code.pdf?Signature=PEdWrp0mFWAGwJp7FW3b%2FeA2eyY%3D&Expires=1385930652&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA", "rate": {"amount": "5.5", "amount_local": "5.5", "currency": "USD", "currency_local": "USD", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "provider": "USPS", "carrier_account": "078870331023437cb917f5187429b093", "servicelevel_name": "Priority Mail", "servicelevel_token": "fedex_ground"}, "status": "SUCCESS", "tracking_number": "9499907123456123456781", "tracking_status": "DELIVERED", "tracking_url_provider": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9499907123456123456781"}} + ListAddresses: + speakeasy-default-list-addresses: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": []}, "test": false}]} + CreateAddress: + speakeasy-default-create-address: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true} + responses: + "201": + application/json: {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false} + GetAddress: + speakeasy-default-get-address: + parameters: + path: + AddressId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false} + ValidateAddress: + speakeasy-default-validate-address: + parameters: + path: + AddressId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false} + CreateBatch: + speakeasy-default-create-batch: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"default_carrier_account": "078870331023437cb917f5187429b093", "default_servicelevel_token": "usps_priority", "label_filetype": "PDF_4x6", "metadata": "BATCH #1", "batch_shipments": [{"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "shipment": {"extra": {"accounts_receivable_customer_account": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "appropriation_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "bill_of_lading_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "cod_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "customer_reference": {"ref_sort": 1}, "dealer_order_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "dept_number": {"ref_sort": 3}, "fda_product_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "insurance": {"amount": "5.5", "currency": "USD"}, "invoice_number": {"ref_sort": 2}, "manifest_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "model_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "part_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "po_number": {"ref_sort": 2}, "production_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "purchase_request_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "rma_number": {"ref_sort": 1}, "salesperson_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "serial_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "store_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "transaction_reference_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}}, "metadata": "Customer ID 123456", "shipment_date": "2021-03-22T12:00:00Z", "address_from": "d799c2679e644279b59fe661ac8fa488", "address_return": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "address_to": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "customs_declaration": {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "Blumenstraße", "street3": "", "street_no": "22", "city": "München", "state": "CA", "zip": "80331", "country": "DE", "phone": "80331", "email": "shippotle@shippo.com", "is_residential": true}, "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": [{"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD"}, {"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD"}, {"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD"}], "non_delivery_option": "RETURN", "test": true}, "carrier_accounts": ["065a4a8c10d24a34ab932163a1b87f52", "73f706f4bdb94b54a337563840ce52b0"], "parcels": [{"extra": {"COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "insurance": {"amount": "5.5", "content": "Laptop", "currency": "USD", "provider": "UPS"}}, "metadata": "Customer ID 123456", "mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"}, {"extra": {"COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "insurance": {"amount": "5.5", "content": "Laptop", "currency": "USD", "provider": "UPS"}}, "metadata": "Customer ID 123456", "mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"}, {"extra": {"COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "insurance": {"amount": "5.5", "content": "Laptop", "currency": "USD", "provider": "UPS"}}, "metadata": "Customer ID 123456", "mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"}]}}]} + responses: + "201": + application/json: {"default_carrier_account": "078870331023437cb917f5187429b093", "default_servicelevel_token": "usps_priority", "label_filetype": "PDF_4x6", "metadata": "BATCH #1", "batch_shipments": {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "object_id": "e11c95a6788d4ddcaa22f03175838740", "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "status": "INVALID", "transaction": "4c33736a67e2450da88b38c42deef6b7"}, {"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "object_id": "e11c95a6788d4ddcaa22f03175838740", "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "status": "INVALID", "transaction": "4c33736a67e2450da88b38c42deef6b7"}, {"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "object_id": "e11c95a6788d4ddcaa22f03175838740", "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "status": "INVALID", "transaction": "4c33736a67e2450da88b38c42deef6b7"}]}, "label_url": ["https://sleepy-vein.info", "https://agile-defendant.biz/", "https://glorious-convection.com/"], "object_created": "2016-01-04T00:15:44.394Z", "object_id": "5ef63c54f5bf45d3b1f8fb37dcb1c5f4", "object_owner": "shippo@shippo.com", "object_results": {"creation_failed": 3, "creation_succeeded": 5, "purchase_failed": 0, "purchase_succeeded": 0}, "object_updated": "2016-01-04T00:48:13.841Z", "status": "VALID", "test": false} + GetBatch: + speakeasy-default-get-batch: + parameters: + path: + BatchId: "" + query: {} + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"default_carrier_account": "078870331023437cb917f5187429b093", "default_servicelevel_token": "usps_priority", "label_filetype": "PDF_4x6", "metadata": "BATCH #1", "batch_shipments": {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "object_id": "e11c95a6788d4ddcaa22f03175838740", "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "status": "INVALID", "transaction": "4c33736a67e2450da88b38c42deef6b7"}, {"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "object_id": "e11c95a6788d4ddcaa22f03175838740", "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "status": "INVALID", "transaction": "4c33736a67e2450da88b38c42deef6b7"}]}, "label_url": ["https://misguided-violin.info", "https://fatal-custom.org/"], "object_created": "2016-01-04T00:15:44.394Z", "object_id": "5ef63c54f5bf45d3b1f8fb37dcb1c5f4", "object_owner": "shippo@shippo.com", "object_results": {"creation_failed": 3, "creation_succeeded": 5, "purchase_failed": 0, "purchase_succeeded": 0}, "object_updated": "2016-01-04T00:48:13.841Z", "status": "VALID", "test": false} + AddShipmentsToBatch: + speakeasy-default-add-shipments-to-batch: + parameters: + path: + BatchId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: [{"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "shipment": {"extra": {"accounts_receivable_customer_account": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "appropriation_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "bill_of_lading_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "cod_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "customer_reference": {"ref_sort": 1}, "dealer_order_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "dept_number": {"ref_sort": 3}, "fda_product_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "insurance": {"amount": "5.5", "currency": "USD"}, "invoice_number": {"ref_sort": 2}, "manifest_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "model_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "part_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "po_number": {"ref_sort": 2}, "production_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "purchase_request_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "rma_number": {"ref_sort": 1}, "salesperson_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "serial_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "store_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "transaction_reference_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}}, "metadata": "Customer ID 123456", "shipment_date": "2021-03-22T12:00:00Z", "address_from": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "address_return": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "address_to": "d799c2679e644279b59fe661ac8fa489", "customs_declaration": "adcfdddf8ec64b84ad22772bce3ea37a", "carrier_accounts": ["065a4a8c10d24a34ab932163a1b87f52", "73f706f4bdb94b54a337563840ce52b0"], "parcels": ["", "", {"extra": {"COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "insurance": {"amount": "5.5", "content": "Laptop", "currency": "USD", "provider": "UPS"}}, "metadata": "Customer ID 123456", "mass_unit": "lb", "weight": "1", "template": "USPS_SmallFlatRateEnvelope"}]}}, {"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "shipment": {"extra": {"accounts_receivable_customer_account": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "appropriation_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "bill_of_lading_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "cod_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "customer_reference": {"ref_sort": 1}, "dealer_order_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "dept_number": {"ref_sort": 3}, "fda_product_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "insurance": {"amount": "5.5", "currency": "USD"}, "invoice_number": {"ref_sort": 2}, "manifest_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "model_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "part_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "po_number": {"ref_sort": 2}, "production_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "purchase_request_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "rma_number": {"ref_sort": 1}, "salesperson_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "serial_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "store_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "transaction_reference_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}}, "metadata": "Customer ID 123456", "shipment_date": "2021-03-22T12:00:00Z", "address_from": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "address_return": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "address_to": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "customs_declaration": {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "Blumenstraße", "street3": "", "street_no": "22", "city": "München", "state": "CA", "zip": "80331", "country": "DE", "phone": "80331", "email": "shippotle@shippo.com", "is_residential": true}, "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": [], "non_delivery_option": "RETURN", "test": true}, "carrier_accounts": ["065a4a8c10d24a34ab932163a1b87f52", "73f706f4bdb94b54a337563840ce52b0"], "parcels": [{"extra": {"COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "insurance": {"amount": "5.5", "content": "Laptop", "currency": "USD", "provider": "UPS"}}, "metadata": "Customer ID 123456", "mass_unit": "lb", "weight": "1", "template": "couriersplease_1kg_satchel"}, {"extra": {"COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "insurance": {"amount": "5.5", "content": "Laptop", "currency": "USD", "provider": "UPS"}}, "metadata": "Customer ID 123456", "mass_unit": "lb", "weight": "1", "template": "DHLeC_SM_Flats"}]}}, {"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "shipment": {"extra": {"accounts_receivable_customer_account": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "appropriation_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "bill_of_lading_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "cod_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "customer_reference": {"ref_sort": 1}, "dealer_order_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "dept_number": {"ref_sort": 3}, "fda_product_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "insurance": {"amount": "5.5", "currency": "USD"}, "invoice_number": {"ref_sort": 2}, "manifest_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "model_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "part_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "po_number": {"ref_sort": 2}, "production_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "purchase_request_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "rma_number": {"ref_sort": 1}, "salesperson_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "serial_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "store_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "transaction_reference_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}}, "metadata": "Customer ID 123456", "shipment_date": "2021-03-22T12:00:00Z", "address_from": "d799c2679e644279b59fe661ac8fa488", "address_return": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "address_to": "d799c2679e644279b59fe661ac8fa489", "customs_declaration": {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "Blumenstraße", "street3": "", "street_no": "22", "city": "München", "state": "CA", "zip": "80331", "country": "DE", "phone": "80331", "email": "shippotle@shippo.com", "is_residential": true}, "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": [{"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD"}, {"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD"}, {"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD"}], "non_delivery_option": "RETURN", "test": true}, "carrier_accounts": ["065a4a8c10d24a34ab932163a1b87f52", "73f706f4bdb94b54a337563840ce52b0"], "parcels": ["", "", ""]}}] + responses: + "200": + application/json: {"default_carrier_account": "078870331023437cb917f5187429b093", "default_servicelevel_token": "usps_priority", "label_filetype": "PDF_4x6", "metadata": "BATCH #1", "batch_shipments": {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": []}, "label_url": ["https://quiet-premise.net/", "https://linear-tabletop.biz/"], "object_created": "2016-01-04T00:15:44.394Z", "object_id": "5ef63c54f5bf45d3b1f8fb37dcb1c5f4", "object_owner": "shippo@shippo.com", "object_results": {"creation_failed": 3, "creation_succeeded": 5, "purchase_failed": 0, "purchase_succeeded": 0}, "object_updated": "2016-01-04T00:48:13.841Z", "status": "VALID", "test": false} + PurchaseBatch: + speakeasy-default-purchase-batch: + parameters: + path: + BatchId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "202": + application/json: {"default_carrier_account": "078870331023437cb917f5187429b093", "default_servicelevel_token": "usps_priority", "label_filetype": "PDF_4x6", "metadata": "BATCH #1", "batch_shipments": {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "object_id": "e11c95a6788d4ddcaa22f03175838740", "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "status": "INVALID", "transaction": "4c33736a67e2450da88b38c42deef6b7"}, {"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "object_id": "e11c95a6788d4ddcaa22f03175838740", "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "status": "INVALID", "transaction": "4c33736a67e2450da88b38c42deef6b7"}, {"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "object_id": "e11c95a6788d4ddcaa22f03175838740", "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "status": "INVALID", "transaction": "4c33736a67e2450da88b38c42deef6b7"}]}, "label_url": [], "object_created": "2016-01-04T00:15:44.394Z", "object_id": "5ef63c54f5bf45d3b1f8fb37dcb1c5f4", "object_owner": "shippo@shippo.com", "object_results": {"creation_failed": 3, "creation_succeeded": 5, "purchase_failed": 0, "purchase_succeeded": 0}, "object_updated": "2016-01-04T00:48:13.841Z", "status": "VALID", "test": false} + RemoveShipmentsFromBatch: + speakeasy-default-remove-shipments-from-batch: + parameters: + path: + BatchId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: ["", "", ""] + responses: + "200": + application/json: {"default_carrier_account": "078870331023437cb917f5187429b093", "default_servicelevel_token": "usps_priority", "label_filetype": "PDF_4x6", "metadata": "BATCH #1", "batch_shipments": {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3", "metadata": "SHIPMENT #1", "servicelevel_token": "fedex_ground", "object_id": "e11c95a6788d4ddcaa22f03175838740", "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "status": "INVALID", "transaction": "4c33736a67e2450da88b38c42deef6b7"}]}, "label_url": [], "object_created": "2016-01-04T00:15:44.394Z", "object_id": "5ef63c54f5bf45d3b1f8fb37dcb1c5f4", "object_owner": "shippo@shippo.com", "object_results": {"creation_failed": 3, "creation_succeeded": 5, "purchase_failed": 0, "purchase_succeeded": 0}, "object_updated": "2016-01-04T00:48:13.841Z", "status": "VALID", "test": false} + ListCarrierAccounts: + speakeasy-default-list-carrier-accounts: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"account_id": "****", "carrier": "usps", "parameters": {"first_name": "Marie", "last_name": "Fay", "phone_number": "1-760-700-6560", "from_address_st": "", "from_address_city": "", "from_address_state": "", "from_address_zip": "", "from_address_country_iso2": ""}, "carrier_name": "USPS", "is_shippo_account": false, "object_id": "6aa34d5f6865448fbb1ee93636e98999", "object_owner": "bob+22@gmail.com", "service_levels": [], "test": false}, {"account_id": "****", "carrier": "usps", "parameters": {"first_name": "Jeanette", "last_name": "Waters", "phone_number": "(940) 480-8491 x0814", "from_address_st": "", "from_address_city": "", "from_address_state": "", "from_address_zip": "", "from_address_country_iso2": ""}, "carrier_name": "USPS", "is_shippo_account": false, "object_id": "6aa34d5f6865448fbb1ee93636e98999", "object_owner": "bob+22@gmail.com", "service_levels": [{"name": "Priority Mail Express", "token": "usps_priority_express", "supports_return_labels": true}], "test": false}, {"account_id": "****", "carrier": "usps", "parameters": {"first_name": "Jayde", "last_name": "Ledner", "phone_number": "(583) 511-9069 x90658", "from_address_st": "", "from_address_city": "", "from_address_state": "", "from_address_zip": "", "from_address_country_iso2": ""}, "carrier_name": "USPS", "is_shippo_account": false, "object_id": "6aa34d5f6865448fbb1ee93636e98999", "object_owner": "bob+22@gmail.com", "service_levels": [{"name": "Priority Mail Express", "token": "usps_priority_express", "supports_return_labels": true}, {"name": "Priority Mail Express", "token": "usps_priority_express", "supports_return_labels": true}, {"name": "Priority Mail Express", "token": "usps_priority_express", "supports_return_labels": true}], "test": false}]} + CreateCarrierAccount: + speakeasy-default-create-carrier-account: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"account_id": "321123", "carrier": "fedex", "metadata": "FEDEX Account", "parameters": {"first_name": "Loyal", "last_name": "Collier", "phone_number": "(890) 307-8579", "from_address_st": "", "from_address_city": "", "from_address_state": "", "from_address_zip": "", "from_address_country_iso2": ""}, "test": false} + responses: + "201": + application/json: {"account_id": "****", "carrier": "usps", "parameters": {"first_name": "Destiny", "last_name": "Fay", "phone_number": "231.216.3066", "from_address_st": "", "from_address_city": "", "from_address_state": "", "from_address_zip": "", "from_address_country_iso2": ""}, "carrier_name": "USPS", "is_shippo_account": false, "object_id": "6aa34d5f6865448fbb1ee93636e98999", "object_owner": "bob+22@gmail.com", "service_levels": [], "test": false} + GetCarrierAccount: + speakeasy-default-get-carrier-account: + parameters: + path: + CarrierAccountId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"account_id": "****", "carrier": "usps", "parameters": {"account_number": "94567e", "aia_country_iso2": "US", "billing_address_city": "San Francisco", "billing_address_country_iso2": "US", "billing_address_state": "CA", "billing_address_street1": "731 Market St", "billing_address_street2": "STE 200", "billing_address_zip": "94103", "collec_country_iso2": "US", "collec_zip": "94103", "company": "Shippo", "currency_code": "USD", "email": "hippo@shippo.com", "full_name": "Shippo Meister", "has_invoice": false, "invoice_controlid": "1234", "invoice_date": "20210529", "invoice_number": "1112234", "invoice_value": "11.23", "phone": "1112223333", "title": "Manager", "ups_agreements": false}, "carrier_name": "USPS", "is_shippo_account": false, "object_id": "6aa34d5f6865448fbb1ee93636e98999", "object_owner": "bob+22@gmail.com", "service_levels": [{"name": "Priority Mail Express", "token": "usps_priority_express", "supports_return_labels": true}, {"name": "Priority Mail Express", "token": "usps_priority_express", "supports_return_labels": true}], "test": false} + UpdateCarrierAccount: + speakeasy-default-update-carrier-account: + parameters: + path: + CarrierAccountId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"account_id": "****", "carrier": "usps", "parameters": {"account_number": "94567e", "aia_country_iso2": "US", "billing_address_city": "San Francisco", "billing_address_country_iso2": "US", "billing_address_state": "CA", "billing_address_street1": "731 Market St", "billing_address_street2": "STE 200", "billing_address_zip": "94103", "collec_country_iso2": "US", "collec_zip": "94103", "company": "Shippo", "currency_code": "USD", "email": "hippo@shippo.com", "full_name": "Shippo Meister", "has_invoice": false, "invoice_controlid": "1234", "invoice_date": "20210529", "invoice_number": "1112234", "invoice_value": "11.23", "phone": "1112223333", "title": "Manager", "ups_agreements": true}} + responses: + "200": + application/json: {"account_id": "****", "carrier": "usps", "parameters": {"account_number": "94567e", "aia_country_iso2": "US", "billing_address_city": "San Francisco", "billing_address_country_iso2": "US", "billing_address_state": "CA", "billing_address_street1": "731 Market St", "billing_address_street2": "STE 200", "billing_address_zip": "94103", "collec_country_iso2": "US", "collec_zip": "94103", "company": "Shippo", "currency_code": "USD", "email": "hippo@shippo.com", "full_name": "Shippo Meister", "has_invoice": false, "invoice_controlid": "1234", "invoice_date": "20210529", "invoice_number": "1112234", "invoice_value": "11.23", "phone": "1112223333", "title": "Manager", "ups_agreements": true}, "carrier_name": "USPS", "is_shippo_account": false, "object_id": "6aa34d5f6865448fbb1ee93636e98999", "object_owner": "bob+22@gmail.com", "service_levels": [{"name": "Priority Mail Express", "token": "usps_priority_express", "supports_return_labels": true}, {"name": "Priority Mail Express", "token": "usps_priority_express", "supports_return_labels": true}, {"name": "Priority Mail Express", "token": "usps_priority_express", "supports_return_labels": true}], "test": false} + InitiateOauth2Signin: + speakeasy-default-initiate-oauth2-signin: + parameters: + path: + CarrierAccountObjectId: "" + query: + redirect_uri: "https://enlightened-mortise.com/" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "400": + application/json: {"title": "Missing required parameter", "detail": "redirect_uri"} + "401": + application/json: {"title": "Unsupported OAuth Carrier Account", "detail": "The carrier account 3c49f998b1234a2097ea0911a7e95bea does not support OAuth authorization"} + "404": + application/json: {"title": "Carrier Account not found", "detail": "Carrier Account not found for object_id: 3c49f998b1234a2097ea0911a7e95bea"} + RegisterCarrierAccount: + speakeasy-default-register-carrier-account: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"carrier": "correos"} + responses: + "201": + application/json: {"account_id": "****", "carrier": "usps", "parameters": {"first_name": "Marlene", "last_name": "Kilback", "phone_number": "(569) 519-5316", "from_address_st": "", "from_address_city": "", "from_address_state": "", "from_address_zip": "", "from_address_country_iso2": ""}, "carrier_name": "USPS", "is_shippo_account": false, "object_id": "6aa34d5f6865448fbb1ee93636e98999", "object_owner": "bob+22@gmail.com", "service_levels": [{"name": "Priority Mail Express", "token": "usps_priority_express", "supports_return_labels": true}], "test": false} + GetCarrierRegistrationStatus: + speakeasy-default-get-carrier-registration-status: + parameters: + query: + carrier: "usps" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"carrier_account": "99dc410d295b4a168993cc38809cb123", "object_owner": "tom@gmail.com", "status": "PENDING_TERMS"} + ListCustomsDeclarations: + speakeasy-default-list-customs-declarations: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": "257ba08436604d2aaf069caafe7acb2a", "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": ["5087f181d1dc4b14b73fdbf636498886"], "non_delivery_option": "RETURN", "object_created": "2014-07-17T01:01:08.306Z", "object_id": "e2197a54da9d470480f4f8796cc419cb", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T01:01:08.306Z", "test": true}, {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": "257ba08436604d2aaf069caafe7acb2a", "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": ["5087f181d1dc4b14b73fdbf636498886"], "non_delivery_option": "RETURN", "object_created": "2014-07-17T01:01:08.306Z", "object_id": "e2197a54da9d470480f4f8796cc419cb", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T01:01:08.306Z", "test": true}, {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": "257ba08436604d2aaf069caafe7acb2a", "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": ["5087f181d1dc4b14b73fdbf636498886"], "non_delivery_option": "RETURN", "object_created": "2014-07-17T01:01:08.306Z", "object_id": "e2197a54da9d470480f4f8796cc419cb", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T01:01:08.306Z", "test": true}]} + CreateCustomsDeclaration: + speakeasy-default-create-customs-declaration: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "Blumenstraße", "street3": "", "street_no": "22", "city": "München", "state": "CA", "zip": "80331", "country": "DE", "phone": "80331", "email": "shippotle@shippo.com", "is_residential": true}, "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": [{"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD"}], "non_delivery_option": "RETURN", "test": true} + responses: + "201": + application/json: {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": "257ba08436604d2aaf069caafe7acb2a", "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": ["5087f181d1dc4b14b73fdbf636498886"], "non_delivery_option": "RETURN", "object_created": "2014-07-17T01:01:08.306Z", "object_id": "e2197a54da9d470480f4f8796cc419cb", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T01:01:08.306Z", "test": true} + GetCustomsDeclaration: + speakeasy-default-get-customs-declaration: + parameters: + path: + CustomsDeclarationId: "" + query: {} + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": "257ba08436604d2aaf069caafe7acb2a", "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": ["5087f181d1dc4b14b73fdbf636498886"], "non_delivery_option": "RETURN", "object_created": "2014-07-17T01:01:08.306Z", "object_id": "e2197a54da9d470480f4f8796cc419cb", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T01:01:08.306Z", "test": true} + ListCustomsItems: + speakeasy-default-list-customs-items: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD", "object_created": "2014-07-17T00:49:20.631Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T00:49:20.631Z"}, {"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD", "object_created": "2014-07-17T00:49:20.631Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T00:49:20.631Z"}, {"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD", "object_created": "2014-07-17T00:49:20.631Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T00:49:20.631Z"}]} + CreateCustomsItem: + speakeasy-default-create-customs-item: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD"} + responses: + "201": + application/json: {"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD", "object_created": "2014-07-17T00:49:20.631Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T00:49:20.631Z"} + GetCustomsItem: + speakeasy-default-get-customs-item: + parameters: + path: + CustomsItemId: "" + query: {} + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"description": "T-Shirt", "mass_unit": "lb", "metadata": "Order ID \"123454\"", "net_weight": "5", "origin_country": "", "quantity": 20, "sku_code": "HM-123", "hs_code": "0901.21", "value_amount": "200", "value_currency": "USD", "object_created": "2014-07-17T00:49:20.631Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T00:49:20.631Z"} + CreateLiveRate: + speakeasy-default-create-live-rate: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"address_from": "", "address_to": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "line_items": [{"currency": "USD", "manufacture_country": "US", "max_delivery_time": "2016-07-23T00:00:00Z", "max_ship_time": "2016-07-23T00:00:00Z", "quantity": 20, "sku": "HM-123", "title": "Hippo Magazines", "total_price": "12.1", "variant_title": "June Edition", "weight": "0.4", "weight_unit": "lb", "object_id": "abf7d5675d744b6ea9fdb6f796b28f28"}], "parcel": "5df144dca289442cv7a06"} + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "count": 123, "results": []} + GetDefaultParcelTemplate: + speakeasy-default-get-default-parcel-template: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"result": {"distance_unit": "in", "height": "6", "length": "10", "name": "My Custom Template", "weight": "12", "weight_unit": "lb", "width": "8", "object_created": "2013-12-11T19:38:09.729Z", "object_id": "b958d3690bb04bb8b2986724872750f5", "object_owner": "shippotle@shippo.com", "object_updated": "2013-12-12T19:38:09.729Z", "template": {"carrier": "FedEx", "distance_unit": "in", "height": "1.5", "is_variable_dimensions": false, "length": "12.375", "name": "FedEx® Small Box (S1)", "token": "FedEx_Box_Small_1", "width": "10.875"}}} + UpdateDefaultParcelTemplate: + speakeasy-default-update-default-parcel-template: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"object_id": "b958d3690bb04bb8b2986724872750f5"} + responses: + "200": + application/json: {"result": {"distance_unit": "in", "height": "6", "length": "10", "name": "My Custom Template", "weight": "12", "weight_unit": "lb", "width": "8", "object_created": "2013-12-11T19:38:09.729Z", "object_id": "b958d3690bb04bb8b2986724872750f5", "object_owner": "shippotle@shippo.com", "object_updated": "2013-12-12T19:38:09.729Z", "template": {"carrier": "FedEx", "distance_unit": "in", "height": "1.5", "is_variable_dimensions": false, "length": "12.375", "name": "FedEx® Small Box (S1)", "token": "FedEx_Box_Small_1", "width": "10.875"}}} + DeleteDefaultParcelTemplate: + speakeasy-default-delete-default-parcel-template: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + ListManifests: + speakeasy-default-list-manifests: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"carrier_account": "adcfdddf8ec64b84ad22772bce3ea37a", "shipment_date": "2014-05-16T23:59:59Z", "transactions": ["adcfdddf8ec64b84ad22772bce3ea37a"], "address_from": "d799c2679e644279b59fe661ac8fa488", "documents": ["https://shippo-delivery.s3.amazonaws.com/0fadebf6f60c4aca95fa01bcc59c79ae.pdf?Signature=tlQU3RECwdHUQJQadwqg5bAzGFQ%3D&Expires=1402803835&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA"], "object_created": "2023-08-23T19:26:20.850Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "object_updated": "2024-01-14T10:26:00.433Z", "status": "SUCCESS"}, {"carrier_account": "adcfdddf8ec64b84ad22772bce3ea37a", "shipment_date": "2014-05-16T23:59:59Z", "transactions": ["adcfdddf8ec64b84ad22772bce3ea37a"], "address_from": "d799c2679e644279b59fe661ac8fa488", "documents": ["https://shippo-delivery.s3.amazonaws.com/0fadebf6f60c4aca95fa01bcc59c79ae.pdf?Signature=tlQU3RECwdHUQJQadwqg5bAzGFQ%3D&Expires=1402803835&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA"], "object_created": "2022-07-14T18:23:27.528Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "object_updated": "2022-09-09T18:28:08.953Z", "status": "SUCCESS"}, {"carrier_account": "adcfdddf8ec64b84ad22772bce3ea37a", "shipment_date": "2014-05-16T23:59:59Z", "transactions": ["adcfdddf8ec64b84ad22772bce3ea37a"], "address_from": "d799c2679e644279b59fe661ac8fa488", "documents": ["https://shippo-delivery.s3.amazonaws.com/0fadebf6f60c4aca95fa01bcc59c79ae.pdf?Signature=tlQU3RECwdHUQJQadwqg5bAzGFQ%3D&Expires=1402803835&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA"], "object_created": "2022-06-17T12:14:27.999Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "object_updated": "2023-11-28T13:02:27.296Z", "status": "SUCCESS"}]} + CreateManifest: + speakeasy-default-create-manifest: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"carrier_account": "adcfdddf8ec64b84ad22772bce3ea37a", "shipment_date": "2014-05-16T23:59:59Z", "transactions": ["adcfdddf8ec64b84ad22772bce3ea37a"], "address_from": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}} + responses: + "201": + application/json: {"carrier_account": "adcfdddf8ec64b84ad22772bce3ea37a", "shipment_date": "2014-05-16T23:59:59Z", "transactions": ["adcfdddf8ec64b84ad22772bce3ea37a"], "address_from": "d799c2679e644279b59fe661ac8fa488", "documents": ["https://shippo-delivery.s3.amazonaws.com/0fadebf6f60c4aca95fa01bcc59c79ae.pdf?Signature=tlQU3RECwdHUQJQadwqg5bAzGFQ%3D&Expires=1402803835&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA"], "object_created": "2023-12-01T17:06:07.804Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "object_updated": "2023-04-03T12:48:32.253Z", "status": "SUCCESS"} + GetManifest: + speakeasy-default-get-manifest: + parameters: + path: + ManifestId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"carrier_account": "adcfdddf8ec64b84ad22772bce3ea37a", "shipment_date": "2014-05-16T23:59:59Z", "transactions": ["adcfdddf8ec64b84ad22772bce3ea37a"], "address_from": "d799c2679e644279b59fe661ac8fa488", "documents": ["https://shippo-delivery.s3.amazonaws.com/0fadebf6f60c4aca95fa01bcc59c79ae.pdf?Signature=tlQU3RECwdHUQJQadwqg5bAzGFQ%3D&Expires=1402803835&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA"], "object_created": "2024-02-07T13:54:48.821Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "object_updated": "2023-09-05T11:33:52.011Z", "status": "SUCCESS"} + ListOrders: + speakeasy-default-list-orders: + parameters: + query: + order_status[]: ["PAID"] + shop_app: "Shippo" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"currency": "USD", "notes": "This customer is a VIP", "order_number": "#1068", "order_status": "PAID", "placed_at": "2016-09-23T01:28:12Z", "shipping_cost": "12.83", "shipping_cost_currency": "USD", "shipping_method": "USPS First Class Package", "subtotal_price": "12.1", "total_price": "24.93", "total_tax": "0.0", "weight": "0.4", "weight_unit": "lb", "from_address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "to_address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "line_items": [], "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "shop_app": "Shippo"}, {"currency": "USD", "notes": "This customer is a VIP", "order_number": "#1068", "order_status": "PAID", "placed_at": "2016-09-23T01:28:12Z", "shipping_cost": "12.83", "shipping_cost_currency": "USD", "shipping_method": "USPS First Class Package", "subtotal_price": "12.1", "total_price": "24.93", "total_tax": "0.0", "weight": "0.4", "weight_unit": "lb", "from_address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": []}, "test": false}, "to_address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": []}, "test": false}, "line_items": [{"currency": "USD", "manufacture_country": "US", "max_delivery_time": "2016-07-23T00:00:00Z", "max_ship_time": "2016-07-23T00:00:00Z", "quantity": 20, "sku": "HM-123", "title": "Hippo Magazines", "total_price": "12.1", "variant_title": "June Edition", "weight": "0.4", "weight_unit": "lb", "object_id": "abf7d5675d744b6ea9fdb6f796b28f28"}, {"currency": "USD", "manufacture_country": "US", "max_delivery_time": "2016-07-23T00:00:00Z", "max_ship_time": "2016-07-23T00:00:00Z", "quantity": 20, "sku": "HM-123", "title": "Hippo Magazines", "total_price": "12.1", "variant_title": "June Edition", "weight": "0.4", "weight_unit": "lb", "object_id": "abf7d5675d744b6ea9fdb6f796b28f28"}], "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "shop_app": "Shippo"}, {"currency": "USD", "notes": "This customer is a VIP", "order_number": "#1068", "order_status": "PAID", "placed_at": "2016-09-23T01:28:12Z", "shipping_cost": "12.83", "shipping_cost_currency": "USD", "shipping_method": "USPS First Class Package", "subtotal_price": "12.1", "total_price": "24.93", "total_tax": "0.0", "weight": "0.4", "weight_unit": "lb", "from_address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "to_address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": []}, "test": false}, "line_items": [{"currency": "USD", "manufacture_country": "US", "max_delivery_time": "2016-07-23T00:00:00Z", "max_ship_time": "2016-07-23T00:00:00Z", "quantity": 20, "sku": "HM-123", "title": "Hippo Magazines", "total_price": "12.1", "variant_title": "June Edition", "weight": "0.4", "weight_unit": "lb", "object_id": "abf7d5675d744b6ea9fdb6f796b28f28"}, {"currency": "USD", "manufacture_country": "US", "max_delivery_time": "2016-07-23T00:00:00Z", "max_ship_time": "2016-07-23T00:00:00Z", "quantity": 20, "sku": "HM-123", "title": "Hippo Magazines", "total_price": "12.1", "variant_title": "June Edition", "weight": "0.4", "weight_unit": "lb", "object_id": "abf7d5675d744b6ea9fdb6f796b28f28"}], "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "shop_app": "Shippo"}]} + CreateOrder: + speakeasy-default-create-order: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"currency": "USD", "notes": "This customer is a VIP", "order_number": "#1068", "order_status": "PAID", "placed_at": "2016-09-23T01:28:12Z", "shipping_cost": "12.83", "shipping_cost_currency": "USD", "shipping_method": "USPS First Class Package", "subtotal_price": "12.1", "total_price": "24.93", "total_tax": "0.0", "weight": "0.4", "weight_unit": "lb", "from_address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "to_address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "line_items": [{"currency": "USD", "manufacture_country": "US", "max_delivery_time": "2016-07-23T00:00:00Z", "max_ship_time": "2016-07-23T00:00:00Z", "quantity": 20, "sku": "HM-123", "title": "Hippo Magazines", "total_price": "12.1", "variant_title": "June Edition", "weight": "0.4", "weight_unit": "lb"}]} + responses: + "201": + application/json: {"currency": "USD", "notes": "This customer is a VIP", "order_number": "#1068", "order_status": "PAID", "placed_at": "2016-09-23T01:28:12Z", "shipping_cost": "12.83", "shipping_cost_currency": "USD", "shipping_method": "USPS First Class Package", "subtotal_price": "12.1", "total_price": "24.93", "total_tax": "0.0", "weight": "0.4", "weight_unit": "lb", "from_address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "to_address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "line_items": [], "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "shop_app": "Shippo"} + GetOrder: + speakeasy-default-get-order: + parameters: + path: + OrderId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"currency": "USD", "notes": "This customer is a VIP", "order_number": "#1068", "order_status": "PAID", "placed_at": "2016-09-23T01:28:12Z", "shipping_cost": "12.83", "shipping_cost_currency": "USD", "shipping_method": "USPS First Class Package", "subtotal_price": "12.1", "total_price": "24.93", "total_tax": "0.0", "weight": "0.4", "weight_unit": "lb", "from_address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "to_address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "line_items": [{"currency": "USD", "manufacture_country": "US", "max_delivery_time": "2016-07-23T00:00:00Z", "max_ship_time": "2016-07-23T00:00:00Z", "quantity": 20, "sku": "HM-123", "title": "Hippo Magazines", "total_price": "12.1", "variant_title": "June Edition", "weight": "0.4", "weight_unit": "lb", "object_id": "abf7d5675d744b6ea9fdb6f796b28f28"}, {"currency": "USD", "manufacture_country": "US", "max_delivery_time": "2016-07-23T00:00:00Z", "max_ship_time": "2016-07-23T00:00:00Z", "quantity": 20, "sku": "HM-123", "title": "Hippo Magazines", "total_price": "12.1", "variant_title": "June Edition", "weight": "0.4", "weight_unit": "lb", "object_id": "abf7d5675d744b6ea9fdb6f796b28f28"}], "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "shop_app": "Shippo"} + ListCarrierParcelTemplates: + "": + parameters: + query: + carrier: "fedex" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"results": [{"carrier": "FedEx", "distance_unit": "in", "height": "1.5", "is_variable_dimensions": false, "length": "12.375", "name": "FedEx® Small Box (S1)", "token": "FedEx_Box_Small_1", "width": "10.875"}, {"carrier": "FedEx", "distance_unit": "in", "height": "1.5", "is_variable_dimensions": false, "length": "12.375", "name": "FedEx® Small Box (S1)", "token": "FedEx_Box_Small_1", "width": "10.875"}, {"carrier": "FedEx", "distance_unit": "in", "height": "1.5", "is_variable_dimensions": false, "length": "12.375", "name": "FedEx® Small Box (S1)", "token": "FedEx_Box_Small_1", "width": "10.875"}]} + GetCarrierParcelTemplate: + speakeasy-default-get-carrier-parcel-template: + parameters: + path: + CarrierParcelTemplateToken: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"carrier": "FedEx", "distance_unit": "in", "height": "1.5", "is_variable_dimensions": false, "length": "12.375", "name": "FedEx® Small Box (S1)", "token": "FedEx_Box_Small_1", "width": "10.875"} + ListParcels: + speakeasy-default-list-parcels: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"}]} + CreateParcel: + speakeasy-default-create-parcel: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"extra": {"COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "insurance": {"amount": "5.5", "content": "Laptop", "currency": "USD", "provider": "UPS"}}, "metadata": "Customer ID 123456", "mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"} + responses: + "201": + application/json: {"mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"} + GetParcel: + speakeasy-default-get-parcel: + parameters: + path: + ParcelId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"} + CreatePickup: + speakeasy-default-create-pickup: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"carrier_account": "adcfdddf8ec64b84ad22772bce3ea37a", "location": {"address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "building_location_type": "Front Door", "building_type": "apartment", "instructions": "Behind screen door"}, "requested_end_time": "2023-06-18T07:14:55.338Z", "requested_start_time": "2023-12-01T17:06:07.804Z", "transactions": ["adcfdddf8ec64b84ad22772bce3ea37a"]} + responses: + "201": + application/json: {"carrier_account": "adcfdddf8ec64b84ad22772bce3ea37a", "location": {"address": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "building_location_type": "Front Door", "building_type": "apartment", "instructions": "Behind screen door"}, "requested_end_time": "2023-04-03T12:48:32.253Z", "requested_start_time": "2022-05-28T06:20:22.766Z", "transactions": ["adcfdddf8ec64b84ad22772bce3ea37a"], "confirmed_start_time": "2020-05-09T12:00:00Z", "confirmed_end_time": "2020-05-09T23:59:59.999Z", "cancel_by_time": "2020-05-09T08:00:00Z", "status": "CONFIRMED", "confirmation_code": "WTC310058750", "timezone": "US/Pacific", "messages": []} + GetRate: + speakeasy-default-get-rate: + parameters: + path: + RateId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"amount": "5.5", "amount_local": "5.5", "currency": "USD", "currency_local": "USD", "arrives_by": "08:30:00", "attributes": ["CHEAPEST", "CHEAPEST"], "carrier_account": "078870331023437cb917f5187429b093", "duration_terms": "Delivery in 1 to 3 business days", "estimated_days": 2, "included_insurance_price": "1.05", "messages": [{"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}], "object_created": "2024-11-29T01:50:48.954Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "pp@gmail.com", "provider": "USPS", "provider_image_75": "https://cdn2.goshippo.com/providers/75/USPS.png", "provider_image_200": "https://cdn2.goshippo.com/providers/200/USPS.png", "servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express", "parent_servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express"}}, "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "zone": "1"} + ListShipmentRates: + speakeasy-default-list-shipment-rates: + parameters: + path: + ShipmentId: "" + query: {} + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"amount": "5.5", "amount_local": "5.5", "currency": "USD", "currency_local": "USD", "arrives_by": "08:30:00", "attributes": ["FASTEST"], "carrier_account": "078870331023437cb917f5187429b093", "duration_terms": "Delivery in 1 to 3 business days", "estimated_days": 2, "included_insurance_price": "1.05", "messages": [{"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}], "object_created": "2022-10-17T00:25:08.850Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "pp@gmail.com", "provider": "USPS", "provider_image_75": "https://cdn2.goshippo.com/providers/75/USPS.png", "provider_image_200": "https://cdn2.goshippo.com/providers/200/USPS.png", "servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express", "parent_servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express"}}, "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "zone": "1"}]} + ListShipmentRatesByCurrencyCode: + speakeasy-default-list-shipment-rates-by-currency-code: + parameters: + path: + ShipmentId: "" + CurrencyCode: "USD" + query: {} + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": []} + CreateRefund: + speakeasy-default-create-refund: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"async": false, "transaction": "915d94940ea54c3a80cbfa328722f5a1"} + responses: + "201": + application/json: {"object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "status": "SUCCESS", "transaction": "915d94940ea54c3a80cbfa328722f5a1"} + ListRefunds: + speakeasy-default-list-refunds: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "status": "SUCCESS", "transaction": "915d94940ea54c3a80cbfa328722f5a1"}, {"object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "status": "SUCCESS", "transaction": "915d94940ea54c3a80cbfa328722f5a1"}, {"object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "status": "SUCCESS", "transaction": "915d94940ea54c3a80cbfa328722f5a1"}]} + GetRefund: + speakeasy-default-get-refund: + parameters: + path: + RefundId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "shippotle@shippo.com", "status": "SUCCESS", "transaction": "915d94940ea54c3a80cbfa328722f5a1"} + ListServiceGroups: + speakeasy-default-list-service-groups: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: [{"description": "USPS shipping options", "flat_rate": "5", "flat_rate_currency": "USD", "free_shipping_threshold_currency": "USD", "free_shipping_threshold_min": "5", "name": "USPS Shipping", "rate_adjustment": 15, "type": "FLAT_RATE", "object_id": "80feb1633d4a43c898f005850", "is_active": true, "service_levels": [{"account_object_id": "80feb1633d4a43c898f0058506cfd82d", "service_level_token": "ups_next_day_air_saver"}, {"account_object_id": "80feb1633d4a43c898f0058506cfd82d", "service_level_token": "ups_next_day_air_saver"}]}, {"description": "USPS shipping options", "flat_rate": "5", "flat_rate_currency": "USD", "free_shipping_threshold_currency": "USD", "free_shipping_threshold_min": "5", "name": "USPS Shipping", "rate_adjustment": 15, "type": "FLAT_RATE", "object_id": "80feb1633d4a43c898f005850", "is_active": true, "service_levels": [{"account_object_id": "80feb1633d4a43c898f0058506cfd82d", "service_level_token": "ups_next_day_air_saver"}, {"account_object_id": "80feb1633d4a43c898f0058506cfd82d", "service_level_token": "ups_next_day_air_saver"}]}, {"description": "USPS shipping options", "flat_rate": "5", "flat_rate_currency": "USD", "free_shipping_threshold_currency": "USD", "free_shipping_threshold_min": "5", "name": "USPS Shipping", "rate_adjustment": 15, "type": "FLAT_RATE", "object_id": "80feb1633d4a43c898f005850", "is_active": true, "service_levels": []}] + CreateServiceGroup: + speakeasy-default-create-service-group: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"description": "USPS shipping options", "flat_rate": "5", "flat_rate_currency": "USD", "free_shipping_threshold_currency": "USD", "free_shipping_threshold_min": "5", "name": "USPS Shipping", "rate_adjustment": 15, "type": "FLAT_RATE", "service_levels": [{"account_object_id": "80feb1633d4a43c898f0058506cfd82d", "service_level_token": "ups_next_day_air_saver"}]} + responses: + "201": + application/json: {"description": "USPS shipping options", "flat_rate": "5", "flat_rate_currency": "USD", "free_shipping_threshold_currency": "USD", "free_shipping_threshold_min": "5", "name": "USPS Shipping", "rate_adjustment": 15, "type": "FLAT_RATE", "object_id": "80feb1633d4a43c898f005850", "is_active": true, "service_levels": [{"account_object_id": "80feb1633d4a43c898f0058506cfd82d", "service_level_token": "ups_next_day_air_saver"}, {"account_object_id": "80feb1633d4a43c898f0058506cfd82d", "service_level_token": "ups_next_day_air_saver"}]} + UpdateServiceGroup: + speakeasy-default-update-service-group: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"description": "USPS shipping options", "flat_rate": "5", "flat_rate_currency": "USD", "free_shipping_threshold_currency": "USD", "free_shipping_threshold_min": "5", "name": "USPS Shipping", "rate_adjustment": 15, "type": "FLAT_RATE", "object_id": "80feb1633d4a43c898f005850", "is_active": true, "service_levels": [{"account_object_id": "80feb1633d4a43c898f0058506cfd82d", "service_level_token": "ups_next_day_air_saver"}, {"account_object_id": "80feb1633d4a43c898f0058506cfd82d", "service_level_token": "ups_next_day_air_saver"}, {"account_object_id": "80feb1633d4a43c898f0058506cfd82d", "service_level_token": "ups_next_day_air_saver"}]} + responses: + "200": + application/json: {"description": "USPS shipping options", "flat_rate": "5", "flat_rate_currency": "USD", "free_shipping_threshold_currency": "USD", "free_shipping_threshold_min": "5", "name": "USPS Shipping", "rate_adjustment": 15, "type": "FLAT_RATE", "object_id": "80feb1633d4a43c898f005850", "is_active": true, "service_levels": [{"account_object_id": "80feb1633d4a43c898f0058506cfd82d", "service_level_token": "ups_next_day_air_saver"}, {"account_object_id": "80feb1633d4a43c898f0058506cfd82d", "service_level_token": "ups_next_day_air_saver"}]} + DeleteServiceGroup: + speakeasy-default-delete-service-group: + parameters: + path: + ServiceGroupId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + ListShipments: + speakeasy-default-list-shipments: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"extra": {"accounts_receivable_customer_account": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "appropriation_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "bill_of_lading_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "cod_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "customer_reference": {"ref_sort": 1}, "dealer_order_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "dept_number": {"ref_sort": 3}, "fda_product_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "insurance": {"amount": "5.5", "currency": "USD"}, "invoice_number": {"ref_sort": 2}, "manifest_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "model_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "part_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "po_number": {"ref_sort": 2}, "production_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "purchase_request_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "rma_number": {"ref_sort": 1}, "salesperson_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "serial_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "store_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "transaction_reference_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}}, "metadata": "Customer ID 123456", "shipment_date": "2021-03-22T12:00:00Z", "address_from": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "address_return": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "address_to": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": []}, "test": false}, "carrier_accounts": [], "customs_declaration": {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": "257ba08436604d2aaf069caafe7acb2a", "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": ["5087f181d1dc4b14b73fdbf636498886"], "non_delivery_option": "RETURN", "object_created": "2014-07-17T01:01:08.306Z", "object_id": "e2197a54da9d470480f4f8796cc419cb", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T01:01:08.306Z", "test": true}, "messages": [], "object_created": "2023-11-28T13:02:27.296Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "pp@gmail.com", "object_updated": "2023-12-02T18:25:37.169Z", "parcels": [{"mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"}], "rates": [], "status": "QUEUED"}, {"extra": {"accounts_receivable_customer_account": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "appropriation_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "bill_of_lading_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "cod_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "customer_reference": {"ref_sort": 1}, "dealer_order_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "dept_number": {"ref_sort": 3}, "fda_product_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "insurance": {"amount": "5.5", "currency": "USD"}, "invoice_number": {"ref_sort": 2}, "manifest_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "model_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "part_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "po_number": {"ref_sort": 2}, "production_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "purchase_request_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "rma_number": {"ref_sort": 1}, "salesperson_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "serial_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "store_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "transaction_reference_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}}, "metadata": "Customer ID 123456", "shipment_date": "2021-03-22T12:00:00Z", "address_from": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "address_return": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": []}, "test": false}, "address_to": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": []}, "test": false}, "carrier_accounts": ["", ""], "customs_declaration": {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": "257ba08436604d2aaf069caafe7acb2a", "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": ["5087f181d1dc4b14b73fdbf636498886"], "non_delivery_option": "RETURN", "object_created": "2014-07-17T01:01:08.306Z", "object_id": "e2197a54da9d470480f4f8796cc419cb", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T01:01:08.306Z", "test": true}, "messages": [{"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}], "object_created": "2023-11-26T18:23:24.264Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "pp@gmail.com", "object_updated": "2022-01-09T04:26:27.312Z", "parcels": [{"mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"}], "rates": [], "status": "QUEUED"}, {"extra": {"accounts_receivable_customer_account": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "appropriation_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "bill_of_lading_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "cod_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "customer_reference": {"ref_sort": 1}, "dealer_order_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "dept_number": {"ref_sort": 3}, "fda_product_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "insurance": {"amount": "5.5", "currency": "USD"}, "invoice_number": {"ref_sort": 2}, "manifest_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "model_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "part_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "po_number": {"ref_sort": 2}, "production_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "purchase_request_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "rma_number": {"ref_sort": 1}, "salesperson_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "serial_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "store_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "transaction_reference_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}}, "metadata": "Customer ID 123456", "shipment_date": "2021-03-22T12:00:00Z", "address_from": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "address_return": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "address_to": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": []}, "test": false}, "carrier_accounts": ["", "", ""], "customs_declaration": {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": "257ba08436604d2aaf069caafe7acb2a", "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": ["5087f181d1dc4b14b73fdbf636498886"], "non_delivery_option": "RETURN", "object_created": "2014-07-17T01:01:08.306Z", "object_id": "e2197a54da9d470480f4f8796cc419cb", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T01:01:08.306Z", "test": true}, "messages": [{"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}], "object_created": "2024-08-18T13:00:42.665Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "pp@gmail.com", "object_updated": "2023-06-22T03:00:04.393Z", "parcels": [{"mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"}], "rates": [], "status": "QUEUED"}]} + CreateShipment: + speakeasy-default-create-shipment: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"extra": {"accounts_receivable_customer_account": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "appropriation_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "bill_of_lading_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "cod_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "customer_reference": {"ref_sort": 1}, "dealer_order_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "dept_number": {"ref_sort": 3}, "fda_product_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "insurance": {"amount": "5.5", "currency": "USD"}, "invoice_number": {"ref_sort": 2}, "manifest_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "model_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "part_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "po_number": {"ref_sort": 2}, "production_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "purchase_request_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "rma_number": {"ref_sort": 1}, "salesperson_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "serial_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "store_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "transaction_reference_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}}, "metadata": "Customer ID 123456", "shipment_date": "2021-03-22T12:00:00Z", "address_from": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "address_return": "d799c2679e644279b59fe661ac8fa488", "address_to": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "validate": true}, "customs_declaration": {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "Blumenstraße", "street3": "", "street_no": "22", "city": "München", "state": "CA", "zip": "80331", "country": "DE", "phone": "80331", "email": "shippotle@shippo.com", "is_residential": true}, "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": [], "non_delivery_option": "RETURN", "test": true}, "carrier_accounts": ["065a4a8c10d24a34ab932163a1b87f52", "73f706f4bdb94b54a337563840ce52b0"], "parcels": ["", {"extra": {"COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "insurance": {"amount": "5.5", "content": "Laptop", "currency": "USD", "provider": "UPS"}}, "metadata": "Customer ID 123456", "mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"}, {"extra": {"COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "insurance": {"amount": "5.5", "content": "Laptop", "currency": "USD", "provider": "UPS"}}, "metadata": "Customer ID 123456", "mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"}]} + responses: + "201": + application/json: {"extra": {"accounts_receivable_customer_account": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "appropriation_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "bill_of_lading_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "cod_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "customer_reference": {"ref_sort": 1}, "dealer_order_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "dept_number": {"ref_sort": 3}, "fda_product_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "insurance": {"amount": "5.5", "currency": "USD"}, "invoice_number": {"ref_sort": 2}, "manifest_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "model_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "part_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "po_number": {"ref_sort": 2}, "production_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "purchase_request_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "rma_number": {"ref_sort": 1}, "salesperson_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "serial_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "store_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "transaction_reference_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}}, "metadata": "Customer ID 123456", "shipment_date": "2021-03-22T12:00:00Z", "address_from": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": []}, "test": false}, "address_return": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "address_to": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "carrier_accounts": ["", ""], "customs_declaration": {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": "257ba08436604d2aaf069caafe7acb2a", "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": ["5087f181d1dc4b14b73fdbf636498886"], "non_delivery_option": "RETURN", "object_created": "2014-07-17T01:01:08.306Z", "object_id": "e2197a54da9d470480f4f8796cc419cb", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T01:01:08.306Z", "test": true}, "messages": [{"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}], "object_created": "2024-11-15T07:40:19.243Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "pp@gmail.com", "object_updated": "2023-01-27T07:05:06.005Z", "parcels": [{"mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"}], "rates": [{"amount": "5.5", "amount_local": "5.5", "currency": "USD", "currency_local": "USD", "arrives_by": "08:30:00", "attributes": [], "carrier_account": "078870331023437cb917f5187429b093", "duration_terms": "Delivery in 1 to 3 business days", "estimated_days": 2, "included_insurance_price": "1.05", "messages": [], "object_created": "2022-08-20T15:01:30.899Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "pp@gmail.com", "provider": "USPS", "provider_image_75": "https://cdn2.goshippo.com/providers/75/USPS.png", "provider_image_200": "https://cdn2.goshippo.com/providers/200/USPS.png", "servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express", "parent_servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express"}}, "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "zone": "1"}], "status": "QUEUED"} + GetShipment: + speakeasy-default-get-shipment: + parameters: + path: + ShipmentId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"extra": {"accounts_receivable_customer_account": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "appropriation_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "bill_of_lading_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "COD": {"amount": "5.5", "currency": "USD", "payment_method": "CASH"}, "cod_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "customer_reference": {"ref_sort": 1}, "dealer_order_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "dept_number": {"ref_sort": 3}, "fda_product_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "insurance": {"amount": "5.5", "currency": "USD"}, "invoice_number": {"ref_sort": 2}, "manifest_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "model_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "part_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "po_number": {"ref_sort": 2}, "production_code": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "purchase_request_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "rma_number": {"ref_sort": 1}, "salesperson_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "serial_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "store_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}, "transaction_reference_number": {"prefix": "ABC", "value": "value", "ref_sort": 1}}, "metadata": "Customer ID 123456", "shipment_date": "2021-03-22T12:00:00Z", "address_from": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "address_return": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "address_to": {"name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": {"is_valid": false, "messages": [{"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}, {"code": "Unknown Street", "source": "Shippo Address Validator", "text": "City, State and ZIP Code are valid, but street address is not a match.", "type": "address_warning"}]}, "test": false}, "carrier_accounts": ["", ""], "customs_declaration": {"b13a_filing_option": "FILED_ELECTRONICALLY", "certify": true, "certify_signer": "Shawn Ippotle", "contents_explanation": "T-Shirt purchase", "duties_payor": {"account": "2323434543", "type": "THIRD_PARTY", "address": {"name": "Patrick Kavanagh", "zip": "80331", "country": "DE"}}, "exporter_identification": {"eori_number": "PL123456790ABCDE", "tax_id": {"number": "123456789", "type": "EIN"}}, "invoice": "#123123", "metadata": "Order ID #123123", "address_importer": "257ba08436604d2aaf069caafe7acb2a", "contents_type": "MERCHANDISE", "eel_pfc": "NOEEI_30_37_a", "incoterm": "DDP", "items": ["5087f181d1dc4b14b73fdbf636498886"], "non_delivery_option": "RETURN", "object_created": "2014-07-17T01:01:08.306Z", "object_id": "e2197a54da9d470480f4f8796cc419cb", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-17T01:01:08.306Z", "test": true}, "messages": [{"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}], "object_created": "2023-05-18T00:32:02.244Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "pp@gmail.com", "object_updated": "2023-05-10T02:28:23.533Z", "parcels": [{"mass_unit": "lb", "weight": "1", "distance_unit": "in", "height": "1", "length": "1", "width": "1"}], "rates": [{"amount": "5.5", "amount_local": "5.5", "currency": "USD", "currency_local": "USD", "arrives_by": "08:30:00", "attributes": [], "carrier_account": "078870331023437cb917f5187429b093", "duration_terms": "Delivery in 1 to 3 business days", "estimated_days": 2, "included_insurance_price": "1.05", "messages": [{"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}], "object_created": "2023-04-26T04:53:50.189Z", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "object_owner": "pp@gmail.com", "provider": "USPS", "provider_image_75": "https://cdn2.goshippo.com/providers/75/USPS.png", "provider_image_200": "https://cdn2.goshippo.com/providers/200/USPS.png", "servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express", "parent_servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express"}}, "shipment": "adcfdddf8ec64b84ad22772bce3ea37a", "zone": "1"}], "status": "QUEUED"} + CreateTrack: + speakeasy-default-create-track: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"carrier": "usps", "metadata": "Order 000123", "tracking_number": "9205590164917312751089"} + responses: + "200": + application/json: {"address_from": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "address_to": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "carrier": "usps", "messages": [""], "metadata": "Order 000123", "original_eta": "2021-07-23T00:00:00Z", "servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express", "parent_servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express"}}, "tracking_history": [{"location": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "object_created": "2023-04-03T12:48:32.253Z", "object_id": "", "object_updated": "2022-05-28T06:20:22.766Z", "status": "DELIVERED", "substatus": {"code": "information_received", "text": "Information about the package received.", "action_required": true}, "status_date": "2016-07-23T00:00:00Z", "status_details": "Your shipment has been delivered at the destination mailbox."}, {"location": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "object_created": "2024-05-22T22:27:14.379Z", "object_id": "", "object_updated": "2024-11-08T08:43:39.394Z", "status": "DELIVERED", "substatus": {"code": "information_received", "text": "Information about the package received.", "action_required": true}, "status_date": "2016-07-23T00:00:00Z", "status_details": "Your shipment has been delivered at the destination mailbox."}], "tracking_number": "9205590164917312751089", "tracking_status": {"location": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "object_created": "2022-07-06T00:30:20.403Z", "object_id": "", "object_updated": "2022-04-09T14:25:29.356Z", "status": "DELIVERED", "substatus": {"code": "information_received", "text": "Information about the package received.", "action_required": false}, "status_date": "2016-07-23T00:00:00Z", "status_details": "Your shipment has been delivered at the destination mailbox."}} + GetTrack: + speakeasy-default-get-track: + parameters: + path: + TrackingNumber: "" + Carrier: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"address_from": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "address_to": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "carrier": "usps", "messages": ["", ""], "metadata": "Order 000123", "original_eta": "2021-07-23T00:00:00Z", "servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express", "parent_servicelevel": {"name": "Priority Mail Express", "token": "usps_priority_express"}}, "tracking_history": [{"location": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "object_created": "2023-08-20T11:11:04.610Z", "object_id": "", "object_updated": "2023-07-26T06:33:15.810Z", "status": "DELIVERED", "substatus": {"code": "information_received", "text": "Information about the package received.", "action_required": false}, "status_date": "2016-07-23T00:00:00Z", "status_details": "Your shipment has been delivered at the destination mailbox."}, {"location": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "object_created": "2023-05-18T00:32:02.244Z", "object_id": "", "object_updated": "2023-05-10T02:28:23.533Z", "status": "DELIVERED", "substatus": {"code": "information_received", "text": "Information about the package received.", "action_required": true}, "status_date": "2016-07-23T00:00:00Z", "status_details": "Your shipment has been delivered at the destination mailbox."}], "tracking_number": "9205590164917312751089", "tracking_status": {"location": {"city": "Las Vegas", "country": "US", "state": "NV", "zip": "89101"}, "object_created": "2022-08-22T22:47:10.166Z", "object_id": "", "object_updated": "2024-10-24T02:41:21.259Z", "status": "DELIVERED", "substatus": {"code": "information_received", "text": "Information about the package received.", "action_required": true}, "status_date": "2016-07-23T00:00:00Z", "status_details": "Your shipment has been delivered at the destination mailbox."}} + ListTransactions: + speakeasy-default-list-transactions: + parameters: + query: + object_status: "SUCCESS" + tracking_status: "DELIVERED" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"created_by": {"first_name": "Shwan", "last_name": "Ippotle", "username": "shippotle@shippo.com"}, "label_file_type": "PDF_4x6", "label_url": "https://shippo-delivery.s3.amazonaws.com/70ae8117ee1749e393f249d5b77c45e0.pdf?Signature=vDw1ltcyGveVR1OQoUDdzC43BY8%3D&Expires=1437093830&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA", "messages": [{"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}], "object_id": "915d94940ea54c3a80cbfa328722f5a1", "object_owner": "shippotle@shippo.com", "parcel": "e94c7fdfdc7b495dbb390a28d929d90a", "qr_code_url": "https://shippo-delivery.s3.amazonaws.com/96_qr_code.pdf?Signature=PEdWrp0mFWAGwJp7FW3b%2FeA2eyY%3D&Expires=1385930652&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA", "rate": "ec9f0d3adc9441449c85d315f0997fd5", "status": "SUCCESS", "tracking_number": "9499907123456123456781", "tracking_status": "DELIVERED", "tracking_url_provider": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9499907123456123456781"}, {"created_by": {"first_name": "Shwan", "last_name": "Ippotle", "username": "shippotle@shippo.com"}, "label_file_type": "PDF_4x6", "label_url": "https://shippo-delivery.s3.amazonaws.com/70ae8117ee1749e393f249d5b77c45e0.pdf?Signature=vDw1ltcyGveVR1OQoUDdzC43BY8%3D&Expires=1437093830&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA", "messages": [], "object_id": "915d94940ea54c3a80cbfa328722f5a1", "object_owner": "shippotle@shippo.com", "parcel": "e94c7fdfdc7b495dbb390a28d929d90a", "qr_code_url": "https://shippo-delivery.s3.amazonaws.com/96_qr_code.pdf?Signature=PEdWrp0mFWAGwJp7FW3b%2FeA2eyY%3D&Expires=1385930652&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA", "rate": {"amount": "5.5", "amount_local": "5.5", "currency": "USD", "currency_local": "USD", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "provider": "USPS", "carrier_account": "078870331023437cb917f5187429b093", "servicelevel_name": "Priority Mail", "servicelevel_token": "fedex_ground"}, "status": "SUCCESS", "tracking_number": "9499907123456123456781", "tracking_status": "DELIVERED", "tracking_url_provider": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9499907123456123456781"}, {"created_by": {"first_name": "Shwan", "last_name": "Ippotle", "username": "shippotle@shippo.com"}, "label_file_type": "PDF_4x6", "label_url": "https://shippo-delivery.s3.amazonaws.com/70ae8117ee1749e393f249d5b77c45e0.pdf?Signature=vDw1ltcyGveVR1OQoUDdzC43BY8%3D&Expires=1437093830&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA", "messages": [], "object_id": "915d94940ea54c3a80cbfa328722f5a1", "object_owner": "shippotle@shippo.com", "parcel": "e94c7fdfdc7b495dbb390a28d929d90a", "qr_code_url": "https://shippo-delivery.s3.amazonaws.com/96_qr_code.pdf?Signature=PEdWrp0mFWAGwJp7FW3b%2FeA2eyY%3D&Expires=1385930652&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA", "rate": "ec9f0d3adc9441449c85d315f0997fd5", "status": "SUCCESS", "tracking_number": "9499907123456123456781", "tracking_status": "DELIVERED", "tracking_url_provider": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9499907123456123456781"}]} + CreateTransaction: + speakeasy-default-create-transaction: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"async": false, "label_file_type": "PDF_4x6", "metadata": "Order ID #12345", "rate": "ec9f0d3adc9441449c85d315f0997fd5", "order": "adcfdddf8ec64b84ad22772bce3ea37a"} + responses: + "201": + application/json: {"created_by": {"first_name": "Shwan", "last_name": "Ippotle", "username": "shippotle@shippo.com"}, "label_file_type": "PDF_4x6", "label_url": "https://shippo-delivery.s3.amazonaws.com/70ae8117ee1749e393f249d5b77c45e0.pdf?Signature=vDw1ltcyGveVR1OQoUDdzC43BY8%3D&Expires=1437093830&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA", "messages": [{"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}], "object_id": "915d94940ea54c3a80cbfa328722f5a1", "object_owner": "shippotle@shippo.com", "parcel": "e94c7fdfdc7b495dbb390a28d929d90a", "qr_code_url": "https://shippo-delivery.s3.amazonaws.com/96_qr_code.pdf?Signature=PEdWrp0mFWAGwJp7FW3b%2FeA2eyY%3D&Expires=1385930652&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA", "rate": {"amount": "5.5", "amount_local": "5.5", "currency": "USD", "currency_local": "USD", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a", "provider": "USPS", "carrier_account": "078870331023437cb917f5187429b093", "servicelevel_name": "Priority Mail", "servicelevel_token": "fedex_ground"}, "status": "SUCCESS", "tracking_number": "9499907123456123456781", "tracking_status": "DELIVERED", "tracking_url_provider": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9499907123456123456781"} + GetTransaction: + speakeasy-default-get-transaction: + parameters: + path: + TransactionId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"created_by": {"first_name": "Shwan", "last_name": "Ippotle", "username": "shippotle@shippo.com"}, "label_file_type": "PDF_4x6", "label_url": "https://shippo-delivery.s3.amazonaws.com/70ae8117ee1749e393f249d5b77c45e0.pdf?Signature=vDw1ltcyGveVR1OQoUDdzC43BY8%3D&Expires=1437093830&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA", "messages": [{"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}, {"source": "UPS", "code": "carrier_timeout", "text": "UPS API did not respond. Please try again in a few minutes."}], "object_id": "915d94940ea54c3a80cbfa328722f5a1", "object_owner": "shippotle@shippo.com", "parcel": "e94c7fdfdc7b495dbb390a28d929d90a", "qr_code_url": "https://shippo-delivery.s3.amazonaws.com/96_qr_code.pdf?Signature=PEdWrp0mFWAGwJp7FW3b%2FeA2eyY%3D&Expires=1385930652&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA", "rate": "ec9f0d3adc9441449c85d315f0997fd5", "status": "SUCCESS", "tracking_number": "9499907123456123456781", "tracking_status": "DELIVERED", "tracking_url_provider": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9499907123456123456781"} + ListUserParcelTemplates: + speakeasy-default-list-user-parcel-templates: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"results": [{"distance_unit": "in", "height": "6", "length": "10", "name": "My Custom Template", "weight": "12", "weight_unit": "lb", "width": "8", "object_created": "2013-12-11T19:38:09.729Z", "object_id": "b958d3690bb04bb8b2986724872750f5", "object_owner": "shippotle@shippo.com", "object_updated": "2013-12-12T19:38:09.729Z", "template": {"carrier": "FedEx", "distance_unit": "in", "height": "1.5", "is_variable_dimensions": false, "length": "12.375", "name": "FedEx® Small Box (S1)", "token": "FedEx_Box_Small_1", "width": "10.875"}}, {"distance_unit": "in", "height": "6", "length": "10", "name": "My Custom Template", "weight": "12", "weight_unit": "lb", "width": "8", "object_created": "2013-12-11T19:38:09.729Z", "object_id": "b958d3690bb04bb8b2986724872750f5", "object_owner": "shippotle@shippo.com", "object_updated": "2013-12-12T19:38:09.729Z", "template": {"carrier": "FedEx", "distance_unit": "in", "height": "1.5", "is_variable_dimensions": false, "length": "12.375", "name": "FedEx® Small Box (S1)", "token": "FedEx_Box_Small_1", "width": "10.875"}}, {"distance_unit": "in", "height": "6", "length": "10", "name": "My Custom Template", "weight": "12", "weight_unit": "lb", "width": "8", "object_created": "2013-12-11T19:38:09.729Z", "object_id": "b958d3690bb04bb8b2986724872750f5", "object_owner": "shippotle@shippo.com", "object_updated": "2013-12-12T19:38:09.729Z", "template": {"carrier": "FedEx", "distance_unit": "in", "height": "1.5", "is_variable_dimensions": false, "length": "12.375", "name": "FedEx® Small Box (S1)", "token": "FedEx_Box_Small_1", "width": "10.875"}}]} + CreateUserParcelTemplate: + speakeasy-default-create-user-parcel-template: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"weight": "12", "weight_unit": "lb"} + responses: + "200": + application/json: {"distance_unit": "in", "height": "6", "length": "10", "name": "My Custom Template", "weight": "12", "weight_unit": "lb", "width": "8", "object_created": "2013-12-11T19:38:09.729Z", "object_id": "b958d3690bb04bb8b2986724872750f5", "object_owner": "shippotle@shippo.com", "object_updated": "2013-12-12T19:38:09.729Z", "template": {"carrier": "FedEx", "distance_unit": "in", "height": "1.5", "is_variable_dimensions": false, "length": "12.375", "name": "FedEx® Small Box (S1)", "token": "FedEx_Box_Small_1", "width": "10.875"}} + DeleteUserParcelTemplate: + speakeasy-default-delete-user-parcel-template: + parameters: + path: + UserParcelTemplateObjectId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + GetUserParcelTemplate: + speakeasy-default-get-user-parcel-template: + parameters: + path: + UserParcelTemplateObjectId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"distance_unit": "in", "height": "6", "length": "10", "name": "My Custom Template", "weight": "12", "weight_unit": "lb", "width": "8", "object_created": "2013-12-11T19:38:09.729Z", "object_id": "b958d3690bb04bb8b2986724872750f5", "object_owner": "shippotle@shippo.com", "object_updated": "2013-12-12T19:38:09.729Z", "template": {"carrier": "FedEx", "distance_unit": "in", "height": "1.5", "is_variable_dimensions": false, "length": "12.375", "name": "FedEx® Small Box (S1)", "token": "FedEx_Box_Small_1", "width": "10.875"}} + UpdateUserParcelTemplate: + speakeasy-default-update-user-parcel-template: + parameters: + path: + UserParcelTemplateObjectId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"distance_unit": "in", "height": "6", "length": "10", "name": "My Custom Template", "weight": "12", "weight_unit": "lb", "width": "8"} + responses: + "200": + application/json: {"distance_unit": "in", "height": "6", "length": "10", "name": "My Custom Template", "weight": "12", "weight_unit": "lb", "width": "8", "object_created": "2013-12-11T19:38:09.729Z", "object_id": "b958d3690bb04bb8b2986724872750f5", "object_owner": "shippotle@shippo.com", "object_updated": "2013-12-12T19:38:09.729Z", "template": {"carrier": "FedEx", "distance_unit": "in", "height": "1.5", "is_variable_dimensions": false, "length": "12.375", "name": "FedEx® Small Box (S1)", "token": "FedEx_Box_Small_1", "width": "10.875"}} + ListShippoAccounts: + speakeasy-default-list-shippo-accounts: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"email": "hippo@shippo.com", "first_name": "Shippo", "last_name": "Meister", "company_name": "Acme", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a"}, {"email": "hippo@shippo.com", "first_name": "Shippo", "last_name": "Meister", "company_name": "Acme", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a"}, {"email": "hippo@shippo.com", "first_name": "Shippo", "last_name": "Meister", "company_name": "Acme", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a"}]} + CreateShippoAccount: + speakeasy-default-create-shippo-account: + parameters: + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"email": "hippo@shippo.com", "first_name": "Shippo", "last_name": "Meister", "company_name": "Acme"} + responses: + "201": + application/json: {"email": "hippo@shippo.com", "first_name": "Shippo", "last_name": "Meister", "company_name": "Acme", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a"} + GetShippoAccount: + speakeasy-default-get-shippo-account: + parameters: + path: + ShippoAccountId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + responses: + "200": + application/json: {"email": "hippo@shippo.com", "first_name": "Shippo", "last_name": "Meister", "company_name": "Acme", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a"} + UpdateShippoAccount: + speakeasy-default-update-shippo-account: + parameters: + path: + ShippoAccountId: "" + header: + SHIPPO-API-VERSION: "2018-02-08" + requestBody: + application/json: {"email": "hippo@shippo.com", "first_name": "Shippo", "last_name": "Meister", "company_name": "Acme"} + responses: + "200": + application/json: {"email": "hippo@shippo.com", "first_name": "Shippo", "last_name": "Meister", "company_name": "Acme", "object_id": "adcfdddf8ec64b84ad22772bce3ea37a"} + createWebhook: + speakeasy-default-create-webhook: + requestBody: + application/json: {"event": "batch_created", "url": "https://example.com/shippo-webhook", "active": true, "is_test": false} + responses: + "201": + application/json: {"event": "track_updated", "url": "https://example.com/shippo-webhook", "active": true, "is_test": false} + listWebhooks: + speakeasy-default-list-webhooks: + responses: + "200": + application/json: {"next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [{"event": "track_updated", "url": "https://example.com/shippo-webhook", "active": true, "is_test": false}, {"event": "track_updated", "url": "https://example.com/shippo-webhook", "active": true, "is_test": false}]} + getWebhook: + speakeasy-default-get-webhook: + parameters: + path: + webhookId: "" + responses: + "200": + application/json: {"event": "track_updated", "url": "https://example.com/shippo-webhook", "active": true, "is_test": false} + updateWebhook: + speakeasy-default-update-webhook: + parameters: + path: + webhookId: "" + requestBody: + application/json: {"event": "batch_created", "url": "https://example.com/shippo-webhook", "active": true, "is_test": false} + responses: + "200": + application/json: {"event": "track_updated", "url": "https://example.com/shippo-webhook", "active": true, "is_test": false} + deleteWebhook: + speakeasy-default-delete-webhook: + parameters: + path: + webhookId: "" +generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8f00598..b8d08b5 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -20,6 +20,11 @@ info: description: Packagist library which integrates with Shippo Multi Carrier Shipping API. This library provides access to Shippo (goshippo.com) API capabilities. Including label generation, rating, tracking and more. php: version: 3.0.0-alpha + additionalDependencies: + autoload: {} + autoload-dev: {} + require: {} + require-dev: {} author: Shippo clientServerStatusCodesAsErrors: true defaultErrorName: SDKError @@ -39,6 +44,7 @@ php: svcName: openapi license: MIT License maxMethodParams: 3 + methodArguments: infer-optional-args namespace: Shippo\API outputModelSuffix: output packageName: shippo/shippo-php diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 468be98..fd7d088 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,18 +1,26 @@ -speakeasyVersion: 1.310.0 +speakeasyVersion: 1.455.3 sources: openapi: sourceNamespace: openapi - sourceRevisionDigest: sha256:3099fc4c926ab05099ea5c4cbb918e6423a03874cea38c8791efa7efbe6c5706 - sourceBlobDigest: sha256:234f83b39101f22af624857db75abc2440fbe9c279d457ab0a7c8a393245cab1 + sourceRevisionDigest: sha256:3bfca8ec7ce4dabc78868a2b04619d457a166888c343e06a260469d50a0873b3 + sourceBlobDigest: sha256:1b88a763bf9a88c705175433cac246f726297ba1d331abf5d03334a6e25e9b89 tags: - latest + - speakeasy-sdk-regen-1731434842 + - "2018-02-08" targets: my-first-target: source: openapi sourceNamespace: openapi sourceRevisionDigest: sha256:3099fc4c926ab05099ea5c4cbb918e6423a03874cea38c8791efa7efbe6c5706 sourceBlobDigest: sha256:234f83b39101f22af624857db75abc2440fbe9c279d457ab0a7c8a393245cab1 - outLocation: /Users/mike.lueders/dev/shippo-php-sdk + php: + source: openapi + sourceNamespace: openapi + sourceRevisionDigest: sha256:3bfca8ec7ce4dabc78868a2b04619d457a166888c343e06a260469d50a0873b3 + sourceBlobDigest: sha256:1b88a763bf9a88c705175433cac246f726297ba1d331abf5d03334a6e25e9b89 + codeSamplesNamespace: openapi-php-code-samples + codeSamplesRevisionDigest: sha256:038bd0a1688e17d9559aadb8b2af5254b9558f61a472842de277f4b034c6215c workflow: workflowVersion: 1.0.0 speakeasyVersion: latest @@ -23,6 +31,14 @@ workflow: registry: location: registry.speakeasyapi.dev/shippo/shippo/openapi targets: - my-first-target: + php: target: php source: openapi + publish: + packagist: + username: tech@shippo.com + token: $packagist_token + codeSamples: + registry: + location: registry.speakeasyapi.dev/shippo/shippo/openapi-php-code-samples + blocking: false diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index deb3b77..d913907 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -14,3 +14,7 @@ targets: packagist: username: tech@shippo.com token: $packagist_token + codeSamples: + registry: + location: registry.speakeasyapi.dev/shippo/shippo/openapi-php-code-samples + blocking: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d585717 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to This Repository + +Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. + +## How to Report Issues + +If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: + +- A clear and descriptive title +- Steps to reproduce the issue +- Expected and actual behavior +- Any relevant logs, screenshots, or error messages +- Information about your environment (e.g., operating system, software versions) + - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed + +## Issue Triage and Upstream Fixes + +We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. + +## Contact + +If you have any questions or need further assistance, please feel free to reach out by opening an issue. + +Thank you for your understanding and cooperation! + +The Maintainers diff --git a/README.md b/README.md index 6c2164d..ba0de0d 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,18 @@ Shippo external API.: Use this API to integrate with the Shippo service ## Table of Contents + +* [Shippo logo Shippo PHP SDK](#img-srchttpsdocsgoshippocomimageslogopng-width30-altshippo-logo-shippo-php-sdk) + * [SDK Installation](#sdk-installation) + * [SDK Example Usage](#sdk-example-usage) + * [Available Resources and Operations](#available-resources-and-operations) + * [Error Handling](#error-handling) + * [Server Selection](#server-selection) +* [Development](#development) + * [Maturity](#maturity) + * [Contributions](#contributions) + * [About Shippo](#about-shippo) -* [SDK Installation](#sdk-installation) -* [SDK Example Usage](#sdk-example-usage) -* [Available Resources and Operations](#available-resources-and-operations) -* [Error Handling](#error-handling) -* [Server Selection](#server-selection) @@ -34,26 +40,9 @@ Shippo external API.: Use this API to integrate with the Shippo service The SDK relies on [Composer](https://getcomposer.org/) to manage its dependencies. -To install the SDK first add the below to your `composer.json` file: - -```json -{ - "repositories": [ - { - "type": "github", - "url": ".git" - } - ], - "require": { - "Shippo": "*" - } -} -``` - -Then run the following command: - +To install the SDK and add it as a dependency to an existing `composer.json` file: ```bash -composer update +composer require "shippo/shippo-php" ``` @@ -68,23 +57,19 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Shippo\API; - -$security = ''; +use Shippo\API\Models\Components; $sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') - ->setSecurity($security)->build(); + ->build(); +$request = new Components\WebhookPayloadBatch(); - -$response = $sdk->addresses->list( - page: 1, - results: 5, - shippoApiVersion: '2018-02-08' - +$response = $sdk->batch( + request: $request ); -if ($response->addressPaginatedList !== null) { +if ($response->statusCode === 200) { // handle response } ``` @@ -314,7 +299,7 @@ use Shippo\API; $security = ''; $sdk = API\Shippo::builder() - ->setServerURL("https://api.goshippo.com") + ->setServerURL('https://api.goshippo.com') ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); diff --git a/RELEASES.md b/RELEASES.md new file mode 100644 index 0000000..a40fb74 --- /dev/null +++ b/RELEASES.md @@ -0,0 +1,11 @@ + + +## 2024-12-16 00:31:56 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.455.3 (2.479.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [php v3.0.0-alpha] . +### Releases +- [Composer v3.0.0-alpha] https://packagist.org/packages/shippo/shippo-php#v3.0.0-alpha - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index bf8faf2..9f20806 100644 --- a/USAGE.md +++ b/USAGE.md @@ -1,32 +1,28 @@ ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') - ->setSecurity($security) - ->build(); + ->setSecurity($security)->build(); -try { - $response = $sdk->addresses->list(768578, 99895, '2018-02-08'); - if ($response->addressPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception -} +$response = $sdk->addresses->list( + page: 1, + results: 5, + shippoApiVersion: '2018-02-08' + +); + +if ($response->addressPaginatedList !== null) { + // handle response +} ``` \ No newline at end of file diff --git a/composer.json b/composer.json index ed22cb2..d90b599 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "shippo/api", + "name": "shippo/shippo-php", "type": "library", "autoload": { "psr-4": { @@ -9,14 +9,18 @@ "license": "MIT", "require": { "php": "^8.2", + "galbar/jsonpath": "^3.0", "guzzlehttp/guzzle": "^7.0", - "jms/serializer": "^3.22" + "speakeasy/serializer": "^4.0.0", + "brick/date-time": "^0.7.0", + "phpdocumentor/type-resolver": "^1.8", + "brick/math": "^0.12.1" }, "require-dev": { - "laravel/pint": "^1.15", - "phpstan/phpstan": "^1.9", + "laravel/pint": "^1.18.1", + "phpstan/phpstan": "^1.12", "phpunit/phpunit": "^10", - "rector/rector": "^0.18.13", + "rector/rector": "^0.19", "roave/security-advisories": "dev-latest" }, "minimum-stability": "stable", @@ -24,14 +28,15 @@ "config": { "optimize-autoloader": true, "classmap-authoritative": true, - "sort-packages": true + "sort-packages": true, + "process-timeout": 60 }, "scripts": { "test": [ - "./vendor/bin/phpunit --testdox" + "./vendor/bin/phpunit --testdox --display-warnings --colors=always" ], "stan": [ - "./vendor/bin/phpstan analyse --memory-limit=2g" + "./vendor/bin/phpstan analyse --memory-limit=2g --error-format=table" ] }, "script-descriptions": { diff --git a/docs/Models/Components/Address.md b/docs/Models/Components/Address.md index ed5a243..6e925e3 100644 --- a/docs/Models/Components/Address.md +++ b/docs/Models/Components/Address.md @@ -5,28 +5,28 @@ Address represents the address as retrieved from the database ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *?string* | :heavy_minus_sign: | **required for purchase**

First and Last Name of the addressee | Shwan Ippotle | -| `company` | *?string* | :heavy_minus_sign: | Company Name | Shippo | -| `street1` | *?string* | :heavy_minus_sign: | **required for purchase**

First street line, 35 character limit. Usually street number and street name (except for DHL Germany, see street_no). | 215 Clayton St. | -| `street2` | *?string* | :heavy_minus_sign: | Second street line, 35 character limit. | | -| `street3` | *?string* | :heavy_minus_sign: | Third street line, 35 character limit.
Only accepted for USPS international shipments, UPS domestic and UPS international shipments. | | -| `streetNo` | *?string* | :heavy_minus_sign: | Street number of the addressed building.
This field can be included in street1 for all carriers except for DHL Germany. | | -| `city` | *?string* | :heavy_minus_sign: | **required for purchase**

Name of a city. When creating a Quote Address, sending a city is optional but will yield more accurate Rates.
Please bear in mind that city names may be ambiguous (there are 34 Springfields in the US). Pass in a state
or a ZIP code (see below), if known, it will yield more accurate results. | San Francisco | -| `state` | *?string* | :heavy_minus_sign: | **required for purchase for some countries**

State/Province values are required for shipments from/to the US, AU, and CA. UPS requires province for some
countries (i.e Ireland). To receive more accurate quotes, passing this field is recommended. Most carriers
only accept two or three character state abbreviations. | CA | -| `zip` | *?string* | :heavy_minus_sign: | **required for purchase**

Postal code of an Address. When creating a Quote Addresses, sending a ZIP is optional but will yield more
accurate Rates. | 94117 | -| `country` | *string* | :heavy_check_mark: | Example: `US` or `DE`. All accepted values can be found on the
Official ISO Website.
Sending a country is always required. | US | -| `phone` | *?string* | :heavy_minus_sign: | Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This
increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped. | +1 555 341 9393 | -| `email` | *?string* | :heavy_minus_sign: | E-mail address of the contact person, RFC3696/5321-compliant. | shippotle@shippo.com | -| `isResidential` | *?bool* | :heavy_minus_sign: | N/A | true | -| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want
to attach to the object. | Customer ID 123456 | -| `isComplete` | *?bool* | :heavy_minus_sign: | Complete addresses contain all required values.

Incomplete addresses have failed one or multiple
validations.
Incomplete Addresses are eligible for requesting rates but lack at least one required
value for purchasing labels. | true | -| `latitude` | *mixed* | :heavy_minus_sign: | Latitude of address | | -| `longitude` | *mixed* | :heavy_minus_sign: | Longitude of address | | -| `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of Address creation. | 2014-07-09T02:19:13.174Z | -| `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the given Address object.
This ID is required to create a Shipment object. | d799c2679e644279b59fe661ac8fa488 | -| `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the Address object. | shippotle@shippo.com | -| `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of last Address update. Since you cannot update Addresses after they were created, this time
stamp reflects the time when the Address was changed by Shippo's systems for the last time, e.g., during the
approximation of one or more values. | 2014-07-09T02:19:13.174Z | -| `validationResults` | [?\Shippo\API\Models\Components\AddressValidationResults](../../Models/Components/AddressValidationResults.md) | :heavy_minus_sign: | Object that contains information regarding if an address had been validated or not. Also contains any messages
generated during validation. Children keys are is_valid(boolean) and messages(array). | | -| `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | false | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `country` | *string* | :heavy_check_mark: | ISO 3166-1 alpha-2 country codes and country names can be used. For most consistent results, we reccomend using country codes like `US` or `DE`.
If using country names, please ensure they are spelled correctly and in English. Country names are converted to country codes.
Refer to this guide for a list of country codes.
Sending a country is always required. | US | +| `name` | *?string* | :heavy_minus_sign: | **required for purchase**

First and Last Name of the addressee | Shwan Ippotle | +| `company` | *?string* | :heavy_minus_sign: | Company Name | Shippo | +| `street1` | *?string* | :heavy_minus_sign: | **required for purchase**

First street line, 35 character limit. Usually street number and street name (except for DHL Germany, see street_no). | 215 Clayton St. | +| `street2` | *?string* | :heavy_minus_sign: | Second street line, 35 character limit. | | +| `street3` | *?string* | :heavy_minus_sign: | Third street line, 35 character limit.
Only accepted for USPS international shipments, UPS domestic and UPS international shipments. | | +| `streetNo` | *?string* | :heavy_minus_sign: | Street number of the addressed building.
This field can be included in street1 for all carriers except for DHL Germany. | | +| `city` | *?string* | :heavy_minus_sign: | **required for purchase**

Name of a city. When creating a Quote Address, sending a city is optional but will yield more accurate Rates.
Please bear in mind that city names may be ambiguous (there are 34 Springfields in the US). Pass in a state
or a ZIP code (see below), if known, it will yield more accurate results. | San Francisco | +| `state` | *?string* | :heavy_minus_sign: | **required for purchase for some countries**

State/Province values are required for shipments from/to the US, AU, and CA. UPS requires province for some
countries (i.e Ireland). To receive more accurate quotes, passing this field is recommended. Most carriers
only accept two or three character state abbreviations. | CA | +| `zip` | *?string* | :heavy_minus_sign: | **required for purchase**

Postal code of an Address. When creating a Quote Addresses, sending a ZIP is optional but will yield more
accurate Rates. | 94117 | +| `phone` | *?string* | :heavy_minus_sign: | Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This
increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped. | +1 555 341 9393 | +| `email` | *?string* | :heavy_minus_sign: | E-mail address of the contact person, RFC3696/5321-compliant. | shippotle@shippo.com | +| `isResidential` | *?bool* | :heavy_minus_sign: | N/A | true | +| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want
to attach to the object. | Customer ID 123456 | +| `isComplete` | *?bool* | :heavy_minus_sign: | Complete addresses contain all required values.

Incomplete addresses have failed one or multiple
validations.
Incomplete Addresses are eligible for requesting rates but lack at least one required
value for purchasing labels. | true | +| `latitude` | [float\|string\|null](../../Models/Components/Latitude.md) | :heavy_minus_sign: | Latitude of address | | +| `longitude` | [float\|string\|null](../../Models/Components/Longitude.md) | :heavy_minus_sign: | Longitude of address | | +| `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of Address creation. | 2014-07-09T02:19:13.174Z | +| `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the given Address object.
This ID is required to create a Shipment object. | d799c2679e644279b59fe661ac8fa488 | +| `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the Address object. | shippotle@shippo.com | +| `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of last Address update. Since you cannot update Addresses after they were created, this time
stamp reflects the time when the Address was changed by Shippo's systems for the last time, e.g., during the
approximation of one or more values. | 2014-07-09T02:19:13.174Z | +| `validationResults` | [?Components\AddressValidationResults](../../Models/Components/AddressValidationResults.md) | :heavy_minus_sign: | Object that contains information regarding if an address had been validated or not. Also contains any messages
generated during validation. Children keys are is_valid(boolean) and messages(array). | | +| `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | false | \ No newline at end of file diff --git a/docs/Models/Components/AddressCompleteCreateRequest.md b/docs/Models/Components/AddressCompleteCreateRequest.md index 693d658..3e49312 100644 --- a/docs/Models/Components/AddressCompleteCreateRequest.md +++ b/docs/Models/Components/AddressCompleteCreateRequest.md @@ -5,20 +5,20 @@ Address represents the address as retrieved from the database ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_check_mark: | **required for purchase**

First and Last Name of the addressee | Shwan Ippotle | -| `company` | *?string* | :heavy_minus_sign: | Company Name | Shippo | -| `street1` | *string* | :heavy_check_mark: | **required for purchase**

First street line, 35 character limit. Usually street number and street name (except for DHL Germany, see street_no). | 215 Clayton St. | -| `street2` | *?string* | :heavy_minus_sign: | Second street line, 35 character limit. | | -| `street3` | *?string* | :heavy_minus_sign: | Third street line, 35 character limit.
Only accepted for USPS international shipments, UPS domestic and UPS international shipments. | | -| `streetNo` | *?string* | :heavy_minus_sign: | Street number of the addressed building.
This field can be included in street1 for all carriers except for DHL Germany. | | -| `city` | *string* | :heavy_check_mark: | **required for purchase**

Name of a city. When creating a Quote Address, sending a city is optional but will yield more accurate Rates.
Please bear in mind that city names may be ambiguous (there are 34 Springfields in the US). Pass in a state
or a ZIP code (see below), if known, it will yield more accurate results. | San Francisco | -| `state` | *string* | :heavy_check_mark: | **required for purchase for some countries**

State/Province values are required for shipments from/to the US, AU, and CA. UPS requires province for some
countries (i.e Ireland). To receive more accurate quotes, passing this field is recommended. Most carriers
only accept two or three character state abbreviations. | CA | -| `zip` | *string* | :heavy_check_mark: | **required for purchase**

Postal code of an Address. When creating a Quote Addresses, sending a ZIP is optional but will yield more
accurate Rates. | 94117 | -| `country` | *string* | :heavy_check_mark: | Example: `US` or `DE`. All accepted values can be found on the
Official ISO Website.
Sending a country is always required. | US | -| `phone` | *?string* | :heavy_minus_sign: | Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This
increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped. | +1 555 341 9393 | -| `email` | *?string* | :heavy_minus_sign: | E-mail address of the contact person, RFC3696/5321-compliant. | shippotle@shippo.com | -| `isResidential` | *?bool* | :heavy_minus_sign: | N/A | true | -| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want
to attach to the object. | Customer ID 123456 | -| `validate` | *?bool* | :heavy_minus_sign: | N/A | true | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | **required for purchase**

First and Last Name of the addressee | Shwan Ippotle | +| `street1` | *string* | :heavy_check_mark: | **required for purchase**

First street line, 35 character limit. Usually street number and street name (except for DHL Germany, see street_no). | 215 Clayton St. | +| `city` | *string* | :heavy_check_mark: | **required for purchase**

Name of a city. When creating a Quote Address, sending a city is optional but will yield more accurate Rates.
Please bear in mind that city names may be ambiguous (there are 34 Springfields in the US). Pass in a state
or a ZIP code (see below), if known, it will yield more accurate results. | San Francisco | +| `state` | *string* | :heavy_check_mark: | **required for purchase for some countries**

State/Province values are required for shipments from/to the US, AU, and CA. UPS requires province for some
countries (i.e Ireland). To receive more accurate quotes, passing this field is recommended. Most carriers
only accept two or three character state abbreviations. | CA | +| `zip` | *string* | :heavy_check_mark: | **required for purchase**

Postal code of an Address. When creating a Quote Addresses, sending a ZIP is optional but will yield more
accurate Rates. | 94117 | +| `country` | *string* | :heavy_check_mark: | ISO 3166-1 alpha-2 country codes and country names can be used. For most consistent results, we reccomend using country codes like `US` or `DE`.
If using country names, please ensure they are spelled correctly and in English. Country names are converted to country codes.
Refer to this guide for a list of country codes.
Sending a country is always required. | US | +| `company` | *?string* | :heavy_minus_sign: | Company Name | Shippo | +| `street2` | *?string* | :heavy_minus_sign: | Second street line, 35 character limit. | | +| `street3` | *?string* | :heavy_minus_sign: | Third street line, 35 character limit.
Only accepted for USPS international shipments, UPS domestic and UPS international shipments. | | +| `streetNo` | *?string* | :heavy_minus_sign: | Street number of the addressed building.
This field can be included in street1 for all carriers except for DHL Germany. | | +| `phone` | *?string* | :heavy_minus_sign: | Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This
increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped. | +1 555 341 9393 | +| `email` | *?string* | :heavy_minus_sign: | E-mail address of the contact person, RFC3696/5321-compliant. | shippotle@shippo.com | +| `isResidential` | *?bool* | :heavy_minus_sign: | N/A | true | +| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want
to attach to the object. | Customer ID 123456 | +| `validate` | *?bool* | :heavy_minus_sign: | N/A | true | \ No newline at end of file diff --git a/docs/Models/Components/AddressCreateRequest.md b/docs/Models/Components/AddressCreateRequest.md index fe5b6da..047555f 100644 --- a/docs/Models/Components/AddressCreateRequest.md +++ b/docs/Models/Components/AddressCreateRequest.md @@ -5,20 +5,20 @@ Address represents the address as retrieved from the database ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *?string* | :heavy_minus_sign: | **required for purchase**

First and Last Name of the addressee | Shwan Ippotle | -| `company` | *?string* | :heavy_minus_sign: | Company Name | Shippo | -| `street1` | *?string* | :heavy_minus_sign: | **required for purchase**

First street line, 35 character limit. Usually street number and street name (except for DHL Germany, see street_no). | 215 Clayton St. | -| `street2` | *?string* | :heavy_minus_sign: | Second street line, 35 character limit. | | -| `street3` | *?string* | :heavy_minus_sign: | Third street line, 35 character limit.
Only accepted for USPS international shipments, UPS domestic and UPS international shipments. | | -| `streetNo` | *?string* | :heavy_minus_sign: | Street number of the addressed building.
This field can be included in street1 for all carriers except for DHL Germany. | | -| `city` | *?string* | :heavy_minus_sign: | **required for purchase**

Name of a city. When creating a Quote Address, sending a city is optional but will yield more accurate Rates.
Please bear in mind that city names may be ambiguous (there are 34 Springfields in the US). Pass in a state
or a ZIP code (see below), if known, it will yield more accurate results. | San Francisco | -| `state` | *?string* | :heavy_minus_sign: | **required for purchase for some countries**

State/Province values are required for shipments from/to the US, AU, and CA. UPS requires province for some
countries (i.e Ireland). To receive more accurate quotes, passing this field is recommended. Most carriers
only accept two or three character state abbreviations. | CA | -| `zip` | *?string* | :heavy_minus_sign: | **required for purchase**

Postal code of an Address. When creating a Quote Addresses, sending a ZIP is optional but will yield more
accurate Rates. | 94117 | -| `country` | *string* | :heavy_check_mark: | Example: `US` or `DE`. All accepted values can be found on the
Official ISO Website.
Sending a country is always required. | US | -| `phone` | *?string* | :heavy_minus_sign: | Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This
increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped. | +1 555 341 9393 | -| `email` | *?string* | :heavy_minus_sign: | E-mail address of the contact person, RFC3696/5321-compliant. | shippotle@shippo.com | -| `isResidential` | *?bool* | :heavy_minus_sign: | N/A | true | -| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want
to attach to the object. | Customer ID 123456 | -| `validate` | *?bool* | :heavy_minus_sign: | Set to true to validate Address object. | true | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `country` | *string* | :heavy_check_mark: | ISO 3166-1 alpha-2 country codes and country names can be used. For most consistent results, we reccomend using country codes like `US` or `DE`.
If using country names, please ensure they are spelled correctly and in English. Country names are converted to country codes.
Refer to this guide for a list of country codes.
Sending a country is always required. | US | +| `name` | *?string* | :heavy_minus_sign: | **required for purchase**

First and Last Name of the addressee | Shwan Ippotle | +| `company` | *?string* | :heavy_minus_sign: | Company Name | Shippo | +| `street1` | *?string* | :heavy_minus_sign: | **required for purchase**

First street line, 35 character limit. Usually street number and street name (except for DHL Germany, see street_no). | 215 Clayton St. | +| `street2` | *?string* | :heavy_minus_sign: | Second street line, 35 character limit. | | +| `street3` | *?string* | :heavy_minus_sign: | Third street line, 35 character limit.
Only accepted for USPS international shipments, UPS domestic and UPS international shipments. | | +| `streetNo` | *?string* | :heavy_minus_sign: | Street number of the addressed building.
This field can be included in street1 for all carriers except for DHL Germany. | | +| `city` | *?string* | :heavy_minus_sign: | **required for purchase**

Name of a city. When creating a Quote Address, sending a city is optional but will yield more accurate Rates.
Please bear in mind that city names may be ambiguous (there are 34 Springfields in the US). Pass in a state
or a ZIP code (see below), if known, it will yield more accurate results. | San Francisco | +| `state` | *?string* | :heavy_minus_sign: | **required for purchase for some countries**

State/Province values are required for shipments from/to the US, AU, and CA. UPS requires province for some
countries (i.e Ireland). To receive more accurate quotes, passing this field is recommended. Most carriers
only accept two or three character state abbreviations. | CA | +| `zip` | *?string* | :heavy_minus_sign: | **required for purchase**

Postal code of an Address. When creating a Quote Addresses, sending a ZIP is optional but will yield more
accurate Rates. | 94117 | +| `phone` | *?string* | :heavy_minus_sign: | Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This
increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped. | +1 555 341 9393 | +| `email` | *?string* | :heavy_minus_sign: | E-mail address of the contact person, RFC3696/5321-compliant. | shippotle@shippo.com | +| `isResidential` | *?bool* | :heavy_minus_sign: | N/A | true | +| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want
to attach to the object. | Customer ID 123456 | +| `validate` | *?bool* | :heavy_minus_sign: | Set to true to validate Address object. | true | \ No newline at end of file diff --git a/docs/Models/Components/AddressFrom.md b/docs/Models/Components/AddressFrom.md new file mode 100644 index 0000000..945274b --- /dev/null +++ b/docs/Models/Components/AddressFrom.md @@ -0,0 +1,23 @@ +# AddressFrom + + +## Supported Types + +### `Components\AddressCreateRequest` + +```php +/** +* @var Components\AddressCreateRequest +*/ +Components\AddressCreateRequest $value = /* values here */ +``` + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + diff --git a/docs/Models/Components/AddressPaginatedList.md b/docs/Models/Components/AddressPaginatedList.md index 75ab3e8..b273923 100644 --- a/docs/Models/Components/AddressPaginatedList.md +++ b/docs/Models/Components/AddressPaginatedList.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\Address](../../Models/Components/Address.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\Address](../../Models/Components/Address.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/AddressReturn.md b/docs/Models/Components/AddressReturn.md new file mode 100644 index 0000000..1438451 --- /dev/null +++ b/docs/Models/Components/AddressReturn.md @@ -0,0 +1,23 @@ +# AddressReturn + + +## Supported Types + +### `Components\AddressCreateRequest` + +```php +/** +* @var Components\AddressCreateRequest +*/ +Components\AddressCreateRequest $value = /* values here */ +``` + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + diff --git a/docs/Models/Components/AddressTo.md b/docs/Models/Components/AddressTo.md new file mode 100644 index 0000000..242fcc0 --- /dev/null +++ b/docs/Models/Components/AddressTo.md @@ -0,0 +1,23 @@ +# AddressTo + + +## Supported Types + +### `Components\AddressCreateRequest` + +```php +/** +* @var Components\AddressCreateRequest +*/ +Components\AddressCreateRequest $value = /* values here */ +``` + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + diff --git a/docs/Models/Components/AddressValidationResults.md b/docs/Models/Components/AddressValidationResults.md index cea84bc..203ac8f 100644 --- a/docs/Models/Components/AddressValidationResults.md +++ b/docs/Models/Components/AddressValidationResults.md @@ -6,7 +6,7 @@ generated during validation. Children keys are is_valid(boolean) an ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `isValid` | *?bool* | :heavy_minus_sign: | N/A | false | -| `messages` | array<[\Shippo\API\Models\Components\AddressValidationResultsMessage](../../Models/Components/AddressValidationResultsMessage.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `isValid` | *?bool* | :heavy_minus_sign: | N/A | false | +| `messages` | array<[Components\AddressValidationResultsMessage](../../Models/Components/AddressValidationResultsMessage.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/Alcohol.md b/docs/Models/Components/Alcohol.md index ecfaf2f..ad1f46e 100644 --- a/docs/Models/Components/Alcohol.md +++ b/docs/Models/Components/Alcohol.md @@ -5,7 +5,7 @@ Indicates that a shipment contains Alcohol (Fedex and UPS only). ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `containsAlcohol` | *?bool* | :heavy_minus_sign: | Mandatory for Fedex and UPS. Specifies that the package contains Alcohol. | -| `recipientType` | [?\Shippo\API\Models\Components\RecipientType](../../Models/Components/RecipientType.md) | :heavy_minus_sign: | Mandatory for Fedex only. License type of the recipient of the Alcohol Package. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `containsAlcohol` | *?bool* | :heavy_minus_sign: | Mandatory for Fedex and UPS. Specifies that the package contains Alcohol. | +| `recipientType` | [?Components\RecipientType](../../Models/Components/RecipientType.md) | :heavy_minus_sign: | Mandatory for Fedex only. License type of the recipient of the Alcohol Package. | \ No newline at end of file diff --git a/docs/Models/Components/Authentication.md b/docs/Models/Components/Authentication.md index 31d8c3f..ee9c47f 100644 --- a/docs/Models/Components/Authentication.md +++ b/docs/Models/Components/Authentication.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [?\Shippo\API\Models\Components\CarrierAccountWithExtraInfoType](../../Models/Components/CarrierAccountWithExtraInfoType.md) | :heavy_minus_sign: | Authentication method used by this account. | -| `status` | [?\Shippo\API\Models\Components\CarrierAccountWithExtraInfoStatus](../../Models/Components/CarrierAccountWithExtraInfoStatus.md) | :heavy_minus_sign: | Current authentication status. Possible values: 'disconnected' (authorization lost, reconnect needed), 'connected' (authorized and active), 'authorization_pending' (awaiting initial authorization flow). | \ No newline at end of file +| `type` | [?Components\CarrierAccountWithExtraInfoType](../../Models/Components/CarrierAccountWithExtraInfoType.md) | :heavy_minus_sign: | Authentication method used by this account. | +| `status` | [?Components\CarrierAccountWithExtraInfoStatus](../../Models/Components/CarrierAccountWithExtraInfoStatus.md) | :heavy_minus_sign: | Current authentication status. Possible values: 'disconnected' (authorization lost, reconnect needed), 'connected' (authorized and active), 'authorization_pending' (awaiting initial authorization flow). | \ No newline at end of file diff --git a/docs/Models/Components/Batch.md b/docs/Models/Components/Batch.md index 8a7f6e6..e315044 100644 --- a/docs/Models/Components/Batch.md +++ b/docs/Models/Components/Batch.md @@ -7,14 +7,14 @@ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `defaultCarrierAccount` | *string* | :heavy_check_mark: | ID of the Carrier Account object to use as the default for all shipments in this Batch.
The carrier account can be changed on a per-shipment basis by changing the carrier_account in the
corresponding BatchShipment object. | 078870331023437cb917f5187429b093 | | `defaultServicelevelToken` | *string* | :heavy_check_mark: | Token of the service level to use as the default for all shipments in this Batch.
The servicelevel can be changed on a per-shipment basis by changing the servicelevel_token in the
corresponding BatchShipment object. Servicelevel tokens can be found here. | usps_priority | -| `labelFiletype` | [?\Shippo\API\Models\Components\LabelFileTypeEnum](../../Models/Components/LabelFileTypeEnum.md) | :heavy_minus_sign: | Print format of the label. If empty, will use the default format set from
the Shippo dashboard. | PDF_4x6 | -| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want to attach to the object. | BATCH #1 | -| `batchShipments` | [\Shippo\API\Models\Components\BatchShipmentPaginatedList](../../Models/Components/BatchShipmentPaginatedList.md) | :heavy_check_mark: | N/A | | +| `batchShipments` | [Components\BatchShipmentPaginatedList](../../Models/Components/BatchShipmentPaginatedList.md) | :heavy_check_mark: | N/A | | | `labelUrl` | array<*string*> | :heavy_check_mark: | An array of URLs each pointing to a merged file of 100 labels each | | | `objectCreated` | *string* | :heavy_check_mark: | Date and time of Batch creation | 2016-01-04T00:15:44.394Z | | `objectId` | *string* | :heavy_check_mark: | Unique identifier of the given Batch object | 5ef63c54f5bf45d3b1f8fb37dcb1c5f4 | | `objectOwner` | *string* | :heavy_check_mark: | Username of the user who created the Address object. | shippo@shippo.com | -| `objectResults` | [\Shippo\API\Models\Components\ObjectResults](../../Models/Components/ObjectResults.md) | :heavy_check_mark: | An object containing the following counts:
`creation_succeeded`
`creation_failed`
`purchase_succeeded`
`purchase_failed` | | +| `objectResults` | [Components\ObjectResults](../../Models/Components/ObjectResults.md) | :heavy_check_mark: | An object containing the following counts:
`creation_succeeded`
`creation_failed`
`purchase_succeeded`
`purchase_failed` | | | `objectUpdated` | *string* | :heavy_check_mark: | Date and time of last update to the Batch | 2016-01-04T00:48:13.841Z | -| `status` | [\Shippo\API\Models\Components\BatchStatus](../../Models/Components/BatchStatus.md) | :heavy_check_mark: | Batches that are `VALIDATING` are being created and validated

`VALID` batches can be purchased

`INVALID` batches cannot be purchased, `INVALID` BatchShipments must be removed

Batches that are in the `PURCHASING` state are being purchased

`PURCHASED` batches are finished purchasing. | VALID | +| `status` | [Components\BatchStatus](../../Models/Components/BatchStatus.md) | :heavy_check_mark: | Batches that are `VALIDATING` are being created and validated

`VALID` batches can be purchased

`INVALID` batches cannot be purchased, `INVALID` BatchShipments must be removed

Batches that are in the `PURCHASING` state are being purchased

`PURCHASED` batches are finished purchasing. | VALID | +| `labelFiletype` | [?Components\LabelFileTypeEnum](../../Models/Components/LabelFileTypeEnum.md) | :heavy_minus_sign: | Print format of the label. If empty, will use the default format set from
the Shippo dashboard. | PDF_4x6 | +| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want to attach to the object. | BATCH #1 | | `test` | *?bool* | :heavy_minus_sign: | N/A | false | \ No newline at end of file diff --git a/docs/Models/Components/BatchCreateRequest.md b/docs/Models/Components/BatchCreateRequest.md index e24885a..e55e24b 100644 --- a/docs/Models/Components/BatchCreateRequest.md +++ b/docs/Models/Components/BatchCreateRequest.md @@ -7,6 +7,6 @@ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `defaultCarrierAccount` | *string* | :heavy_check_mark: | ID of the Carrier Account object to use as the default for all shipments in this Batch.
The carrier account can be changed on a per-shipment basis by changing the carrier_account in the
corresponding BatchShipment object. | 078870331023437cb917f5187429b093 | | `defaultServicelevelToken` | *string* | :heavy_check_mark: | Token of the service level to use as the default for all shipments in this Batch.
The servicelevel can be changed on a per-shipment basis by changing the servicelevel_token in the
corresponding BatchShipment object. Servicelevel tokens can be found here. | usps_priority | -| `labelFiletype` | [?\Shippo\API\Models\Components\LabelFileTypeEnum](../../Models/Components/LabelFileTypeEnum.md) | :heavy_minus_sign: | Print format of the label. If empty, will use the default format set from
the Shippo dashboard. | PDF_4x6 | -| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want to attach to the object. | BATCH #1 | -| `batchShipments` | array<[\Shippo\API\Models\Components\BatchShipmentCreateRequest](../../Models/Components/BatchShipmentCreateRequest.md)> | :heavy_check_mark: | Array of BatchShipment objects. The response keeps the same order as in the request array. | | \ No newline at end of file +| `batchShipments` | array<[Components\BatchShipmentCreateRequest](../../Models/Components/BatchShipmentCreateRequest.md)> | :heavy_check_mark: | Array of BatchShipment objects. The response keeps the same order as in the request array. | | +| `labelFiletype` | [?Components\LabelFileTypeEnum](../../Models/Components/LabelFileTypeEnum.md) | :heavy_minus_sign: | Print format of the label. If empty, will use the default format set from
the Shippo dashboard. | PDF_4x6 | +| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want to attach to the object. | BATCH #1 | \ No newline at end of file diff --git a/docs/Models/Components/BatchShipment.md b/docs/Models/Components/BatchShipment.md index 7e0b3d2..c3a2ed0 100644 --- a/docs/Models/Components/BatchShipment.md +++ b/docs/Models/Components/BatchShipment.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `objectId` | *string* | :heavy_check_mark: | Object ID of this batch shipment. Can be used in the remove_shipments endpoint. | e11c95a6788d4ddcaa22f03175838740 | +| `shipment` | *string* | :heavy_check_mark: | Object ID of the shipment object created for this batch shipment. | adcfdddf8ec64b84ad22772bce3ea37a | +| `status` | [Components\Status](../../Models/Components/Status.md) | :heavy_check_mark: | `INVALID` batch shipments cannot be purchased and will have to be removed, fixed, and added to the batch again.

`VALID` batch shipments can be purchased.

Batch shipments with the status `TRANSACTION_FAILED` were not able to be purchased and the error will be displayed on the message field

`INCOMPLETE` batch shipments have an issue with the Address and will need to be removed, fixed, and added to the batch again. | INVALID | | `carrierAccount` | *?string* | :heavy_minus_sign: | Object ID of the carrier account to be used for this shipment (will override batch default) | a4391cd4ab974f478f55dc08b5c8e3b3 | | `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want
to attach to the object. | SHIPMENT #1 | | `servicelevelToken` | *?string* | :heavy_minus_sign: | A token that sets the shipping method for the batch, overriding the batch default.
Servicelevel tokens can be found in this list
or at this endpoint. | fedex_ground | | `messages` | array<*mixed*> | :heavy_minus_sign: | List of Shipment and Transaction error messages. | | -| `objectId` | *string* | :heavy_check_mark: | Object ID of this batch shipment. Can be used in the remove_shipments endpoint. | e11c95a6788d4ddcaa22f03175838740 | -| `shipment` | *string* | :heavy_check_mark: | Object ID of the shipment object created for this batch shipment. | adcfdddf8ec64b84ad22772bce3ea37a | -| `status` | [\Shippo\API\Models\Components\Status](../../Models/Components/Status.md) | :heavy_check_mark: | `INVALID` batch shipments cannot be purchased and will have to be removed, fixed, and added to the batch again.

`VALID` batch shipments can be purchased.

Batch shipments with the status `TRANSACTION_FAILED` were not able to be purchased and the error will be displayed on the message field

`INCOMPLETE` batch shipments have an issue with the Address and will need to be removed, fixed, and added to the batch again. | INVALID | | `transaction` | *?string* | :heavy_minus_sign: | Object ID of the transaction object created for this batch shipment. | 4c33736a67e2450da88b38c42deef6b7 | \ No newline at end of file diff --git a/docs/Models/Components/BatchShipmentCreateRequest.md b/docs/Models/Components/BatchShipmentCreateRequest.md index 4d761c8..790ae14 100644 --- a/docs/Models/Components/BatchShipmentCreateRequest.md +++ b/docs/Models/Components/BatchShipmentCreateRequest.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `shipment` | [Components\ShipmentCreateRequest](../../Models/Components/ShipmentCreateRequest.md) | :heavy_check_mark: | N/A | | | `carrierAccount` | *?string* | :heavy_minus_sign: | Object ID of the carrier account to be used for this shipment (will override batch default) | a4391cd4ab974f478f55dc08b5c8e3b3 | | `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want
to attach to the object. | SHIPMENT #1 | -| `servicelevelToken` | *?string* | :heavy_minus_sign: | A token that sets the shipping method for the batch, overriding the batch default.
Servicelevel tokens can be found in this list
or at this endpoint. | fedex_ground | -| `shipment` | [\Shippo\API\Models\Components\ShipmentCreateRequest](../../Models/Components/ShipmentCreateRequest.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `servicelevelToken` | *?string* | :heavy_minus_sign: | A token that sets the shipping method for the batch, overriding the batch default.
Servicelevel tokens can be found in this list
or at this endpoint. | fedex_ground | \ No newline at end of file diff --git a/docs/Models/Components/BatchShipmentPaginatedList.md b/docs/Models/Components/BatchShipmentPaginatedList.md index 4ecfa3e..2cf6fb4 100644 --- a/docs/Models/Components/BatchShipmentPaginatedList.md +++ b/docs/Models/Components/BatchShipmentPaginatedList.md @@ -6,8 +6,8 @@ The response keeps the same order as in the request array. ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\BatchShipment](../../Models/Components/BatchShipment.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\BatchShipment](../../Models/Components/BatchShipment.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/Billing.md b/docs/Models/Components/Billing.md index 87e171e..4fd9bcf 100644 --- a/docs/Models/Components/Billing.md +++ b/docs/Models/Components/Billing.md @@ -10,5 +10,5 @@ Specify billing details (UPS, FedEx, and DHL Germany only). | `account` | *?string* | :heavy_minus_sign: | Account number to be billed. (For DHL Germany, leave this field blank.) | | `country` | *?string* | :heavy_minus_sign: | Country iso2 code of account number to be billed (required for UPS third party billing only). | | `participationCode` | *?string* | :heavy_minus_sign: | 2 digit code used to override your default participation code associated with your DHL Germany account. | -| `type` | [?\Shippo\API\Models\Components\Type](../../Models/Components/Type.md) | :heavy_minus_sign: | Party to be billed. (Leave blank for DHL Germany.) | +| `type` | [?Components\Type](../../Models/Components/Type.md) | :heavy_minus_sign: | Party to be billed. (Leave blank for DHL Germany.) | | `zip` | *?string* | :heavy_minus_sign: | ZIP code of account number to be billed (required for UPS if there is a zip on the billing account). | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccount.md b/docs/Models/Components/CarrierAccount.md index 2e1752d..68c8d57 100644 --- a/docs/Models/Components/CarrierAccount.md +++ b/docs/Models/Components/CarrierAccount.md @@ -6,13 +6,13 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `accountId` | *string* | :heavy_check_mark: | Unique identifier of the account. Please check the carrier accounts tutorial
page for the `account_id` per carrier.

To protect account information, this field will be masked in any API response. | **** | -| `active` | *?bool* | :heavy_minus_sign: | Determines whether the account is active. When creating a shipment, if no `carrier_accounts` are explicitly
passed Shippo will query all carrier accounts that have this field set. By default, this is set to True. | | | `carrier` | *string* | :heavy_check_mark: | Carrier token, see Carriers

Please check the carrier accounts tutorial page for all supported carriers. | usps | -| `parameters` | *mixed* | :heavy_minus_sign: | N/A | | +| `active` | *?bool* | :heavy_minus_sign: | Determines whether the account is active. When creating a shipment, if no `carrier_accounts` are explicitly
passed Shippo will query all carrier accounts that have this field set. By default, this is set to True. | | +| `parameters` | [array\|Components\FedExConnectExistingOwnAccountParameters\|Components\UPSConnectExistingOwnAccountParameters\|null](../../Models/Components/CarrierAccountParameters.md) | :heavy_minus_sign: | N/A | | | `carrierName` | *mixed* | :heavy_minus_sign: | Carrier name, see Carriers
| USPS | | `isShippoAccount` | *?bool* | :heavy_minus_sign: | N/A | false | | `metadata` | *?string* | :heavy_minus_sign: | N/A | | | `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the carrier account object. | 6aa34d5f6865448fbb1ee93636e98999 | | `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the carrier account object. | bob+22@gmail.com | -| `serviceLevels` | array<[\Shippo\API\Models\Components\CarrierAccountServiceLevel](../../Models/Components/CarrierAccountServiceLevel.md)> | :heavy_minus_sign: | N/A | | +| `serviceLevels` | array<[Components\CarrierAccountServiceLevel](../../Models/Components/CarrierAccountServiceLevel.md)> | :heavy_minus_sign: | N/A | | | `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | false | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountBase.md b/docs/Models/Components/CarrierAccountBase.md index 19a2352..e5cdca1 100644 --- a/docs/Models/Components/CarrierAccountBase.md +++ b/docs/Models/Components/CarrierAccountBase.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `accountId` | *string* | :heavy_check_mark: | Unique identifier of the account. Please check the carrier accounts tutorial
page for the `account_id` per carrier.

To protect account information, this field will be masked in any API response. | **** | -| `active` | *?bool* | :heavy_minus_sign: | Determines whether the account is active. When creating a shipment, if no `carrier_accounts` are explicitly
passed Shippo will query all carrier accounts that have this field set. By default, this is set to True. | | | `carrier` | *string* | :heavy_check_mark: | Carrier token, see Carriers

Please check the carrier accounts tutorial page for all supported carriers. | usps | -| `parameters` | *mixed* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `active` | *?bool* | :heavy_minus_sign: | Determines whether the account is active. When creating a shipment, if no `carrier_accounts` are explicitly
passed Shippo will query all carrier accounts that have this field set. By default, this is set to True. | | +| `parameters` | [array\|Components\FedExConnectExistingOwnAccountParameters\|Components\UPSConnectExistingOwnAccountParameters\|null](../../Models/Components/CarrierAccountBaseParameters.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountBaseParameters.md b/docs/Models/Components/CarrierAccountBaseParameters.md new file mode 100644 index 0000000..fb26178 --- /dev/null +++ b/docs/Models/Components/CarrierAccountBaseParameters.md @@ -0,0 +1,32 @@ +# CarrierAccountBaseParameters + + +## Supported Types + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + +### `Components\FedExConnectExistingOwnAccountParameters` + +```php +/** +* @var Components\FedExConnectExistingOwnAccountParameters +*/ +Components\FedExConnectExistingOwnAccountParameters $value = /* values here */ +``` + +### `Components\UPSConnectExistingOwnAccountParameters` + +```php +/** +* @var Components\UPSConnectExistingOwnAccountParameters +*/ +Components\UPSConnectExistingOwnAccountParameters $value = /* values here */ +``` + diff --git a/docs/Models/Components/CarrierAccountCanadaPostCreateParameters.md b/docs/Models/Components/CarrierAccountCanadaPostCreateParameters.md new file mode 100644 index 0000000..25fb8cc --- /dev/null +++ b/docs/Models/Components/CarrierAccountCanadaPostCreateParameters.md @@ -0,0 +1,12 @@ +# CarrierAccountCanadaPostCreateParameters + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `canadaPostTerms` | *bool* | :heavy_check_mark: | Whether or not the user agrees to Canada Post's terms. If passed in as false, request will fail with error 400 | | +| `company` | *string* | :heavy_check_mark: | N/A | Shippo | +| `email` | *string* | :heavy_check_mark: | N/A | hippo@shippo.com | +| `fullName` | *string* | :heavy_check_mark: | N/A | Shippo Meister | +| `phone` | *string* | :heavy_check_mark: | Needs to be a valid phone number and cannot be null | 1112223333 | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountCanadaPostCreateRequest.md b/docs/Models/Components/CarrierAccountCanadaPostCreateRequest.md new file mode 100644 index 0000000..e661a86 --- /dev/null +++ b/docs/Models/Components/CarrierAccountCanadaPostCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountCanadaPostCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `carrier` | *string* | :heavy_check_mark: | N/A | canada_post | +| `parameters` | [Components\CarrierAccountCanadaPostCreateParameters](../../Models/Components/CarrierAccountCanadaPostCreateParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountChronopostCreateRequest.md b/docs/Models/Components/CarrierAccountChronopostCreateRequest.md new file mode 100644 index 0000000..c43bd1d --- /dev/null +++ b/docs/Models/Components/CarrierAccountChronopostCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountChronopostCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `carrier` | *string* | :heavy_check_mark: | N/A | chronopost | +| `parameters` | [Components\CarrierAccountChronopostCreateRequestParameters](../../Models/Components/CarrierAccountChronopostCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountChronopostCreateRequestParameters.md b/docs/Models/Components/CarrierAccountChronopostCreateRequestParameters.md new file mode 100644 index 0000000..6935838 --- /dev/null +++ b/docs/Models/Components/CarrierAccountChronopostCreateRequestParameters.md @@ -0,0 +1,7 @@ +# CarrierAccountChronopostCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountColissimoCreateRequest.md b/docs/Models/Components/CarrierAccountColissimoCreateRequest.md new file mode 100644 index 0000000..50bc7a7 --- /dev/null +++ b/docs/Models/Components/CarrierAccountColissimoCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountColissimoCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `carrier` | *string* | :heavy_check_mark: | N/A | colissimo | +| `parameters` | [Components\CarrierAccountColissimoCreateRequestParameters](../../Models/Components/CarrierAccountColissimoCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountColissimoCreateRequestParameters.md b/docs/Models/Components/CarrierAccountColissimoCreateRequestParameters.md new file mode 100644 index 0000000..52e78bc --- /dev/null +++ b/docs/Models/Components/CarrierAccountColissimoCreateRequestParameters.md @@ -0,0 +1,7 @@ +# CarrierAccountColissimoCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountCorreosCreateRequest.md b/docs/Models/Components/CarrierAccountCorreosCreateRequest.md new file mode 100644 index 0000000..bebd60b --- /dev/null +++ b/docs/Models/Components/CarrierAccountCorreosCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountCorreosCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `carrier` | *string* | :heavy_check_mark: | N/A | correos | +| `parameters` | [Components\CarrierAccountCorreosCreateRequestParameters](../../Models/Components/CarrierAccountCorreosCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountCorreosCreateRequestParameters.md b/docs/Models/Components/CarrierAccountCorreosCreateRequestParameters.md new file mode 100644 index 0000000..13a0aae --- /dev/null +++ b/docs/Models/Components/CarrierAccountCorreosCreateRequestParameters.md @@ -0,0 +1,7 @@ +# CarrierAccountCorreosCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountDHLExpressCreateRequest.md b/docs/Models/Components/CarrierAccountDHLExpressCreateRequest.md new file mode 100644 index 0000000..10d1f1c --- /dev/null +++ b/docs/Models/Components/CarrierAccountDHLExpressCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountDHLExpressCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `carrier` | *string* | :heavy_check_mark: | N/A | dhl_express | +| `parameters` | [Components\CarrierAccountDHLExpressCreateRequestParameters](../../Models/Components/CarrierAccountDHLExpressCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountDHLExpressCreateRequestParameters.md b/docs/Models/Components/CarrierAccountDHLExpressCreateRequestParameters.md new file mode 100644 index 0000000..91f4185 --- /dev/null +++ b/docs/Models/Components/CarrierAccountDHLExpressCreateRequestParameters.md @@ -0,0 +1,8 @@ +# CarrierAccountDHLExpressCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `userAcceptedTermsAndConditions` | *bool* | :heavy_check_mark: | Whether or not the user agrees to the DHL Express Terms and Conditions. If passed in as false, request will fail with error 400 | \ No newline at end of file diff --git a/docs/Models/Operations/GetCarrierRegistrationStatusResponse.md b/docs/Models/Components/CarrierAccountDPDUKCreateRequest.md similarity index 54% rename from docs/Models/Operations/GetCarrierRegistrationStatusResponse.md rename to docs/Models/Components/CarrierAccountDPDUKCreateRequest.md index 491bf3c..0233672 100644 --- a/docs/Models/Operations/GetCarrierRegistrationStatusResponse.md +++ b/docs/Models/Components/CarrierAccountDPDUKCreateRequest.md @@ -1,12 +1,9 @@ -# GetCarrierRegistrationStatusResponse +# CarrierAccountDPDUKCreateRequest ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `carrierAccountRegistrationStatus` | [?\Shippo\API\Models\Components\CarrierAccountRegistrationStatus](../../Models/Components/CarrierAccountRegistrationStatus.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `carrier` | *string* | :heavy_check_mark: | N/A | dpd_uk | +| `parameters` | [Components\CarrierAccountDPDUKCreateRequestParameters](../../Models/Components/CarrierAccountDPDUKCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountDPDUKCreateRequestParameters.md b/docs/Models/Components/CarrierAccountDPDUKCreateRequestParameters.md new file mode 100644 index 0000000..6c4e1fa --- /dev/null +++ b/docs/Models/Components/CarrierAccountDPDUKCreateRequestParameters.md @@ -0,0 +1,7 @@ +# CarrierAccountDPDUKCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountDeutschePostCreateRequest.md b/docs/Models/Components/CarrierAccountDeutschePostCreateRequest.md new file mode 100644 index 0000000..4406c87 --- /dev/null +++ b/docs/Models/Components/CarrierAccountDeutschePostCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountDeutschePostCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `carrier` | *string* | :heavy_check_mark: | N/A | deutsche_post | +| `parameters` | [Components\CarrierAccountDeutschePostCreateRequestParameters](../../Models/Components/CarrierAccountDeutschePostCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountDeutschePostCreateRequestParameters.md b/docs/Models/Components/CarrierAccountDeutschePostCreateRequestParameters.md new file mode 100644 index 0000000..829d052 --- /dev/null +++ b/docs/Models/Components/CarrierAccountDeutschePostCreateRequestParameters.md @@ -0,0 +1,7 @@ +# CarrierAccountDeutschePostCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountDpdDeCreateRequest.md b/docs/Models/Components/CarrierAccountDpdDeCreateRequest.md new file mode 100644 index 0000000..d359160 --- /dev/null +++ b/docs/Models/Components/CarrierAccountDpdDeCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountDpdDeCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `carrier` | *string* | :heavy_check_mark: | N/A | dpd_de | +| `parameters` | [Components\CarrierAccountDpdDeCreateRequestParameters](../../Models/Components/CarrierAccountDpdDeCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountDpdDeCreateRequestParameters.md b/docs/Models/Components/CarrierAccountDpdDeCreateRequestParameters.md new file mode 100644 index 0000000..4a84103 --- /dev/null +++ b/docs/Models/Components/CarrierAccountDpdDeCreateRequestParameters.md @@ -0,0 +1,7 @@ +# CarrierAccountDpdDeCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountFedExCreateRequest.md b/docs/Models/Components/CarrierAccountFedExCreateRequest.md new file mode 100644 index 0000000..7e69dc1 --- /dev/null +++ b/docs/Models/Components/CarrierAccountFedExCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountFedExCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `carrier` | *string* | :heavy_check_mark: | N/A | fedex | +| `parameters` | [Components\CarrierAccountFedExCreateRequestParameters](../../Models/Components/CarrierAccountFedExCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountFedExCreateRequestParameters.md b/docs/Models/Components/CarrierAccountFedExCreateRequestParameters.md new file mode 100644 index 0000000..761e76a --- /dev/null +++ b/docs/Models/Components/CarrierAccountFedExCreateRequestParameters.md @@ -0,0 +1,7 @@ +# CarrierAccountFedExCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountHermesUKCreateRequest.md b/docs/Models/Components/CarrierAccountHermesUKCreateRequest.md new file mode 100644 index 0000000..d509bb2 --- /dev/null +++ b/docs/Models/Components/CarrierAccountHermesUKCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountHermesUKCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `carrier` | *string* | :heavy_check_mark: | N/A | hermes_uk | +| `parameters` | [Components\CarrierAccountHermesUKCreateRequestParameters](../../Models/Components/CarrierAccountHermesUKCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountHermesUKCreateRequestParameters.md b/docs/Models/Components/CarrierAccountHermesUKCreateRequestParameters.md new file mode 100644 index 0000000..a6992c0 --- /dev/null +++ b/docs/Models/Components/CarrierAccountHermesUKCreateRequestParameters.md @@ -0,0 +1,7 @@ +# CarrierAccountHermesUKCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountMondialRelayCreateRequest.md b/docs/Models/Components/CarrierAccountMondialRelayCreateRequest.md new file mode 100644 index 0000000..88ed19e --- /dev/null +++ b/docs/Models/Components/CarrierAccountMondialRelayCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountMondialRelayCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `carrier` | *string* | :heavy_check_mark: | N/A | mondialrelay | +| `parameters` | [Components\CarrierAccountMondialRelayCreateRequestParameters](../../Models/Components/CarrierAccountMondialRelayCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountMondialRelayCreateRequestParameters.md b/docs/Models/Components/CarrierAccountMondialRelayCreateRequestParameters.md new file mode 100644 index 0000000..2980d14 --- /dev/null +++ b/docs/Models/Components/CarrierAccountMondialRelayCreateRequestParameters.md @@ -0,0 +1,7 @@ +# CarrierAccountMondialRelayCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountPaginatedList.md b/docs/Models/Components/CarrierAccountPaginatedList.md index 8a66be2..cea9c89 100644 --- a/docs/Models/Components/CarrierAccountPaginatedList.md +++ b/docs/Models/Components/CarrierAccountPaginatedList.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\CarrierAccountWithExtraInfo](../../Models/Components/CarrierAccountWithExtraInfo.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\CarrierAccountWithExtraInfo](../../Models/Components/CarrierAccountWithExtraInfo.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountParameters.md b/docs/Models/Components/CarrierAccountParameters.md new file mode 100644 index 0000000..49c6852 --- /dev/null +++ b/docs/Models/Components/CarrierAccountParameters.md @@ -0,0 +1,32 @@ +# CarrierAccountParameters + + +## Supported Types + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + +### `Components\FedExConnectExistingOwnAccountParameters` + +```php +/** +* @var Components\FedExConnectExistingOwnAccountParameters +*/ +Components\FedExConnectExistingOwnAccountParameters $value = /* values here */ +``` + +### `Components\UPSConnectExistingOwnAccountParameters` + +```php +/** +* @var Components\UPSConnectExistingOwnAccountParameters +*/ +Components\UPSConnectExistingOwnAccountParameters $value = /* values here */ +``` + diff --git a/docs/Models/Components/CarrierAccountPosteItalianeCreateRequest.md b/docs/Models/Components/CarrierAccountPosteItalianeCreateRequest.md new file mode 100644 index 0000000..7648eaf --- /dev/null +++ b/docs/Models/Components/CarrierAccountPosteItalianeCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountPosteItalianeCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `carrier` | *string* | :heavy_check_mark: | N/A | poste_italiane | +| `parameters` | [Components\CarrierAccountPosteItalianeCreateRequestParameters](../../Models/Components/CarrierAccountPosteItalianeCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountPosteItalianeCreateRequestParameters.md b/docs/Models/Components/CarrierAccountPosteItalianeCreateRequestParameters.md new file mode 100644 index 0000000..b429bd7 --- /dev/null +++ b/docs/Models/Components/CarrierAccountPosteItalianeCreateRequestParameters.md @@ -0,0 +1,7 @@ +# CarrierAccountPosteItalianeCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountSendleCreateRequest.md b/docs/Models/Components/CarrierAccountSendleCreateRequest.md new file mode 100644 index 0000000..2f78bd9 --- /dev/null +++ b/docs/Models/Components/CarrierAccountSendleCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountSendleCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `carrier` | *string* | :heavy_check_mark: | N/A | sendle | +| `parameters` | [Components\CarrierAccountSendleCreateRequestParameters](../../Models/Components/CarrierAccountSendleCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountSendleCreateRequestParameters.md b/docs/Models/Components/CarrierAccountSendleCreateRequestParameters.md new file mode 100644 index 0000000..aa1e00c --- /dev/null +++ b/docs/Models/Components/CarrierAccountSendleCreateRequestParameters.md @@ -0,0 +1,7 @@ +# CarrierAccountSendleCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountUPSCreateRequest.md b/docs/Models/Components/CarrierAccountUPSCreateRequest.md new file mode 100644 index 0000000..50aba12 --- /dev/null +++ b/docs/Models/Components/CarrierAccountUPSCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountUPSCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `carrier` | *string* | :heavy_check_mark: | N/A | ups | +| `parameters` | [?Components\CarrierAccountUPSCreateRequestParameters](../../Models/Components/CarrierAccountUPSCreateRequestParameters.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountUPSCreateRequestParameters.md b/docs/Models/Components/CarrierAccountUPSCreateRequestParameters.md new file mode 100644 index 0000000..4183791 --- /dev/null +++ b/docs/Models/Components/CarrierAccountUPSCreateRequestParameters.md @@ -0,0 +1,25 @@ +# CarrierAccountUPSCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `billingAddressCity` | *string* | :heavy_check_mark: | N/A | San Francisco | +| `billingAddressCountryIso2` | *string* | :heavy_check_mark: | N/A | US | +| `billingAddressState` | *string* | :heavy_check_mark: | N/A | CA | +| `billingAddressStreet1` | *string* | :heavy_check_mark: | N/A | 731 Market St | +| `billingAddressZip` | *string* | :heavy_check_mark: | N/A | 94103 | +| `pickupAddressCity` | *string* | :heavy_check_mark: | User's pickup address city. | San Francisco | +| `pickupAddressCountryIso2` | *string* | :heavy_check_mark: | User's pickup street 1. | US | +| `pickupAddressState` | *string* | :heavy_check_mark: | User's pickup address state. | CA | +| `pickupAddressStreet1` | *string* | :heavy_check_mark: | User's pickup address street 1. | 731 Market St | +| `pickupAddressZip` | *string* | :heavy_check_mark: | User's pickup address zip code. | 94103 | +| `upsAgreements` | *bool* | :heavy_check_mark: | Whether the user agrees to the UPS terms and conditions or not. Error 400 will be returned if passed in as false | | +| `billingAddressStreet2` | *?string* | :heavy_minus_sign: | Empty string acceptable for billing_address_street2 | STE 200 | +| `company` | *?string* | :heavy_minus_sign: | Company name. Full name is acceptable in this field if the user has no company name | Shippo | +| `email` | *?string* | :heavy_minus_sign: | N/A | hippo@shippo.com | +| `fullName` | *?string* | :heavy_minus_sign: | N/A | Shippo Meister | +| `phone` | *?string* | :heavy_minus_sign: | Needs to be a valid phone number and cannot be null | 1112223333 | +| `pickupAddressSameAsBillingAddress` | *?bool* | :heavy_minus_sign: | N/A | false | +| `pickupAddressStreet2` | *?string* | :heavy_minus_sign: | User's pickup street 2. | STE 200 | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountUSPSCreateRequest.md b/docs/Models/Components/CarrierAccountUSPSCreateRequest.md new file mode 100644 index 0000000..3fb76b7 --- /dev/null +++ b/docs/Models/Components/CarrierAccountUSPSCreateRequest.md @@ -0,0 +1,9 @@ +# CarrierAccountUSPSCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `carrier` | *string* | :heavy_check_mark: | N/A | usps | +| `parameters` | [Components\CarrierAccountUSPSCreateRequestParameters](../../Models/Components/CarrierAccountUSPSCreateRequestParameters.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountUSPSCreateRequestParameters.md b/docs/Models/Components/CarrierAccountUSPSCreateRequestParameters.md new file mode 100644 index 0000000..392e692 --- /dev/null +++ b/docs/Models/Components/CarrierAccountUSPSCreateRequestParameters.md @@ -0,0 +1,7 @@ +# CarrierAccountUSPSCreateRequestParameters + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CarrierAccountWithExtraInfo.md b/docs/Models/Components/CarrierAccountWithExtraInfo.md index da86466..288d0a4 100644 --- a/docs/Models/Components/CarrierAccountWithExtraInfo.md +++ b/docs/Models/Components/CarrierAccountWithExtraInfo.md @@ -6,14 +6,14 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `accountId` | *string* | :heavy_check_mark: | Unique identifier of the account. Please check the carrier accounts tutorial
page for the `account_id` per carrier.

To protect account information, this field will be masked in any API response. | **** | -| `active` | *?bool* | :heavy_minus_sign: | Determines whether the account is active. When creating a shipment, if no `carrier_accounts` are explicitly
passed Shippo will query all carrier accounts that have this field set. By default, this is set to True. | | | `carrier` | *string* | :heavy_check_mark: | Carrier token, see Carriers

Please check the carrier accounts tutorial page for all supported carriers. | usps | -| `parameters` | *mixed* | :heavy_minus_sign: | N/A | | +| `active` | *?bool* | :heavy_minus_sign: | Determines whether the account is active. When creating a shipment, if no `carrier_accounts` are explicitly
passed Shippo will query all carrier accounts that have this field set. By default, this is set to True. | | +| `parameters` | [array\|Components\FedExConnectExistingOwnAccountParameters\|Components\UPSConnectExistingOwnAccountParameters\|null](../../Models/Components/Parameters.md) | :heavy_minus_sign: | N/A | | | `carrierName` | *mixed* | :heavy_minus_sign: | Carrier name, see Carriers
| USPS | | `isShippoAccount` | *?bool* | :heavy_minus_sign: | N/A | false | | `metadata` | *?string* | :heavy_minus_sign: | N/A | | | `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the carrier account object. | 6aa34d5f6865448fbb1ee93636e98999 | | `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the carrier account object. | bob+22@gmail.com | -| `serviceLevels` | array<[\Shippo\API\Models\Components\CarrierAccountServiceLevel](../../Models/Components/CarrierAccountServiceLevel.md)> | :heavy_minus_sign: | N/A | | +| `serviceLevels` | array<[Components\CarrierAccountServiceLevel](../../Models/Components/CarrierAccountServiceLevel.md)> | :heavy_minus_sign: | N/A | | | `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | false | -| `objectInfo` | [?\Shippo\API\Models\Components\ObjectInfo](../../Models/Components/ObjectInfo.md) | :heavy_minus_sign: | Holds internal state relevant to users. | | \ No newline at end of file +| `objectInfo` | [?Components\ObjectInfo](../../Models/Components/ObjectInfo.md) | :heavy_minus_sign: | Holds internal state relevant to users. | | \ No newline at end of file diff --git a/docs/Models/Components/CarrierParcelTemplate.md b/docs/Models/Components/CarrierParcelTemplate.md index b741e19..1f1b3f4 100644 --- a/docs/Models/Components/CarrierParcelTemplate.md +++ b/docs/Models/Components/CarrierParcelTemplate.md @@ -3,13 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `carrier` | *?string* | :heavy_minus_sign: | The name of the carrier that provides this parcel template | FedEx | -| `distanceUnit` | [?\Shippo\API\Models\Components\DistanceUnitEnum](../../Models/Components/DistanceUnitEnum.md) | :heavy_minus_sign: | The measure unit used for length, width and height. | in | -| `height` | *?string* | :heavy_minus_sign: | The height of the package, in units specified by the distance_unit attribute | 1.5 | -| `isVariableDimensions` | *?string* | :heavy_minus_sign: | True if the carrier parcel template allows custom dimensions, such as USPS Softpack. | false | -| `length` | *?string* | :heavy_minus_sign: | The length of the package, in units specified by the distance_unit attribute | 12.375 | -| `name` | *?string* | :heavy_minus_sign: | The name of the carrier parcel template | FedEx® Small Box (S1) | -| `token` | *?string* | :heavy_minus_sign: | The unique string representation of the carrier parcel template | FedEx_Box_Small_1 | -| `width` | *?string* | :heavy_minus_sign: | The width of the package, in units specified by the distance_unit attribute | 10.875 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `carrier` | *?string* | :heavy_minus_sign: | The name of the carrier that provides this parcel template | FedEx | +| `distanceUnit` | [?Components\DistanceUnitEnum](../../Models/Components/DistanceUnitEnum.md) | :heavy_minus_sign: | The measure unit used for length, width and height. | in | +| `height` | *?string* | :heavy_minus_sign: | The height of the package, in units specified by the distance_unit attribute | 1.5 | +| `isVariableDimensions` | *?bool* | :heavy_minus_sign: | True if the carrier parcel template allows custom dimensions, such as USPS Softpack. | false | +| `length` | *?string* | :heavy_minus_sign: | The length of the package, in units specified by the distance_unit attribute | 12.375 | +| `name` | *?string* | :heavy_minus_sign: | The name of the carrier parcel template | FedEx® Small Box (S1) | +| `token` | *?string* | :heavy_minus_sign: | The unique string representation of the carrier parcel template | FedEx_Box_Small_1 | +| `width` | *?string* | :heavy_minus_sign: | The width of the package, in units specified by the distance_unit attribute | 10.875 | \ No newline at end of file diff --git a/docs/Models/Components/CarrierParcelTemplateList.md b/docs/Models/Components/CarrierParcelTemplateList.md index c29ad8d..583fba1 100644 --- a/docs/Models/Components/CarrierParcelTemplateList.md +++ b/docs/Models/Components/CarrierParcelTemplateList.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `results` | array<[\Shippo\API\Models\Components\CarrierParcelTemplate](../../Models/Components/CarrierParcelTemplate.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `results` | array<[Components\CarrierParcelTemplate](../../Models/Components/CarrierParcelTemplate.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/CarriersEnum.md b/docs/Models/Components/CarriersEnum.md index 97e4f70..9788d24 100644 --- a/docs/Models/Components/CarriersEnum.md +++ b/docs/Models/Components/CarriersEnum.md @@ -45,9 +45,7 @@ | new_zealand_post | New Zealand Post (also used for Pace and CourierPost)| | nippon_express | Nippon Express| | ontrac | OnTrac| -| orangeds | OrangeDS| | parcelforce | Parcelforce| -| parcel | Parcel| | passport | Passport| | pcf | PCF| | poste_italiane | Poste Italiane | @@ -64,8 +62,6 @@ | ups | UPS| | usps | USPS| | veho | Veho | -| x_delivery | X Delivery (now Maergo)| -| yodel | Yodel| @@ -116,9 +112,7 @@ | `NewZealandPost` | new_zealand_post | | `NipponExpress` | nippon_express | | `Ontrac` | ontrac | -| `Orangeds` | orangeds | | `Parcelforce` | parcelforce | -| `Parcel` | parcel | | `Passport` | passport | | `Pcf` | pcf | | `PosteItaliane` | poste_italiane | @@ -134,6 +128,4 @@ | `Uds` | uds | | `Ups` | ups | | `Usps` | usps | -| `Veho` | veho | -| `XDelivery` | x_delivery | -| `Yodel` | yodel | \ No newline at end of file +| `Veho` | veho | \ No newline at end of file diff --git a/docs/Models/Components/Cod.md b/docs/Models/Components/Cod.md index f598642..83c1c6c 100644 --- a/docs/Models/Components/Cod.md +++ b/docs/Models/Components/Cod.md @@ -9,4 +9,4 @@ Specify collection on delivery details (UPS only). | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `amount` | *?string* | :heavy_minus_sign: | Amount to be collected. | 5.5 | | `currency` | *?string* | :heavy_minus_sign: | Currency for the amount to be collected. Currently only USD is supported for UPS. | USD | -| `paymentMethod` | [?\Shippo\API\Models\Components\PaymentMethod](../../Models/Components/PaymentMethod.md) | :heavy_minus_sign: | Secured funds include money orders, certified cheques and others (see
UPS for details).
If no payment_method inputted the value defaults to "ANY".) | CASH | \ No newline at end of file +| `paymentMethod` | [?Components\PaymentMethod](../../Models/Components/PaymentMethod.md) | :heavy_minus_sign: | Secured funds include money orders, certified cheques and others (see
UPS for details).
If no payment_method inputted the value defaults to "ANY".) | CASH | \ No newline at end of file diff --git a/docs/Models/Components/ConnectExistingOwnAccountRequest.md b/docs/Models/Components/ConnectExistingOwnAccountRequest.md index a2a3cc4..8168274 100644 --- a/docs/Models/Components/ConnectExistingOwnAccountRequest.md +++ b/docs/Models/Components/ConnectExistingOwnAccountRequest.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `accountId` | *string* | :heavy_check_mark: | N/A | 321123 | -| `active` | *?bool* | :heavy_minus_sign: | N/A | | -| `carrier` | *string* | :heavy_check_mark: | N/A | fedex | -| `metadata` | *?string* | :heavy_minus_sign: | N/A | FEDEX Account | -| `parameters` | *mixed* | :heavy_check_mark: | N/A | | -| `test` | *?bool* | :heavy_minus_sign: | N/A | false | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `accountId` | *string* | :heavy_check_mark: | N/A | 321123 | +| `carrier` | *string* | :heavy_check_mark: | N/A | fedex | +| `parameters` | [array\|Components\FedExConnectExistingOwnAccountParameters\|Components\UPSConnectExistingOwnAccountParameters](../../Models/Components/ConnectExistingOwnAccountRequestParameters.md) | :heavy_check_mark: | N/A | | +| `active` | *?bool* | :heavy_minus_sign: | N/A | | +| `metadata` | *?string* | :heavy_minus_sign: | N/A | FEDEX Account | +| `test` | *?bool* | :heavy_minus_sign: | N/A | false | \ No newline at end of file diff --git a/docs/Models/Components/ConnectExistingOwnAccountRequestParameters.md b/docs/Models/Components/ConnectExistingOwnAccountRequestParameters.md new file mode 100644 index 0000000..5f86f00 --- /dev/null +++ b/docs/Models/Components/ConnectExistingOwnAccountRequestParameters.md @@ -0,0 +1,32 @@ +# ConnectExistingOwnAccountRequestParameters + + +## Supported Types + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + +### `Components\FedExConnectExistingOwnAccountParameters` + +```php +/** +* @var Components\FedExConnectExistingOwnAccountParameters +*/ +Components\FedExConnectExistingOwnAccountParameters $value = /* values here */ +``` + +### `Components\UPSConnectExistingOwnAccountParameters` + +```php +/** +* @var Components\UPSConnectExistingOwnAccountParameters +*/ +Components\UPSConnectExistingOwnAccountParameters $value = /* values here */ +``` + diff --git a/docs/Models/Components/CoreRate.md b/docs/Models/Components/CoreRate.md new file mode 100644 index 0000000..38b603d --- /dev/null +++ b/docs/Models/Components/CoreRate.md @@ -0,0 +1,16 @@ +# CoreRate + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `amount` | *?string* | :heavy_minus_sign: | Final Rate price, expressed in the currency used in the sender's country. | 5.5 | +| `amountLocal` | *?string* | :heavy_minus_sign: | Final Rate price, expressed in the currency used in the recipient's country. | 5.5 | +| `currency` | *?string* | :heavy_minus_sign: | Currency used in the sender's country, refers to `amount`.
The official ISO 4217 currency codes are used, e.g. `USD` or `EUR`. | USD | +| `currencyLocal` | *?string* | :heavy_minus_sign: | Currency used in the recipient's country, refers to `amount_local`.
The official ISO 4217 currency codes are used, e.g. `USD` or "EUR". | USD | +| `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the Rate object. | adcfdddf8ec64b84ad22772bce3ea37a | +| `provider` | *?string* | :heavy_minus_sign: | Carrier offering the rate, e.g., `FedEx` or `Deutsche Post DHL`. | USPS | +| `carrierAccount` | *?string* | :heavy_minus_sign: | Object ID of the carrier account that has been used to retrieve the rate. | 078870331023437cb917f5187429b093 | +| `servicelevelName` | *?string* | :heavy_minus_sign: | Service level name, e.g. `Priority Mail` or `FedEx Ground®`.
A service level commonly defines the transit time of a Shipment (e.g., Express vs. Standard),
along with other properties. These names vary depending on the provider.

See Service Levels. | Priority Mail | +| `servicelevelToken` | *?string* | :heavy_minus_sign: | Token of the Rate's servicelevel, e.g. `usps_priority` or `fedex_ground`.
See servicelevels. | fedex_ground | \ No newline at end of file diff --git a/docs/Models/Components/CustomsDeclaration.md b/docs/Models/Components/CustomsDeclaration.md index 6ad2951..d4a8217 100644 --- a/docs/Models/Components/CustomsDeclaration.md +++ b/docs/Models/Components/CustomsDeclaration.md @@ -5,16 +5,20 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `certify` | *bool* | :heavy_check_mark: | Expresses that the certify_signer has provided all information of this customs declaration truthfully. | true | +| `certifySigner` | *string* | :heavy_check_mark: | Name of the person who created the customs declaration and is responsible for the validity of all
information provided. | Shawn Ippotle | +| `contentsType` | *string* | :heavy_check_mark: | Type of goods of the shipment.
Allowed values available here | MERCHANDISE | +| `items` | array<*string*> | :heavy_check_mark: | Distinct Parcel content items as Customs Items object_ids. | [
"5087f181d1dc4b14b73fdbf636498886"
] | +| `nonDeliveryOption` | *string* | :heavy_check_mark: | Indicates how the carrier should proceed in case the shipment can't be delivered.
Allowed values available here | RETURN | | `aesItn` | *?string* | :heavy_minus_sign: | **required if eel_pfc is `AES_ITN`**

AES / ITN reference of the shipment. | | | `b13aFilingOption` | *?string* | :heavy_minus_sign: | B13A Option details are obtained by filing a B13A Canada Export Declaration via the Canadian Export Reporting System (CERS).
More information on reporting commercial exports from Canada.
Allowed values available here | FILED_ELECTRONICALLY | | `b13aNumber` | *?string* | :heavy_minus_sign: | **must be provided if and only if b13a_filing_option is provided**

Represents:
the Proof of Report (POR) Number when b13a_filing_option is `FILED_ELECTRONICALLY`;

the Summary ID Number when b13a_filing_option is `SUMMARY_REPORTING`;

or the Exemption Number when b13a_filing_option is `NOT_REQUIRED`. | | | `certificate` | *?string* | :heavy_minus_sign: | Certificate reference of the shipment. | | -| `certify` | *bool* | :heavy_check_mark: | Expresses that the certify_signer has provided all information of this customs declaration truthfully. | true | -| `certifySigner` | *string* | :heavy_check_mark: | Name of the person who created the customs declaration and is responsible for the validity of all
information provided. | Shawn Ippotle | | `commercialInvoice` | *?bool* | :heavy_minus_sign: | N/A | | | `contentsExplanation` | *?string* | :heavy_minus_sign: | **required if contents_type is `OTHER`**

Explanation of the type of goods of the shipment. | T-Shirt purchase | | `disclaimer` | *?string* | :heavy_minus_sign: | Disclaimer for the shipment and customs information that have been provided. | | -| `exporterIdentification` | [?\Shippo\API\Models\Components\CustomsExporterIdentification](../../Models/Components/CustomsExporterIdentification.md) | :heavy_minus_sign: | Additional exporter identification that may be required to ship in certain countries | | +| `dutiesPayor` | [?Components\CustomsDeclarationDutiesPayor](../../Models/Components/CustomsDeclarationDutiesPayor.md) | :heavy_minus_sign: | Specifies who will pay the duties for the shipment. Only accepted for FedEx shipments. | | +| `exporterIdentification` | [?Components\CustomsExporterIdentification](../../Models/Components/CustomsExporterIdentification.md) | :heavy_minus_sign: | Additional exporter identification that may be required to ship in certain countries | | | `exporterReference` | *?string* | :heavy_minus_sign: | Exporter reference of an export shipment. | | | `importerReference` | *?string* | :heavy_minus_sign: | Importer reference of an import shipment. | | | `isVatCollected` | *?bool* | :heavy_minus_sign: | Indicates whether the shipment's destination VAT has been collected. May be required for some destinations. | | @@ -23,15 +27,12 @@ | `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you
want to attach to the object. | Order ID #123123 | | `notes` | *?string* | :heavy_minus_sign: | Additional notes to be included in the customs declaration. | | | `addressImporter` | *?string* | :heavy_minus_sign: | Object ID of the Importer address. | 257ba08436604d2aaf069caafe7acb2a | -| `contentsType` | *string* | :heavy_check_mark: | Type of goods of the shipment.
Allowed values available here | MERCHANDISE | | `eelPfc` | *?string* | :heavy_minus_sign: | EEL / PFC type of the shipment. For most shipments from the US to CA, `NOEEI_30_36` is applicable; for most
other shipments from the US, `NOEEI_30_37_a` is applicable.
Allowed values available here | NOEEI_30_37_a | | `incoterm` | *?string* | :heavy_minus_sign: | The incoterm reference of the shipment. FCA is available for DHL Express and FedEx only.
eDAP is available for DPD UK only. DAP is available for DHL Express and DPD UK.
If expecting DAP for other carriers, please use DDU.
Allowed values available here | DDP | -| `invoicedCharges` | [?\Shippo\API\Models\Components\CustomsInvoicedCharges](../../Models/Components/CustomsInvoicedCharges.md) | :heavy_minus_sign: | Additional invoiced charges to be shown on the Customs Declaration Commercial Invoice. | | -| `items` | array<*string*> | :heavy_check_mark: | Distinct Parcel content items as Customs Items object_ids. | [
"5087f181d1dc4b14b73fdbf636498886"
] | -| `nonDeliveryOption` | *string* | :heavy_check_mark: | Indicates how the carrier should proceed in case the shipment can't be delivered.
Allowed values available here | RETURN | +| `invoicedCharges` | [?Components\CustomsInvoicedCharges](../../Models/Components/CustomsInvoicedCharges.md) | :heavy_minus_sign: | Additional invoiced charges to be shown on the Customs Declaration Commercial Invoice. | | | `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of object creation. | 2014-07-17T01:01:08.306Z | | `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the given object. | e2197a54da9d470480f4f8796cc419cb | | `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the object. | shippotle@shippo.com | -| `objectState` | [?\Shippo\API\Models\Components\ObjectStateEnum](../../Models/Components/ObjectStateEnum.md) | :heavy_minus_sign: | Indicates the validity of the enclosing object | | +| `objectState` | [?Components\ObjectStateEnum](../../Models/Components/ObjectStateEnum.md) | :heavy_minus_sign: | Indicates the validity of the enclosing object | | | `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of last object update. | 2014-07-17T01:01:08.306Z | | `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | true | \ No newline at end of file diff --git a/docs/Models/Components/CustomsDeclarationAddress.md b/docs/Models/Components/CustomsDeclarationAddress.md new file mode 100644 index 0000000..183a2b3 --- /dev/null +++ b/docs/Models/Components/CustomsDeclarationAddress.md @@ -0,0 +1,10 @@ +# CustomsDeclarationAddress + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `name` | *?string* | :heavy_minus_sign: | Name of the party to be billed for duties. | Patrick Kavanagh | +| `zip` | *?string* | :heavy_minus_sign: | Postal code of the party to be billed for duties. | 80331 | +| `country` | *?string* | :heavy_minus_sign: | Country ISO code of account number to be billed. | DE | \ No newline at end of file diff --git a/docs/Models/Components/CustomsDeclarationCreateRequest.md b/docs/Models/Components/CustomsDeclarationCreateRequest.md index eeed306..1f0762e 100644 --- a/docs/Models/Components/CustomsDeclarationCreateRequest.md +++ b/docs/Models/Components/CustomsDeclarationCreateRequest.md @@ -5,16 +5,20 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `certify` | *bool* | :heavy_check_mark: | Expresses that the certify_signer has provided all information of this customs declaration truthfully. | true | +| `certifySigner` | *string* | :heavy_check_mark: | Name of the person who created the customs declaration and is responsible for the validity of all
information provided. | Shawn Ippotle | +| `contentsType` | [Components\CustomsDeclarationContentsTypeEnum](../../Models/Components/CustomsDeclarationContentsTypeEnum.md) | :heavy_check_mark: | N/A | MERCHANDISE | +| `items` | array<[Components\CustomsItemCreateRequest](../../Models/Components/CustomsItemCreateRequest.md)> | :heavy_check_mark: | N/A | | +| `nonDeliveryOption` | [Components\CustomsDeclarationNonDeliveryOptionEnum](../../Models/Components/CustomsDeclarationNonDeliveryOptionEnum.md) | :heavy_check_mark: | N/A | RETURN | | `aesItn` | *?string* | :heavy_minus_sign: | **required if eel_pfc is `AES_ITN`**

AES / ITN reference of the shipment. | | -| `b13aFilingOption` | [?\Shippo\API\Models\Components\CustomsDeclarationB13AFilingOptionEnum](../../Models/Components/CustomsDeclarationB13AFilingOptionEnum.md) | :heavy_minus_sign: | N/A | FILED_ELECTRONICALLY | +| `b13aFilingOption` | [?Components\CustomsDeclarationB13AFilingOptionEnum](../../Models/Components/CustomsDeclarationB13AFilingOptionEnum.md) | :heavy_minus_sign: | N/A | FILED_ELECTRONICALLY | | `b13aNumber` | *?string* | :heavy_minus_sign: | **must be provided if and only if b13a_filing_option is provided**

Represents:
the Proof of Report (POR) Number when b13a_filing_option is `FILED_ELECTRONICALLY`;

the Summary ID Number when b13a_filing_option is `SUMMARY_REPORTING`;

or the Exemption Number when b13a_filing_option is `NOT_REQUIRED`. | | | `certificate` | *?string* | :heavy_minus_sign: | Certificate reference of the shipment. | | -| `certify` | *bool* | :heavy_check_mark: | Expresses that the certify_signer has provided all information of this customs declaration truthfully. | true | -| `certifySigner` | *string* | :heavy_check_mark: | Name of the person who created the customs declaration and is responsible for the validity of all
information provided. | Shawn Ippotle | | `commercialInvoice` | *?bool* | :heavy_minus_sign: | N/A | | | `contentsExplanation` | *?string* | :heavy_minus_sign: | **required if contents_type is `OTHER`**

Explanation of the type of goods of the shipment. | T-Shirt purchase | | `disclaimer` | *?string* | :heavy_minus_sign: | Disclaimer for the shipment and customs information that have been provided. | | -| `exporterIdentification` | [?\Shippo\API\Models\Components\CustomsExporterIdentification](../../Models/Components/CustomsExporterIdentification.md) | :heavy_minus_sign: | Additional exporter identification that may be required to ship in certain countries | | +| `dutiesPayor` | [?Components\DutiesPayor](../../Models/Components/DutiesPayor.md) | :heavy_minus_sign: | Specifies who will pay the duties for the shipment. Only accepted for FedEx shipments. | | +| `exporterIdentification` | [?Components\CustomsExporterIdentification](../../Models/Components/CustomsExporterIdentification.md) | :heavy_minus_sign: | Additional exporter identification that may be required to ship in certain countries | | | `exporterReference` | *?string* | :heavy_minus_sign: | Exporter reference of an export shipment. | | | `importerReference` | *?string* | :heavy_minus_sign: | Importer reference of an import shipment. | | | `isVatCollected` | *?bool* | :heavy_minus_sign: | Indicates whether the shipment's destination VAT has been collected. May be required for some destinations. | | @@ -22,10 +26,7 @@ | `license` | *?string* | :heavy_minus_sign: | License reference of the shipment. | | | `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you
want to attach to the object. | Order ID #123123 | | `notes` | *?string* | :heavy_minus_sign: | Additional notes to be included in the customs declaration. | | -| `addressImporter` | [?\Shippo\API\Models\Components\AddressImporter](../../Models/Components/AddressImporter.md) | :heavy_minus_sign: | Object that represents the address of the importer | | -| `contentsType` | [\Shippo\API\Models\Components\CustomsDeclarationContentsTypeEnum](../../Models/Components/CustomsDeclarationContentsTypeEnum.md) | :heavy_check_mark: | N/A | MERCHANDISE | -| `eelPfc` | [?\Shippo\API\Models\Components\CustomsDeclarationEelPfcEnum](../../Models/Components/CustomsDeclarationEelPfcEnum.md) | :heavy_minus_sign: | N/A | NOEEI_30_37_a | -| `incoterm` | [?\Shippo\API\Models\Components\CustomsDeclarationIncotermEnum](../../Models/Components/CustomsDeclarationIncotermEnum.md) | :heavy_minus_sign: | N/A | DDP | -| `items` | array<[\Shippo\API\Models\Components\CustomsItemCreateRequest](../../Models/Components/CustomsItemCreateRequest.md)> | :heavy_check_mark: | N/A | | -| `nonDeliveryOption` | [\Shippo\API\Models\Components\CustomsDeclarationNonDeliveryOptionEnum](../../Models/Components/CustomsDeclarationNonDeliveryOptionEnum.md) | :heavy_check_mark: | N/A | RETURN | +| `addressImporter` | [?Components\AddressImporter](../../Models/Components/AddressImporter.md) | :heavy_minus_sign: | Object that represents the address of the importer | | +| `eelPfc` | [?Components\CustomsDeclarationEelPfcEnum](../../Models/Components/CustomsDeclarationEelPfcEnum.md) | :heavy_minus_sign: | N/A | NOEEI_30_37_a | +| `incoterm` | [?Components\CustomsDeclarationIncotermEnum](../../Models/Components/CustomsDeclarationIncotermEnum.md) | :heavy_minus_sign: | N/A | DDP | | `test` | *?bool* | :heavy_minus_sign: | N/A | true | \ No newline at end of file diff --git a/docs/Models/Components/CustomsDeclarationCreateRequestAddress.md b/docs/Models/Components/CustomsDeclarationCreateRequestAddress.md new file mode 100644 index 0000000..da2b988 --- /dev/null +++ b/docs/Models/Components/CustomsDeclarationCreateRequestAddress.md @@ -0,0 +1,10 @@ +# CustomsDeclarationCreateRequestAddress + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `name` | *?string* | :heavy_minus_sign: | Name of the party to be billed for duties. | Patrick Kavanagh | +| `zip` | *?string* | :heavy_minus_sign: | Postal code of the party to be billed for duties. | 80331 | +| `country` | *?string* | :heavy_minus_sign: | Country ISO code of account number to be billed. | DE | \ No newline at end of file diff --git a/docs/Models/Components/CustomsDeclarationCreateRequestType.md b/docs/Models/Components/CustomsDeclarationCreateRequestType.md new file mode 100644 index 0000000..f7b49fc --- /dev/null +++ b/docs/Models/Components/CustomsDeclarationCreateRequestType.md @@ -0,0 +1,12 @@ +# CustomsDeclarationCreateRequestType + +Party to be billed for duties. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `Sender` | SENDER | +| `Recipient` | RECIPIENT | +| `ThirdParty` | THIRD_PARTY | \ No newline at end of file diff --git a/docs/Models/Components/CustomsDeclarationDutiesPayor.md b/docs/Models/Components/CustomsDeclarationDutiesPayor.md new file mode 100644 index 0000000..8810cd0 --- /dev/null +++ b/docs/Models/Components/CustomsDeclarationDutiesPayor.md @@ -0,0 +1,12 @@ +# CustomsDeclarationDutiesPayor + +Specifies who will pay the duties for the shipment. Only accepted for FedEx shipments. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `account` | *?string* | :heavy_minus_sign: | Account number to be billed for duties. | 2323434543 | +| `type` | [?Components\CustomsDeclarationType](../../Models/Components/CustomsDeclarationType.md) | :heavy_minus_sign: | Party to be billed for duties. | THIRD_PARTY | +| `address` | [?Components\CustomsDeclarationAddress](../../Models/Components/CustomsDeclarationAddress.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CustomsDeclarationPaginatedList.md b/docs/Models/Components/CustomsDeclarationPaginatedList.md index 19aa027..e9283dd 100644 --- a/docs/Models/Components/CustomsDeclarationPaginatedList.md +++ b/docs/Models/Components/CustomsDeclarationPaginatedList.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\CustomsDeclaration](../../Models/Components/CustomsDeclaration.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\CustomsDeclaration](../../Models/Components/CustomsDeclaration.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CustomsDeclarationType.md b/docs/Models/Components/CustomsDeclarationType.md new file mode 100644 index 0000000..6b61ca2 --- /dev/null +++ b/docs/Models/Components/CustomsDeclarationType.md @@ -0,0 +1,12 @@ +# CustomsDeclarationType + +Party to be billed for duties. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `Sender` | SENDER | +| `Recipient` | RECIPIENT | +| `ThirdParty` | THIRD_PARTY | \ No newline at end of file diff --git a/docs/Models/Components/CustomsExporterIdentification.md b/docs/Models/Components/CustomsExporterIdentification.md index c223ec6..38a2e1f 100644 --- a/docs/Models/Components/CustomsExporterIdentification.md +++ b/docs/Models/Components/CustomsExporterIdentification.md @@ -8,4 +8,4 @@ Additional exporter identification that may be required to ship in certain count | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `eoriNumber` | *?string* | :heavy_minus_sign: | Economic Operators' Registration and Identification (EORI) number. Must start with a 2 character
country code followed by a 6-17 character alphanumeric identifier (e.g. PL1234567890ABCDE).
More information on EORI. | PL123456790ABCDE | -| `taxId` | [?\Shippo\API\Models\Components\CustomsTaxIdentification](../../Models/Components/CustomsTaxIdentification.md) | :heavy_minus_sign: | Tax identification that may be required to ship in certain countries. Typically used to assess duties on
goods that are crossing a border. | | \ No newline at end of file +| `taxId` | [?Components\CustomsTaxIdentification](../../Models/Components/CustomsTaxIdentification.md) | :heavy_minus_sign: | Tax identification that may be required to ship in certain countries. Typically used to assess duties on
goods that are crossing a border. | | \ No newline at end of file diff --git a/docs/Models/Components/CustomsItem.md b/docs/Models/Components/CustomsItem.md index f1b0de9..ff931ec 100644 --- a/docs/Models/Components/CustomsItem.md +++ b/docs/Models/Components/CustomsItem.md @@ -3,23 +3,23 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `description` | *string* | :heavy_check_mark: | Text description of your item. | T-Shirt | -| `eccnEar99` | *?string* | :heavy_minus_sign: | Export Control Classification Number, required on some exports from the United States. | | -| `massUnit` | [\Shippo\API\Models\Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_check_mark: | The unit used for weight. | lb | -| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you
want to attach to the object. | Order ID "123454" | -| `netWeight` | *string* | :heavy_check_mark: | Total weight of this item, i.e. quantity * weight per item. | 5 | -| `originCountry` | *string* | :heavy_check_mark: | Country of origin of the item. Example: `US` or `DE`.
All accepted values can be found on the Official ISO Website. | | -| `quantity` | *int* | :heavy_check_mark: | Quantity of this item in the shipment you send. Must be greater than 0. | 20 | -| `skuCode` | *?string* | :heavy_minus_sign: | SKU code of the item, which is required by some carriers. | HM-123 | -| `hsCode` | *?string* | :heavy_minus_sign: | HS code of the item, which is required by some carriers. | 0901.21 | -| `tariffNumber` | *?string* | :heavy_minus_sign: | The tariff number of the item. | | -| `valueAmount` | *string* | :heavy_check_mark: | Total value of this item, i.e. quantity * value per item. | 200 | -| `valueCurrency` | *string* | :heavy_check_mark: | Currency used for value_amount. The official ISO 4217
currency codes are used, e.g. `USD` or `EUR`. | USD | -| `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of object creation. | 2014-07-17T00:49:20.631Z | -| `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the given object. | d799c2679e644279b59fe661ac8fa488 | -| `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the object. | shippotle@shippo.com | -| `objectState` | [?\Shippo\API\Models\Components\ObjectStateEnum](../../Models/Components/ObjectStateEnum.md) | :heavy_minus_sign: | Indicates the validity of the enclosing object | | -| `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of last object update. | 2014-07-17T00:49:20.631Z | -| `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `description` | *string* | :heavy_check_mark: | Text description of your item. | T-Shirt | +| `massUnit` | [Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_check_mark: | The unit used for weight. | lb | +| `netWeight` | *string* | :heavy_check_mark: | Total weight of this item, i.e. quantity * weight per item. | 5 | +| `originCountry` | *string* | :heavy_check_mark: | Country of origin of the item. Example: `US` or `DE`.
All accepted values can be found on the Official ISO Website. | | +| `quantity` | *int* | :heavy_check_mark: | Quantity of this item in the shipment you send. Must be greater than 0. | 20 | +| `valueAmount` | *string* | :heavy_check_mark: | Total value of this item, i.e. quantity * value per item. | 200 | +| `valueCurrency` | *string* | :heavy_check_mark: | Currency used for value_amount. The official ISO 4217
currency codes are used, e.g. `USD` or `EUR`. | USD | +| `eccnEar99` | *?string* | :heavy_minus_sign: | Export Control Classification Number, required on some exports from the United States. | | +| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you
want to attach to the object. | Order ID "123454" | +| `skuCode` | *?string* | :heavy_minus_sign: | SKU code of the item, which is required by some carriers. | HM-123 | +| `hsCode` | *?string* | :heavy_minus_sign: | HS code of the item, which is required by some carriers. If `tariff_number` is not provided, `hs_code` will be used. If both `hs_code` and `tariff_number` are provided, `tariff_number` will be used. 50 character limit. | 0901.21 | +| `tariffNumber` | *?string* | :heavy_minus_sign: | The tariff number of the item. If `tariff_number` is not provided, `hs_code` will be used. If both `hs_code` and `tariff_number` are provided, `tariff_number` will be used. 12 character limit. | | +| `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of object creation. | 2014-07-17T00:49:20.631Z | +| `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the given object. | d799c2679e644279b59fe661ac8fa488 | +| `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the object. | shippotle@shippo.com | +| `objectState` | [?Components\ObjectStateEnum](../../Models/Components/ObjectStateEnum.md) | :heavy_minus_sign: | Indicates the validity of the enclosing object | | +| `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of last object update. | 2014-07-17T00:49:20.631Z | +| `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | | \ No newline at end of file diff --git a/docs/Models/Components/CustomsItemCreateRequest.md b/docs/Models/Components/CustomsItemCreateRequest.md index 0259306..e0ea814 100644 --- a/docs/Models/Components/CustomsItemCreateRequest.md +++ b/docs/Models/Components/CustomsItemCreateRequest.md @@ -3,17 +3,17 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `description` | *string* | :heavy_check_mark: | Text description of your item. | T-Shirt | -| `eccnEar99` | *?string* | :heavy_minus_sign: | Export Control Classification Number, required on some exports from the United States. | | -| `massUnit` | [\Shippo\API\Models\Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_check_mark: | The unit used for weight. | lb | -| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you
want to attach to the object. | Order ID "123454" | -| `netWeight` | *string* | :heavy_check_mark: | Total weight of this item, i.e. quantity * weight per item. | 5 | -| `originCountry` | *string* | :heavy_check_mark: | Country of origin of the item. Example: `US` or `DE`.
All accepted values can be found on the Official ISO Website. | | -| `quantity` | *int* | :heavy_check_mark: | Quantity of this item in the shipment you send. Must be greater than 0. | 20 | -| `skuCode` | *?string* | :heavy_minus_sign: | SKU code of the item, which is required by some carriers. | HM-123 | -| `hsCode` | *?string* | :heavy_minus_sign: | HS code of the item, which is required by some carriers. | 0901.21 | -| `tariffNumber` | *?string* | :heavy_minus_sign: | The tariff number of the item. | | -| `valueAmount` | *string* | :heavy_check_mark: | Total value of this item, i.e. quantity * value per item. | 200 | -| `valueCurrency` | *string* | :heavy_check_mark: | Currency used for value_amount. The official ISO 4217
currency codes are used, e.g. `USD` or `EUR`. | USD | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `description` | *string* | :heavy_check_mark: | Text description of your item. | T-Shirt | +| `massUnit` | [Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_check_mark: | The unit used for weight. | lb | +| `netWeight` | *string* | :heavy_check_mark: | Total weight of this item, i.e. quantity * weight per item. | 5 | +| `originCountry` | *string* | :heavy_check_mark: | Country of origin of the item. Example: `US` or `DE`.
All accepted values can be found on the Official ISO Website. | | +| `quantity` | *int* | :heavy_check_mark: | Quantity of this item in the shipment you send. Must be greater than 0. | 20 | +| `valueAmount` | *string* | :heavy_check_mark: | Total value of this item, i.e. quantity * value per item. | 200 | +| `valueCurrency` | *string* | :heavy_check_mark: | Currency used for value_amount. The official ISO 4217
currency codes are used, e.g. `USD` or `EUR`. | USD | +| `eccnEar99` | *?string* | :heavy_minus_sign: | Export Control Classification Number, required on some exports from the United States. | | +| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you
want to attach to the object. | Order ID "123454" | +| `skuCode` | *?string* | :heavy_minus_sign: | SKU code of the item, which is required by some carriers. | HM-123 | +| `hsCode` | *?string* | :heavy_minus_sign: | HS code of the item, which is required by some carriers. If `tariff_number` is not provided, `hs_code` will be used. If both `hs_code` and `tariff_number` are provided, `tariff_number` will be used. 50 character limit. | 0901.21 | +| `tariffNumber` | *?string* | :heavy_minus_sign: | The tariff number of the item. If `tariff_number` is not provided, `hs_code` will be used. If both `hs_code` and `tariff_number` are provided, `tariff_number` will be used. 12 character limit. | | \ No newline at end of file diff --git a/docs/Models/Components/CustomsItemPaginatedList.md b/docs/Models/Components/CustomsItemPaginatedList.md index 5529d5c..73e6225 100644 --- a/docs/Models/Components/CustomsItemPaginatedList.md +++ b/docs/Models/Components/CustomsItemPaginatedList.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\CustomsItem](../../Models/Components/CustomsItem.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\CustomsItem](../../Models/Components/CustomsItem.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/CustomsTaxIdentification.md b/docs/Models/Components/CustomsTaxIdentification.md index 5d0f973..8ffed8e 100644 --- a/docs/Models/Components/CustomsTaxIdentification.md +++ b/docs/Models/Components/CustomsTaxIdentification.md @@ -9,4 +9,4 @@ goods that are crossing a border. | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `number` | *?string* | :heavy_minus_sign: | Tax identification number. | 123456789 | -| `type` | [?\Shippo\API\Models\Components\CustomsTaxIdentificationType](../../Models/Components/CustomsTaxIdentificationType.md) | :heavy_minus_sign: | Type of tax identification.
* `EIN` - Employer Identification Number, also known as a Federal Tax Identification Number.
* `VAT` - Value Added Tax identification number.
* `IOSS` - Import One-Stop Shop
* `ARN` - Australian Taxation Office Reference Number | EIN | \ No newline at end of file +| `type` | [?Components\CustomsTaxIdentificationType](../../Models/Components/CustomsTaxIdentificationType.md) | :heavy_minus_sign: | Type of tax identification.
* `EIN` - Employer Identification Number, also known as a Federal Tax Identification Number.
* `VAT` - Value Added Tax identification number.
* `IOSS` - Import One-Stop Shop
* `ARN` - Australian Taxation Office Reference Number | EIN | \ No newline at end of file diff --git a/docs/Models/Components/DangerousGoodsObject.md b/docs/Models/Components/DangerousGoodsObject.md index 7790730..14e5996 100644 --- a/docs/Models/Components/DangerousGoodsObject.md +++ b/docs/Models/Components/DangerousGoodsObject.md @@ -7,8 +7,8 @@ are provided, only certain USPS service levels will be eligible. For more inform ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contains` | *?bool* | :heavy_minus_sign: | Indicates if the shipment contains dangerous goods. | -| `biologicalMaterial` | [?\Shippo\API\Models\Components\DangerousGoodsBiologicalMaterial](../../Models/Components/DangerousGoodsBiologicalMaterial.md) | :heavy_minus_sign: | Container for specifying the presence of biological material. | -| `lithiumBatteries` | [?\Shippo\API\Models\Components\DangerousGoodsLithiumBatteries](../../Models/Components/DangerousGoodsLithiumBatteries.md) | :heavy_minus_sign: | Container for specifying the presence of lithium batteries. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `contains` | *?bool* | :heavy_minus_sign: | Indicates if the shipment contains dangerous goods. | +| `biologicalMaterial` | [?Components\DangerousGoodsBiologicalMaterial](../../Models/Components/DangerousGoodsBiologicalMaterial.md) | :heavy_minus_sign: | Container for specifying the presence of biological material. | +| `lithiumBatteries` | [?Components\DangerousGoodsLithiumBatteries](../../Models/Components/DangerousGoodsLithiumBatteries.md) | :heavy_minus_sign: | Container for specifying the presence of lithium batteries. | \ No newline at end of file diff --git a/docs/Models/Components/DefaultParcelTemplate.md b/docs/Models/Components/DefaultParcelTemplate.md index 48630f5..e6d73ff 100644 --- a/docs/Models/Components/DefaultParcelTemplate.md +++ b/docs/Models/Components/DefaultParcelTemplate.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `result` | [?\Shippo\API\Models\Components\UserParcelTemplate](../../Models/Components/UserParcelTemplate.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `result` | [?Components\UserParcelTemplate](../../Models/Components/UserParcelTemplate.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/DutiesPayor.md b/docs/Models/Components/DutiesPayor.md new file mode 100644 index 0000000..e8ba749 --- /dev/null +++ b/docs/Models/Components/DutiesPayor.md @@ -0,0 +1,12 @@ +# DutiesPayor + +Specifies who will pay the duties for the shipment. Only accepted for FedEx shipments. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `account` | *?string* | :heavy_minus_sign: | Account number to be billed for duties. | 2323434543 | +| `type` | [?Components\CustomsDeclarationCreateRequestType](../../Models/Components/CustomsDeclarationCreateRequestType.md) | :heavy_minus_sign: | Party to be billed for duties. | THIRD_PARTY | +| `address` | [?Components\CustomsDeclarationCreateRequestAddress](../../Models/Components/CustomsDeclarationCreateRequestAddress.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/FedExConnectExistingOwnAccountParameters.md b/docs/Models/Components/FedExConnectExistingOwnAccountParameters.md new file mode 100644 index 0000000..ef1bb33 --- /dev/null +++ b/docs/Models/Components/FedExConnectExistingOwnAccountParameters.md @@ -0,0 +1,15 @@ +# FedExConnectExistingOwnAccountParameters + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `firstName` | *string* | :heavy_check_mark: | First name of the account holder | +| `lastName` | *string* | :heavy_check_mark: | Last name of the account holder | +| `phoneNumber` | *string* | :heavy_check_mark: | Phone number of the account holder | +| `fromAddressSt` | *string* | :heavy_check_mark: | Street address of the account holder | +| `fromAddressCity` | *string* | :heavy_check_mark: | City of the account holder | +| `fromAddressState` | *string* | :heavy_check_mark: | State of the account holder | +| `fromAddressZip` | *string* | :heavy_check_mark: | Zip code of the account holder | +| `fromAddressCountryIso2` | *string* | :heavy_check_mark: | Country of the account holder | \ No newline at end of file diff --git a/docs/Models/Components/InstantTransactionCreateRequest.md b/docs/Models/Components/InstantTransactionCreateRequest.md new file mode 100644 index 0000000..fb1aefc --- /dev/null +++ b/docs/Models/Components/InstantTransactionCreateRequest.md @@ -0,0 +1,14 @@ +# InstantTransactionCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `carrierAccount` | *string* | :heavy_check_mark: | N/A | b741b99f95e841639b54272834bc478c | +| `servicelevelToken` | *string* | :heavy_check_mark: | N/A | usps_priority | +| `shipment` | [Components\ShipmentCreateRequest](../../Models/Components/ShipmentCreateRequest.md) | :heavy_check_mark: | N/A | | +| `async` | *?bool* | :heavy_minus_sign: | N/A | false | +| `labelFileType` | [?Components\LabelFileType](../../Models/Components/LabelFileType.md) | :heavy_minus_sign: | N/A | PDF | +| `metadata` | *?string* | :heavy_minus_sign: | N/A | Order ID #12345 | +| `order` | *?string* | :heavy_minus_sign: | N/A | adcfdddf8ec64b84ad22772bce3ea37a | \ No newline at end of file diff --git a/docs/Models/Components/Insurance.md b/docs/Models/Components/Insurance.md index fbe3ab9..3e6eb5b 100644 --- a/docs/Models/Components/Insurance.md +++ b/docs/Models/Components/Insurance.md @@ -1,6 +1,9 @@ # Insurance -To add 3rd party insurance powered by XCover, specify
`amount`, `content`, and `currency`.
Alternatively, you can choose carrier provided insurance by additionally specifying `provider` (UPS, FedEx and OnTrac only).

If you do not want to add insurance to you shipment, do not set these parameters. +To add 3rd party insurance powered by XCover, +specify
`amount`, `content`, and `currency`.
Alternatively, you can choose carrier provided insurance +by additionally specifying `provider` (UPS, FedEx and OnTrac only).

If you do not want to add insurance +to your shipment, do not set these parameters. ## Fields @@ -10,4 +13,4 @@ To add 3rd party insurance powered by supported for DHL Express. | Front Door | -| `buildingType` | [?\Shippo\API\Models\Components\BuildingType](../../Models/Components/BuildingType.md) | :heavy_minus_sign: | The type of building where the pickup is located. | apartment | +| `address` | [Components\AddressCompleteCreateRequest](../../Models/Components/AddressCompleteCreateRequest.md) | :heavy_check_mark: | The pickup address, which includes your name, company name, street address, city, state, zip code,
country, phone number, and email address (strings). Special characters should not be included in
any address element, especially name, company, and email. | | +| `buildingLocationType` | [Components\BuildingLocationType](../../Models/Components/BuildingLocationType.md) | :heavy_check_mark: | Where your parcels will be available for pickup. "Security Deck" and "Shipping Dock" are only
supported for DHL Express. | Front Door | +| `buildingType` | [?Components\BuildingType](../../Models/Components/BuildingType.md) | :heavy_minus_sign: | The type of building where the pickup is located. | apartment | | `instructions` | *?string* | :heavy_minus_sign: | Pickup instructions for the courier. This is a mandatory field if the building_location_type is "Other". | Behind screen door | \ No newline at end of file diff --git a/docs/Models/Components/Longitude.md b/docs/Models/Components/Longitude.md new file mode 100644 index 0000000..dd23018 --- /dev/null +++ b/docs/Models/Components/Longitude.md @@ -0,0 +1,23 @@ +# Longitude + + +## Supported Types + +### `float` + +```php +/** +* @var float +*/ +float $value = /* values here */ +``` + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + diff --git a/docs/Models/Components/Manifest.md b/docs/Models/Components/Manifest.md index bdb3966..a5ce450 100644 --- a/docs/Models/Components/Manifest.md +++ b/docs/Models/Components/Manifest.md @@ -7,12 +7,12 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `carrierAccount` | *string* | :heavy_check_mark: | ID of carrier account | adcfdddf8ec64b84ad22772bce3ea37a | | `shipmentDate` | *string* | :heavy_check_mark: | All shipments to be submitted on this day will be closed out.
Must be in the format `2014-01-18T00:35:03.463Z` (ISO 8601 date). | 2014-05-16T23:59:59Z | -| `transactions` | array<*string*> | :heavy_minus_sign: | IDs transactions to use. If you set this to null or not send this parameter,
Shippo will automatically assign all applicable transactions. | [
"adcfdddf8ec64b84ad22772bce3ea37a"
] | | `addressFrom` | *string* | :heavy_check_mark: | ID of the Address object that should be used as pickup address for the scan form.
The USPS will validate this address before creating the scan form. | d799c2679e644279b59fe661ac8fa488 | | `documents` | array<*string*> | :heavy_check_mark: | An array containing the URLs to all returned manifest documents. | [
"https://shippo-delivery.s3.amazonaws.com/0fadebf6f60c4aca95fa01bcc59c79ae.pdf?Signature=tlQU3RECwdHUQJQadwqg5bAzGFQ%3D\u0026Expires=1402803835\u0026AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA"
] | -| `errors` | array<*string*> | :heavy_minus_sign: | An array of codes and messages describing the error that occurred if any. | | | `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Date and time of object creation. | | | `objectId` | *string* | :heavy_check_mark: | Unique identifier of the given object. | adcfdddf8ec64b84ad22772bce3ea37a | | `objectOwner` | *string* | :heavy_check_mark: | Username of the user who created the object. | shippotle@shippo.com | | `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Date and time of last object update. | | -| `status` | [\Shippo\API\Models\Components\ManifestStatus](../../Models/Components/ManifestStatus.md) | :heavy_check_mark: | Indicates the status of the manifest. | SUCCESS | \ No newline at end of file +| `status` | [Components\ManifestStatus](../../Models/Components/ManifestStatus.md) | :heavy_check_mark: | Indicates the status of the manifest. | SUCCESS | +| `transactions` | array<*string*> | :heavy_minus_sign: | IDs transactions to use. If you set this to null or not send this parameter,
Shippo will automatically assign all applicable transactions. | [
"adcfdddf8ec64b84ad22772bce3ea37a"
] | +| `errors` | array<*string*> | :heavy_minus_sign: | An array of codes and messages describing the error that occurred if any. | | \ No newline at end of file diff --git a/docs/Models/Components/ManifestCreateRequest.md b/docs/Models/Components/ManifestCreateRequest.md index 1c18884..c8d6681 100644 --- a/docs/Models/Components/ManifestCreateRequest.md +++ b/docs/Models/Components/ManifestCreateRequest.md @@ -7,6 +7,6 @@ | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | `carrierAccount` | *string* | :heavy_check_mark: | ID of carrier account | adcfdddf8ec64b84ad22772bce3ea37a | | `shipmentDate` | *string* | :heavy_check_mark: | All shipments to be submitted on this day will be closed out.
Must be in the format `2014-01-18T00:35:03.463Z` (ISO 8601 date). | 2014-05-16T23:59:59Z | +| `addressFrom` | [Components\AddressCreateRequest\|string](../../Models/Components/ManifestCreateRequestAddressFrom.md) | :heavy_check_mark: | N/A | | | `transactions` | array<*string*> | :heavy_minus_sign: | IDs transactions to use. If you set this to null or not send this parameter,
Shippo will automatically assign all applicable transactions. | [
"adcfdddf8ec64b84ad22772bce3ea37a"
] | -| `addressFrom` | *mixed* | :heavy_check_mark: | N/A | | | `async` | *?bool* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/ManifestCreateRequestAddressFrom.md b/docs/Models/Components/ManifestCreateRequestAddressFrom.md new file mode 100644 index 0000000..93c1e53 --- /dev/null +++ b/docs/Models/Components/ManifestCreateRequestAddressFrom.md @@ -0,0 +1,23 @@ +# ManifestCreateRequestAddressFrom + + +## Supported Types + +### `Components\AddressCreateRequest` + +```php +/** +* @var Components\AddressCreateRequest +*/ +Components\AddressCreateRequest $value = /* values here */ +``` + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + diff --git a/docs/Models/Components/ManifestPaginatedList.md b/docs/Models/Components/ManifestPaginatedList.md index eda1bcd..1dca3f3 100644 --- a/docs/Models/Components/ManifestPaginatedList.md +++ b/docs/Models/Components/ManifestPaginatedList.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\Manifest](../../Models/Components/Manifest.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\Manifest](../../Models/Components/Manifest.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/ObjectInfo.md b/docs/Models/Components/ObjectInfo.md index c86ef9a..58ec3fb 100644 --- a/docs/Models/Components/ObjectInfo.md +++ b/docs/Models/Components/ObjectInfo.md @@ -5,6 +5,6 @@ Holds internal state relevant to users. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `authentication` | [?\Shippo\API\Models\Components\Authentication](../../Models/Components/Authentication.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `authentication` | [?Components\Authentication](../../Models/Components/Authentication.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/Order.md b/docs/Models/Components/Order.md index 1d3954c..2764e79 100644 --- a/docs/Models/Components/Order.md +++ b/docs/Models/Components/Order.md @@ -5,11 +5,12 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `placedAt` | *string* | :heavy_check_mark: | Date and time when the order was placed. This datetime can be different from the datetime of the order object creation on Shippo. | 2016-09-23T01:28:12Z | +| `toAddress` | [Components\Address](../../Models/Components/Address.md) | :heavy_check_mark: |
Address object of the recipient / buyer. Will be returned expanded by default. | | | `currency` | *?string* | :heavy_minus_sign: | **Required if total_price is provided**

Currency of the total_price and total_tax amounts. | USD | | `notes` | *?string* | :heavy_minus_sign: | Custom buyer- or seller-provided notes about the order. | This customer is a VIP | | `orderNumber` | *?string* | :heavy_minus_sign: | An alphanumeric identifier for the order used by the seller/buyer. This identifier doesn't need to be unique. | #1068 | -| `orderStatus` | [?\Shippo\API\Models\Components\OrderStatusEnum](../../Models/Components/OrderStatusEnum.md) | :heavy_minus_sign: | Current state of the order. See the orders tutorial
for the logic of how the status is handled. | PAID | -| `placedAt` | *string* | :heavy_check_mark: | Date and time when the order was placed. This datetime can be different from the datetime of the order object creation on Shippo. | 2016-09-23T01:28:12Z | +| `orderStatus` | [?Components\OrderStatusEnum](../../Models/Components/OrderStatusEnum.md) | :heavy_minus_sign: | Current state of the order. See the orders tutorial
for the logic of how the status is handled. | PAID | | `shippingCost` | *?string* | :heavy_minus_sign: | Amount paid by the buyer for shipping. This amount can be different from the price the seller will actually pay for shipping. | 12.83 | | `shippingCostCurrency` | *?string* | :heavy_minus_sign: | **Required if shipping_cost is provided**

Currency of the shipping_cost amount. | USD | | `shippingMethod` | *?string* | :heavy_minus_sign: | Shipping method (carrier + service or other free text description) chosen by the buyer.
This value can be different from the shipping method the seller will actually choose. | USPS First Class Package | @@ -17,11 +18,10 @@ | `totalPrice` | *?string* | :heavy_minus_sign: | Total amount paid by the buyer for this order. | 24.93 | | `totalTax` | *?string* | :heavy_minus_sign: | Total tax amount paid by the buyer for this order. | 0.0 | | `weight` | *?string* | :heavy_minus_sign: | Total weight of the order. | 0.4 | -| `weightUnit` | [?\Shippo\API\Models\Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_minus_sign: | The unit used for weight. | lb | -| `fromAddress` | [?\Shippo\API\Models\Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | Address object of the sender / seller. Will be returned expanded by default. | | -| `toAddress` | [\Shippo\API\Models\Components\Address](../../Models/Components/Address.md) | :heavy_check_mark: | Address object of the recipient / buyer. Will be returned expanded by default. | | -| `lineItems` | array<[\Shippo\API\Models\Components\LineItem](../../Models/Components/LineItem.md)> | :heavy_minus_sign: | Array of line item objects representing the items in this order.
All objects will be returned expanded by default. | | +| `weightUnit` | [?Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_minus_sign: | The unit used for weight. | lb | +| `fromAddress` | [?Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | Address object of the sender / seller. Will be returned expanded by default. | | +| `lineItems` | array<[Components\LineItem](../../Models/Components/LineItem.md)> | :heavy_minus_sign: | Array of line item objects representing the items in this order.
All objects will be returned expanded by default. | | | `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the order object. | adcfdddf8ec64b84ad22772bce3ea37a | | `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the object. | shippotle@shippo.com | -| `shopApp` | [?\Shippo\API\Models\Components\ShopApp](../../Models/Components/ShopApp.md) | :heavy_minus_sign: | Platform the order was created on and, if applicable, imported from.
Orders created via the Shippo API or dashboard will have the value "Shippo". | Shippo | -| `transactions` | array<*string*> | :heavy_minus_sign: | Array of transaction objects representing all shipping labels purchased for this order.
All objects are returned expanded with a limited number of fields by default. | | \ No newline at end of file +| `shopApp` | [?Components\OrderShopAppEnum](../../Models/Components/OrderShopAppEnum.md) | :heavy_minus_sign: | Platform the order was created on and, if applicable, imported from.
Orders created via the Shippo API or dashboard will have the value "Shippo". | Shippo | +| `transactions` | array<[Components\Transactions](../../Models/Components/Transactions.md)> | :heavy_minus_sign: | Array of transaction objects representing all shipping labels purchased for this order.
All objects are returned expanded with a limited number of fields by default. | | \ No newline at end of file diff --git a/docs/Models/Components/OrderCreateRequest.md b/docs/Models/Components/OrderCreateRequest.md index 16d668b..aa31a8c 100644 --- a/docs/Models/Components/OrderCreateRequest.md +++ b/docs/Models/Components/OrderCreateRequest.md @@ -5,11 +5,12 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `placedAt` | *string* | :heavy_check_mark: | Date and time when the order was placed. This datetime can be different from the datetime of the order object creation on Shippo. | 2016-09-23T01:28:12Z | +| `toAddress` | [Components\AddressCreateRequest](../../Models/Components/AddressCreateRequest.md) | :heavy_check_mark: | Address object of the recipient / buyer. Will be returned expanded by default. | | | `currency` | *?string* | :heavy_minus_sign: | **Required if total_price is provided**

Currency of the total_price and total_tax amounts. | USD | | `notes` | *?string* | :heavy_minus_sign: | Custom buyer- or seller-provided notes about the order. | This customer is a VIP | | `orderNumber` | *?string* | :heavy_minus_sign: | An alphanumeric identifier for the order used by the seller/buyer. This identifier doesn't need to be unique. | #1068 | -| `orderStatus` | [?\Shippo\API\Models\Components\OrderStatusEnum](../../Models/Components/OrderStatusEnum.md) | :heavy_minus_sign: | Current state of the order. See the orders tutorial
for the logic of how the status is handled. | PAID | -| `placedAt` | *string* | :heavy_check_mark: | Date and time when the order was placed. This datetime can be different from the datetime of the order object creation on Shippo. | 2016-09-23T01:28:12Z | +| `orderStatus` | [?Components\OrderStatusEnum](../../Models/Components/OrderStatusEnum.md) | :heavy_minus_sign: | Current state of the order. See the orders tutorial
for the logic of how the status is handled. | PAID | | `shippingCost` | *?string* | :heavy_minus_sign: | Amount paid by the buyer for shipping. This amount can be different from the price the seller will actually pay for shipping. | 12.83 | | `shippingCostCurrency` | *?string* | :heavy_minus_sign: | **Required if shipping_cost is provided**

Currency of the shipping_cost amount. | USD | | `shippingMethod` | *?string* | :heavy_minus_sign: | Shipping method (carrier + service or other free text description) chosen by the buyer.
This value can be different from the shipping method the seller will actually choose. | USPS First Class Package | @@ -17,7 +18,6 @@ | `totalPrice` | *?string* | :heavy_minus_sign: | Total amount paid by the buyer for this order. | 24.93 | | `totalTax` | *?string* | :heavy_minus_sign: | Total tax amount paid by the buyer for this order. | 0.0 | | `weight` | *?string* | :heavy_minus_sign: | Total weight of the order. | 0.4 | -| `weightUnit` | [?\Shippo\API\Models\Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_minus_sign: | The unit used for weight. | lb | -| `fromAddress` | [?\Shippo\API\Models\Components\AddressCreateRequest](../../Models/Components/AddressCreateRequest.md) | :heavy_minus_sign: | Address object of the sender / seller. Will be returned expanded by default.. | | -| `toAddress` | [\Shippo\API\Models\Components\AddressCreateRequest](../../Models/Components/AddressCreateRequest.md) | :heavy_check_mark: | Address object of the recipient / buyer. Will be returned expanded by default. | | -| `lineItems` | array<[\Shippo\API\Models\Components\LineItemBase](../../Models/Components/LineItemBase.md)> | :heavy_minus_sign: | Array of line item objects representing the items in this order.
All objects will be returned expanded by default. | | \ No newline at end of file +| `weightUnit` | [?Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_minus_sign: | The unit used for weight. | lb | +| `fromAddress` | [?Components\AddressCreateRequest](../../Models/Components/AddressCreateRequest.md) | :heavy_minus_sign: | Address object of the sender / seller. Will be returned expanded by default.. | | +| `lineItems` | array<[Components\LineItemBase](../../Models/Components/LineItemBase.md)> | :heavy_minus_sign: | Array of line item objects representing the items in this order.
All objects will be returned expanded by default. | | \ No newline at end of file diff --git a/docs/Models/Components/OrderPaginatedList.md b/docs/Models/Components/OrderPaginatedList.md index e93427d..4ce936b 100644 --- a/docs/Models/Components/OrderPaginatedList.md +++ b/docs/Models/Components/OrderPaginatedList.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\Order](../../Models/Components/Order.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\Order](../../Models/Components/Order.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/ShopApp.md b/docs/Models/Components/OrderShopAppEnum.md similarity index 93% rename from docs/Models/Components/ShopApp.md rename to docs/Models/Components/OrderShopAppEnum.md index 4977b34..7cbcaeb 100644 --- a/docs/Models/Components/ShopApp.md +++ b/docs/Models/Components/OrderShopAppEnum.md @@ -1,4 +1,4 @@ -# ShopApp +# OrderShopAppEnum Platform the order was created on and, if applicable, imported from. Orders created via the Shippo API or dashboard will have the value "Shippo". @@ -20,5 +20,6 @@ Orders created via the Shippo API or dashboard will have the value "Shippo". | `Shopify` | Shopify | | `Spreecommerce` | Spreecommerce | | `StripeRelay` | StripeRelay | +| `Walmart` | Walmart | | `Weebly` | Weebly | | `WooCommerce` | WooCommerce | \ No newline at end of file diff --git a/docs/Models/Components/Parameters.md b/docs/Models/Components/Parameters.md new file mode 100644 index 0000000..78cb82d --- /dev/null +++ b/docs/Models/Components/Parameters.md @@ -0,0 +1,32 @@ +# Parameters + + +## Supported Types + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + +### `Components\FedExConnectExistingOwnAccountParameters` + +```php +/** +* @var Components\FedExConnectExistingOwnAccountParameters +*/ +Components\FedExConnectExistingOwnAccountParameters $value = /* values here */ +``` + +### `Components\UPSConnectExistingOwnAccountParameters` + +```php +/** +* @var Components\UPSConnectExistingOwnAccountParameters +*/ +Components\UPSConnectExistingOwnAccountParameters $value = /* values here */ +``` + diff --git a/docs/Models/Components/Parcel.md b/docs/Models/Components/Parcel.md index e81dc1b..e103302 100644 --- a/docs/Models/Components/Parcel.md +++ b/docs/Models/Components/Parcel.md @@ -3,20 +3,20 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `extra` | [?\Shippo\API\Models\Components\ParcelExtra](../../Models/Components/ParcelExtra.md) | :heavy_minus_sign: | An object holding optional extra services to be requested for each parcel in a multi-piece shipment.
See the Parcel Extra table below for all available services. | | -| `metadata` | *?string* | :heavy_minus_sign: | N/A | Customer ID 123456 | -| `massUnit` | [\Shippo\API\Models\Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_check_mark: | The unit used for weight. | lb | -| `weight` | *string* | :heavy_check_mark: | Weight of the parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | -| `distanceUnit` | [\Shippo\API\Models\Components\DistanceUnitEnum](../../Models/Components/DistanceUnitEnum.md) | :heavy_check_mark: | The measure unit used for length, width and height. | in | -| `height` | *string* | :heavy_check_mark: | Height of the parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | -| `length` | *string* | :heavy_check_mark: | Length of the Parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | -| `width` | *string* | :heavy_check_mark: | Width of the Parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | -| `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of Parcel creation. | 2014-07-09T02:19:13.174Z | -| `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the given Parcel object. This ID is required to create a Shipment object. | adcfdddf8ec64b84ad22772bce3ea37a | -| `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the Parcel object. | shippotle@shippo.com | -| `objectState` | [?\Shippo\API\Models\Components\ObjectState](../../Models/Components/ObjectState.md) | :heavy_minus_sign: | A Parcel will only be valid when all required values have been sent and validated successfully. | VALID | -| `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of last Parcel update. Since you cannot update Parcels after they were created, this time stamp reflects the time when the Parcel was changed by Shippo's systems for the last time, e.g., during sorting the dimensions given. | 2014-07-09T02:19:13.174Z | -| `template` | *mixed* | :heavy_minus_sign: | If template is passed, `length`, `width`, `height`, and `distance_unit` are not required | | -| `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `massUnit` | [Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_check_mark: | The unit used for weight. | lb | +| `weight` | *string* | :heavy_check_mark: | Weight of the parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | +| `distanceUnit` | [Components\DistanceUnitEnum](../../Models/Components/DistanceUnitEnum.md) | :heavy_check_mark: | The measure unit used for length, width and height. | in | +| `height` | *string* | :heavy_check_mark: | Height of the parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | +| `length` | *string* | :heavy_check_mark: | Length of the Parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | +| `width` | *string* | :heavy_check_mark: | Width of the Parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | +| `extra` | [?Components\ParcelExtra](../../Models/Components/ParcelExtra.md) | :heavy_minus_sign: | An object holding optional extra services to be requested for each parcel in a multi-piece shipment.
See the Parcel Extra table below for all available services. | | +| `metadata` | *?string* | :heavy_minus_sign: | N/A | Customer ID 123456 | +| `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of Parcel creation. | 2014-07-09T02:19:13.174Z | +| `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the given Parcel object. This ID is required to create a Shipment object. | adcfdddf8ec64b84ad22772bce3ea37a | +| `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the Parcel object. | shippotle@shippo.com | +| `objectState` | [?Components\ObjectState](../../Models/Components/ObjectState.md) | :heavy_minus_sign: | A Parcel will only be valid when all required values have been sent and validated successfully. | VALID | +| `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of last Parcel update. Since you cannot update Parcels after they were created, this time stamp reflects the time when the Parcel was changed by Shippo's systems for the last time, e.g., during sorting the dimensions given. | 2014-07-09T02:19:13.174Z | +| `template` | [Components\ParcelTemplateFedExEnum\|Components\ParcelTemplateUPSEnum\|Components\ParcelTemplateUSPSEnum\|Components\ParcelTemplateDHLeCommerceEnum\|Components\ParcelTemplateDPDUKEnum\|Components\ParcelTemplateCouriersPleaseEnum\|Components\ParcelTemplateAramexAustraliaEnum\|null](../../Models/Components/ParcelTemplateEnumSet.md) | :heavy_minus_sign: | If template is passed, `length`, `width`, `height`, and `distance_unit` are not required | | +| `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | | \ No newline at end of file diff --git a/docs/Models/Components/ParcelCreateFromTemplateRequest.md b/docs/Models/Components/ParcelCreateFromTemplateRequest.md new file mode 100644 index 0000000..88aac4f --- /dev/null +++ b/docs/Models/Components/ParcelCreateFromTemplateRequest.md @@ -0,0 +1,12 @@ +# ParcelCreateFromTemplateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `massUnit` | [Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_check_mark: | The unit used for weight. | lb | +| `weight` | *string* | :heavy_check_mark: | Weight of the parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | +| `template` | [Components\ParcelTemplateFedExEnum\|Components\ParcelTemplateUPSEnum\|Components\ParcelTemplateUSPSEnum\|Components\ParcelTemplateDHLeCommerceEnum\|Components\ParcelTemplateDPDUKEnum\|Components\ParcelTemplateCouriersPleaseEnum\|Components\ParcelTemplateAramexAustraliaEnum](../../Models/Components/ParcelTemplateEnumSet.md) | :heavy_check_mark: | If template is passed, `length`, `width`, `height`, and `distance_unit` are not required | | +| `extra` | [?Components\ParcelExtra](../../Models/Components/ParcelExtra.md) | :heavy_minus_sign: | An object holding optional extra services to be requested for each parcel in a multi-piece shipment.
See the Parcel Extra table below for all available services. | | +| `metadata` | *?string* | :heavy_minus_sign: | N/A | Customer ID 123456 | \ No newline at end of file diff --git a/docs/Models/Components/ParcelCreateRequest.md b/docs/Models/Components/ParcelCreateRequest.md new file mode 100644 index 0000000..5f55438 --- /dev/null +++ b/docs/Models/Components/ParcelCreateRequest.md @@ -0,0 +1,15 @@ +# ParcelCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `massUnit` | [Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_check_mark: | The unit used for weight. | lb | +| `weight` | *string* | :heavy_check_mark: | Weight of the parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | +| `distanceUnit` | [Components\DistanceUnitEnum](../../Models/Components/DistanceUnitEnum.md) | :heavy_check_mark: | The measure unit used for length, width and height. | in | +| `height` | *string* | :heavy_check_mark: | Height of the parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | +| `length` | *string* | :heavy_check_mark: | Length of the Parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | +| `width` | *string* | :heavy_check_mark: | Width of the Parcel. Up to six digits in front and four digits after the decimal separator are accepted. | 1 | +| `extra` | [?Components\ParcelExtra](../../Models/Components/ParcelExtra.md) | :heavy_minus_sign: | An object holding optional extra services to be requested for each parcel in a multi-piece shipment.
See the Parcel Extra table below for all available services. | | +| `metadata` | *?string* | :heavy_minus_sign: | N/A | Customer ID 123456 | \ No newline at end of file diff --git a/docs/Models/Components/ParcelExtra.md b/docs/Models/Components/ParcelExtra.md index b3259d1..afdc5b6 100644 --- a/docs/Models/Components/ParcelExtra.md +++ b/docs/Models/Components/ParcelExtra.md @@ -8,7 +8,7 @@ See the Parcel Extra table below for all av | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cod` | [?\Shippo\API\Models\Components\Cod](../../Models/Components/Cod.md) | :heavy_minus_sign: | Specify collection on delivery details (UPS only). | -| `insurance` | [?\Shippo\API\Models\Components\ParcelInsurance](../../Models/Components/ParcelInsurance.md) | :heavy_minus_sign: | To add insurace to your parcel, specify `amount`, `content` and `currency`.

If you do not want to add insurance to you parcel, do not set these parameters. | +| `cod` | [?Components\Cod](../../Models/Components/Cod.md) | :heavy_minus_sign: | Specify collection on delivery details (UPS only). | +| `insurance` | [?Components\ParcelInsurance](../../Models/Components/ParcelInsurance.md) | :heavy_minus_sign: | To add insurace to your parcel, specify `amount`, `content` and `currency`.

If you do not want to add insurance to you parcel, do not set these parameters. | | `reference1` | *?string* | :heavy_minus_sign: | Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. | | `reference2` | *?string* | :heavy_minus_sign: | Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. | \ No newline at end of file diff --git a/docs/Models/Components/ParcelInsurance.md b/docs/Models/Components/ParcelInsurance.md index 73f4692..eb65a54 100644 --- a/docs/Models/Components/ParcelInsurance.md +++ b/docs/Models/Components/ParcelInsurance.md @@ -10,4 +10,4 @@ To add insurace to your parcel, specify `amount`, `content` and `currency`.
| `amount` | *?string* | :heavy_minus_sign: | Declared value of the goods you want to insure. | 5.5 | | `content` | *?string* | :heavy_minus_sign: | Description of parcel content. | Laptop | | `currency` | *?string* | :heavy_minus_sign: | Currency for the amount value. Currently only USD is supported for FedEx and UPS. | USD | -| `provider` | [?\Shippo\API\Models\Components\ParcelInsuranceProvider](../../Models/Components/ParcelInsuranceProvider.md) | :heavy_minus_sign: | To have insurance cover provided by a carrier directly instead of Shippo's provider (XCover), set provider to `FEDEX`, `UPS`, or `ONTRAC`. | UPS | \ No newline at end of file +| `provider` | [?Components\ParcelInsuranceProvider](../../Models/Components/ParcelInsuranceProvider.md) | :heavy_minus_sign: | To have insurance cover provided by a carrier directly instead of Shippo's provider (XCover), set provider to `FEDEX`, `UPS`, or `ONTRAC`. | UPS | \ No newline at end of file diff --git a/docs/Models/Components/ParcelPaginatedList.md b/docs/Models/Components/ParcelPaginatedList.md index 747a3de..d1a1627 100644 --- a/docs/Models/Components/ParcelPaginatedList.md +++ b/docs/Models/Components/ParcelPaginatedList.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\Parcel](../../Models/Components/Parcel.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\Parcel](../../Models/Components/Parcel.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/ParcelTemplateAramexAustraliaEnum.md b/docs/Models/Components/ParcelTemplateAramexAustraliaEnum.md new file mode 100644 index 0000000..5b69260 --- /dev/null +++ b/docs/Models/Components/ParcelTemplateAramexAustraliaEnum.md @@ -0,0 +1,19 @@ +# ParcelTemplateAramexAustraliaEnum + +|Token | Name | Dimensions| +|:---|:---|:---| +| Fastway_Australia_Satchel_A2 | Satchel A2 | 594.00 x 420.00 x 48.00 mm| +| Fastway_Australia_Satchel_A3 | Satchel A3 | 420.00 x 297.00 x 64.00 mm| +| Fastway_Australia_Satchel_A4 | Satchel A4 | 297.00 x 210.00 x 64.00 mm| +| Fastway_Australia_Satchel_A5 | Satchel A5 | 210.00 x 148.00 x 64.00 mm| + + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `FastwayAustraliaSatchelA2` | Fastway_Australia_Satchel_A2 | +| `FastwayAustraliaSatchelA3` | Fastway_Australia_Satchel_A3 | +| `FastwayAustraliaSatchelA4` | Fastway_Australia_Satchel_A4 | +| `FastwayAustraliaSatchelA5` | Fastway_Australia_Satchel_A5 | \ No newline at end of file diff --git a/docs/Models/Components/ParcelTemplateCouriersPleaseEnum.md b/docs/Models/Components/ParcelTemplateCouriersPleaseEnum.md new file mode 100644 index 0000000..0e860b5 --- /dev/null +++ b/docs/Models/Components/ParcelTemplateCouriersPleaseEnum.md @@ -0,0 +1,19 @@ +# ParcelTemplateCouriersPleaseEnum + +|Token | Name | Dimensions| +|:---|:---|:---| +| couriersplease_500g_satchel | 500g Satchel | 22.00 x 33.50 x 0.10 cm| +| couriersplease_1kg_satchel | 1kg Satchel | 28.00 x 35.00 x 0.10 cm| +| couriersplease_3kg_satchel | 3kg Satchel | 34.00 x 42.00 x 0.10 cm| +| couriersplease_5kg_satchel | 5kg Satchel | 43.70 x 59.70 x 0.10 cm| + + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `Couriersplease500gSatchel` | couriersplease_500g_satchel | +| `Couriersplease1kgSatchel` | couriersplease_1kg_satchel | +| `Couriersplease3kgSatchel` | couriersplease_3kg_satchel | +| `Couriersplease5kgSatchel` | couriersplease_5kg_satchel | \ No newline at end of file diff --git a/docs/Models/Components/ParcelTemplateDHLeCommerceEnum.md b/docs/Models/Components/ParcelTemplateDHLeCommerceEnum.md new file mode 100644 index 0000000..9dfb294 --- /dev/null +++ b/docs/Models/Components/ParcelTemplateDHLeCommerceEnum.md @@ -0,0 +1,15 @@ +# ParcelTemplateDHLeCommerceEnum + +|Token | Name | Dimensions| +|:---|:---|:---| +| DHLeC_Irregular | Irregular Shipment | 10.00 x 10.00 x 10.00 in| +| DHLeC_SM_Flats | Flats | 27.00 x 17.00 x 17.00 in| + + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `DHLeCIrregular` | DHLeC_Irregular | +| `DHLeCSMFlats` | DHLeC_SM_Flats | \ No newline at end of file diff --git a/docs/Models/Components/ParcelTemplateDPDUKEnum.md b/docs/Models/Components/ParcelTemplateDPDUKEnum.md new file mode 100644 index 0000000..a4d1054 --- /dev/null +++ b/docs/Models/Components/ParcelTemplateDPDUKEnum.md @@ -0,0 +1,13 @@ +# ParcelTemplateDPDUKEnum + +|Token | Name | Dimensions| +|:---|:---|:---| +| DPD_UK_Express_Pak| DPD UK Express Pak | 530.00 x 400.00 x 100.00 mm| + + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `DPDUKExpressPak` | DPD_UK_Express_Pak | \ No newline at end of file diff --git a/docs/Models/Components/ParcelTemplateEnumSet.md b/docs/Models/Components/ParcelTemplateEnumSet.md new file mode 100644 index 0000000..4e682e9 --- /dev/null +++ b/docs/Models/Components/ParcelTemplateEnumSet.md @@ -0,0 +1,70 @@ +# ParcelTemplateEnumSet + +If template is passed, `length`, `width`, `height`, and `distance_unit` are not required + + +## Supported Types + +### `Components\ParcelTemplateFedExEnum` + +```php +/** +* @var Components\ParcelTemplateFedExEnum +*/ +Components\ParcelTemplateFedExEnum $value = /* values here */ +``` + +### `Components\ParcelTemplateUPSEnum` + +```php +/** +* @var Components\ParcelTemplateUPSEnum +*/ +Components\ParcelTemplateUPSEnum $value = /* values here */ +``` + +### `Components\ParcelTemplateUSPSEnum` + +```php +/** +* @var Components\ParcelTemplateUSPSEnum +*/ +Components\ParcelTemplateUSPSEnum $value = /* values here */ +``` + +### `Components\ParcelTemplateDHLeCommerceEnum` + +```php +/** +* @var Components\ParcelTemplateDHLeCommerceEnum +*/ +Components\ParcelTemplateDHLeCommerceEnum $value = /* values here */ +``` + +### `Components\ParcelTemplateDPDUKEnum` + +```php +/** +* @var Components\ParcelTemplateDPDUKEnum +*/ +Components\ParcelTemplateDPDUKEnum $value = /* values here */ +``` + +### `Components\ParcelTemplateCouriersPleaseEnum` + +```php +/** +* @var Components\ParcelTemplateCouriersPleaseEnum +*/ +Components\ParcelTemplateCouriersPleaseEnum $value = /* values here */ +``` + +### `Components\ParcelTemplateAramexAustraliaEnum` + +```php +/** +* @var Components\ParcelTemplateAramexAustraliaEnum +*/ +Components\ParcelTemplateAramexAustraliaEnum $value = /* values here */ +``` + diff --git a/docs/Models/Components/ParcelTemplateFedExEnum.md b/docs/Models/Components/ParcelTemplateFedExEnum.md new file mode 100644 index 0000000..7fba55f --- /dev/null +++ b/docs/Models/Components/ParcelTemplateFedExEnum.md @@ -0,0 +1,43 @@ +# ParcelTemplateFedExEnum + +|Token | Name | Dimensions| +|:---|:---|:---| +| FedEx_Box_10kg | FedEx® 10kg Box | 15.81 x 12.94 x 10.19 in| +| FedEx_Box_25kg | FedEx® 25kg Box | 54.80 x 42.10 x 33.50 in| +| FedEx_Box_Extra_Large_1 | FedEx® Extra Large Box (X1) | 11.88 x 11.00 x 10.75 in| +| FedEx_Box_Extra_Large_2 | FedEx® Extra Large Box (X2) | 15.75 x 14.13 x 6.00 in| +| FedEx_Box_Large_1 | FedEx® Large Box (L1) | 17.50 x 12.38 x 3.00 in| +| FedEx_Box_Large_2 | FedEx® Large Box (L2) | 11.25 x 8.75 x 7.75 in| +| FedEx_Box_Medium_1 | FedEx® Medium Box (M1) | 13.25 x 11.50 x 2.38 in| +| FedEx_Box_Medium_2 | FedEx® Medium Box (M2) | 11.25 x 8.75 x 4.38 in| +| FedEx_Box_Small_1 | FedEx® Small Box (S1) | 12.38 x 10.88 x 1.50 in| +| FedEx_Box_Small_2 | FedEx® Small Box (S2) | 11.25 x 8.75 x 4.38 in| +| FedEx_Envelope | FedEx® Envelope | 12.50 x 9.50 x 0.80 in| +| FedEx_Padded_Pak | FedEx® Padded Pak | 11.75 x 14.75 x 2.00 in| +| FedEx_Pak_1 | FedEx® Large Pak | 15.50 x 12.00 x 0.80 in| +| FedEx_Pak_2 | FedEx® Small Pak | 12.75 x 10.25 x 0.80 in| +| FedEx_Tube | FedEx® Tube | 38.00 x 6.00 x 6.00 in| +| FedEx_XL_Pak | FedEx® Extra Large Pak | 17.50 x 20.75 x 2.00 in| + + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `FedExBox10kg` | FedEx_Box_10kg | +| `FedExBox25kg` | FedEx_Box_25kg | +| `FedExBoxExtraLarge1` | FedEx_Box_Extra_Large_1 | +| `FedExBoxExtraLarge2` | FedEx_Box_Extra_Large_2 | +| `FedExBoxLarge1` | FedEx_Box_Large_1 | +| `FedExBoxLarge2` | FedEx_Box_Large_2 | +| `FedExBoxMedium1` | FedEx_Box_Medium_1 | +| `FedExBoxMedium2` | FedEx_Box_Medium_2 | +| `FedExBoxSmall1` | FedEx_Box_Small_1 | +| `FedExBoxSmall2` | FedEx_Box_Small_2 | +| `FedExEnvelope` | FedEx_Envelope | +| `FedExPaddedPak` | FedEx_Padded_Pak | +| `FedExPak1` | FedEx_Pak_1 | +| `FedExPak2` | FedEx_Pak_2 | +| `FedExTube` | FedEx_Tube | +| `FedExXLPak` | FedEx_XL_Pak | \ No newline at end of file diff --git a/docs/Models/Components/ParcelTemplateUPSEnum.md b/docs/Models/Components/ParcelTemplateUPSEnum.md new file mode 100644 index 0000000..19263ce --- /dev/null +++ b/docs/Models/Components/ParcelTemplateUPSEnum.md @@ -0,0 +1,61 @@ +# ParcelTemplateUPSEnum + +|Token | Name | Dimensions| +|:---|:---|:---| +| UPS_Box_10kg | Box 10kg | 410.00 x 335.00 x 265.00 mm| +| UPS_Box_25kg | Box 25kg | 484.00 x 433.00 x 350.00 mm| +| UPS_Express_Box | Express Box | 460.00 x 315.00 x 95.00 mm| +| UPS_Express_Box_Large | Express Box Large | 18.00 x 13.00 x 3.00 in| +| UPS_Express_Box_Medium | Express Box Medium | 15.00 x 11.00 x 3.00 in| +| UPS_Express_Box_Small | Express Box Small | 13.00 x 11.00 x 2.00 in| +| UPS_Express_Envelope | Express Envelope | 12.50 x 9.50 x 2.00 in| +| UPS_Express_Hard_Pak | Express Hard Pak | 14.75 x 11.50 x 2.00 in| +| UPS_Express_Legal_Envelope | Express Legal Envelope | 15.00 x 9.50 x 2.00 in| +| UPS_Express_Pak | Express Pak | 16.00 x 12.75 x 2.00 in| +| UPS_Express_Tube | Express Tube | 970.00 x 190.00 x 165.00 mm| +| UPS_Laboratory_Pak | Laboratory Pak | 17.25 x 12.75 x 2.00 in| +| UPS_MI_BPM | BPM (Mail Innovations - Domestic & International) | 0.00 x 0.00 x 0.00 in| +| UPS_MI_BPM_Flat | BPM Flat (Mail Innovations - Domestic & International) | 0.00 x 0.00 x 0.00 in| +| UPS_MI_BPM_Parcel | BPM Parcel (Mail Innovations - Domestic & International) | 0.00 x 0.00 x 0.00 in| +| UPS_MI_First_Class | First Class (Mail Innovations - Domestic only) | 0.00 x 0.00 x 0.00 in| +| UPS_MI_Flat | Flat (Mail Innovations - Domestic only) | 0.00 x 0.00 x 0.00 in| +| UPS_MI_Irregular | Irregular (Mail Innovations - Domestic only) | 0.00 x 0.00 x 0.00 in| +| UPS_MI_Machinable | Machinable (Mail Innovations - Domestic only) | 0.00 x 0.00 x 0.00 in| +| UPS_MI_MEDIA_MAIL | Media Mail (Mail Innovations - Domestic only) | 0.00 x 0.00 x 0.00 in| +| UPS_MI_Parcel_Post | Parcel Post (Mail Innovations - Domestic only) | 0.00 x 0.00 x 0.00 in| +| UPS_MI_Priority | Priority (Mail Innovations - Domestic only) | 0.00 x 0.00 x 0.00 in| +| UPS_MI_Standard_Flat | Standard Flat (Mail Innovations - Domestic only) | 0.00 x 0.00 x 0.00 in| +| UPS_Pad_Pak | Pad Pak | 14.75 x 11.00 x 2.00 in| +| UPS_Pallet | Pallet | 120.00 x 80.00 x 200.00 cm| + + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `UPSBox10kg` | UPS_Box_10kg | +| `UPSBox25kg` | UPS_Box_25kg | +| `UPSExpressBox` | UPS_Express_Box | +| `UPSExpressBoxLarge` | UPS_Express_Box_Large | +| `UPSExpressBoxMedium` | UPS_Express_Box_Medium | +| `UPSExpressBoxSmall` | UPS_Express_Box_Small | +| `UPSExpressEnvelope` | UPS_Express_Envelope | +| `UPSExpressHardPak` | UPS_Express_Hard_Pak | +| `UPSExpressLegalEnvelope` | UPS_Express_Legal_Envelope | +| `UPSExpressPak` | UPS_Express_Pak | +| `UPSExpressTube` | UPS_Express_Tube | +| `UPSLaboratoryPak` | UPS_Laboratory_Pak | +| `UpsMiBpm` | UPS_MI_BPM | +| `UPSMIBPMFlat` | UPS_MI_BPM_Flat | +| `UPSMIBPMParcel` | UPS_MI_BPM_Parcel | +| `UPSMIFirstClass` | UPS_MI_First_Class | +| `UPSMIFlat` | UPS_MI_Flat | +| `UPSMIIrregular` | UPS_MI_Irregular | +| `UPSMIMachinable` | UPS_MI_Machinable | +| `UpsMiMediaMail` | UPS_MI_MEDIA_MAIL | +| `UPSMIParcelPost` | UPS_MI_Parcel_Post | +| `UPSMIPriority` | UPS_MI_Priority | +| `UPSMIStandardFlat` | UPS_MI_Standard_Flat | +| `UPSPadPak` | UPS_Pad_Pak | +| `UPSPallet` | UPS_Pallet | \ No newline at end of file diff --git a/docs/Models/Components/ParcelTemplateUSPSEnum.md b/docs/Models/Components/ParcelTemplateUSPSEnum.md new file mode 100644 index 0000000..8cce38e --- /dev/null +++ b/docs/Models/Components/ParcelTemplateUSPSEnum.md @@ -0,0 +1,51 @@ +# ParcelTemplateUSPSEnum + +|Token | Name | Dimensions| +|:---|:---|:---| +| USPS_FlatRateCardboardEnvelope | Flat Rate Cardboard Envelope | 12.50 x 9.50 x 0.75 in | +| USPS_FlatRateEnvelope | Flat Rate Envelope | 12.50 x 9.50 x 0.75 in | +| USPS_FlatRateGiftCardEnvelope | Flat Rate Gift Card Envelope | 10.00 x 7.00 x 0.75 in | +| USPS_FlatRateLegalEnvelope | Flat Rate Legal Envelope | 15.00 x 9.50 x 0.75 in | +| USPS_FlatRatePaddedEnvelope | Flat Rate Padded Envelope | 12.50 x 9.50 x 1.00 in | +| USPS_FlatRateWindowEnvelope | Flat Rate Window Envelope | 10.00 x 5.00 x 0.75 in | +| USPS_IrregularParcel | Irregular Parcel | 0.00 x 0.00 x 0.00 in | +| USPS_LargeFlatRateBoardGameBox | Large Flat Rate Board Game Box | 24.06 x 11.88 x 3.13 in | +| USPS_LargeFlatRateBox | Large Flat Rate Box | 12.25 x 12.25 x 6.00 in | +| USPS_APOFlatRateBox | APO/FPO/DPO Large Flat Rate Box | 12.25 x 12.25 x 6.00 in | +| USPS_LargeVideoFlatRateBox | Flat Rate Large Video Box (Int'l only) | 9.60 x 6.40 x 2.20 in | +| USPS_MediumFlatRateBox1 | Medium Flat Rate Box 1 | 11.25 x 8.75 x 6.00 in | +| USPS_MediumFlatRateBox2 | Medium Flat Rate Box 2 | 14.00 x 12.00 x 3.50 in | +| USPS_RegionalRateBoxA1 | Regional Rate Box A1 | 10.13 x 7.13 x 5.00 in | +| USPS_RegionalRateBoxA2 | Regional Rate Box A2 | 13.06 x 11.06 x 2.50 in | +| USPS_RegionalRateBoxB1 | Regional Rate Box B1 | 12.25 x 10.50 x 5.50 in | +| USPS_RegionalRateBoxB2 | Regional Rate Box B2 | 16.25 x 14.50 x 3.00 in | +| USPS_SmallFlatRateBox | Small Flat Rate Box | 8.69 x 5.44 x 1.75 in | +| USPS_SmallFlatRateEnvelope | Small Flat Rate Envelope | 10.00 x 6.00 x 4.00 in | +| USPS_SoftPack | Soft Pack Padded Envelope | Length and width defined in the Parcel| + + + +## Values + +| Name | Value | +| ------------------------------- | ------------------------------- | +| `USPSFlatRateCardboardEnvelope` | USPS_FlatRateCardboardEnvelope | +| `USPSFlatRateEnvelope` | USPS_FlatRateEnvelope | +| `USPSFlatRateGiftCardEnvelope` | USPS_FlatRateGiftCardEnvelope | +| `USPSFlatRateLegalEnvelope` | USPS_FlatRateLegalEnvelope | +| `USPSFlatRatePaddedEnvelope` | USPS_FlatRatePaddedEnvelope | +| `USPSFlatRateWindowEnvelope` | USPS_FlatRateWindowEnvelope | +| `USPSIrregularParcel` | USPS_IrregularParcel | +| `USPSLargeFlatRateBoardGameBox` | USPS_LargeFlatRateBoardGameBox | +| `USPSLargeFlatRateBox` | USPS_LargeFlatRateBox | +| `USPSAPOFlatRateBox` | USPS_APOFlatRateBox | +| `USPSLargeVideoFlatRateBox` | USPS_LargeVideoFlatRateBox | +| `USPSMediumFlatRateBox1` | USPS_MediumFlatRateBox1 | +| `USPSMediumFlatRateBox2` | USPS_MediumFlatRateBox2 | +| `USPSRegionalRateBoxA1` | USPS_RegionalRateBoxA1 | +| `USPSRegionalRateBoxA2` | USPS_RegionalRateBoxA2 | +| `USPSRegionalRateBoxB1` | USPS_RegionalRateBoxB1 | +| `USPSRegionalRateBoxB2` | USPS_RegionalRateBoxB2 | +| `USPSSmallFlatRateBox` | USPS_SmallFlatRateBox | +| `USPSSmallFlatRateEnvelope` | USPS_SmallFlatRateEnvelope | +| `USPSSoftPack` | USPS_SoftPack | \ No newline at end of file diff --git a/docs/Models/Components/Parcels.md b/docs/Models/Components/Parcels.md new file mode 100644 index 0000000..95955f3 --- /dev/null +++ b/docs/Models/Components/Parcels.md @@ -0,0 +1,32 @@ +# Parcels + + +## Supported Types + +### `Components\ParcelCreateRequest` + +```php +/** +* @var Components\ParcelCreateRequest +*/ +Components\ParcelCreateRequest $value = /* values here */ +``` + +### `Components\ParcelCreateFromTemplateRequest` + +```php +/** +* @var Components\ParcelCreateFromTemplateRequest +*/ +Components\ParcelCreateFromTemplateRequest $value = /* values here */ +``` + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + diff --git a/docs/Models/Components/Pickup.md b/docs/Models/Components/Pickup.md index 292600d..d0cefb5 100644 --- a/docs/Models/Components/Pickup.md +++ b/docs/Models/Components/Pickup.md @@ -6,18 +6,18 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `carrierAccount` | *string* | :heavy_check_mark: | The object ID of your USPS or DHL Express carrier account.
You can retrieve this from your Rate requests or our Carrier Accounts endpoint. | adcfdddf8ec64b84ad22772bce3ea37a | -| `location` | [\Shippo\API\Models\Components\Location](../../Models/Components/Location.md) | :heavy_check_mark: | Location where the parcel(s) will be picked up. | | -| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you
want to attach to the object. | | +| `location` | [Components\Location](../../Models/Components/Location.md) | :heavy_check_mark: | Location where the parcel(s) will be picked up. | | | `requestedEndTime` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | The latest that you requested your parcels to be available for pickup.
Expressed in the timezone specified in the response. | | | `requestedStartTime` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | The earliest that you requested your parcels to be ready for pickup.
Expressed in the timezone specified in the response. | | | `transactions` | array<*string*> | :heavy_check_mark: | The transaction(s) object ID(s) for the parcel(s) that need to be picked up. | [
"adcfdddf8ec64b84ad22772bce3ea37a"
] | +| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you
want to attach to the object. | | | `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of Pickup creation. | | | `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the given Pickup object. | | | `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of last Pickup update. | | | `confirmedStartTime` | *?string* | :heavy_minus_sign: | The earliest that your parcels will be ready for pickup, confirmed by the carrier.
Expressed in the timezone specified in the response. | 2020-05-09T12:00:00Z | | `confirmedEndTime` | *?string* | :heavy_minus_sign: | The latest that your parcels will be available for pickup, confirmed by the carrier.
Expressed in the timezone specified in the response. | 2020-05-09T23:59:59.999Z | | `cancelByTime` | *?string* | :heavy_minus_sign: | The latest time to cancel a pickup. Expressed in the timezone specified in the response.
To cancel a pickup, you will need to contact the carrier directly.
The ability to cancel a pickup through Shippo may be released in future iterations. | 2020-05-09T08:00:00Z | -| `status` | [?\Shippo\API\Models\Components\PickupStatus](../../Models/Components/PickupStatus.md) | :heavy_minus_sign: | Indicates the status of the pickup. | CONFIRMED | +| `status` | [?Components\PickupStatus](../../Models/Components/PickupStatus.md) | :heavy_minus_sign: | Indicates the status of the pickup. | CONFIRMED | | `confirmationCode` | *?string* | :heavy_minus_sign: | Pickup's confirmation code returned by the carrier.
To edit or cancel a pickup, you will need to contact USPS or DHL Express directly and provide your `confirmation_code`. | WTC310058750 | | `timezone` | *?string* | :heavy_minus_sign: | The pickup time windows will be in the time zone specified here, not UTC. | US/Pacific | | `messages` | array<*string*> | :heavy_minus_sign: | An array containing strings of any messages generated during validation. | [] | diff --git a/docs/Models/Components/PickupBase.md b/docs/Models/Components/PickupBase.md index 92d0c47..3001608 100644 --- a/docs/Models/Components/PickupBase.md +++ b/docs/Models/Components/PickupBase.md @@ -6,8 +6,8 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `carrierAccount` | *string* | :heavy_check_mark: | The object ID of your USPS or DHL Express carrier account.
You can retrieve this from your Rate requests or our Carrier Accounts endpoint. | adcfdddf8ec64b84ad22772bce3ea37a | -| `location` | [\Shippo\API\Models\Components\Location](../../Models/Components/Location.md) | :heavy_check_mark: | Location where the parcel(s) will be picked up. | | -| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you
want to attach to the object. | | +| `location` | [Components\Location](../../Models/Components/Location.md) | :heavy_check_mark: | Location where the parcel(s) will be picked up. | | | `requestedEndTime` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | The latest that you requested your parcels to be available for pickup.
Expressed in the timezone specified in the response. | | | `requestedStartTime` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | The earliest that you requested your parcels to be ready for pickup.
Expressed in the timezone specified in the response. | | -| `transactions` | array<*string*> | :heavy_check_mark: | The transaction(s) object ID(s) for the parcel(s) that need to be picked up. | [
"adcfdddf8ec64b84ad22772bce3ea37a"
] | \ No newline at end of file +| `transactions` | array<*string*> | :heavy_check_mark: | The transaction(s) object ID(s) for the parcel(s) that need to be picked up. | [
"adcfdddf8ec64b84ad22772bce3ea37a"
] | +| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you
want to attach to the object. | | \ No newline at end of file diff --git a/docs/Models/Components/Rate.md b/docs/Models/Components/Rate.md index f951cfc..86a5de6 100644 --- a/docs/Models/Components/Rate.md +++ b/docs/Models/Components/Rate.md @@ -9,20 +9,20 @@ | `amountLocal` | *string* | :heavy_check_mark: | Final Rate price, expressed in the currency used in the recipient's country. | 5.5 | | `currency` | *string* | :heavy_check_mark: | Currency used in the sender's country, refers to `amount`.
The official ISO 4217 currency codes are used, e.g. `USD` or `EUR`. | USD | | `currencyLocal` | *string* | :heavy_check_mark: | Currency used in the recipient's country, refers to `amount_local`.
The official ISO 4217 currency codes are used, e.g. `USD` or "EUR". | USD | -| `arrivesBy` | *?string* | :heavy_minus_sign: | Predicted time the carrier will deliver the package in the destination's local time zone. In the format `HH:MM:SS`. | 08:30:00 | -| `attributes` | array<[\Shippo\API\Models\Components\Attributes](../../Models/Components/Attributes.md)> | :heavy_check_mark: | An array containing specific attributes of this Rate in context of the entire shipment.
Attributes can be assigned `CHEAPEST`, `FASTEST`, or `BESTVALUE`. | | +| `attributes` | array<[Components\Attributes](../../Models/Components/Attributes.md)> | :heavy_check_mark: | An array containing specific attributes of this Rate in context of the entire shipment.
Attributes can be assigned `CHEAPEST`, `FASTEST`, or `BESTVALUE`. | | | `carrierAccount` | *string* | :heavy_check_mark: | Object ID of the carrier account that has been used to retrieve the rate. | 078870331023437cb917f5187429b093 | -| `durationTerms` | *?string* | :heavy_minus_sign: | Further clarification of the transit times.
Often, this includes notes that the transit time as given in "days" is only an average, not a guaranteed time. | Delivery in 1 to 3 business days | -| `estimatedDays` | *?int* | :heavy_minus_sign: | Estimated transit time (duration) in days of the Parcel at the given servicelevel.
Please note that this is not binding, but only an average value as given by the provider.
Shippo is not able to guarantee any transit times. | 2 | -| `includedInsurancePrice` | *?string* | :heavy_minus_sign: | Cost to the user to insure the Rate for the requested amount of coverage, if insurance coverage was requested.
Expressed in the currency used in the sender's country. Will be null if no insurance coverage was requested, or if insurance is requested from a non-standard insurance provider.
Please note this price is already included in the `amount` and `amount_local` fields on the Rate. Do not add this field to them. | 1.05 | -| `messages` | array<[\Shippo\API\Models\Components\ResponseMessage](../../Models/Components/ResponseMessage.md)> | :heavy_minus_sign: | N/A | | | `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Date and time of Rate creation. | | | `objectId` | *string* | :heavy_check_mark: | Unique identifier of the given Rate object. | adcfdddf8ec64b84ad22772bce3ea37a | | `objectOwner` | *string* | :heavy_check_mark: | Username of the user who created the rate object. | pp@gmail.com | | `provider` | *string* | :heavy_check_mark: | Carrier offering the rate, e.g., `FedEx` or `Deutsche Post DHL`. | USPS | +| `servicelevel` | [Components\ServiceLevelWithParent](../../Models/Components/ServiceLevelWithParent.md) | :heavy_check_mark: | N/A | | +| `shipment` | *string* | :heavy_check_mark: | N/A | adcfdddf8ec64b84ad22772bce3ea37a | +| `arrivesBy` | *?string* | :heavy_minus_sign: | Predicted time the carrier will deliver the package in the destination's local time zone. In the format `HH:MM:SS`. | 08:30:00 | +| `durationTerms` | *?string* | :heavy_minus_sign: | Further clarification of the transit times.
Often, this includes notes that the transit time as given in "days" is only an average, not a guaranteed time. | Delivery in 1 to 3 business days | +| `estimatedDays` | *?int* | :heavy_minus_sign: | Estimated transit time (duration) in days of the Parcel at the given servicelevel.
Please note that this is not binding, but only an average value as given by the provider.
Shippo is not able to guarantee any transit times. | 2 | +| `includedInsurancePrice` | *?string* | :heavy_minus_sign: | Cost to the user to insure the Rate for the requested amount of coverage, if insurance coverage was requested.
Expressed in the currency used in the sender's country. Will be null if no insurance coverage was requested, or if insurance is requested from a non-standard insurance provider.
Please note this price is already included in the `amount` and `amount_local` fields on the Rate. Do not add this field to them. | 1.05 | +| `messages` | array<[Components\ResponseMessage](../../Models/Components/ResponseMessage.md)> | :heavy_minus_sign: | N/A | | | `providerImage75` | *?string* | :heavy_minus_sign: | URL to the provider logo with max. dimensions of 75*75px.
Please refer to the provider's Logo Usage Guidelines before using the logo. | https://cdn2.goshippo.com/providers/75/USPS.png | | `providerImage200` | *?string* | :heavy_minus_sign: | URL to the provider logo with max. dimensions of 200*200px.
Please refer to the provider's Logo Usage Guidelines before using the logo. | https://cdn2.goshippo.com/providers/200/USPS.png | -| `servicelevel` | [\Shippo\API\Models\Components\ServiceLevelWithParent](../../Models/Components/ServiceLevelWithParent.md) | :heavy_check_mark: | N/A | | -| `shipment` | *string* | :heavy_check_mark: | N/A | adcfdddf8ec64b84ad22772bce3ea37a | | `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | | | `zone` | *?string* | :heavy_minus_sign: | The parcel's transit zone token. These tokens can vary depending on the provider. | 1 | \ No newline at end of file diff --git a/docs/Models/Components/RatePaginatedList.md b/docs/Models/Components/RatePaginatedList.md index 673e1cb..89af374 100644 --- a/docs/Models/Components/RatePaginatedList.md +++ b/docs/Models/Components/RatePaginatedList.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\Rate](../../Models/Components/Rate.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\Rate](../../Models/Components/Rate.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/Refund.md b/docs/Models/Components/Refund.md index dd9a6cc..b2cb1cd 100644 --- a/docs/Models/Components/Refund.md +++ b/docs/Models/Components/Refund.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of object creation. | | -| `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the given object. | adcfdddf8ec64b84ad22772bce3ea37a | -| `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the object. | shippotle@shippo.com | -| `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of last object update. | | -| `status` | [?\Shippo\API\Models\Components\RefundStatus](../../Models/Components/RefundStatus.md) | :heavy_minus_sign: | Indicates the status of the Refund. | SUCCESS | -| `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | | -| `transaction` | *?string* | :heavy_minus_sign: | Object ID of the Transaction to be refunded. | 915d94940ea54c3a80cbfa328722f5a1 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of object creation. | | +| `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the given object. | adcfdddf8ec64b84ad22772bce3ea37a | +| `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the object. | shippotle@shippo.com | +| `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of last object update. | | +| `status` | [?Components\RefundStatus](../../Models/Components/RefundStatus.md) | :heavy_minus_sign: | Indicates the status of the Refund. | SUCCESS | +| `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | | +| `transaction` | *?string* | :heavy_minus_sign: | Object ID of the Transaction to be refunded. | 915d94940ea54c3a80cbfa328722f5a1 | \ No newline at end of file diff --git a/docs/Models/Components/RefundPaginatedList.md b/docs/Models/Components/RefundPaginatedList.md index 73a49ed..5ea6307 100644 --- a/docs/Models/Components/RefundPaginatedList.md +++ b/docs/Models/Components/RefundPaginatedList.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\Refund](../../Models/Components/Refund.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\Refund](../../Models/Components/Refund.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/RefundRequestBody.md b/docs/Models/Components/RefundRequestBody.md index 0ca5268..673ee2a 100644 --- a/docs/Models/Components/RefundRequestBody.md +++ b/docs/Models/Components/RefundRequestBody.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `async` | *?bool* | :heavy_minus_sign: | N/A | false | -| `transaction` | *string* | :heavy_check_mark: | N/A | 915d94940ea54c3a80cbfa328722f5a1 | \ No newline at end of file +| `transaction` | *string* | :heavy_check_mark: | N/A | 915d94940ea54c3a80cbfa328722f5a1 | +| `async` | *?bool* | :heavy_minus_sign: | N/A | false | \ No newline at end of file diff --git a/docs/Models/Components/ReturnServiceType.md b/docs/Models/Components/ReturnServiceType.md new file mode 100644 index 0000000..6de0364 --- /dev/null +++ b/docs/Models/Components/ReturnServiceType.md @@ -0,0 +1,25 @@ +# ReturnServiceType + +Request additional return option for return shipments (UPS and Lasership only). + + +## Supported Types + +### `Components\ShipmentExtraReturnServiceTypeUPSEnum` + +```php +/** +* @var Components\ShipmentExtraReturnServiceTypeUPSEnum +*/ +Components\ShipmentExtraReturnServiceTypeUPSEnum $value = /* values here */ +``` + +### `Components\ShipmentExtraReturnServiceTypeLasershipEnum` + +```php +/** +* @var Components\ShipmentExtraReturnServiceTypeLasershipEnum +*/ +Components\ShipmentExtraReturnServiceTypeLasershipEnum $value = /* values here */ +``` + diff --git a/docs/Models/Components/ServiceGroup.md b/docs/Models/Components/ServiceGroup.md index 3718ddc..ac76ff9 100644 --- a/docs/Models/Components/ServiceGroup.md +++ b/docs/Models/Components/ServiceGroup.md @@ -3,16 +3,16 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `description` | *string* | :heavy_check_mark: | Description for the service group | USPS shipping options | -| `flatRate` | *?string* | :heavy_minus_sign: | String representation of an amount to be returned as the flat rate
if 1. The service group is of type `LIVE_RATE` and no matching rates
were found; or 2. The service group is of type `FLAT_RATE`. Either
integers or decimals are accepted. Required unless type is
`FREE_SHIPPING` | 5 | -| `flatRateCurrency` | *?string* | :heavy_minus_sign: | required unless type is `FREE_SHIPPING`. (ISO 4217 currency) | USD | -| `freeShippingThresholdCurrency` | *?string* | :heavy_minus_sign: | optional unless type is `FREE_SHIPPING`. (ISO 4217 currency) | USD | -| `freeShippingThresholdMin` | *?string* | :heavy_minus_sign: | For service groups of type `FREE_SHIPPING`, this field must be required to configure the minimum cart total (total cost of items in the cart) for this service group to be returned for rates at checkout. Optional unless type is `FREE_SHIPPING` | 5 | -| `name` | *string* | :heavy_check_mark: | Name for the service group that will be shown to customers in the response | USPS Shipping | -| `rateAdjustment` | *?int* | :heavy_minus_sign: | The amount in percent (%) that the service group's returned rate should be adjusted. For example, if this field is set to 5 and the matched rate price is $5.00, the returned value of the service group will be $5.25. Negative integers are also accepted and will discount the rate price by the defined percentage amount. | 15 | -| `type` | [\Shippo\API\Models\Components\ServiceGroupTypeEnum](../../Models/Components/ServiceGroupTypeEnum.md) | :heavy_check_mark: | The type of the service group.
`LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
`FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
`FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` | FLAT_RATE | -| `objectId` | *string* | :heavy_check_mark: | The unique identifier of the given Service Group object. | 80feb1633d4a43c898f005850 | -| `isActive` | *?bool* | :heavy_minus_sign: | True if the service group is enabled, false otherwise. | true | -| `serviceLevels` | array<[\Shippo\API\Models\Components\ServiceLevelWithParent](../../Models/Components/ServiceLevelWithParent.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `description` | *string* | :heavy_check_mark: | Description for the service group | USPS shipping options | +| `name` | *string* | :heavy_check_mark: | Name for the service group that will be shown to customers in the response | USPS Shipping | +| `type` | [Components\ServiceGroupTypeEnum](../../Models/Components/ServiceGroupTypeEnum.md) | :heavy_check_mark: | The type of the service group.

`LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.

`FLAT_RATE` - Returns a shipping option with the specified flat rate amount.

`FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` | FLAT_RATE | +| `objectId` | *string* | :heavy_check_mark: | The unique identifier of the given Service Group object. | 80feb1633d4a43c898f005850 | +| `serviceLevels` | array<[Components\ServiceGroupAccountAndServiceLevel](../../Models/Components/ServiceGroupAccountAndServiceLevel.md)> | :heavy_check_mark: | N/A | | +| `flatRate` | *?string* | :heavy_minus_sign: | String representation of an amount to be returned as the flat rate
if 1. The service group is of type `LIVE_RATE` and no matching rates
were found; or 2. The service group is of type `FLAT_RATE`. Either
integers or decimals are accepted. Required unless type is
`FREE_SHIPPING` | 5 | +| `flatRateCurrency` | *?string* | :heavy_minus_sign: | required unless type is `FREE_SHIPPING`. (ISO 4217 currency) | USD | +| `freeShippingThresholdCurrency` | *?string* | :heavy_minus_sign: | optional unless type is `FREE_SHIPPING`. (ISO 4217 currency) | USD | +| `freeShippingThresholdMin` | *?string* | :heavy_minus_sign: | For service groups of type `FREE_SHIPPING`, this field must be required to configure the minimum
cart total (total cost of items in the cart) for this service group to be returned for rates at
checkout. Optional unless type is `FREE_SHIPPING` | 5 | +| `rateAdjustment` | *?int* | :heavy_minus_sign: | The amount in percent (%) that the service group's returned rate should be adjusted. For example, if this field is set to 5 and the matched rate price is $5.00, the returned value of the service group will be $5.25. Negative integers are also accepted and will discount the rate price by the defined percentage amount. | 15 | +| `isActive` | *?bool* | :heavy_minus_sign: | True if the service group is enabled, false otherwise. | true | \ No newline at end of file diff --git a/docs/Models/Components/ServiceGroupCreateRequest.md b/docs/Models/Components/ServiceGroupCreateRequest.md index 8a47256..bcc6c45 100644 --- a/docs/Models/Components/ServiceGroupCreateRequest.md +++ b/docs/Models/Components/ServiceGroupCreateRequest.md @@ -3,14 +3,14 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `description` | *string* | :heavy_check_mark: | Description for the service group | USPS shipping options | -| `flatRate` | *?string* | :heavy_minus_sign: | String representation of an amount to be returned as the flat rate
if 1. The service group is of type `LIVE_RATE` and no matching rates
were found; or 2. The service group is of type `FLAT_RATE`. Either
integers or decimals are accepted. Required unless type is
`FREE_SHIPPING` | 5 | -| `flatRateCurrency` | *?string* | :heavy_minus_sign: | required unless type is `FREE_SHIPPING`. (ISO 4217 currency) | USD | -| `freeShippingThresholdCurrency` | *?string* | :heavy_minus_sign: | optional unless type is `FREE_SHIPPING`. (ISO 4217 currency) | USD | -| `freeShippingThresholdMin` | *?string* | :heavy_minus_sign: | For service groups of type `FREE_SHIPPING`, this field must be required to configure the minimum cart total (total cost of items in the cart) for this service group to be returned for rates at checkout. Optional unless type is `FREE_SHIPPING` | 5 | -| `name` | *string* | :heavy_check_mark: | Name for the service group that will be shown to customers in the response | USPS Shipping | -| `rateAdjustment` | *?int* | :heavy_minus_sign: | The amount in percent (%) that the service group's returned rate should be adjusted. For example, if this field is set to 5 and the matched rate price is $5.00, the returned value of the service group will be $5.25. Negative integers are also accepted and will discount the rate price by the defined percentage amount. | 15 | -| `type` | [\Shippo\API\Models\Components\ServiceGroupTypeEnum](../../Models/Components/ServiceGroupTypeEnum.md) | :heavy_check_mark: | The type of the service group.
`LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
`FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
`FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` | FLAT_RATE | -| `serviceLevels` | array<[\Shippo\API\Models\Components\ServiceGroupAccountAndServiceLevel](../../Models/Components/ServiceGroupAccountAndServiceLevel.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `description` | *string* | :heavy_check_mark: | Description for the service group | USPS shipping options | +| `name` | *string* | :heavy_check_mark: | Name for the service group that will be shown to customers in the response | USPS Shipping | +| `type` | [Components\ServiceGroupTypeEnum](../../Models/Components/ServiceGroupTypeEnum.md) | :heavy_check_mark: | The type of the service group.

`LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.

`FLAT_RATE` - Returns a shipping option with the specified flat rate amount.

`FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` | FLAT_RATE | +| `serviceLevels` | array<[Components\ServiceGroupAccountAndServiceLevel](../../Models/Components/ServiceGroupAccountAndServiceLevel.md)> | :heavy_check_mark: | N/A | | +| `flatRate` | *?string* | :heavy_minus_sign: | String representation of an amount to be returned as the flat rate
if 1. The service group is of type `LIVE_RATE` and no matching rates
were found; or 2. The service group is of type `FLAT_RATE`. Either
integers or decimals are accepted. Required unless type is
`FREE_SHIPPING` | 5 | +| `flatRateCurrency` | *?string* | :heavy_minus_sign: | required unless type is `FREE_SHIPPING`. (ISO 4217 currency) | USD | +| `freeShippingThresholdCurrency` | *?string* | :heavy_minus_sign: | optional unless type is `FREE_SHIPPING`. (ISO 4217 currency) | USD | +| `freeShippingThresholdMin` | *?string* | :heavy_minus_sign: | For service groups of type `FREE_SHIPPING`, this field must be required to configure the minimum
cart total (total cost of items in the cart) for this service group to be returned for rates at
checkout. Optional unless type is `FREE_SHIPPING` | 5 | +| `rateAdjustment` | *?int* | :heavy_minus_sign: | The amount in percent (%) that the service group's returned rate should be adjusted. For example, if this field is set to 5 and the matched rate price is $5.00, the returned value of the service group will be $5.25. Negative integers are also accepted and will discount the rate price by the defined percentage amount. | 15 | \ No newline at end of file diff --git a/docs/Models/Components/ServiceGroupTypeEnum.md b/docs/Models/Components/ServiceGroupTypeEnum.md index 0ce5b7f..c8172b7 100644 --- a/docs/Models/Components/ServiceGroupTypeEnum.md +++ b/docs/Models/Components/ServiceGroupTypeEnum.md @@ -1,6 +1,9 @@ # ServiceGroupTypeEnum -The type of the service group.
`LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
`FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
`FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` +The type of the service group.
+`LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
+`FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
+`FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` ## Values diff --git a/docs/Models/Components/ServiceGroupUpdateRequest.md b/docs/Models/Components/ServiceGroupUpdateRequest.md index 3752f86..1561c47 100644 --- a/docs/Models/Components/ServiceGroupUpdateRequest.md +++ b/docs/Models/Components/ServiceGroupUpdateRequest.md @@ -3,16 +3,16 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `description` | *string* | :heavy_check_mark: | Description for the service group | USPS shipping options | -| `flatRate` | *?string* | :heavy_minus_sign: | String representation of an amount to be returned as the flat rate
if 1. The service group is of type `LIVE_RATE` and no matching rates
were found; or 2. The service group is of type `FLAT_RATE`. Either
integers or decimals are accepted. Required unless type is
`FREE_SHIPPING` | 5 | -| `flatRateCurrency` | *?string* | :heavy_minus_sign: | required unless type is `FREE_SHIPPING`. (ISO 4217 currency) | USD | -| `freeShippingThresholdCurrency` | *?string* | :heavy_minus_sign: | optional unless type is `FREE_SHIPPING`. (ISO 4217 currency) | USD | -| `freeShippingThresholdMin` | *?string* | :heavy_minus_sign: | For service groups of type `FREE_SHIPPING`, this field must be required to configure the minimum cart total (total cost of items in the cart) for this service group to be returned for rates at checkout. Optional unless type is `FREE_SHIPPING` | 5 | -| `name` | *string* | :heavy_check_mark: | Name for the service group that will be shown to customers in the response | USPS Shipping | -| `rateAdjustment` | *?int* | :heavy_minus_sign: | The amount in percent (%) that the service group's returned rate should be adjusted. For example, if this field is set to 5 and the matched rate price is $5.00, the returned value of the service group will be $5.25. Negative integers are also accepted and will discount the rate price by the defined percentage amount. | 15 | -| `type` | [\Shippo\API\Models\Components\ServiceGroupTypeEnum](../../Models/Components/ServiceGroupTypeEnum.md) | :heavy_check_mark: | The type of the service group.
`LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
`FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
`FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` | FLAT_RATE | -| `objectId` | *string* | :heavy_check_mark: | The unique identifier of the given Service Group object. | 80feb1633d4a43c898f005850 | -| `isActive` | *bool* | :heavy_check_mark: | True if the service group is enabled, false otherwise. | true | -| `serviceLevels` | array<[\Shippo\API\Models\Components\ServiceGroupAccountAndServiceLevel](../../Models/Components/ServiceGroupAccountAndServiceLevel.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `description` | *string* | :heavy_check_mark: | Description for the service group | USPS shipping options | +| `name` | *string* | :heavy_check_mark: | Name for the service group that will be shown to customers in the response | USPS Shipping | +| `type` | [Components\ServiceGroupTypeEnum](../../Models/Components/ServiceGroupTypeEnum.md) | :heavy_check_mark: | The type of the service group.

`LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.

`FLAT_RATE` - Returns a shipping option with the specified flat rate amount.

`FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` | FLAT_RATE | +| `objectId` | *string* | :heavy_check_mark: | The unique identifier of the given Service Group object. | 80feb1633d4a43c898f005850 | +| `isActive` | *bool* | :heavy_check_mark: | True if the service group is enabled, false otherwise. | true | +| `serviceLevels` | array<[Components\ServiceGroupAccountAndServiceLevel](../../Models/Components/ServiceGroupAccountAndServiceLevel.md)> | :heavy_check_mark: | N/A | | +| `flatRate` | *?string* | :heavy_minus_sign: | String representation of an amount to be returned as the flat rate
if 1. The service group is of type `LIVE_RATE` and no matching rates
were found; or 2. The service group is of type `FLAT_RATE`. Either
integers or decimals are accepted. Required unless type is
`FREE_SHIPPING` | 5 | +| `flatRateCurrency` | *?string* | :heavy_minus_sign: | required unless type is `FREE_SHIPPING`. (ISO 4217 currency) | USD | +| `freeShippingThresholdCurrency` | *?string* | :heavy_minus_sign: | optional unless type is `FREE_SHIPPING`. (ISO 4217 currency) | USD | +| `freeShippingThresholdMin` | *?string* | :heavy_minus_sign: | For service groups of type `FREE_SHIPPING`, this field must be required to configure the minimum
cart total (total cost of items in the cart) for this service group to be returned for rates at
checkout. Optional unless type is `FREE_SHIPPING` | 5 | +| `rateAdjustment` | *?int* | :heavy_minus_sign: | The amount in percent (%) that the service group's returned rate should be adjusted. For example, if this field is set to 5 and the matched rate price is $5.00, the returned value of the service group will be $5.25. Negative integers are also accepted and will discount the rate price by the defined percentage amount. | 15 | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevel.md b/docs/Models/Components/ServiceLevel.md index 87ec37a..bc13415 100644 --- a/docs/Models/Components/ServiceLevel.md +++ b/docs/Models/Components/ServiceLevel.md @@ -1,6 +1,9 @@ # ServiceLevel -Contains details regarding the service level for the given rate. +Used for some Service Levels to link to the more "generic" version of this Service Level - for example, +if this Service Level is a variation specific to shipments to Europe("ups_saver_eu"), the "parent" is +the fully generic version ("ups_saver"). Helpful when displaying Service Levels to users. Has the same +structure of the servicelevel - "name", "token", "terms", and "extended_token", or it is otherwise null. ## Fields diff --git a/docs/Models/Components/ServiceLevelAPCPostalEnum.md b/docs/Models/Components/ServiceLevelAPCPostalEnum.md new file mode 100644 index 0000000..679ccce --- /dev/null +++ b/docs/Models/Components/ServiceLevelAPCPostalEnum.md @@ -0,0 +1,29 @@ +# ServiceLevelAPCPostalEnum + +|Token | Service name| +|:---|:---| +| apc_postal_parcelconnect_expedited | parcelConnect Expedited| +| apc_postal_parcelconnect_priority | parcelConnect Priority| +| apc_postal_parcelconnect_priority_delcon | parcelConnect Priority Delcon| +| apc_postal_parcelconnect_priority_pqw | parcelConnect Priority PQW| +| apc_postal_parcelconnect_book_service | parcelConnect Book Service| +| apc_postal_parcelconnect_standard | parcelConnect Standard| +| apc_postal_parcelconnect_epmi | parcelConnect ePMI| +| apc_postal_parcelconnect_epacket | parcelConnect ePacket| +| apc_postal_parcelconnect_epmei | parcelConnect ePMEI| + + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `ApcPostalParcelconnectExpedited` | apc_postal_parcelconnect_expedited | +| `ApcPostalParcelconnectPriority` | apc_postal_parcelconnect_priority | +| `ApcPostalParcelconnectPriorityDelcon` | apc_postal_parcelconnect_priority_delcon | +| `ApcPostalParcelconnectPriorityPqw` | apc_postal_parcelconnect_priority_pqw | +| `ApcPostalParcelconnectBookService` | apc_postal_parcelconnect_book_service | +| `ApcPostalParcelconnectStandard` | apc_postal_parcelconnect_standard | +| `ApcPostalParcelconnectEpmi` | apc_postal_parcelconnect_epmi | +| `ApcPostalParcelconnectEpacket` | apc_postal_parcelconnect_epacket | +| `ApcPostalParcelconnectEpmei` | apc_postal_parcelconnect_epmei | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelAPGEnum.md b/docs/Models/Components/ServiceLevelAPGEnum.md new file mode 100644 index 0000000..71f4d01 --- /dev/null +++ b/docs/Models/Components/ServiceLevelAPGEnum.md @@ -0,0 +1,19 @@ +# ServiceLevelAPGEnum + +|Token | Service name| +|:---|:---| +| epacket | ePacket| +| epacket_plus | ePacket Plus| +| eparcel_premium | eParcel premium| +| apg_eparcel_expedited | eParcel Expedited| + + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `Epacket` | epacket | +| `EpacketPlus` | epacket_plus | +| `EparcelPremium` | eparcel_premium | +| `ApgEparcelExpedited` | apg_eparcel_expedited | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelAirterraEnum.md b/docs/Models/Components/ServiceLevelAirterraEnum.md new file mode 100644 index 0000000..e08e824 --- /dev/null +++ b/docs/Models/Components/ServiceLevelAirterraEnum.md @@ -0,0 +1,15 @@ +# ServiceLevelAirterraEnum + +|Token | Service name| +|:---|:---| +| airterra_ground | GroundXC| +| airterra_postal | FastPost| + + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `AirterraGround` | airterra_ground | +| `AirterraPostal` | airterra_postal | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelAramexAustraliaEnum.md b/docs/Models/Components/ServiceLevelAramexAustraliaEnum.md new file mode 100644 index 0000000..8b851f0 --- /dev/null +++ b/docs/Models/Components/ServiceLevelAramexAustraliaEnum.md @@ -0,0 +1,21 @@ +# ServiceLevelAramexAustraliaEnum + +|Token | Service name| +|:---|:---| +| fastway_australia_parcel | Parcel| +| fastway_australia_satchel | Satchel| +| fastway_australia_box_small | Box Small| +| fastway_australia_box_medium | Box Medium| +| fastway_australia_box_large | Box Large| + + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `FastwayAustraliaParcel` | fastway_australia_parcel | +| `FastwayAustraliaSatchel` | fastway_australia_satchel | +| `FastwayAustraliaBoxSmall` | fastway_australia_box_small | +| `FastwayAustraliaBoxMedium` | fastway_australia_box_medium | +| `FastwayAustraliaBoxLarge` | fastway_australia_box_large | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelAsendiaEnum.md b/docs/Models/Components/ServiceLevelAsendiaEnum.md new file mode 100644 index 0000000..5e1fe16 --- /dev/null +++ b/docs/Models/Components/ServiceLevelAsendiaEnum.md @@ -0,0 +1,27 @@ +# ServiceLevelAsendiaEnum + +|Token | Service name| +|:---|:---| +| asendia_us_priority_tracked | Asendia USA Priority Tracked| +| asendia_us_international_express | Asendia USA International Express| +| asendia_us_international_priority_airmail | Asendia USA International Priority Airmail| +| asendia_us_international_surface_airlift | Asendia USA International Surface Air Lift| +| asendia_us_priority_mail_international | Asendia USA Priority Mail International| +| asendia_us_priority_mail_express_international | Asendia USA Priority Mail Express International| +| asendia_us_epacket | Asendia USA International ePacket| +| asendia_us_other | Asendia USA Other Services (custom)| + + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `AsendiaUsPriorityTracked` | asendia_us_priority_tracked | +| `AsendiaUsInternationalExpress` | asendia_us_international_express | +| `AsendiaUsInternationalPriorityAirmail` | asendia_us_international_priority_airmail | +| `AsendiaUsInternationalSurfaceAirlift` | asendia_us_international_surface_airlift | +| `AsendiaUsPriorityMailInternational` | asendia_us_priority_mail_international | +| `AsendiaUsPriorityMailExpressInternational` | asendia_us_priority_mail_express_international | +| `AsendiaUsEpacket` | asendia_us_epacket | +| `AsendiaUsOther` | asendia_us_other | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelAustraliaPostEnum.md b/docs/Models/Components/ServiceLevelAustraliaPostEnum.md new file mode 100644 index 0000000..79cb213 --- /dev/null +++ b/docs/Models/Components/ServiceLevelAustraliaPostEnum.md @@ -0,0 +1,31 @@ +# ServiceLevelAustraliaPostEnum + +|Token | Service name| +|:---|:---| +| australia_post_express_post | Express Post| +| australia_post_parcel_post | Parcel Post| +| australia_post_pack_and_track_international | Pack and Track International| +| australia_post_international_airmail | International Airmail| +| australia_post_express_post_international | Express Post International| +| australia_post_express_courier_international | Express Courier International| +| australia_post_international_express | International Express| +| australia_post_international_standard | International Standard| +| australia_post_international_economy | International Economy| +| australia_post_parcel_post_return | Parcel Post Return| + + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `AustraliaPostExpressPost` | australia_post_express_post | +| `AustraliaPostParcelPost` | australia_post_parcel_post | +| `AustraliaPostPackAndTrackInternational` | australia_post_pack_and_track_international | +| `AustraliaPostInternationalAirmail` | australia_post_international_airmail | +| `AustraliaPostExpressPostInternational` | australia_post_express_post_international | +| `AustraliaPostExpressCourierInternational` | australia_post_express_courier_international | +| `AustraliaPostInternationalExpress` | australia_post_international_express | +| `AustraliaPostInternationalStandard` | australia_post_international_standard | +| `AustraliaPostInternationalEconomy` | australia_post_international_economy | +| `AustraliaPostParcelPostReturn` | australia_post_parcel_post_return | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelBetterTrucksEnum.md b/docs/Models/Components/ServiceLevelBetterTrucksEnum.md new file mode 100644 index 0000000..d6b1df6 --- /dev/null +++ b/docs/Models/Components/ServiceLevelBetterTrucksEnum.md @@ -0,0 +1,15 @@ +# ServiceLevelBetterTrucksEnum + +|Token | Service name| +|:---|:---| +| better_trucks_same_day | Same Day| +| better_trucks_next_day | Next Day| + + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `BetterTrucksSameDay` | better_trucks_same_day | +| `BetterTrucksNextDay` | better_trucks_next_day | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelCDLEnum.md b/docs/Models/Components/ServiceLevelCDLEnum.md new file mode 100644 index 0000000..8e122c7 --- /dev/null +++ b/docs/Models/Components/ServiceLevelCDLEnum.md @@ -0,0 +1,13 @@ +# ServiceLevelCDLEnum + +|Token | Service name| +|:---|:---| +| cdl_next_day | Next Day| + + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `CdlNextDay` | cdl_next_day | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelCanadaPostEnum.md b/docs/Models/Components/ServiceLevelCanadaPostEnum.md new file mode 100644 index 0000000..d7d293b --- /dev/null +++ b/docs/Models/Components/ServiceLevelCanadaPostEnum.md @@ -0,0 +1,39 @@ +# ServiceLevelCanadaPostEnum + +|Token | Service name| +|:---|:---| +| canada_post_regular_parcel | Regular Parcel| +| canada_post_expedited_parcel | Expedited Parcel| +| canada_post_priority | Priority| +| canada_post_xpresspost | Xpresspost| +| canada_post_xpresspost_international | Xpresspost International| +| canada_post_xpresspost_usa | Xpresspost USA| +| canada_post_expedited_parcel_usa | Expedited Parcel USA| +| canada_post_tracked_packet_usa | Tracked Packet USA| +| canada_post_small_packet_usa_air | Small Packet USA Air| +| canada_post_tracked_packet_international | Tracked Packet International| +| canada_post_small_packet_international_air | Small Package International Air| +| canada_post_small_packet_international_surface | Small Packet International Surface +| canada_post_international_parcel_surface | International Parcel Surface +| canada_post_international_parcel_air | International Parcel Air + + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `CanadaPostRegularParcel` | canada_post_regular_parcel | +| `CanadaPostExpeditedParcel` | canada_post_expedited_parcel | +| `CanadaPostPriority` | canada_post_priority | +| `CanadaPostXpresspost` | canada_post_xpresspost | +| `CanadaPostXpresspostInternational` | canada_post_xpresspost_international | +| `CanadaPostXpresspostUsa` | canada_post_xpresspost_usa | +| `CanadaPostExpeditedParcelUsa` | canada_post_expedited_parcel_usa | +| `CanadaPostTrackedPacketUsa` | canada_post_tracked_packet_usa | +| `CanadaPostSmallPacketUsaAir` | canada_post_small_packet_usa_air | +| `CanadaPostTrackedPacketInternational` | canada_post_tracked_packet_international | +| `CanadaPostSmallPacketInternationalAir` | canada_post_small_packet_international_air | +| `CanadaPostSmallPacketInternationalSurface` | canada_post_small_packet_international_surface | +| `CanadaPostInternationalParcelSurface` | canada_post_international_parcel_surface | +| `CanadaPostInternationalParcelAir` | canada_post_international_parcel_air | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelChronopostEnum.md b/docs/Models/Components/ServiceLevelChronopostEnum.md new file mode 100644 index 0000000..fd66959 --- /dev/null +++ b/docs/Models/Components/ServiceLevelChronopostEnum.md @@ -0,0 +1,23 @@ +# ServiceLevelChronopostEnum + +|Token | Service name| +|:---|:---| +| chronopost_13 | Chrono 13| +| chronopost_10 | Chrono 10| +| chronopost_18| Chrono 18| +| chronopost_relais_fr | Chrono Point Relais| +| chronopost_classic | Chrono Classic International| +| chronopost_express | Chrono Express International| + + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `Chronopost13` | chronopost_13 | +| `Chronopost10` | chronopost_10 | +| `Chronopost18` | chronopost_18 | +| `ChronopostRelaisFr` | chronopost_relais_fr | +| `ChronopostClassic` | chronopost_classic | +| `ChronopostExpress` | chronopost_express | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelColissimoEnum.md b/docs/Models/Components/ServiceLevelColissimoEnum.md new file mode 100644 index 0000000..98d12a5 --- /dev/null +++ b/docs/Models/Components/ServiceLevelColissimoEnum.md @@ -0,0 +1,17 @@ +# ServiceLevelColissimoEnum + +|Token | Service name| +|:---|:---| +| colissimo_home | Domicile| +| colissimo_pick_up_point | Point Retrait| +| colissimo_return_mainland_france | Retour France| + + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `ColissimoHome` | colissimo_home | +| `ColissimoPickUpPoint` | colissimo_pick_up_point | +| `ColissimoReturnMainlandFrance` | colissimo_return_mainland_france | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelCorreosEspanaEnum.md b/docs/Models/Components/ServiceLevelCorreosEspanaEnum.md new file mode 100644 index 0000000..d1a9594 --- /dev/null +++ b/docs/Models/Components/ServiceLevelCorreosEspanaEnum.md @@ -0,0 +1,15 @@ +# ServiceLevelCorreosEspanaEnum + +|Token | Service name| +|:---|:---| +| correos_standard_home| Paquete Estándar| +| correos_premium_home | Paquete Premium| + + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `CorreosStandardHome` | correos_standard_home | +| `CorreosPremiumHome` | correos_premium_home | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelCouriersPleaseEnum.md b/docs/Models/Components/ServiceLevelCouriersPleaseEnum.md new file mode 100644 index 0000000..2c5cdef --- /dev/null +++ b/docs/Models/Components/ServiceLevelCouriersPleaseEnum.md @@ -0,0 +1,33 @@ +# ServiceLevelCouriersPleaseEnum + +|Token | Service name| +|:---|:---| +| couriersplease_domestic_priority_auth_to_leave | Domestic Priority - Authority To Leave/POPPoints| +| couriersplease_domestic_priority_sign_required | Domestic Priority - Signature Required| +| couriersplease_gold_domestic_auth_to_leave | Gold Domestic - Authority To Leave/POPPoints| +| couriersplease_gold_domestic_sign_required | Gold Domestic - Signature Required| +| couriersplease_off_peak_auth_to_leave | Off Peak - Authority To Leave/POPPoints| +| couriersplease_off_peak_sign_required | Off Peak - Signature Required| +| couriersplease_parcel_auth_to_leave | Parcel - Authority To Leave| +| couriersplease_parcel_sign_required | Parcel - Signature Required| +| couriersplease_road_express | Road Express| +| couriersplease_satchel_auth_to_leave | Satchel - Authority To Leave| +| couriersplease_satchel_sign_required | Satchel - Signature Required| + + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `CourierspleaseDomesticPriorityAuthToLeave` | couriersplease_domestic_priority_auth_to_leave | +| `CourierspleaseDomesticPrioritySignRequired` | couriersplease_domestic_priority_sign_required | +| `CourierspleaseGoldDomesticAuthToLeave` | couriersplease_gold_domestic_auth_to_leave | +| `CourierspleaseGoldDomesticSignRequired` | couriersplease_gold_domestic_sign_required | +| `CourierspleaseOffPeakAuthToLeave` | couriersplease_off_peak_auth_to_leave | +| `CourierspleaseOffPeakSignRequired` | couriersplease_off_peak_sign_required | +| `CourierspleaseParcelAuthToLeave` | couriersplease_parcel_auth_to_leave | +| `CourierspleaseParcelSignRequired` | couriersplease_parcel_sign_required | +| `CourierspleaseRoadExpress` | couriersplease_road_express | +| `CourierspleaseSatchelAuthToLeave` | couriersplease_satchel_auth_to_leave | +| `CourierspleaseSatchelSignRequired` | couriersplease_satchel_sign_required | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelDHLExpressEnum.md b/docs/Models/Components/ServiceLevelDHLExpressEnum.md new file mode 100644 index 0000000..2813540 --- /dev/null +++ b/docs/Models/Components/ServiceLevelDHLExpressEnum.md @@ -0,0 +1,55 @@ +# ServiceLevelDHLExpressEnum + +|Token | Service name| +|:---|:---| +| dhl_express_domestic_express_doc | Domestic Express Doc| +| dhl_express_economy_select_doc | Economy Select Doc| +| dhl_express_worldwide_nondoc | Express Worldwide Nondoc| +| dhl_express_worldwide_doc | Express Worldwide Doc| +| dhl_express_worldwide | Worldwide| +| dhl_express_worldwide_eu_doc | Express Worldwide EU Doc| +| dhl_express_break_bulk_express_doc | Break Bulk Express Doc| +| dhl_express_express_9_00_nondoc | Express 9:00 NonDoc| +| dhl_express_economy_select_nondoc | Economy Select NonDoc| +| dhl_express_break_bulk_economy_doc | Break Bulk Economy Doc| +| dhl_express_express_9_00_doc | Express 9:00 Doc| +| dhl_express_express_10_30_doc | Express 10:30 Doc| +| dhl_express_express_10_30_nondoc | Express 10:30 NonDoc| +| dhl_express_express_12_00_doc | Express 12:00 Doc| +| dhl_express_europack_nondoc | Europack NonDoc| +| dhl_express_express_envelope_doc | Express Envelope Doc| +| dhl_express_express_12_00_nondoc | Express 12:00 NonDoc| +| dhl_express_express_12_doc | Domestic Express 12:00| +| dhl_express_worldwide_b2c_doc | Express Worldwide (B2C) Doc| +| dhl_express_worldwide_b2c_nondoc | Express Worldwide (B2C) NonDoc| +| dhl_express_medical_express | Medical Express| +| dhl_express_express_easy_nondoc | Express Easy NonDoc| + + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `DhlExpressDomesticExpressDoc` | dhl_express_domestic_express_doc | +| `DhlExpressEconomySelectDoc` | dhl_express_economy_select_doc | +| `DhlExpressWorldwideNondoc` | dhl_express_worldwide_nondoc | +| `DhlExpressWorldwideDoc` | dhl_express_worldwide_doc | +| `DhlExpressWorldwide` | dhl_express_worldwide | +| `DhlExpressWorldwideEuDoc` | dhl_express_worldwide_eu_doc | +| `DhlExpressBreakBulkExpressDoc` | dhl_express_break_bulk_express_doc | +| `DhlExpressExpress900Nondoc` | dhl_express_express_9_00_nondoc | +| `DhlExpressEconomySelectNondoc` | dhl_express_economy_select_nondoc | +| `DhlExpressBreakBulkEconomyDoc` | dhl_express_break_bulk_economy_doc | +| `DhlExpressExpress900Doc` | dhl_express_express_9_00_doc | +| `DhlExpressExpress1030Doc` | dhl_express_express_10_30_doc | +| `DhlExpressExpress1030Nondoc` | dhl_express_express_10_30_nondoc | +| `DhlExpressExpress1200Doc` | dhl_express_express_12_00_doc | +| `DhlExpressEuropackNondoc` | dhl_express_europack_nondoc | +| `DhlExpressExpressEnvelopeDoc` | dhl_express_express_envelope_doc | +| `DhlExpressExpress1200Nondoc` | dhl_express_express_12_00_nondoc | +| `DhlExpressExpress12Doc` | dhl_express_express_12_doc | +| `DhlExpressWorldwideB2cDoc` | dhl_express_worldwide_b2c_doc | +| `DhlExpressWorldwideB2cNondoc` | dhl_express_worldwide_b2c_nondoc | +| `DhlExpressMedicalExpress` | dhl_express_medical_express | +| `DhlExpressExpressEasyNondoc` | dhl_express_express_easy_nondoc | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelDHLGermanyEnum.md b/docs/Models/Components/ServiceLevelDHLGermanyEnum.md new file mode 100644 index 0000000..d3aac5f --- /dev/null +++ b/docs/Models/Components/ServiceLevelDHLGermanyEnum.md @@ -0,0 +1,23 @@ +# ServiceLevelDHLGermanyEnum + +|Token | Service name| +|:---|:---| +| dhl_germany_europaket | DHL Germany Europaket| +| dhl_germany_paket | DHL Germany Paket| +| dhl_germany_paket_connect | DHL Germany Paket Connect| +| dhl_germany_paket_international | DHL Germany Paket International| +| dhl_germany_paket_priority | DHL Germany Paket Priority| +| dhl_germany_paket_sameday | DHL Germany Paket Sameday| + + + +## Values + +| Name | Value | +| ------------------------------- | ------------------------------- | +| `DhlGermanyEuropaket` | dhl_germany_europaket | +| `DhlGermanyPaket` | dhl_germany_paket | +| `DhlGermanyPaketConnect` | dhl_germany_paket_connect | +| `DhlGermanyPaketInternational` | dhl_germany_paket_international | +| `DhlGermanyPaketPriority` | dhl_germany_paket_priority | +| `DhlGermanyPaketSameday` | dhl_germany_paket_sameday | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelDHLeCommerceEnum.md b/docs/Models/Components/ServiceLevelDHLeCommerceEnum.md new file mode 100644 index 0000000..2e54834 --- /dev/null +++ b/docs/Models/Components/ServiceLevelDHLeCommerceEnum.md @@ -0,0 +1,67 @@ +# ServiceLevelDHLeCommerceEnum + +|Token | Service name| +|:---|:---| +| dhl_ecommerce_marketing_parcel_expedited | Marketing Parcel Expedited| +| dhl_ecommerce_globalmail_business_ipa | GlobalMail Business IPA| +| dhl_ecommerce_parcel_international_direct | Parcel International Direct| +| dhl_ecommerce_parcels_expedited_max | Parcels Expedited Max| +| dhl_ecommerce_bpm_ground | Bounded Printed Matter Ground| +| dhl_ecommerce_priority_expedited | Priority Expedited| +| dhl_ecommerce_globalmail_packet_ipa | GlobalMail Packet IPA| +| dhl_ecommerce_globalmail_packet_isal | GlobalMail Packet ISAL| +| dhl_ecommerce_easy_return_plus | Easy Return Plus| +| dhl_ecommerce_marketing_parcel_ground | Marketing Parcel Ground| +| dhl_ecommerce_first_class_parcel_expedited | First Class Parcel Expedited| +| dhl_ecommerce_globalmail_business_priority | GlobalMail Business Priority| +| dhl_ecommerce_parcels_expedited | Parcels Expedited| +| dhl_ecommerce_globalmail_business_isal | GlobalMail Business ISAL| +| dhl_ecommerce_parcel_plus_expedited_max | Parcel Plus Expedited Max| +| dhl_ecommerce_globalmail_packet_plus | GlobalMail Packet Plus| +| dhl_ecommerce_parcels_ground | Parcels Ground| +| dhl_ecommerce_expedited | Expedited| +| dhl_ecommerce_parcel_plus_ground | Parcel Plus Ground| +| dhl_ecommerce_parcel_international_standard | Parcel International Standard| +| dhl_ecommerce_bpm_expedited | Bounded Printed Matter Expedited| +| dhl_ecommerce_parcel_international_expedited | Parcel International Expedited| +| dhl_ecommerce_globalmail_packet_priority | GlobalMail Packet Priority| +| dhl_ecommerce_easy_return_light | Easy Return Light| +| dhl_ecommerce_parcel_plus_expedited | Parcel Plus Expedited| +| dhl_ecommerce_globalmail_business_standard | GlobalMail Packet Standard| +| dhl_ecommerce_ground | Ground| +| dhl_ecommerce_globalmail_packet_standard | GlobalMail Business Standard| + + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `DhlEcommerceMarketingParcelExpedited` | dhl_ecommerce_marketing_parcel_expedited | +| `DhlEcommerceGlobalmailBusinessIpa` | dhl_ecommerce_globalmail_business_ipa | +| `DhlEcommerceParcelInternationalDirect` | dhl_ecommerce_parcel_international_direct | +| `DhlEcommerceParcelsExpeditedMax` | dhl_ecommerce_parcels_expedited_max | +| `DhlEcommerceBpmGround` | dhl_ecommerce_bpm_ground | +| `DhlEcommercePriorityExpedited` | dhl_ecommerce_priority_expedited | +| `DhlEcommerceGlobalmailPacketIpa` | dhl_ecommerce_globalmail_packet_ipa | +| `DhlEcommerceGlobalmailPacketIsal` | dhl_ecommerce_globalmail_packet_isal | +| `DhlEcommerceEasyReturnPlus` | dhl_ecommerce_easy_return_plus | +| `DhlEcommerceMarketingParcelGround` | dhl_ecommerce_marketing_parcel_ground | +| `DhlEcommerceFirstClassParcelExpedited` | dhl_ecommerce_first_class_parcel_expedited | +| `DhlEcommerceGlobalmailBusinessPriority` | dhl_ecommerce_globalmail_business_priority | +| `DhlEcommerceParcelsExpedited` | dhl_ecommerce_parcels_expedited | +| `DhlEcommerceGlobalmailBusinessIsal` | dhl_ecommerce_globalmail_business_isal | +| `DhlEcommerceParcelPlusExpeditedMax` | dhl_ecommerce_parcel_plus_expedited_max | +| `DhlEcommerceGlobalmailPacketPlus` | dhl_ecommerce_globalmail_packet_plus | +| `DhlEcommerceParcelsGround` | dhl_ecommerce_parcels_ground | +| `DhlEcommerceExpedited` | dhl_ecommerce_expedited | +| `DhlEcommerceParcelPlusGround` | dhl_ecommerce_parcel_plus_ground | +| `DhlEcommerceParcelInternationalStandard` | dhl_ecommerce_parcel_international_standard | +| `DhlEcommerceBpmExpedited` | dhl_ecommerce_bpm_expedited | +| `DhlEcommerceParcelInternationalExpedited` | dhl_ecommerce_parcel_international_expedited | +| `DhlEcommerceGlobalmailPacketPriority` | dhl_ecommerce_globalmail_packet_priority | +| `DhlEcommerceEasyReturnLight` | dhl_ecommerce_easy_return_light | +| `DhlEcommerceParcelPlusExpedited` | dhl_ecommerce_parcel_plus_expedited | +| `DhlEcommerceGlobalmailBusinessStandard` | dhl_ecommerce_globalmail_business_standard | +| `DhlEcommerceGround` | dhl_ecommerce_ground | +| `DhlEcommerceGlobalmailPacketStandard` | dhl_ecommerce_globalmail_packet_standard | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelDPDDEEnum.md b/docs/Models/Components/ServiceLevelDPDDEEnum.md new file mode 100644 index 0000000..7c1e76a --- /dev/null +++ b/docs/Models/Components/ServiceLevelDPDDEEnum.md @@ -0,0 +1,13 @@ +# ServiceLevelDPDDEEnum + +|Token | Service name| +|:---|:---| +| dpd_de_classic | DPD Classic| + + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `DpdDeClassic` | dpd_de_classic | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelDPDUKEnum.md b/docs/Models/Components/ServiceLevelDPDUKEnum.md new file mode 100644 index 0000000..7f23046 --- /dev/null +++ b/docs/Models/Components/ServiceLevelDPDUKEnum.md @@ -0,0 +1,45 @@ +# ServiceLevelDPDUKEnum + +|Token | Service name| +|:---|:---| +| dpd_uk_ship_to_shop | Ship to shop| +| dpd_uk_1030 | Door to door 10.30 next day| +| dpd_uk_1200 | Door to door 12.00 next day| +| dpd_uk_saturday | Saturday Delivery| +| dpd_uk_saturday_1030 | Saturday Delivery 10.30| +| dpd_uk_saturday_1200 | Saturday Delivery 12.00| +| dpd_uk_sunday | Sunday Delivery| +| dpd_uk_sunday_1030 | Sunday Delivery 10.30| +| dpd_uk_sunday_1200 | Sunday Delivery 12.00| +| dpd_uk_next_day | Next day| +| dpd_uk_two_day | Two day| +| dpd_uk_classic | DPD Classic| +| dpd_uk_air_classic | DPD Air Classic| +| dpd_uk_air_express | DPD Air Express| +| dpd_uk_direct | DPD Direct| +| dpd_uk_direct_tracked_mail| DPD Tracked Mail| +| dpd_uk_pickup_returns | Pickup Returns| + + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `DpdUkShipToShop` | dpd_uk_ship_to_shop | +| `DpdUk1030` | dpd_uk_1030 | +| `DpdUk1200` | dpd_uk_1200 | +| `DpdUkSaturday` | dpd_uk_saturday | +| `DpdUkSaturday1030` | dpd_uk_saturday_1030 | +| `DpdUkSaturday1200` | dpd_uk_saturday_1200 | +| `DpdUkSunday` | dpd_uk_sunday | +| `DpdUkSunday1030` | dpd_uk_sunday_1030 | +| `DpdUkSunday1200` | dpd_uk_sunday_1200 | +| `DpdUkNextDay` | dpd_uk_next_day | +| `DpdUkTwoDay` | dpd_uk_two_day | +| `DpdUkClassic` | dpd_uk_classic | +| `DpdUkAirClassic` | dpd_uk_air_classic | +| `DpdUkAirExpress` | dpd_uk_air_express | +| `DpdUkDirect` | dpd_uk_direct | +| `DpdUkDirectTrackedMail` | dpd_uk_direct_tracked_mail | +| `DpdUkPickupReturns` | dpd_uk_pickup_returns | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelDeutschePostEnum.md b/docs/Models/Components/ServiceLevelDeutschePostEnum.md new file mode 100644 index 0000000..db898e2 --- /dev/null +++ b/docs/Models/Components/ServiceLevelDeutschePostEnum.md @@ -0,0 +1,31 @@ +# ServiceLevelDeutschePostEnum + +|Token | Service name| +|:---|:---| +| deutsche_post_postkarte | Postkarte| +| deutsche_post_standardbrief | Standardbrief| +| deutsche_post_kompaktbrief | Kompaktbrief| +| deutsche_post_grossbrief | Grossbrief| +| deutsche_post_maxibrief | Maxibrief| +| deutsche_post_maxibrief_plus | Maxibrief Plus| +| deutsche_post_warenpost_international_xs | Warenpost International XS| +| deutsche_post_warenpost_international_s | Warenpost International S| +| deutsche_post_warenpost_international_m | Warenpost International M| +| deutsche_post_warenpost_international_l | Warenpost International L| + + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `DeutschePostPostkarte` | deutsche_post_postkarte | +| `DeutschePostStandardbrief` | deutsche_post_standardbrief | +| `DeutschePostKompaktbrief` | deutsche_post_kompaktbrief | +| `DeutschePostGrossbrief` | deutsche_post_grossbrief | +| `DeutschePostMaxibrief` | deutsche_post_maxibrief | +| `DeutschePostMaxibriefPlus` | deutsche_post_maxibrief_plus | +| `DeutschePostWarenpostInternationalXs` | deutsche_post_warenpost_international_xs | +| `DeutschePostWarenpostInternationalS` | deutsche_post_warenpost_international_s | +| `DeutschePostWarenpostInternationalM` | deutsche_post_warenpost_international_m | +| `DeutschePostWarenpostInternationalL` | deutsche_post_warenpost_international_l | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelEnumSet.md b/docs/Models/Components/ServiceLevelEnumSet.md new file mode 100644 index 0000000..82d3377 --- /dev/null +++ b/docs/Models/Components/ServiceLevelEnumSet.md @@ -0,0 +1,356 @@ +# ServiceLevelEnumSet + + +## Supported Types + +### `Components\ServiceLevelUSPSEnum` + +```php +/** +* @var Components\ServiceLevelUSPSEnum +*/ +Components\ServiceLevelUSPSEnum $value = /* values here */ +``` + +### `Components\ServiceLevelFedExEnum` + +```php +/** +* @var Components\ServiceLevelFedExEnum +*/ +Components\ServiceLevelFedExEnum $value = /* values here */ +``` + +### `Components\ServiceLevelUPSEnum` + +```php +/** +* @var Components\ServiceLevelUPSEnum +*/ +Components\ServiceLevelUPSEnum $value = /* values here */ +``` + +### `Components\ServiceLevelAirterraEnum` + +```php +/** +* @var Components\ServiceLevelAirterraEnum +*/ +Components\ServiceLevelAirterraEnum $value = /* values here */ +``` + +### `Components\ServiceLevelAPCPostalEnum` + +```php +/** +* @var Components\ServiceLevelAPCPostalEnum +*/ +Components\ServiceLevelAPCPostalEnum $value = /* values here */ +``` + +### `Components\ServiceLevelAsendiaEnum` + +```php +/** +* @var Components\ServiceLevelAsendiaEnum +*/ +Components\ServiceLevelAsendiaEnum $value = /* values here */ +``` + +### `Components\ServiceLevelAustraliaPostEnum` + +```php +/** +* @var Components\ServiceLevelAustraliaPostEnum +*/ +Components\ServiceLevelAustraliaPostEnum $value = /* values here */ +``` + +### `Components\ServiceLevelAPGEnum` + +```php +/** +* @var Components\ServiceLevelAPGEnum +*/ +Components\ServiceLevelAPGEnum $value = /* values here */ +``` + +### `Components\ServiceLevelBetterTrucksEnum` + +```php +/** +* @var Components\ServiceLevelBetterTrucksEnum +*/ +Components\ServiceLevelBetterTrucksEnum $value = /* values here */ +``` + +### `Components\ServiceLevelCanadaPostEnum` + +```php +/** +* @var Components\ServiceLevelCanadaPostEnum +*/ +Components\ServiceLevelCanadaPostEnum $value = /* values here */ +``` + +### `Components\ServiceLevelCDLEnum` + +```php +/** +* @var Components\ServiceLevelCDLEnum +*/ +Components\ServiceLevelCDLEnum $value = /* values here */ +``` + +### `Components\ServiceLevelChronopostEnum` + +```php +/** +* @var Components\ServiceLevelChronopostEnum +*/ +Components\ServiceLevelChronopostEnum $value = /* values here */ +``` + +### `Components\ServiceLevelCouriersPleaseEnum` + +```php +/** +* @var Components\ServiceLevelCouriersPleaseEnum +*/ +Components\ServiceLevelCouriersPleaseEnum $value = /* values here */ +``` + +### `Components\ServiceLevelCorreosEspanaEnum` + +```php +/** +* @var Components\ServiceLevelCorreosEspanaEnum +*/ +Components\ServiceLevelCorreosEspanaEnum $value = /* values here */ +``` + +### `Components\ServiceLevelColissimoEnum` + +```php +/** +* @var Components\ServiceLevelColissimoEnum +*/ +Components\ServiceLevelColissimoEnum $value = /* values here */ +``` + +### `Components\ServiceLevelPurolatorEnum` + +```php +/** +* @var Components\ServiceLevelPurolatorEnum +*/ +Components\ServiceLevelPurolatorEnum $value = /* values here */ +``` + +### `Components\ServiceLevelDHLExpressEnum` + +```php +/** +* @var Components\ServiceLevelDHLExpressEnum +*/ +Components\ServiceLevelDHLExpressEnum $value = /* values here */ +``` + +### `Components\ServiceLevelDHLeCommerceEnum` + +```php +/** +* @var Components\ServiceLevelDHLeCommerceEnum +*/ +Components\ServiceLevelDHLeCommerceEnum $value = /* values here */ +``` + +### `Components\ServiceLevelDHLGermanyEnum` + +```php +/** +* @var Components\ServiceLevelDHLGermanyEnum +*/ +Components\ServiceLevelDHLGermanyEnum $value = /* values here */ +``` + +### `Components\ServiceLevelDPDDEEnum` + +```php +/** +* @var Components\ServiceLevelDPDDEEnum +*/ +Components\ServiceLevelDPDDEEnum $value = /* values here */ +``` + +### `Components\ServiceLevelDPDUKEnum` + +```php +/** +* @var Components\ServiceLevelDPDUKEnum +*/ +Components\ServiceLevelDPDUKEnum $value = /* values here */ +``` + +### `Components\ServiceLevelDeutschePostEnum` + +```php +/** +* @var Components\ServiceLevelDeutschePostEnum +*/ +Components\ServiceLevelDeutschePostEnum $value = /* values here */ +``` + +### `Components\ServiceLevelAramexAustraliaEnum` + +```php +/** +* @var Components\ServiceLevelAramexAustraliaEnum +*/ +Components\ServiceLevelAramexAustraliaEnum $value = /* values here */ +``` + +### `Components\ServiceLevelGlobegisticsEnum` + +```php +/** +* @var Components\ServiceLevelGlobegisticsEnum +*/ +Components\ServiceLevelGlobegisticsEnum $value = /* values here */ +``` + +### `Components\ServiceLevelGLSUSEnum` + +```php +/** +* @var Components\ServiceLevelGLSUSEnum +*/ +Components\ServiceLevelGLSUSEnum $value = /* values here */ +``` + +### `Components\ServiceLevelLSOEnum` + +```php +/** +* @var Components\ServiceLevelLSOEnum +*/ +Components\ServiceLevelLSOEnum $value = /* values here */ +``` + +### `Components\ServiceLevelMondialRelayEnum` + +```php +/** +* @var Components\ServiceLevelMondialRelayEnum +*/ +Components\ServiceLevelMondialRelayEnum $value = /* values here */ +``` + +### `Components\ServiceLevelParcelforceEnum` + +```php +/** +* @var Components\ServiceLevelParcelforceEnum +*/ +Components\ServiceLevelParcelforceEnum $value = /* values here */ +``` + +### `Components\ServiceLevelPostItalianeEnum` + +```php +/** +* @var Components\ServiceLevelPostItalianeEnum +*/ +Components\ServiceLevelPostItalianeEnum $value = /* values here */ +``` + +### `Components\ServiceLevelePostGlobalEnum` + +```php +/** +* @var Components\ServiceLevelePostGlobalEnum +*/ +Components\ServiceLevelePostGlobalEnum $value = /* values here */ +``` + +### `Components\ServiceLevelRoyalMailEnum` + +```php +/** +* @var Components\ServiceLevelRoyalMailEnum +*/ +Components\ServiceLevelRoyalMailEnum $value = /* values here */ +``` + +### `Components\ServiceLevelSendleEnum` + +```php +/** +* @var Components\ServiceLevelSendleEnum +*/ +Components\ServiceLevelSendleEnum $value = /* values here */ +``` + +### `Components\ServiceLevelOnTracEnum` + +```php +/** +* @var Components\ServiceLevelOnTracEnum +*/ +Components\ServiceLevelOnTracEnum $value = /* values here */ +``` + +### `Components\ServiceLevelJitsuEnum` + +```php +/** +* @var Components\ServiceLevelJitsuEnum +*/ +Components\ServiceLevelJitsuEnum $value = /* values here */ +``` + +### `Components\ServiceLevelLasershipEnum` + +```php +/** +* @var Components\ServiceLevelLasershipEnum +*/ +Components\ServiceLevelLasershipEnum $value = /* values here */ +``` + +### `Components\ServiceLevelEvriUKEnum` + +```php +/** +* @var Components\ServiceLevelEvriUKEnum +*/ +Components\ServiceLevelEvriUKEnum $value = /* values here */ +``` + +### `Components\ServiceLevelUDSEnum` + +```php +/** +* @var Components\ServiceLevelUDSEnum +*/ +Components\ServiceLevelUDSEnum $value = /* values here */ +``` + +### `Components\ServiceLevelVehoEnum` + +```php +/** +* @var Components\ServiceLevelVehoEnum +*/ +Components\ServiceLevelVehoEnum $value = /* values here */ +``` + +### `Components\ServiceLevelSwyftEnum` + +```php +/** +* @var Components\ServiceLevelSwyftEnum +*/ +Components\ServiceLevelSwyftEnum $value = /* values here */ +``` + diff --git a/docs/Models/Components/ServiceLevelEvriUKEnum.md b/docs/Models/Components/ServiceLevelEvriUKEnum.md new file mode 100644 index 0000000..eca87e8 --- /dev/null +++ b/docs/Models/Components/ServiceLevelEvriUKEnum.md @@ -0,0 +1,21 @@ +# ServiceLevelEvriUKEnum + +|Token | Service name| +|:---|:---| +| hermes_uk_courier_service | Courier Collection| +| hermes_uk_parcelshop_dropoff | ParcelShop Drop-Off| +| hermes_uk_parcelshop_dropoff_nextday | ParcelShop Drop-Off Next Day| +| hermes_uk_postable | Postable| +| hermes_uk_postable_nextday | Postable Next Day| + + + +## Values + +| Name | Value | +| ------------------------------------ | ------------------------------------ | +| `HermesUkCourierService` | hermes_uk_courier_service | +| `HermesUkParcelshopDropoff` | hermes_uk_parcelshop_dropoff | +| `HermesUkParcelshopDropoffNextday` | hermes_uk_parcelshop_dropoff_nextday | +| `HermesUkPostable` | hermes_uk_postable | +| `HermesUkPostableNextday` | hermes_uk_postable_nextday | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelFedExEnum.md b/docs/Models/Components/ServiceLevelFedExEnum.md new file mode 100644 index 0000000..6dab00d --- /dev/null +++ b/docs/Models/Components/ServiceLevelFedExEnum.md @@ -0,0 +1,60 @@ +# ServiceLevelFedExEnum + +|Token | Service name| +|:---|:---| +| fedex_ground | FedEx Ground®| +| fedex_home_delivery | FedEx Home Delivery®| +| fedex_ground_economy | FedEx Ground® Economy| +| fedex_2_day | FedEx 2Day®| +| fedex_2_day_am | FedEx 2Day® A.M.| +| fedex_express_saver | FedEx Express Saver®| +| fedex_standard_overnight | FedEx Standard Overnight®| +| fedex_priority_overnight | FedEx Priority Overnight®| +| fedex_first_overnight | FedEx First Overnight®| +| fedex_international_economy | FedEx International Economy®| +| fedex_international_priority | FedEx International Priority®| +| fedex_international_first | FedEx International First®| +| fedex_europe_first_international_priority | FedEx International First®| +| fedex_international_connect_plus | FedEx International Connect Plus| +| fedex_first | FedEx First | +| fedex_priority | FedEx Priority | +| fedex_priority_express | FedEx Priority Express| +| fedex_economy_select | FedEx® Economy | +| fedex_regional_economy | FedEx® Regional Economy | +| fedex_first_overnight_extra_hours | First Overnight® EH | +| fedex_international_priority_express | International Priority® Express | +| fedex_next_day_mid_morning | Next Day Mid Morning | +| fedex_priority_overnight_extra_hours | Priority Overnight® EH | +| fedex_standard_overnight_extra_hours | Standard Overnight® EH | + + + +## Values + +| Name | Value | +| ----------------------------------------- | ----------------------------------------- | +| `FedexGround` | fedex_ground | +| `FedexHomeDelivery` | fedex_home_delivery | +| `FedexSmartPost` | fedex_smart_post | +| `FedexGroundEconomy` | fedex_ground_economy | +| `Fedex2Day` | fedex_2_day | +| `Fedex2DayAm` | fedex_2_day_am | +| `FedexExpressSaver` | fedex_express_saver | +| `FedexStandardOvernight` | fedex_standard_overnight | +| `FedexPriorityOvernight` | fedex_priority_overnight | +| `FedexFirstOvernight` | fedex_first_overnight | +| `FedexInternationalEconomy` | fedex_international_economy | +| `FedexInternationalPriority` | fedex_international_priority | +| `FedexInternationalFirst` | fedex_international_first | +| `FedexEuropeFirstInternationalPriority` | fedex_europe_first_international_priority | +| `FedexInternationalConnectPlus` | fedex_international_connect_plus | +| `FedexFirst` | fedex_first | +| `FedexPriority` | fedex_priority | +| `FedexPriorityExpress` | fedex_priority_express | +| `FedexEconomySelect` | fedex_economy_select | +| `FedexRegionalEconomy` | fedex_regional_economy | +| `FedexFirstOvernightExtraHours` | fedex_first_overnight_extra_hours | +| `FedexInternationalPriorityExpress` | fedex_international_priority_express | +| `FedexNextDayMidMorning` | fedex_next_day_mid_morning | +| `FedexPriorityOvernightExtraHours` | fedex_priority_overnight_extra_hours | +| `FedexStandardOvernightExtraHours` | fedex_standard_overnight_extra_hours | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelGLSUSEnum.md b/docs/Models/Components/ServiceLevelGLSUSEnum.md new file mode 100644 index 0000000..3060d97 --- /dev/null +++ b/docs/Models/Components/ServiceLevelGLSUSEnum.md @@ -0,0 +1,23 @@ +# ServiceLevelGLSUSEnum + +|Token | Service name| +|:---|:---| +| gls_us_cps | GSO Ground| +| gls_us_eps | Early Priority Overnight| +| gls_us_ess | Early Saturday Delivery| +| gls_us_nps | Noon Priority Overnight| +| gls_us_pds | Priority Overnight| +| gls_us_sds | Saturday Delivery| + + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `GlsUsCps` | gls_us_cps | +| `GlsUsEps` | gls_us_eps | +| `GlsUsEss` | gls_us_ess | +| `GlsUsNps` | gls_us_nps | +| `GlsUsPds` | gls_us_pds | +| `GlsUsSds` | gls_us_sds | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelGlobegisticsEnum.md b/docs/Models/Components/ServiceLevelGlobegisticsEnum.md new file mode 100644 index 0000000..4df3ade --- /dev/null +++ b/docs/Models/Components/ServiceLevelGlobegisticsEnum.md @@ -0,0 +1,35 @@ +# ServiceLevelGlobegisticsEnum + +|Token | Service name| +|:---|:---| +| globegistics_priority_mail_express_international | Globegistics Priority Mail Express International| +| globegistics_priority_mail_international | Globegistics Priority Mail International| +| globegistics_priority_mail_express_international_pds | Globegistics Priority Mail Express International PreSort Drop Ship| +| globegistics_priority_mail_international_pds | Globegistics Priority Mail International PreSort Drop Ship| +| globegistics_epacket | Globegistics ePacket| +| globegistics_ecom_tracked_ddp | Globegistics eCom Tracked DDP| +| globegistics_ecom_packet_ddp | Globegistics eCom Packet DDP| +| globegistics_ecom_priority_mail_international_ddp | Globegistics eCom Priority Mail International DDP| +| globegistics_ecom_priority_mail_express_international_ddp | Globegistics eCom Priority Mail Express International DDP| +| globegistics_ecom_extra | Globegistics eCom Extra| +| globegistics_ecom_international_priority_airmail | Globegistics eCom International Priority Airmail| +| globegistics_ecom_international_surface_airlift | Globegistics eCom International Surface Air Lift| + + + +## Values + +| Name | Value | +| --------------------------------------------------------- | --------------------------------------------------------- | +| `GlobegisticsPriorityMailExpressInternational` | globegistics_priority_mail_express_international | +| `GlobegisticsPriorityMailInternational` | globegistics_priority_mail_international | +| `GlobegisticsPriorityMailExpressInternationalPds` | globegistics_priority_mail_express_international_pds | +| `GlobegisticsPriorityMailInternationalPds` | globegistics_priority_mail_international_pds | +| `GlobegisticsEpacket` | globegistics_epacket | +| `GlobegisticsEcomTrackedDdp` | globegistics_ecom_tracked_ddp | +| `GlobegisticsEcomPacketDdp` | globegistics_ecom_packet_ddp | +| `GlobegisticsEcomPriorityMailInternationalDdp` | globegistics_ecom_priority_mail_international_ddp | +| `GlobegisticsEcomPriorityMailExpressInternationalDdp` | globegistics_ecom_priority_mail_express_international_ddp | +| `GlobegisticsEcomExtra` | globegistics_ecom_extra | +| `GlobegisticsEcomInternationalPriorityAirmail` | globegistics_ecom_international_priority_airmail | +| `GlobegisticsEcomInternationalSurfaceAirlift` | globegistics_ecom_international_surface_airlift | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelJitsuEnum.md b/docs/Models/Components/ServiceLevelJitsuEnum.md new file mode 100644 index 0000000..a1407c7 --- /dev/null +++ b/docs/Models/Components/ServiceLevelJitsuEnum.md @@ -0,0 +1,15 @@ +# ServiceLevelJitsuEnum + +|Token | Service name| +|:---|:---| +| axlehire_same_day | Same Day| +| axlehire_next_day | Next Day| + + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `AxlehireSameDay` | axlehire_same_day | +| `AxlehireNextDay` | axlehire_next_day | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelLSOEnum.md b/docs/Models/Components/ServiceLevelLSOEnum.md new file mode 100644 index 0000000..75cefa0 --- /dev/null +++ b/docs/Models/Components/ServiceLevelLSOEnum.md @@ -0,0 +1,23 @@ +# ServiceLevelLSOEnum + +|Token | Service name| +|:---|:---| +| lso_ground | Ground| +| lso_economy_next_day | Economy Next Day| +| lso_saturday_delivery | Saturday Delivery| +| lso_2nd_day | 2nd Day| +| lso_priority_next_day | Priority Next Day| +| lso_early_overnight | Early Overnight| + + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `LsoGround` | lso_ground | +| `LsoEconomyNextDay` | lso_economy_next_day | +| `LsoSaturdayDelivery` | lso_saturday_delivery | +| `Lso2ndDay` | lso_2nd_day | +| `LsoPriorityNextDay` | lso_priority_next_day | +| `LsoEarlyOvernight` | lso_early_overnight | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelLasershipEnum.md b/docs/Models/Components/ServiceLevelLasershipEnum.md new file mode 100644 index 0000000..dd44d39 --- /dev/null +++ b/docs/Models/Components/ServiceLevelLasershipEnum.md @@ -0,0 +1,13 @@ +# ServiceLevelLasershipEnum + +|Token | Service name| +|:---|:---| +| lasership_routed_delivery | Routed Delivery| + + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `LasershipRoutedDelivery` | lasership_routed_delivery | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelMondialRelayEnum.md b/docs/Models/Components/ServiceLevelMondialRelayEnum.md new file mode 100644 index 0000000..ac4bfc6 --- /dev/null +++ b/docs/Models/Components/ServiceLevelMondialRelayEnum.md @@ -0,0 +1,13 @@ +# ServiceLevelMondialRelayEnum + +|Token | Service name| +|:---|:---| +| mondial_relay_pointrelais | Point Relais| + + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `MondialRelayPointrelais` | mondial_relay_pointrelais | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelOnTracEnum.md b/docs/Models/Components/ServiceLevelOnTracEnum.md new file mode 100644 index 0000000..5ac0782 --- /dev/null +++ b/docs/Models/Components/ServiceLevelOnTracEnum.md @@ -0,0 +1,17 @@ +# ServiceLevelOnTracEnum + +|Token | Service name| +|:---|:---| +| ontrac_ground | Ground| +| ontrac_sunrise_gold | Sunrise Gold| +| ontrac_sunrise | Sunrise| + + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `OntracGround` | ontrac_ground | +| `OntracSunriseGold` | ontrac_sunrise_gold | +| `OntracSunrise` | ontrac_sunrise | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelParcelforceEnum.md b/docs/Models/Components/ServiceLevelParcelforceEnum.md new file mode 100644 index 0000000..8c5825c --- /dev/null +++ b/docs/Models/Components/ServiceLevelParcelforceEnum.md @@ -0,0 +1,17 @@ +# ServiceLevelParcelforceEnum + +|Token | Service name| +|:---|:---| +| parcelforce_express48 | Express 48| +| parcelforce_express24 | Express 24| +| parcelforce_expressam | Express AM| + + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `ParcelforceExpress48` | parcelforce_express48 | +| `ParcelforceExpress24` | parcelforce_express24 | +| `ParcelforceExpressam` | parcelforce_expressam | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelPostItalianeEnum.md b/docs/Models/Components/ServiceLevelPostItalianeEnum.md new file mode 100644 index 0000000..11dfc9f --- /dev/null +++ b/docs/Models/Components/ServiceLevelPostItalianeEnum.md @@ -0,0 +1,13 @@ +# ServiceLevelPostItalianeEnum + +|Token | Service name| +|:---|:---| +| poste_italiane_delivery_business_express | Poste Delivery Business Express| + + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `PosteItalianeDeliveryBusinessExpress` | poste_italiane_delivery_business_express | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelPurolatorEnum.md b/docs/Models/Components/ServiceLevelPurolatorEnum.md new file mode 100644 index 0000000..363de91 --- /dev/null +++ b/docs/Models/Components/ServiceLevelPurolatorEnum.md @@ -0,0 +1,47 @@ +# ServiceLevelPurolatorEnum + +|Token | Service name| +|:---|:---| +| purolator_ground | Ground| +| purolator_ground9_am | Ground 9am| +| purolator_ground1030_am | Ground 10:30am| +| purolator_ground_distribution | Ground Distribution| +| purolator_ground_evening | Ground Evening| +| purolator_ground_us | Ground US| +| purolator_express | Express| +| purolator_express9_am | Express 9am| +| purolator_express1030_am | Express 10am| +| purolator_express_evening | Express Evening| +| purolator_express_us | Express US| +| purolator_express_us9_am | Express US 9am| +| purolator_express_us1030_am | Express US 10:30am| +| purolator_express_us1200 | Express US 12pm| +| purolator_express_international | Express International| +| purolator_express_international9_am | Express International 9am| +| purolator_express_international1030_am | Express International 10:30am| +| purolator_express_international1200 | Express International 12pm| + + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `PurolatorGround` | purolator_ground | +| `PurolatorGround9Am` | purolator_ground9_am | +| `PurolatorGround1030Am` | purolator_ground1030_am | +| `PurolatorGroundDistribution` | purolator_ground_distribution | +| `PurolatorGroundEvening` | purolator_ground_evening | +| `PurolatorGroundUs` | purolator_ground_us | +| `PurolatorExpress` | purolator_express | +| `PurolatorExpress9Am` | purolator_express9_am | +| `PurolatorExpress1030Am` | purolator_express1030_am | +| `PurolatorExpressEvening` | purolator_express_evening | +| `PurolatorExpressUs` | purolator_express_us | +| `PurolatorExpressUs9Am` | purolator_express_us9_am | +| `PurolatorExpressUs1030Am` | purolator_express_us1030_am | +| `PurolatorExpressUs1200` | purolator_express_us1200 | +| `PurolatorExpressInternational` | purolator_express_international | +| `PurolatorExpressInternational9Am` | purolator_express_international9_am | +| `PurolatorExpressInternational1030Am` | purolator_express_international1030_am | +| `PurolatorExpressInternational1200` | purolator_express_international1200 | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelRoyalMailEnum.md b/docs/Models/Components/ServiceLevelRoyalMailEnum.md new file mode 100644 index 0000000..10a0161 --- /dev/null +++ b/docs/Models/Components/ServiceLevelRoyalMailEnum.md @@ -0,0 +1,51 @@ +# ServiceLevelRoyalMailEnum + +|Token | Service name| +|:---|:---| +| royal_mail_tracked_letter_boxable_24_no_signature | Royal Mail Tracked Letter-Boxable 24 No Signature| +| royal_mail_tracked_letter_boxable_48_no_signature | Royal Mail Tracked Letter-Boxable 48 No Signature| +| royal_mail_tracked_24_returns | Royal Mail Tracked Returns 24| +| royal_mail_tracked_48_returns | Royal Mail Tracked Returns 48| +| royal_mail_special_delivery_guaranteed_1pm | Special Delivery Guaranteed by 1pm +| royal_mail_special_delivery_guaranteed_9am | Special Delivery Guaranteed by 9am +| royal_mail_24 | RoyalMail 24 +| royal_mail_48 | RoyalMail 48 +| royal_mail_signed_for_first_class | Signed for First Class +| royal_mail_signed_for_second_class | Signed for Second Class +| royal_mail_standard_first_class | Standard First Class +| royal_mail_standard_second_class | Standard Second Class +| royal_mail_tracked_24_no_signature | Royal Mail Tracked 24 No Signature +| royal_mail_tracked_48_no_signature | Royal Mail Ttacked 48 No Signature +| royal_mail_intl_bus_mail_lrg_ltr_zone_sort_pri | International Business Mail Large Letter Zone Sort Priority +| royal_mail_intl_bus_parcels_tracked_zone_sort | International Business Parcels Tracked Zone Sort +| royal_mail_intl_bus_parcels_tracked_country_priced | International Business Parcels Tracked Country Priced +| royal_mail_intl_bus_parcels_tracked_signed_zone_srt | International Business Parcels & Signed Zone Sort +| royal_mail_24_flat_rate | Royal Mail 24 Parcel Flat Rate +| royal_mail_48_flat_rate | Royal Mail 48 Parcel Flat Rate + + + +## Values + +| Name | Value | +| --------------------------------------------------- | --------------------------------------------------- | +| `RoyalMailTrackedLetterBoxable24NoSignature` | royal_mail_tracked_letter_boxable_24_no_signature | +| `RoyalMailTrackedLetterBoxable48NoSignature` | royal_mail_tracked_letter_boxable_48_no_signature | +| `RoyalMailTracked24Returns` | royal_mail_tracked_24_returns | +| `RoyalMailTracked48Returns` | royal_mail_tracked_48_returns | +| `RoyalMailSpecialDeliveryGuaranteed1pm` | royal_mail_special_delivery_guaranteed_1pm | +| `RoyalMailSpecialDeliveryGuaranteed9am` | royal_mail_special_delivery_guaranteed_9am | +| `RoyalMail24` | royal_mail_24 | +| `RoyalMail48` | royal_mail_48 | +| `RoyalMailSignedForFirstClass` | royal_mail_signed_for_first_class | +| `RoyalMailSignedForSecondClass` | royal_mail_signed_for_second_class | +| `RoyalMailStandardFirstClass` | royal_mail_standard_first_class | +| `RoyalMailStandardSecondClass` | royal_mail_standard_second_class | +| `RoyalMailTracked24NoSignature` | royal_mail_tracked_24_no_signature | +| `RoyalMailTracked48NoSignature` | royal_mail_tracked_48_no_signature | +| `RoyalMailIntlBusMailLrgLtrZoneSortPri` | royal_mail_intl_bus_mail_lrg_ltr_zone_sort_pri | +| `RoyalMailIntlBusParcelsTrackedZoneSort` | royal_mail_intl_bus_parcels_tracked_zone_sort | +| `RoyalMailIntlBusParcelsTrackedCountryPriced` | royal_mail_intl_bus_parcels_tracked_country_priced | +| `RoyalMailIntlBusParcelsTrackedSignedZoneSrt` | royal_mail_intl_bus_parcels_tracked_signed_zone_srt | +| `RoyalMail24FlatRate` | royal_mail_24_flat_rate | +| `RoyalMail48FlatRate` | royal_mail_48_flat_rate | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelSendleEnum.md b/docs/Models/Components/ServiceLevelSendleEnum.md new file mode 100644 index 0000000..9f35d00 --- /dev/null +++ b/docs/Models/Components/ServiceLevelSendleEnum.md @@ -0,0 +1,15 @@ +# ServiceLevelSendleEnum + +|Token | Service name| +|:---|:---| +| sendle_parcel | Sendle Parcel| +| sendle_standard_dropoff | Sendle Standard Dropoff| + + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `SendleParcel` | sendle_parcel | +| `SendleStandardDropoff` | sendle_standard_dropoff | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelSwyftEnum.md b/docs/Models/Components/ServiceLevelSwyftEnum.md new file mode 100644 index 0000000..d3738a3 --- /dev/null +++ b/docs/Models/Components/ServiceLevelSwyftEnum.md @@ -0,0 +1,15 @@ +# ServiceLevelSwyftEnum + +|Token | Service name| +|:---|:---| +| same_day | Next Day| +| next_day | Next Day| + + + +## Values + +| Name | Value | +| --------- | --------- | +| `SameDay` | same_day | +| `NextDay` | next_day | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelUDSEnum.md b/docs/Models/Components/ServiceLevelUDSEnum.md new file mode 100644 index 0000000..3633674 --- /dev/null +++ b/docs/Models/Components/ServiceLevelUDSEnum.md @@ -0,0 +1,13 @@ +# ServiceLevelUDSEnum + +|Token | Service name| +|:---|:---| +| uds_next_day | Next Day| + + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `UdsNextDay` | uds_next_day | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelUPSEnum.md b/docs/Models/Components/ServiceLevelUPSEnum.md new file mode 100644 index 0000000..1e4a8d1 --- /dev/null +++ b/docs/Models/Components/ServiceLevelUPSEnum.md @@ -0,0 +1,61 @@ +# ServiceLevelUPSEnum + +|Token | Service name| +|:---|:---| +| ups_standard | Standard℠| +| ups_ground | Ground| +| ups_saver | Saver®| +| ups_3_day_select | 3 Day Select®| +| ups_second_day_air | 2nd Day Air®| +| ups_second_day_air_am | 2nd Day Air® A.M.| +| ups_next_day_air | Next Day Air®| +| ups_next_day_air_saver | Next Day Air Saver®| +| ups_next_day_air_early_am | Next Day Air® Early| +| ups_mail_innovations_bpm_flat | Mail Innovations BPM Flat | +| ups_mail_innovations_bpm_parcel | Mail Innovations BPM Parcel | +| ups_mail_innovations_irregular | Mail Innovations Irregular | +| ups_mail_innovations_media_mail | Mail Innovations Media Mail | +| ups_mail_innovations_parcel | Mail Innovations Parcel | +| ups_mail_innovations_standard_flat | Mail Innovations Standard Flat | +| ups_surepost | Surepost| +| ups_surepost_bound_printed_matter | SurePost® Bound Printed Matter| +| ups_surepost_lightweight | Surepost Lightweight| +| ups_surepost_media | SurePost® Media| +| ups_express | Express®| +| ups_express_1200 | Express 12:00| +| ups_express_plus | Express Plus®| +| ups_expedited | Expedited®| +| ups_express_early | Express® Early| +| ups_access_point_economy | Access Point™ Economy| + + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `UpsStandard` | ups_standard | +| `UpsGround` | ups_ground | +| `UpsSaver` | ups_saver | +| `Ups3DaySelect` | ups_3_day_select | +| `UpsSecondDayAir` | ups_second_day_air | +| `UpsSecondDayAirAm` | ups_second_day_air_am | +| `UpsNextDayAir` | ups_next_day_air | +| `UpsNextDayAirSaver` | ups_next_day_air_saver | +| `UpsNextDayAirEarlyAm` | ups_next_day_air_early_am | +| `UpsMailInnovationsBpmFlat` | ups_mail_innovations_bpm_flat | +| `UpsMailInnovationsBpmParcel` | ups_mail_innovations_bpm_parcel | +| `UpsMailInnovationsIrregular` | ups_mail_innovations_irregular | +| `UpsMailInnovationsMediaMail` | ups_mail_innovations_media_mail | +| `UpsMailInnovationsParcel` | ups_mail_innovations_parcel | +| `UpsMailInnovationsStandardFlat` | ups_mail_innovations_standard_flat | +| `UpsSurepost` | ups_surepost | +| `UpsSurepostBoundPrintedMatter` | ups_surepost_bound_printed_matter | +| `UpsSurepostLightweight` | ups_surepost_lightweight | +| `UpsSurepostMedia` | ups_surepost_media | +| `UpsExpress` | ups_express | +| `UpsExpress1200` | ups_express_1200 | +| `UpsExpressPlus` | ups_express_plus | +| `UpsExpedited` | ups_expedited | +| `UpsExpressEarly` | ups_express_early | +| `UpsAccessPointEconomy` | ups_access_point_economy | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelUSPSEnum.md b/docs/Models/Components/ServiceLevelUSPSEnum.md new file mode 100644 index 0000000..652aedc --- /dev/null +++ b/docs/Models/Components/ServiceLevelUSPSEnum.md @@ -0,0 +1,25 @@ +# ServiceLevelUSPSEnum + +|Token | Service name| +|:---|:---| +| usps_priority | Priority Mail| +| usps_priority_express | Priority Mail Express| +| usps_media_mail | Media Mail, only for existing Shippo customers with grandfathered Media Mail option.| +| usps_priority_mail_international | Priority Mail International| +| usps_priority_mail_express_international | Priority Mail Express International| +| usps_first_class_package_international_service | First Class Package International| +| usps_ground_advantage | Ground Advantage | + + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `UspsPriority` | usps_priority | +| `UspsPriorityExpress` | usps_priority_express | +| `UspsMediaMail` | usps_media_mail | +| `UspsPriorityMailInternational` | usps_priority_mail_international | +| `UspsPriorityMailExpressInternational` | usps_priority_mail_express_international | +| `UspsFirstClassPackageInternationalService` | usps_first_class_package_international_service | +| `UspsGroundAdvantage` | usps_ground_advantage | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelVehoEnum.md b/docs/Models/Components/ServiceLevelVehoEnum.md new file mode 100644 index 0000000..fd303bb --- /dev/null +++ b/docs/Models/Components/ServiceLevelVehoEnum.md @@ -0,0 +1,13 @@ +# ServiceLevelVehoEnum + +|Token | Service name| +|:---|:---| +| veho_next_day | Veho Next Day | + + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `VehoNextDay` | veho_next_day | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelWithParent.md b/docs/Models/Components/ServiceLevelWithParent.md index 355ea20..bdd84ce 100644 --- a/docs/Models/Components/ServiceLevelWithParent.md +++ b/docs/Models/Components/ServiceLevelWithParent.md @@ -11,4 +11,4 @@ Contains details regarding the service level for the given rate. | `terms` | *?string* | :heavy_minus_sign: | Further clarification of the service. | | | `token` | *?string* | :heavy_minus_sign: | Token of the Rate's servicelevel, e.g. `usps_priority` or `fedex_ground`.
See servicelevels. | usps_priority_express | | `extendedToken` | *?string* | :heavy_minus_sign: | Unique, extended version of the Service Level "token".
Guaranteed to be unique across all Service Levels, and may help offer insight into the specific Service Level it describes. | | -| `parentServicelevel` | [?\Shippo\API\Models\Components\ParentServicelevel](../../Models/Components/ParentServicelevel.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `parentServicelevel` | [?Components\ServiceLevel](../../Models/Components/ServiceLevel.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/ServiceLevelePostGlobalEnum.md b/docs/Models/Components/ServiceLevelePostGlobalEnum.md new file mode 100644 index 0000000..0740c79 --- /dev/null +++ b/docs/Models/Components/ServiceLevelePostGlobalEnum.md @@ -0,0 +1,37 @@ +# ServiceLevelePostGlobalEnum + +|Token | Service name| +|:---|:---| +| rr_donnelley_domestic_economy_parcel | Domestic Economy Parcel| +| rr_donnelley_domestic_priority_parcel | Domestic Priority Parcel | +| rr_donnelley_domestic_parcel_bpm | Domestic Parcel BPM| +| rr_donnelley_priority_domestic_priority_parcel_bpm | Domestic Priority Parcel BPM| +| rr_donnelley_priority_parcel_delcon | International Priority Parcel DelCon| +| rr_donnelley_priority_parcel_nondelcon | International Priority Parcel NonDelcon| +| rr_donnelley_economy_parcel | Economy Parcel Service | +| rr_donnelley_ipa | International Priority Airmail (IPA)| +| rr_donnelley_courier | International Courier| +| rr_donnelley_isal | International Surface Air Lift (ISAL)| +| rr_donnelley_epacket | e-Packet| +| rr_donnelley_pmi | Priority Mail International| +| rr_donnelley_emi | Express Mail International| + + + +## Values + +| Name | Value | +| -------------------------------------------------- | -------------------------------------------------- | +| `RrDonnelleyDomesticEconomyParcel` | rr_donnelley_domestic_economy_parcel | +| `RrDonnelleyDomesticPriorityParcel` | rr_donnelley_domestic_priority_parcel | +| `RrDonnelleyDomesticParcelBpm` | rr_donnelley_domestic_parcel_bpm | +| `RrDonnelleyPriorityDomesticPriorityParcelBpm` | rr_donnelley_priority_domestic_priority_parcel_bpm | +| `RrDonnelleyPriorityParcelDelcon` | rr_donnelley_priority_parcel_delcon | +| `RrDonnelleyPriorityParcelNondelcon` | rr_donnelley_priority_parcel_nondelcon | +| `RrDonnelleyEconomyParcel` | rr_donnelley_economy_parcel | +| `RrDonnelleyIpa` | rr_donnelley_ipa | +| `RrDonnelleyCourier` | rr_donnelley_courier | +| `RrDonnelleyIsal` | rr_donnelley_isal | +| `RrDonnelleyEpacket` | rr_donnelley_epacket | +| `RrDonnelleyPmi` | rr_donnelley_pmi | +| `RrDonnelleyEmi` | rr_donnelley_emi | \ No newline at end of file diff --git a/docs/Models/Components/Shipment.md b/docs/Models/Components/Shipment.md index 306bbee..80dc61d 100644 --- a/docs/Models/Components/Shipment.md +++ b/docs/Models/Components/Shipment.md @@ -7,20 +7,20 @@ Shipment represents the parcel as retrieved from the database | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `extra` | [?\Shippo\API\Models\Components\ShipmentExtra](../../Models/Components/ShipmentExtra.md) | :heavy_minus_sign: | An object holding optional extra services to be requested. | | | `metadata` | *string* | :heavy_check_mark: | A string of up to 100 characters that can be filled with any additional information you want to attach to the object. | Customer ID 123456 | -| `shipmentDate` | *?string* | :heavy_minus_sign: | Date the shipment will be tendered to the carrier. Must be in the format `2014-01-18T00:35:03.463Z`.
Defaults to current date and time if no value is provided. Please note that some carriers require this value to
be in the future, on a working day, or similar. | 2021-03-22T12:00:00Z | -| `addressFrom` | [\Shippo\API\Models\Components\Address](../../Models/Components/Address.md) | :heavy_check_mark: | Address object of the sender / seller. Will be returned expanded by default. | | -| `addressReturn` | [?\Shippo\API\Models\Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | ID of the Address object where the shipment will be sent back to if it is not delivered
(Only available for UPS, USPS, and Fedex shipments).

If this field is not set, your shipments will be returned to the address_from. | | -| `addressTo` | [\Shippo\API\Models\Components\Address](../../Models/Components/Address.md) | :heavy_check_mark: | Address object of the recipient / buyer. Will be returned expanded by default. | | +| `addressFrom` | [Components\Address](../../Models/Components/Address.md) | :heavy_check_mark: | Address object of the sender / seller. Will be returned expanded by default. | | +| `addressTo` | [Components\Address](../../Models/Components/Address.md) | :heavy_check_mark: | Address object of the recipient / buyer. Will be returned expanded by default. | | | `carrierAccounts` | array<*string*> | :heavy_check_mark: | An array of object_ids of the carrier account objects to be used for getting shipping rates for this shipment.
If no carrier account object_ids are set in this field, Shippo will attempt to generate rates using all the
carrier accounts that have the `active` field set. | | -| `customsDeclaration` | [?\Shippo\API\Models\Components\CustomsDeclaration](../../Models/Components/CustomsDeclaration.md) | :heavy_minus_sign: | N/A | | -| `messages` | array<[\Shippo\API\Models\Components\ResponseMessage](../../Models/Components/ResponseMessage.md)> | :heavy_check_mark: | N/A | | +| `messages` | array<[Components\ResponseMessage](../../Models/Components/ResponseMessage.md)> | :heavy_check_mark: | N/A | | | `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Date and time of Shipment creation. | | | `objectId` | *string* | :heavy_check_mark: | Unique identifier of the given Shipment object. | adcfdddf8ec64b84ad22772bce3ea37a | | `objectOwner` | *string* | :heavy_check_mark: | Username of the user who created the Shipment object. | pp@gmail.com | | `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Date and time of last Shipment update. | | -| `parcels` | array<[\Shippo\API\Models\Components\Parcel](../../Models/Components/Parcel.md)> | :heavy_check_mark: | List of Parcel objects to be shipped. | | -| `rates` | array<[\Shippo\API\Models\Components\Rate](../../Models/Components/Rate.md)> | :heavy_check_mark: | An array with all available rates. If async has been set to false in the request,
this will be populated with all available rates in the response. Otherwise rates will be created
asynchronously and this array will initially be empty. | | -| `status` | [\Shippo\API\Models\Components\ShipmentStatus](../../Models/Components/ShipmentStatus.md) | :heavy_check_mark: | `Waiting` shipments have been successfully submitted but not yet been processed.
`Queued` shipments are currently being processed.
`Success` shipments have been processed successfully, meaning that rate generation has concluded.
`Error` does not occur currently and is reserved for future use. | SUCCESS | +| `parcels` | array<[Components\Parcel](../../Models/Components/Parcel.md)> | :heavy_check_mark: | List of Parcel objects to be shipped. | | +| `rates` | array<[Components\Rate](../../Models/Components/Rate.md)> | :heavy_check_mark: | An array with all available rates. If async has been set to false in the request,
this will be populated with all available rates in the response. Otherwise rates will be created
asynchronously and this array will initially be empty. | | +| `status` | [Components\ShipmentStatus](../../Models/Components/ShipmentStatus.md) | :heavy_check_mark: | `Waiting` shipments have been successfully submitted but not yet been processed.
`Queued` shipments are currently being processed.
`Success` shipments have been processed successfully, meaning that rate generation has concluded.
`Error` does not occur currently and is reserved for future use. | QUEUED | +| `extra` | [?Components\ShipmentExtra](../../Models/Components/ShipmentExtra.md) | :heavy_minus_sign: | An object holding optional extra services to be requested. | | +| `shipmentDate` | *?string* | :heavy_minus_sign: | Date the shipment will be tendered to the carrier. Must be in the format `2014-01-18T00:35:03.463Z`.
Defaults to current date and time if no value is provided. Please note that some carriers require this value to
be in the future, on a working day, or similar. | 2021-03-22T12:00:00Z | +| `addressReturn` | [?Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | ID of the Address object where the shipment will be sent back to if it is not delivered
(Only available for UPS, USPS, and Fedex shipments).

If this field is not set, your shipments will be returned to the address_from. | | +| `customsDeclaration` | [?Components\CustomsDeclaration](../../Models/Components/CustomsDeclaration.md) | :heavy_minus_sign: | N/A | | | `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | | \ No newline at end of file diff --git a/docs/Models/Components/ShipmentCreateRequest.md b/docs/Models/Components/ShipmentCreateRequest.md index a692831..4c0657e 100644 --- a/docs/Models/Components/ShipmentCreateRequest.md +++ b/docs/Models/Components/ShipmentCreateRequest.md @@ -5,13 +5,13 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `extra` | [?\Shippo\API\Models\Components\ShipmentExtra](../../Models/Components/ShipmentExtra.md) | :heavy_minus_sign: | An object holding optional extra services to be requested. | | +| `addressFrom` | [Components\AddressCreateRequest\|string](../../Models/Components/AddressFrom.md) | :heavy_check_mark: | N/A | | +| `addressTo` | [Components\AddressCreateRequest\|string](../../Models/Components/AddressTo.md) | :heavy_check_mark: | N/A | | +| `parcels` | array<[Components\ParcelCreateRequest\|Components\ParcelCreateFromTemplateRequest\|string](../../Models/Components/Parcels.md)> | :heavy_check_mark: | N/A | | +| `extra` | [?Components\ShipmentExtra](../../Models/Components/ShipmentExtra.md) | :heavy_minus_sign: | An object holding optional extra services to be requested. | | | `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want to attach to the object. | Customer ID 123456 | | `shipmentDate` | *?string* | :heavy_minus_sign: | Date the shipment will be tendered to the carrier. Must be in the format `2014-01-18T00:35:03.463Z`.
Defaults to current date and time if no value is provided. Please note that some carriers require this value to
be in the future, on a working day, or similar. | 2021-03-22T12:00:00Z | -| `addressFrom` | *mixed* | :heavy_check_mark: | N/A | | -| `addressReturn` | *mixed* | :heavy_minus_sign: | N/A | | -| `addressTo` | *mixed* | :heavy_check_mark: | N/A | | -| `customsDeclaration` | *mixed* | :heavy_minus_sign: | N/A | | +| `addressReturn` | [Components\AddressCreateRequest\|string\|null](../../Models/Components/AddressReturn.md) | :heavy_minus_sign: | N/A | | +| `customsDeclaration` | [Components\CustomsDeclarationCreateRequest\|string\|null](../../Models/Components/ShipmentCreateRequestCustomsDeclaration.md) | :heavy_minus_sign: | N/A | | | `async` | *?bool* | :heavy_minus_sign: | N/A | | -| `carrierAccounts` | array<*string*> | :heavy_minus_sign: | List of Carrier Accounts `object_id`s used to filter
the returned rates. If set, only rates from these carriers will be returned. | [
"065a4a8c10d24a34ab932163a1b87f52",
"73f706f4bdb94b54a337563840ce52b0"
] | -| `parcels` | array<*mixed*> | :heavy_check_mark: | N/A | | \ No newline at end of file +| `carrierAccounts` | array<*string*> | :heavy_minus_sign: | List of Carrier Accounts `object_id`s used to filter
the returned rates. If set, only rates from these carriers will be returned. | [
"065a4a8c10d24a34ab932163a1b87f52",
"73f706f4bdb94b54a337563840ce52b0"
] | \ No newline at end of file diff --git a/docs/Models/Components/ShipmentCreateRequestCustomsDeclaration.md b/docs/Models/Components/ShipmentCreateRequestCustomsDeclaration.md new file mode 100644 index 0000000..5264d9f --- /dev/null +++ b/docs/Models/Components/ShipmentCreateRequestCustomsDeclaration.md @@ -0,0 +1,23 @@ +# ShipmentCreateRequestCustomsDeclaration + + +## Supported Types + +### `Components\CustomsDeclarationCreateRequest` + +```php +/** +* @var Components\CustomsDeclarationCreateRequest +*/ +Components\CustomsDeclarationCreateRequest $value = /* values here */ +``` + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + diff --git a/docs/Models/Components/ShipmentExtra.md b/docs/Models/Components/ShipmentExtra.md index 5feeaaf..809c83d 100644 --- a/docs/Models/Components/ShipmentExtra.md +++ b/docs/Models/Components/ShipmentExtra.md @@ -5,55 +5,55 @@ An object holding optional extra services to be requested. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `accountsReceivableCustomerAccount` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `alcohol` | [?\Shippo\API\Models\Components\Alcohol](../../Models/Components/Alcohol.md) | :heavy_minus_sign: | Indicates that a shipment contains Alcohol (Fedex and UPS only). | -| `ancillaryEndorsement` | [?\Shippo\API\Models\Components\AncillaryEndorsement](../../Models/Components/AncillaryEndorsement.md) | :heavy_minus_sign: | Specify an ancillary service endorsement to provide the USPS with instructions on how to handle undeliverable-as-addressed pieces (DHL eCommerce only). | -| `appropriationNumber` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `authorityToLeave` | *?bool* | :heavy_minus_sign: | Request `true` to give carrier permission to leave the parcel in a safe place if no one answers the
door (where supported). When set to `false`, if no one is available to receive the item, the parcel
will not be left (*surcharges may be applicable). | -| `billOfLadingNumber` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `billing` | [?\Shippo\API\Models\Components\Billing](../../Models/Components/Billing.md) | :heavy_minus_sign: | Specify billing details (UPS, FedEx, and DHL Germany only). | -| `bypassAddressValidation` | *?bool* | :heavy_minus_sign: | Bypasses address validation (USPS, UPS, & LaserShip only). | -| `carbonNeutral` | *?bool* | :heavy_minus_sign: | Request carbon offsets by passing true (UPS only). | -| `carrierHubId` | *?string* | :heavy_minus_sign: | Identifies the carrier injection site. | -| `carrierHubTravelTime` | *?int* | :heavy_minus_sign: | Travel time in hours from fulfillment center to carrier injection site. | -| `cod` | [?\Shippo\API\Models\Components\Cod](../../Models/Components/Cod.md) | :heavy_minus_sign: | Specify collection on delivery details (UPS only). | -| `codNumber` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `containerType` | *?string* | :heavy_minus_sign: | Specify container type. | -| `criticalPullTime` | *?string* | :heavy_minus_sign: | Carrier arrival time to pickup packages from the fulfillment center.
UTC format: `%Y-%m-%dT%H:%M:%SZ` | -| `customerBranch` | *?string* | :heavy_minus_sign: | Specify customer branch (Lasership only). | -| `customerReference` | [?\Shippo\API\Models\Components\CustomerReference](../../Models/Components/CustomerReference.md) | :heavy_minus_sign: | Specify the reference field on the label (FedEx and UPS only). | -| `dangerousGoods` | [?\Shippo\API\Models\Components\DangerousGoodsObject](../../Models/Components/DangerousGoodsObject.md) | :heavy_minus_sign: | Container for specifying the presence of dangerous materials. This is specific to USPS, and if any contents
are provided, only certain USPS service levels will be eligible. For more information, see our
guide on hazardous or dangerous materials shipping. | -| `dangerousGoodsCode` | [?\Shippo\API\Models\Components\DangerousGoodsCode](../../Models/Components/DangerousGoodsCode.md) | :heavy_minus_sign: | Dangerous Goods Code (DHL eCommerce only). See Category Codes | -| `dealerOrderNumber` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `deliveryInstructions` | *?string* | :heavy_minus_sign: | Specify delivery instructions. Up to 500 characters. (FedEx and OnTrac only). | -| `deptNumber` | [?\Shippo\API\Models\Components\DepartmentNumber](../../Models/Components/DepartmentNumber.md) | :heavy_minus_sign: | Specify the department number field on the label (FedEx and UPS only). | -| `dryIce` | [?\Shippo\API\Models\Components\DryIce](../../Models/Components/DryIce.md) | :heavy_minus_sign: | Specify that the package contains Dry Ice (FedEx, Veho, and UPS only). | -| `fdaProductCode` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `fulfillmentCenter` | *?string* | :heavy_minus_sign: | The fulfilment center where the package originates from. | -| `insurance` | [?\Shippo\API\Models\Components\Insurance](../../Models/Components/Insurance.md) | :heavy_minus_sign: | To add 3rd party insurance powered by XCover, specify
`amount`, `content`, and `currency`.
Alternatively, you can choose carrier provided insurance by additionally specifying `provider` (UPS, FedEx and OnTrac only).

If you do not want to add insurance to you shipment, do not set these parameters. | -| `invoiceNumber` | [?\Shippo\API\Models\Components\InvoiceNumber](../../Models/Components/InvoiceNumber.md) | :heavy_minus_sign: | Specify the invoice number field on the label (FedEx and UPS only). | -| `isReturn` | *?bool* | :heavy_minus_sign: | This field specifies if it is a scan-based return shipment. See the Create a return shipment section for more details. | -| `lasershipAttrs` | array<[\Shippo\API\Models\Components\ShipmentExtraLasershipAttributesEnum](../../Models/Components/ShipmentExtraLasershipAttributesEnum.md)> | :heavy_minus_sign: | Specify Lasership Attributes (Lasership only). Multiple options accepted. | -| `lasershipDeclaredValue` | *?string* | :heavy_minus_sign: | Declared value (Lasership only). Defaults to `50.00`. | -| `manifestNumber` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `modelNumber` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `partNumber` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `poNumber` | [?\Shippo\API\Models\Components\PoNumber](../../Models/Components/PoNumber.md) | :heavy_minus_sign: | Specify the PO number field on the label (FedEx and UPS only). | -| `preferredDeliveryTimeframe` | [?\Shippo\API\Models\Components\PreferredDeliveryTimeframe](../../Models/Components/PreferredDeliveryTimeframe.md) | :heavy_minus_sign: | Required for DHL Germany Paket Sameday. Designates a desired timeframe for delivery. Format is `HHMMHHMM` | -| `premium` | *?bool* | :heavy_minus_sign: | Add premium service to a shipment (DHL Germany international shipments only). | -| `productionCode` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `purchaseRequestNumber` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `qrCodeRequested` | *?bool* | :heavy_minus_sign: | Request a QR code for a given transaction when creating a shipping label (USPS domestic and Evri UK only). | -| `reference1` | *?string* | :heavy_minus_sign: | Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. | -| `reference2` | *?string* | :heavy_minus_sign: | Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. For DHL eCommerce, this field can be used for billing reference. | -| `requestRetailRates` | *?bool* | :heavy_minus_sign: | Returns retail rates instead of account-based rates (UPS and FedEx only). | -| `returnServiceType` | *mixed* | :heavy_minus_sign: | Request additional return option for return shipments (UPS and Lasership only). | -| `rmaNumber` | [?\Shippo\API\Models\Components\RmaNumber](../../Models/Components/RmaNumber.md) | :heavy_minus_sign: | Specify the RMA number field on the label (FedEx and UPS only). | -| `saturdayDelivery` | *?bool* | :heavy_minus_sign: | Marks shipment as to be delivered on a Saturday. | -| `salespersonNumber` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `serialNumber` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `signatureConfirmation` | [?\Shippo\API\Models\Components\SignatureConfirmation](../../Models/Components/SignatureConfirmation.md) | :heavy_minus_sign: | Request standard or adult signature confirmation. You can alternatively request Certified Mail (USPS only)
or Indirect signature (FedEx only) or Carrier Confirmation (Deutsche Post only). | -| `storeNumber` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | -| `transactionReferenceNumber` | [?\Shippo\API\Models\Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountsReceivableCustomerAccount` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `alcohol` | [?Components\Alcohol](../../Models/Components/Alcohol.md) | :heavy_minus_sign: | Indicates that a shipment contains Alcohol (Fedex and UPS only). | +| `ancillaryEndorsement` | [?Components\AncillaryEndorsement](../../Models/Components/AncillaryEndorsement.md) | :heavy_minus_sign: | Specify an ancillary service endorsement to provide the USPS with instructions on how to handle undeliverable-as-addressed pieces (DHL eCommerce only). | +| `appropriationNumber` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `authorityToLeave` | *?bool* | :heavy_minus_sign: | Request `true` to give carrier permission to leave the parcel in a safe place if no one answers the
door (where supported). When set to `false`, if no one is available to receive the item, the parcel
will not be left (*surcharges may be applicable). | +| `billOfLadingNumber` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `billing` | [?Components\Billing](../../Models/Components/Billing.md) | :heavy_minus_sign: | Specify billing details (UPS, FedEx, and DHL Germany only). | +| `bypassAddressValidation` | *?bool* | :heavy_minus_sign: | Bypasses address validation (USPS, UPS, & LaserShip only). | +| `carbonNeutral` | *?bool* | :heavy_minus_sign: | Request carbon offsets by passing true (UPS only). | +| `carrierHubId` | *?string* | :heavy_minus_sign: | Identifies the carrier injection site. | +| `carrierHubTravelTime` | *?int* | :heavy_minus_sign: | Travel time in hours from fulfillment center to carrier injection site. | +| `cod` | [?Components\Cod](../../Models/Components/Cod.md) | :heavy_minus_sign: | Specify collection on delivery details (UPS only). | +| `codNumber` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `containerType` | *?string* | :heavy_minus_sign: | Specify container type. | +| `criticalPullTime` | *?string* | :heavy_minus_sign: | Carrier arrival time to pickup packages from the fulfillment center.
UTC format: `%Y-%m-%dT%H:%M:%SZ` | +| `customerBranch` | *?string* | :heavy_minus_sign: | Specify customer branch (Lasership only). | +| `customerReference` | [?Components\CustomerReference](../../Models/Components/CustomerReference.md) | :heavy_minus_sign: | Specify the reference field on the label (FedEx and UPS only). | +| `dangerousGoods` | [?Components\DangerousGoodsObject](../../Models/Components/DangerousGoodsObject.md) | :heavy_minus_sign: | Container for specifying the presence of dangerous materials. This is specific to USPS, and if any contents
are provided, only certain USPS service levels will be eligible. For more information, see our
guide on hazardous or dangerous materials shipping. | +| `dangerousGoodsCode` | [?Components\DangerousGoodsCode](../../Models/Components/DangerousGoodsCode.md) | :heavy_minus_sign: | Dangerous Goods Code (DHL eCommerce only). See Category Codes | +| `dealerOrderNumber` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `deliveryInstructions` | *?string* | :heavy_minus_sign: | Specify delivery instructions. Up to 500 characters. (FedEx and OnTrac only). | +| `deptNumber` | [?Components\DepartmentNumber](../../Models/Components/DepartmentNumber.md) | :heavy_minus_sign: | Specify the department number field on the label (FedEx and UPS only). | +| `dryIce` | [?Components\DryIce](../../Models/Components/DryIce.md) | :heavy_minus_sign: | Specify that the package contains Dry Ice (FedEx, Veho, and UPS only). | +| `fdaProductCode` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `fulfillmentCenter` | *?string* | :heavy_minus_sign: | The fulfilment center where the package originates from. | +| `insurance` | [?Components\Insurance](../../Models/Components/Insurance.md) | :heavy_minus_sign: | To add 3rd party insurance powered by XCover,
specify
`amount`, `content`, and `currency`.
Alternatively, you can choose carrier provided insurance
by additionally specifying `provider` (UPS, FedEx and OnTrac only).

If you do not want to add insurance
to your shipment, do not set these parameters. | +| `invoiceNumber` | [?Components\InvoiceNumber](../../Models/Components/InvoiceNumber.md) | :heavy_minus_sign: | Specify the invoice number field on the label (FedEx and UPS only). | +| `isReturn` | *?bool* | :heavy_minus_sign: | This field specifies if it is a scan-based return shipment. See the Create a return shipment section for more details. | +| `lasershipAttrs` | array<[Components\ShipmentExtraLasershipAttributesEnum](../../Models/Components/ShipmentExtraLasershipAttributesEnum.md)> | :heavy_minus_sign: | Specify Lasership Attributes (Lasership only). Multiple options accepted. | +| `lasershipDeclaredValue` | *?string* | :heavy_minus_sign: | Declared value (Lasership only). Defaults to `50.00`. | +| `manifestNumber` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `modelNumber` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `partNumber` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `poNumber` | [?Components\PoNumber](../../Models/Components/PoNumber.md) | :heavy_minus_sign: | Specify the PO number field on the label (FedEx and UPS only). | +| `preferredDeliveryTimeframe` | [?Components\PreferredDeliveryTimeframe](../../Models/Components/PreferredDeliveryTimeframe.md) | :heavy_minus_sign: | Required for DHL Germany Paket Sameday. Designates a desired timeframe for delivery. Format is `HHMMHHMM` | +| `premium` | *?bool* | :heavy_minus_sign: | Add premium service to a shipment (DHL Germany international shipments only). | +| `productionCode` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `purchaseRequestNumber` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `qrCodeRequested` | *?bool* | :heavy_minus_sign: | Request a QR code for a given transaction when creating a shipping label (USPS domestic and Evri UK only). | +| `reference1` | *?string* | :heavy_minus_sign: | Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. | +| `reference2` | *?string* | :heavy_minus_sign: | Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. For DHL eCommerce, this field can be used for billing reference. | +| `requestRetailRates` | *?bool* | :heavy_minus_sign: | Returns retail rates instead of account-based rates (UPS and FedEx only). | +| `returnServiceType` | [Components\ShipmentExtraReturnServiceTypeUPSEnum\|Components\ShipmentExtraReturnServiceTypeLasershipEnum\|null](../../Models/Components/ReturnServiceType.md) | :heavy_minus_sign: | Request additional return option for return shipments (UPS and Lasership only). | +| `rmaNumber` | [?Components\RmaNumber](../../Models/Components/RmaNumber.md) | :heavy_minus_sign: | Specify the RMA number field on the label (FedEx and UPS only). | +| `saturdayDelivery` | *?bool* | :heavy_minus_sign: | Marks shipment as to be delivered on a Saturday. | +| `salespersonNumber` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `serialNumber` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `signatureConfirmation` | [?Components\SignatureConfirmation](../../Models/Components/SignatureConfirmation.md) | :heavy_minus_sign: | Request standard or adult signature confirmation. You can alternatively request Certified Mail (USPS only)
or Indirect signature (FedEx only) or Carrier Confirmation (Deutsche Post only). | +| `storeNumber` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | +| `transactionReferenceNumber` | [?Components\UPSReferenceFields](../../Models/Components/UPSReferenceFields.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/ShipmentExtraReturnServiceTypeLasershipEnum.md b/docs/Models/Components/ShipmentExtraReturnServiceTypeLasershipEnum.md new file mode 100644 index 0000000..edf8991 --- /dev/null +++ b/docs/Models/Components/ShipmentExtraReturnServiceTypeLasershipEnum.md @@ -0,0 +1,8 @@ +# ShipmentExtraReturnServiceTypeLasershipEnum + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `NoReturn` | NO_RETURN | \ No newline at end of file diff --git a/docs/Models/Components/ShipmentExtraReturnServiceTypeUPSEnum.md b/docs/Models/Components/ShipmentExtraReturnServiceTypeUPSEnum.md new file mode 100644 index 0000000..d41d766 --- /dev/null +++ b/docs/Models/Components/ShipmentExtraReturnServiceTypeUPSEnum.md @@ -0,0 +1,11 @@ +# ShipmentExtraReturnServiceTypeUPSEnum + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `PrintAndMail` | PRINT_AND_MAIL | +| `Attempt1` | ATTEMPT_1 | +| `Attempt3` | ATTEMPT_3 | +| `ElectronicLabel` | ELECTRONIC_LABEL | \ No newline at end of file diff --git a/docs/Models/Components/ShipmentPaginatedList.md b/docs/Models/Components/ShipmentPaginatedList.md index f655d3a..11ed19f 100644 --- a/docs/Models/Components/ShipmentPaginatedList.md +++ b/docs/Models/Components/ShipmentPaginatedList.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\Shipment](../../Models/Components/Shipment.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\Shipment](../../Models/Components/Shipment.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/ShipmentStatus.md b/docs/Models/Components/ShipmentStatus.md index 904ebd6..2f4dc3f 100644 --- a/docs/Models/Components/ShipmentStatus.md +++ b/docs/Models/Components/ShipmentStatus.md @@ -13,4 +13,4 @@ | `Error` | ERROR | | `Queued` | QUEUED | | `Success` | SUCCESS | -| `Status` | STATUS | \ No newline at end of file +| `Waiting` | WAITING | \ No newline at end of file diff --git a/docs/Models/Components/ShippoAccountPaginatedList.md b/docs/Models/Components/ShippoAccountPaginatedList.md index 1d9ec7f..4b6e809 100644 --- a/docs/Models/Components/ShippoAccountPaginatedList.md +++ b/docs/Models/Components/ShippoAccountPaginatedList.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\ShippoAccount](../../Models/Components/ShippoAccount.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\ShippoAccount](../../Models/Components/ShippoAccount.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/Track.md b/docs/Models/Components/Track.md index ddbd186..c46eb88 100644 --- a/docs/Models/Components/Track.md +++ b/docs/Models/Components/Track.md @@ -5,15 +5,15 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `addressFrom` | [?\Shippo\API\Models\Components\TrackingStatusLocationBase](../../Models/Components/TrackingStatusLocationBase.md) | :heavy_minus_sign: | The sender address with city, state, zip and country information. | | -| `addressTo` | [?\Shippo\API\Models\Components\TrackingStatusLocationBase](../../Models/Components/TrackingStatusLocationBase.md) | :heavy_minus_sign: | The recipient address with city, state, zip and country information. | | | `carrier` | *string* | :heavy_check_mark: | Name of the carrier of the shipment to track. See Carriers. | usps | -| `eta` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | The estimated time of arrival according to the carrier, this might be updated by carriers during the life of the shipment. | | | `messages` | array<*string*> | :heavy_check_mark: | N/A | | +| `trackingHistory` | array<[Components\TrackingStatus](../../Models/Components/TrackingStatus.md)> | :heavy_check_mark: | A list of tracking events, following the same structure as tracking_status.
It contains a full history of all tracking statuses, starting with the earlier tracking event first. | | +| `trackingNumber` | *string* | :heavy_check_mark: | Tracking number to track. | 9205590164917312751089 | +| `addressFrom` | [?Components\TrackingStatusLocationBase](../../Models/Components/TrackingStatusLocationBase.md) | :heavy_minus_sign: | The sender address with city, state, zip and country information. | | +| `addressTo` | [?Components\TrackingStatusLocationBase](../../Models/Components/TrackingStatusLocationBase.md) | :heavy_minus_sign: | The recipient address with city, state, zip and country information. | | +| `eta` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | The estimated time of arrival according to the carrier, this might be updated by carriers during the life of the shipment. | | | `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want to attach to the object. | Order 000123 | | `originalEta` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | The estimated time of arrival according to the carrier at the time the shipment first entered the system. | 2021-07-23T00:00:00Z | -| `servicelevel` | [?\Shippo\API\Models\Components\ServiceLevelWithParent](../../Models/Components/ServiceLevelWithParent.md) | :heavy_minus_sign: | N/A | | -| `trackingHistory` | array<[\Shippo\API\Models\Components\TrackingStatus](../../Models/Components/TrackingStatus.md)> | :heavy_check_mark: | A list of tracking events, following the same structure as tracking_status.
It contains a full history of all tracking statuses, starting with the earlier tracking event first. | | -| `trackingNumber` | *string* | :heavy_check_mark: | Tracking number to track. | 9205590164917312751089 | -| `trackingStatus` | [?\Shippo\API\Models\Components\TrackingStatus](../../Models/Components/TrackingStatus.md) | :heavy_minus_sign: | The latest tracking information of this shipment. | | +| `servicelevel` | [?Components\ServiceLevelWithParent](../../Models/Components/ServiceLevelWithParent.md) | :heavy_minus_sign: | N/A | | +| `trackingStatus` | [?Components\TrackingStatus](../../Models/Components/TrackingStatus.md) | :heavy_minus_sign: | The latest tracking information of this shipment. | | | `transaction` | *?string* | :heavy_minus_sign: | The object_id of the transaction associated with this tracking object.
This field is visible only to the object owner of the transaction. | | \ No newline at end of file diff --git a/docs/Models/Components/TrackingStatus.md b/docs/Models/Components/TrackingStatus.md index 140caec..c743360 100644 --- a/docs/Models/Components/TrackingStatus.md +++ b/docs/Models/Components/TrackingStatus.md @@ -5,13 +5,13 @@ The latest tracking information of this shipment. ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `location` | [?\Shippo\API\Models\Components\TrackingStatusLocationBase](../../Models/Components/TrackingStatusLocationBase.md) | :heavy_minus_sign: | An object containing zip, city, state and country information of the tracking event. | | -| `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | -| `objectId` | *string* | :heavy_check_mark: | N/A | | -| `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | -| `status` | [\Shippo\API\Models\Components\TrackingStatusEnum](../../Models/Components/TrackingStatusEnum.md) | :heavy_check_mark: | Indicates the high level status of the shipment. | DELIVERED | -| `substatus` | [?\Shippo\API\Models\Components\TrackingStatusSubstatus](../../Models/Components/TrackingStatusSubstatus.md) | :heavy_minus_sign: | A finer-grained classification of the tracking event. | | -| `statusDate` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time when the carrier scanned this tracking event. This is displayed in UTC. | 2016-07-23T00:00:00Z | -| `statusDetails` | *string* | :heavy_check_mark: | The human-readable description of the status. | Your shipment has been delivered at the destination mailbox. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | +| `objectId` | *string* | :heavy_check_mark: | N/A | | +| `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | +| `status` | [Components\TrackingStatusEnum](../../Models/Components/TrackingStatusEnum.md) | :heavy_check_mark: | Indicates the high level status of the shipment. | DELIVERED | +| `statusDetails` | *string* | :heavy_check_mark: | The human-readable description of the status. | Your shipment has been delivered at the destination mailbox. | +| `location` | [?Components\TrackingStatusLocationBase](../../Models/Components/TrackingStatusLocationBase.md) | :heavy_minus_sign: | An object containing zip, city, state and country information of the tracking event. | | +| `substatus` | [?Components\TrackingStatusSubstatus](../../Models/Components/TrackingStatusSubstatus.md) | :heavy_minus_sign: | A finer-grained classification of the tracking event. | | +| `statusDate` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time when the carrier scanned this tracking event. This is displayed in UTC. | 2016-07-23T00:00:00Z | \ No newline at end of file diff --git a/docs/Models/Components/TracksRequest.md b/docs/Models/Components/TracksRequest.md index 9e77487..8cd20e0 100644 --- a/docs/Models/Components/TracksRequest.md +++ b/docs/Models/Components/TracksRequest.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | `carrier` | *string* | :heavy_check_mark: | Name of the carrier of the shipment to track. | usps | -| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want to attach to the object. | Order 000123 | -| `trackingNumber` | *string* | :heavy_check_mark: | Tracking number to track. | 9205590164917312751089 | \ No newline at end of file +| `trackingNumber` | *string* | :heavy_check_mark: | Tracking number to track. | 9205590164917312751089 | +| `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want to attach to the object. | Order 000123 | \ No newline at end of file diff --git a/docs/Models/Components/Transaction.md b/docs/Models/Components/Transaction.md index cdc4b55..1021b4c 100644 --- a/docs/Models/Components/Transaction.md +++ b/docs/Models/Components/Transaction.md @@ -6,21 +6,22 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `commercialInvoiceUrl` | *?string* | :heavy_minus_sign: | A URL pointing to the commercial invoice as a 8.5x11 inch PDF file.
A value will only be returned if the Transactions has been processed successfully and if the shipment is international. | | -| `createdBy` | [?\Shippo\API\Models\Components\CreatedBy](../../Models/Components/CreatedBy.md) | :heavy_minus_sign: | N/A | | | `eta` | *?string* | :heavy_minus_sign: | The estimated time of arrival according to the carrier. | | -| `labelFileType` | [?\Shippo\API\Models\Components\LabelFileTypeEnum](../../Models/Components/LabelFileTypeEnum.md) | :heavy_minus_sign: | Print format of the label. If empty, will use the default format set from
the Shippo dashboard. | PDF_4x6 | +| `labelFileType` | [?Components\LabelFileTypeEnum](../../Models/Components/LabelFileTypeEnum.md) | :heavy_minus_sign: | Print format of the label. If empty, will use the default format set from
the Shippo dashboard. | PDF_4x6 | | `labelUrl` | *?string* | :heavy_minus_sign: | A URL pointing directly to the label in the format you've set in your settings.
A value will only be returned if the Transactions has been processed successfully. | https://shippo-delivery.s3.amazonaws.com/70ae8117ee1749e393f249d5b77c45e0.pdf?Signature=vDw1ltcyGveVR1OQoUDdzC43BY8%3D&Expires=1437093830&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA | -| `messages` | array<[\Shippo\API\Models\Components\ResponseMessage](../../Models/Components/ResponseMessage.md)> | :heavy_minus_sign: | N/A | | +| `messages` | array<[Components\ResponseMessage](../../Models/Components/ResponseMessage.md)> | :heavy_minus_sign: | N/A | | | `metadata` | *?string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want to
attach to the object. | | | `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of Transaction creation. | | | `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the given Transaction object. | 915d94940ea54c3a80cbfa328722f5a1 | | `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the Transaction object. | shippotle@shippo.com | -| `objectState` | [?\Shippo\API\Models\Components\ObjectStateEnum](../../Models/Components/ObjectStateEnum.md) | :heavy_minus_sign: | Indicates the validity of the enclosing object | | +| `objectState` | [?Components\ObjectStateEnum](../../Models/Components/ObjectStateEnum.md) | :heavy_minus_sign: | Indicates the validity of the enclosing object | | | `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of last Transaction update. | | +| `parcel` | *?string* | :heavy_minus_sign: | Object ID of the Parcel object that is being shipped. | e94c7fdfdc7b495dbb390a28d929d90a | | `qrCodeUrl` | *?string* | :heavy_minus_sign: | A URL pointing directly to the QR code in PNG format.
A value will only be returned if requested using qr_code_requested flag and the carrier provides such an option. | https://shippo-delivery.s3.amazonaws.com/96_qr_code.pdf?Signature=PEdWrp0mFWAGwJp7FW3b%2FeA2eyY%3D&Expires=1385930652&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA | -| `rate` | *mixed* | :heavy_minus_sign: | ID of the Rate object for which a Label has to be obtained.
If you purchase a label by calling the transaction endpoint without a rate (instalabel),
this field will be a simplified Rate object in the Transaction model returned from the POST request.

Note, only rates less than 7 days old can be purchased to ensure up-to-date pricing. | | -| `status` | [?\Shippo\API\Models\Components\TransactionStatusEnum](../../Models/Components/TransactionStatusEnum.md) | :heavy_minus_sign: | Indicates the status of the Transaction. | SUCCESS | +| `rate` | [Components\CoreRate\|string\|null](../../Models/Components/TransactionRate.md) | :heavy_minus_sign: | ID of the Rate object for which a Label has to be obtained.
If you purchase a label by calling the transaction endpoint without a rate (instalabel),
this field will be a simplified Rate object in the Transaction model returned from the POST request.

Note, only rates less than 7 days old can be purchased to ensure up-to-date pricing. | | +| `status` | [?Components\TransactionStatusEnum](../../Models/Components/TransactionStatusEnum.md) | :heavy_minus_sign: | Indicates the status of the Transaction. | SUCCESS | | `test` | *?bool* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | | | `trackingNumber` | *?string* | :heavy_minus_sign: | The carrier-specific tracking number that can be used to track the Shipment.
A value will only be returned if the Rate is for a trackable Shipment and if the Transactions has been processed successfully. | 9499907123456123456781 | -| `trackingStatus` | [?\Shippo\API\Models\Components\TrackingStatusEnum](../../Models/Components/TrackingStatusEnum.md) | :heavy_minus_sign: | Indicates the high level status of the shipment. | DELIVERED | -| `trackingUrlProvider` | *?string* | :heavy_minus_sign: | A link to track this item on the carrier-provided tracking website.
A value will only be returned if tracking is available and the carrier provides such a service. | https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9499907123456123456781 | \ No newline at end of file +| `trackingStatus` | [?Components\TrackingStatusEnum](../../Models/Components/TrackingStatusEnum.md) | :heavy_minus_sign: | Indicates the high level status of the shipment. | DELIVERED | +| `trackingUrlProvider` | *?string* | :heavy_minus_sign: | A link to track this item on the carrier-provided tracking website.
A value will only be returned if tracking is available and the carrier provides such a service. | https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9499907123456123456781 | +| `createdBy` | [?Components\CreatedBy](../../Models/Components/CreatedBy.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/ParentServicelevel.md b/docs/Models/Components/TransactionCreateRequest.md similarity index 50% rename from docs/Models/Components/ParentServicelevel.md rename to docs/Models/Components/TransactionCreateRequest.md index abcbdd4..d4a35d2 100644 --- a/docs/Models/Components/ParentServicelevel.md +++ b/docs/Models/Components/TransactionCreateRequest.md @@ -1,16 +1,12 @@ -# ParentServicelevel - -Used for some Service Levels to link to the more "generic" version of this Service Level - for example, -if this Service Level is a variation specific to shipments to Europe("ups_saver_eu"), the "parent" is -the fully generic version ("ups_saver"). Helpful when displaying Service Levels to users. Has the same -structure of the servicelevel - "name", "token", "terms", and "extended_token", or it is otherwise null. +# TransactionCreateRequest ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *?string* | :heavy_minus_sign: | Name of the Rate's servicelevel, e.g. `International Priority` or `Standard Post`.
A servicelevel commonly defines the transit time of a Shipment (e.g., Express vs. Standard), along with other properties.
These names vary depending on the provider. | Priority Mail Express | -| `terms` | *?string* | :heavy_minus_sign: | Further clarification of the service. | | -| `token` | *?string* | :heavy_minus_sign: | Token of the Rate's servicelevel, e.g. `usps_priority` or `fedex_ground`.
See servicelevels. | usps_priority_express | -| `extendedToken` | *?string* | :heavy_minus_sign: | Unique, extended version of the Service Level "token".
Guaranteed to be unique across all Service Levels, and may help offer insight into the specific Service Level it describes. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `rate` | *string* | :heavy_check_mark: | N/A | ec9f0d3adc9441449c85d315f0997fd5 | +| `async` | *?bool* | :heavy_minus_sign: | N/A | false | +| `labelFileType` | [?Components\LabelFileTypeEnum](../../Models/Components/LabelFileTypeEnum.md) | :heavy_minus_sign: | Print format of the label. If empty, will use the default format set from
the Shippo dashboard. | PDF_4x6 | +| `metadata` | *?string* | :heavy_minus_sign: | N/A | Order ID #12345 | +| `order` | *?string* | :heavy_minus_sign: | N/A | adcfdddf8ec64b84ad22772bce3ea37a | \ No newline at end of file diff --git a/docs/Models/Components/TransactionPaginatedList.md b/docs/Models/Components/TransactionPaginatedList.md index ce6ffe4..7997be6 100644 --- a/docs/Models/Components/TransactionPaginatedList.md +++ b/docs/Models/Components/TransactionPaginatedList.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `results` | array<[\Shippo\API\Models\Components\Transaction](../../Models/Components/Transaction.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `results` | array<[Components\Transaction](../../Models/Components/Transaction.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/TransactionRate.md b/docs/Models/Components/TransactionRate.md new file mode 100644 index 0000000..6f11976 --- /dev/null +++ b/docs/Models/Components/TransactionRate.md @@ -0,0 +1,28 @@ +# TransactionRate + +ID of the Rate object for which a Label has to be obtained. +If you purchase a label by calling the transaction endpoint without a rate (instalabel), +this field will be a simplified Rate object in the Transaction model returned from the POST request. +
Note, only rates less than 7 days old can be purchased to ensure up-to-date pricing. + + +## Supported Types + +### `Components\CoreRate` + +```php +/** +* @var Components\CoreRate +*/ +Components\CoreRate $value = /* values here */ +``` + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + diff --git a/docs/Models/Components/Transactions.md b/docs/Models/Components/Transactions.md new file mode 100644 index 0000000..f9511d8 --- /dev/null +++ b/docs/Models/Components/Transactions.md @@ -0,0 +1,7 @@ +# Transactions + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/UPSConnectExistingOwnAccountParameters.md b/docs/Models/Components/UPSConnectExistingOwnAccountParameters.md new file mode 100644 index 0000000..3155c1f --- /dev/null +++ b/docs/Models/Components/UPSConnectExistingOwnAccountParameters.md @@ -0,0 +1,33 @@ +# UPSConnectExistingOwnAccountParameters + +An array of additional parameters for the account, such as e.g. password or token. +Please check the carrier accounts tutorial page for the parameters per carrier.
+To protect account information, this field will be masked in any API response. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountNumber` | *string* | :heavy_check_mark: | The UPS account number | 94567e | +| `billingAddressCity` | *string* | :heavy_check_mark: | N/A | San Francisco | +| `billingAddressCountryIso2` | *string* | :heavy_check_mark: | N/A | US | +| `billingAddressState` | *string* | :heavy_check_mark: | N/A | CA | +| `billingAddressStreet1` | *string* | :heavy_check_mark: | N/A | 731 Market St | +| `billingAddressZip` | *string* | :heavy_check_mark: | N/A | 94103 | +| `collecCountryIso2` | *string* | :heavy_check_mark: | N/A | US | +| `collecZip` | *string* | :heavy_check_mark: | Zip code of the collection/pickup address | 94103 | +| `company` | *string* | :heavy_check_mark: | Company name. Full name is acceptable in this field if the user has no company name | Shippo | +| `email` | *string* | :heavy_check_mark: | N/A | hippo@shippo.com | +| `fullName` | *string* | :heavy_check_mark: | N/A | Shippo Meister | +| `hasInvoice` | *bool* | :heavy_check_mark: | true if user has been issued a UPS invoice within the past 90 days for the US or Canada; and 45 days for any other countries. User can use data from any of the last 3 invoices | | +| `phone` | *string* | :heavy_check_mark: | N/A | 1112223333 | +| `title` | *string* | :heavy_check_mark: | User's title, e.g. including but not limited to Manager, Doctor, Artist, Engineer, Mr, Ms, Mrs, Mx | Manager | +| `upsAgreements` | *bool* | :heavy_check_mark: | Whether the user agrees to the UPS terms and conditions or not. Error 400 will be returned if passed in as false | | +| `aiaCountryIso2` | *?string* | :heavy_minus_sign: | Only required if has_invoice is true. Country associated with the account that issued the invoice | US | +| `billingAddressStreet2` | *?string* | :heavy_minus_sign: | Empty string acceptable for billing_address_street2 | STE 200 | +| `currencyCode` | *?string* | :heavy_minus_sign: | Only required if has_invoice is true. 3-letter currency code associated with invoice_value | USD | +| `invoiceControlid` | *?string* | :heavy_minus_sign: | Only required if aia_country_iso2 is US and has_invoice is true. | 1234 | +| `invoiceDate` | *?string* | :heavy_minus_sign: | Only required if has_invoice is true. Date the invoice was issued. yyyymmdd format | 20210529 | +| `invoiceNumber` | *?string* | :heavy_minus_sign: | N/A | 1112234 | +| `invoiceValue` | *?string* | :heavy_minus_sign: | Only required if has_invoice is true. Max 16 digits before decimal and 2 digits after decimal | 11.23 | \ No newline at end of file diff --git a/docs/Models/Components/UserParcelTemplate.md b/docs/Models/Components/UserParcelTemplate.md index 82a16f5..f1e3126 100644 --- a/docs/Models/Components/UserParcelTemplate.md +++ b/docs/Models/Components/UserParcelTemplate.md @@ -5,15 +5,15 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `distanceUnit` | [?\Shippo\API\Models\Components\DistanceUnitEnum](../../Models/Components/DistanceUnitEnum.md) | :heavy_minus_sign: | The measure unit used for length, width and height. | in | +| `distanceUnit` | [?Components\DistanceUnitEnum](../../Models/Components/DistanceUnitEnum.md) | :heavy_minus_sign: | The measure unit used for length, width and height. | in | | `height` | *?string* | :heavy_minus_sign: | The height of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. | 6 | | `length` | *?string* | :heavy_minus_sign: | The length of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. | 10 | | `name` | *?string* | :heavy_minus_sign: | The name of the User Parcel Template | My Custom Template | | `weight` | *?string* | :heavy_minus_sign: | The weight of the package, in units specified by the weight_unit attribute. | 12 | -| `weightUnit` | [?\Shippo\API\Models\Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_minus_sign: | The unit used for weight. | lb | +| `weightUnit` | [?Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_minus_sign: | The unit used for weight. | lb | | `width` | *?string* | :heavy_minus_sign: | The width of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. | 8 | | `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of User Parcel Template creation | 2013-12-11T19:38:09.729Z | | `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the given User Parcel Template object | b958d3690bb04bb8b2986724872750f5 | | `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the User Parcel Template object | shippotle@shippo.com | | `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Date and time of last update on User Parcel Template | 2013-12-12T19:38:09.729Z | -| `template` | [?\Shippo\API\Models\Components\CarrierParcelTemplate](../../Models/Components/CarrierParcelTemplate.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `template` | [?Components\CarrierParcelTemplate](../../Models/Components/CarrierParcelTemplate.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/UserParcelTemplateCreateRequest.md b/docs/Models/Components/UserParcelTemplateCreateRequest.md new file mode 100644 index 0000000..9af6cab --- /dev/null +++ b/docs/Models/Components/UserParcelTemplateCreateRequest.md @@ -0,0 +1,23 @@ +# UserParcelTemplateCreateRequest + + +## Supported Types + +### `Components\UserParcelTemplateWithCarrierTemplateCreateRequest` + +```php +/** +* @var Components\UserParcelTemplateWithCarrierTemplateCreateRequest +*/ +Components\UserParcelTemplateWithCarrierTemplateCreateRequest $value = /* values here */ +``` + +### `Components\UserParcelTemplateWithoutCarrierTemplateCreateRequest` + +```php +/** +* @var Components\UserParcelTemplateWithoutCarrierTemplateCreateRequest +*/ +Components\UserParcelTemplateWithoutCarrierTemplateCreateRequest $value = /* values here */ +``` + diff --git a/docs/Models/Components/UserParcelTemplateList.md b/docs/Models/Components/UserParcelTemplateList.md index 87434d5..42ce4b2 100644 --- a/docs/Models/Components/UserParcelTemplateList.md +++ b/docs/Models/Components/UserParcelTemplateList.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `results` | array<[\Shippo\API\Models\Components\UserParcelTemplate](../../Models/Components/UserParcelTemplate.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `results` | array<[Components\UserParcelTemplate](../../Models/Components/UserParcelTemplate.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/UserParcelTemplateUpdateRequest.md b/docs/Models/Components/UserParcelTemplateUpdateRequest.md index 09e912f..feab5ee 100644 --- a/docs/Models/Components/UserParcelTemplateUpdateRequest.md +++ b/docs/Models/Components/UserParcelTemplateUpdateRequest.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `distanceUnit` | [\Shippo\API\Models\Components\DistanceUnitEnum](../../Models/Components/DistanceUnitEnum.md) | :heavy_check_mark: | The measure unit used for length, width and height. | in | +| `distanceUnit` | [Components\DistanceUnitEnum](../../Models/Components/DistanceUnitEnum.md) | :heavy_check_mark: | The measure unit used for length, width and height. | in | | `height` | *string* | :heavy_check_mark: | The height of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. | 6 | | `length` | *string* | :heavy_check_mark: | The length of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. | 10 | | `name` | *string* | :heavy_check_mark: | The name of the User Parcel Template | My Custom Template | +| `width` | *string* | :heavy_check_mark: | The width of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. | 8 | | `weight` | *?string* | :heavy_minus_sign: | The weight of the package, in units specified by the weight_unit attribute. | 12 | -| `weightUnit` | [?\Shippo\API\Models\Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_minus_sign: | The unit used for weight. | lb | -| `width` | *string* | :heavy_check_mark: | The width of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. | 8 | \ No newline at end of file +| `weightUnit` | [?Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_minus_sign: | The unit used for weight. | lb | \ No newline at end of file diff --git a/docs/Models/Components/UserParcelTemplateWithCarrierTemplateCreateRequest.md b/docs/Models/Components/UserParcelTemplateWithCarrierTemplateCreateRequest.md new file mode 100644 index 0000000..8aad71a --- /dev/null +++ b/docs/Models/Components/UserParcelTemplateWithCarrierTemplateCreateRequest.md @@ -0,0 +1,10 @@ +# UserParcelTemplateWithCarrierTemplateCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `template` | *?string* | :heavy_minus_sign: | The object representing the carrier parcel template | | +| `weight` | *?string* | :heavy_minus_sign: | The weight of the package, in units specified by the weight_unit attribute. | 12 | +| `weightUnit` | [?Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_minus_sign: | The unit used for weight. | lb | \ No newline at end of file diff --git a/docs/Models/Components/UserParcelTemplateWithoutCarrierTemplateCreateRequest.md b/docs/Models/Components/UserParcelTemplateWithoutCarrierTemplateCreateRequest.md new file mode 100644 index 0000000..7b74241 --- /dev/null +++ b/docs/Models/Components/UserParcelTemplateWithoutCarrierTemplateCreateRequest.md @@ -0,0 +1,14 @@ +# UserParcelTemplateWithoutCarrierTemplateCreateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `distanceUnit` | [Components\DistanceUnitEnum](../../Models/Components/DistanceUnitEnum.md) | :heavy_check_mark: | The measure unit used for length, width and height. | in | +| `height` | *string* | :heavy_check_mark: | The height of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. | 6 | +| `length` | *string* | :heavy_check_mark: | The length of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. | 10 | +| `name` | *string* | :heavy_check_mark: | The name of the User Parcel Template | My Custom Template | +| `width` | *string* | :heavy_check_mark: | The width of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. | 8 | +| `weight` | *?string* | :heavy_minus_sign: | The weight of the package, in units specified by the weight_unit attribute. | 12 | +| `weightUnit` | [?Components\WeightUnitEnum](../../Models/Components/WeightUnitEnum.md) | :heavy_minus_sign: | The unit used for weight. | lb | \ No newline at end of file diff --git a/docs/Models/Components/Webhook.md b/docs/Models/Components/Webhook.md index dbae0e9..35d54f1 100644 --- a/docs/Models/Components/Webhook.md +++ b/docs/Models/Components/Webhook.md @@ -3,13 +3,13 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `event` | *string* | :heavy_check_mark: | Type of event that triggers the webhook. | -| `url` | *string* | :heavy_check_mark: | URL webhook events are sent to. | -| `active` | *?bool* | :heavy_minus_sign: | Determines whether the webhook is active or not. | -| `isTest` | *?bool* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. | -| `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Timestamp of the creation of the webhook. | -| `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the webhook. This can be used to retrieve or delete the webhook. | -| `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Timestamp of the last update of the webhook. | -| `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the webhook. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `event` | *string* | :heavy_check_mark: | Type of event that triggers the webhook. | track_updated | +| `url` | *string* | :heavy_check_mark: | URL webhook events are sent to. | https://example.com/shippo-webhook | +| `active` | *?bool* | :heavy_minus_sign: | Determines whether the webhook is active or not. | true | +| `isTest` | *?bool* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. | false | +| `objectCreated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Timestamp of the creation of the webhook. | | +| `objectId` | *?string* | :heavy_minus_sign: | Unique identifier of the webhook. This can be used to retrieve or delete the webhook. | | +| `objectUpdated` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Timestamp of the last update of the webhook. | | +| `objectOwner` | *?string* | :heavy_minus_sign: | Username of the user who created the webhook. | | \ No newline at end of file diff --git a/docs/Models/Components/WebhookEventTypeEnum.md b/docs/Models/Components/WebhookEventTypeEnum.md index 264165b..dfb156c 100644 --- a/docs/Models/Components/WebhookEventTypeEnum.md +++ b/docs/Models/Components/WebhookEventTypeEnum.md @@ -1,5 +1,7 @@ # WebhookEventTypeEnum +Type of event that triggered the webhook. + ## Values @@ -9,4 +11,5 @@ | `TransactionUpdated` | transaction_updated | | `TrackUpdated` | track_updated | | `BatchCreated` | batch_created | -| `BatchPurchased` | batch_purchased | \ No newline at end of file +| `BatchPurchased` | batch_purchased | +| `All` | all | \ No newline at end of file diff --git a/docs/Models/Components/WebhookPaginatedList.md b/docs/Models/Components/WebhookPaginatedList.md index a1d16a6..0c92427 100644 --- a/docs/Models/Components/WebhookPaginatedList.md +++ b/docs/Models/Components/WebhookPaginatedList.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | -| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | -| `count` | *?int* | :heavy_minus_sign: | N/A | | -| `results` | array<[\Shippo\API\Models\Components\Webhook](../../Models/Components/Webhook.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `next` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=3&results=10 | +| `previous` | *?string* | :heavy_minus_sign: | N/A | baseurl?page=1&results=10 | +| `count` | *?int* | :heavy_minus_sign: | N/A | | +| `results` | array<[Components\Webhook](../../Models/Components/Webhook.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/WebhookPayload.md b/docs/Models/Components/WebhookPayload.md new file mode 100644 index 0000000..9dae38a --- /dev/null +++ b/docs/Models/Components/WebhookPayload.md @@ -0,0 +1,50 @@ +# WebhookPayload + + +## Supported Types + +### `Components\WebhookPayloadTrack` + +```php +/** +* @var Components\WebhookPayloadTrack +*/ +Components\WebhookPayloadTrack $value = /* values here */ +``` + +### `Components\WebhookPayloadBatch` + +```php +/** +* @var Components\WebhookPayloadBatch +*/ +Components\WebhookPayloadBatch $value = /* values here */ +``` + +### `Components\WebhookPayloadBatch` + +```php +/** +* @var Components\WebhookPayloadBatch +*/ +Components\WebhookPayloadBatch $value = /* values here */ +``` + +### `Components\WebhookPayloadTransaction` + +```php +/** +* @var Components\WebhookPayloadTransaction +*/ +Components\WebhookPayloadTransaction $value = /* values here */ +``` + +### `Components\WebhookPayloadTransaction` + +```php +/** +* @var Components\WebhookPayloadTransaction +*/ +Components\WebhookPayloadTransaction $value = /* values here */ +``` + diff --git a/docs/Models/Components/WebhookPayloadBatch.md b/docs/Models/Components/WebhookPayloadBatch.md new file mode 100644 index 0000000..b3f7894 --- /dev/null +++ b/docs/Models/Components/WebhookPayloadBatch.md @@ -0,0 +1,12 @@ +# WebhookPayloadBatch + +Content of the webhook posted to the external URL + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `event` | [?Components\WebhookEventTypeEnum](../../Models/Components/WebhookEventTypeEnum.md) | :heavy_minus_sign: | Type of event that triggered the webhook. | +| `test` | *?bool* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. | +| `data` | *?string* | :heavy_minus_sign: | A string containing the batch object ID, of the form 'batch {batchId} (created\|processing complete)'. | \ No newline at end of file diff --git a/docs/Models/Components/WebhookPayloadTrack.md b/docs/Models/Components/WebhookPayloadTrack.md new file mode 100644 index 0000000..4195d63 --- /dev/null +++ b/docs/Models/Components/WebhookPayloadTrack.md @@ -0,0 +1,12 @@ +# WebhookPayloadTrack + +Content of the webhook posted to the external URL + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `event` | [?Components\WebhookEventTypeEnum](../../Models/Components/WebhookEventTypeEnum.md) | :heavy_minus_sign: | Type of event that triggered the webhook. | +| `test` | *?bool* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. | +| `data` | [?Components\Track](../../Models/Components/Track.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookPayloadTransaction.md b/docs/Models/Components/WebhookPayloadTransaction.md new file mode 100644 index 0000000..a83ac9b --- /dev/null +++ b/docs/Models/Components/WebhookPayloadTransaction.md @@ -0,0 +1,12 @@ +# WebhookPayloadTransaction + +Content of the webhook posted to the external URL + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `event` | [?Components\WebhookEventTypeEnum](../../Models/Components/WebhookEventTypeEnum.md) | :heavy_minus_sign: | Type of event that triggered the webhook. | +| `test` | *?bool* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. | +| `data` | [?Components\Transaction](../../Models/Components/Transaction.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookUpdateRequest.md b/docs/Models/Components/WebhookUpdateRequest.md index 6b7c50d..3edf3fe 100644 --- a/docs/Models/Components/WebhookUpdateRequest.md +++ b/docs/Models/Components/WebhookUpdateRequest.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `event` | [\Shippo\API\Models\Components\WebhookEventTypeEnum](../../Models/Components/WebhookEventTypeEnum.md) | :heavy_check_mark: | N/A | -| `url` | *string* | :heavy_check_mark: | URL webhook events are sent to. | -| `active` | *?bool* | :heavy_minus_sign: | Determines whether the webhook is active or not. | -| `isTest` | *?bool* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `event` | [Components\WebhookEventTypeEnum](../../Models/Components/WebhookEventTypeEnum.md) | :heavy_check_mark: | Type of event that triggered the webhook. | | +| `url` | *string* | :heavy_check_mark: | URL webhook events are sent to. | https://example.com/shippo-webhook | +| `active` | *?bool* | :heavy_minus_sign: | Determines whether the webhook is active or not. | true | +| `isTest` | *?bool* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. | false | \ No newline at end of file diff --git a/docs/Models/Operations/InitiateOauth2SigninCarrierAccountsResponseBody.md b/docs/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseBody.md similarity index 100% rename from docs/Models/Operations/InitiateOauth2SigninCarrierAccountsResponseBody.md rename to docs/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseBody.md diff --git a/docs/Models/Operations/InitiateOauth2SigninCarrierAccountsResponseResponseBody.md b/docs/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBody.md similarity index 100% rename from docs/Models/Operations/InitiateOauth2SigninCarrierAccountsResponseResponseBody.md rename to docs/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBody.md diff --git a/docs/Models/Operations/InitiateOauth2SigninResponseBody.md b/docs/Models/Errors/InitiateOauth2SigninResponseBody.md similarity index 100% rename from docs/Models/Operations/InitiateOauth2SigninResponseBody.md rename to docs/Models/Errors/InitiateOauth2SigninResponseBody.md diff --git a/docs/Models/Operations/AddShipmentsToBatchRequest.md b/docs/Models/Operations/AddShipmentsToBatchRequest.md index b580e8f..384d290 100644 --- a/docs/Models/Operations/AddShipmentsToBatchRequest.md +++ b/docs/Models/Operations/AddShipmentsToBatchRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `batchId` | *string* | :heavy_check_mark: | Object ID of the batch | | -| `requestBody` | array<[\Shippo\API\Models\Components\BatchShipmentCreateRequest](../../Models/Components/BatchShipmentCreateRequest.md)> | :heavy_check_mark: | Array of shipments to add to the batch | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `batchId` | *string* | :heavy_check_mark: | Object ID of the batch | | +| `requestBody` | array<[Components\BatchShipmentCreateRequest](../../Models/Components/BatchShipmentCreateRequest.md)> | :heavy_check_mark: | Array of shipments to add to the batch | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/AddShipmentsToBatchResponse.md b/docs/Models/Operations/AddShipmentsToBatchResponse.md deleted file mode 100644 index b075c5d..0000000 --- a/docs/Models/Operations/AddShipmentsToBatchResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# AddShipmentsToBatchResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `batch` | [?\Shippo\API\Models\Components\Batch](../../Models/Components/Batch.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateAddressRequest.md b/docs/Models/Operations/CreateAddressRequest.md index efb1117..8f70d78 100644 --- a/docs/Models/Operations/CreateAddressRequest.md +++ b/docs/Models/Operations/CreateAddressRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `addressCreateRequest` | [\Shippo\API\Models\Components\AddressCreateRequest](../../Models/Components/AddressCreateRequest.md) | :heavy_check_mark: | Address details. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `addressCreateRequest` | [Components\AddressCreateRequest](../../Models/Components/AddressCreateRequest.md) | :heavy_check_mark: | Address details. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateAddressResponse.md b/docs/Models/Operations/CreateAddressResponse.md deleted file mode 100644 index dd31077..0000000 --- a/docs/Models/Operations/CreateAddressResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateAddressResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `address` | [?\Shippo\API\Models\Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateBatchRequest.md b/docs/Models/Operations/CreateBatchRequest.md index 289bd1b..40b0cc4 100644 --- a/docs/Models/Operations/CreateBatchRequest.md +++ b/docs/Models/Operations/CreateBatchRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `batchCreateRequest` | [\Shippo\API\Models\Components\BatchCreateRequest](../../Models/Components/BatchCreateRequest.md) | :heavy_check_mark: | Batch details. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `batchCreateRequest` | [Components\BatchCreateRequest](../../Models/Components/BatchCreateRequest.md) | :heavy_check_mark: | Batch details. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateBatchResponse.md b/docs/Models/Operations/CreateBatchResponse.md deleted file mode 100644 index fbdd082..0000000 --- a/docs/Models/Operations/CreateBatchResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateBatchResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `batch` | [?\Shippo\API\Models\Components\Batch](../../Models/Components/Batch.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateCarrierAccountRequest.md b/docs/Models/Operations/CreateCarrierAccountRequest.md index f7a12cd..f63d038 100644 --- a/docs/Models/Operations/CreateCarrierAccountRequest.md +++ b/docs/Models/Operations/CreateCarrierAccountRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `connectExistingOwnAccountRequest` | [\Shippo\API\Models\Components\ConnectExistingOwnAccountRequest](../../Models/Components/ConnectExistingOwnAccountRequest.md) | :heavy_check_mark: | Examples. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `connectExistingOwnAccountRequest` | [Components\ConnectExistingOwnAccountRequest](../../Models/Components/ConnectExistingOwnAccountRequest.md) | :heavy_check_mark: | Examples. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateCarrierAccountResponse.md b/docs/Models/Operations/CreateCarrierAccountResponse.md deleted file mode 100644 index 6dc67cb..0000000 --- a/docs/Models/Operations/CreateCarrierAccountResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateCarrierAccountResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `carrierAccount` | [?\Shippo\API\Models\Components\CarrierAccount](../../Models/Components/CarrierAccount.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateCustomsDeclarationRequest.md b/docs/Models/Operations/CreateCustomsDeclarationRequest.md index 41d013c..b684900 100644 --- a/docs/Models/Operations/CreateCustomsDeclarationRequest.md +++ b/docs/Models/Operations/CreateCustomsDeclarationRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `customsDeclarationCreateRequest` | [\Shippo\API\Models\Components\CustomsDeclarationCreateRequest](../../Models/Components/CustomsDeclarationCreateRequest.md) | :heavy_check_mark: | CustomsDeclaration details. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `customsDeclarationCreateRequest` | [Components\CustomsDeclarationCreateRequest](../../Models/Components/CustomsDeclarationCreateRequest.md) | :heavy_check_mark: | CustomsDeclaration details. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateCustomsDeclarationResponse.md b/docs/Models/Operations/CreateCustomsDeclarationResponse.md deleted file mode 100644 index 4fa7e8a..0000000 --- a/docs/Models/Operations/CreateCustomsDeclarationResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateCustomsDeclarationResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `customsDeclaration` | [?\Shippo\API\Models\Components\CustomsDeclaration](../../Models/Components/CustomsDeclaration.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateCustomsItemRequest.md b/docs/Models/Operations/CreateCustomsItemRequest.md index a7560e9..30d7f75 100644 --- a/docs/Models/Operations/CreateCustomsItemRequest.md +++ b/docs/Models/Operations/CreateCustomsItemRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `customsItemCreateRequest` | [\Shippo\API\Models\Components\CustomsItemCreateRequest](../../Models/Components/CustomsItemCreateRequest.md) | :heavy_check_mark: | CustomsItem details. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `customsItemCreateRequest` | [Components\CustomsItemCreateRequest](../../Models/Components/CustomsItemCreateRequest.md) | :heavy_check_mark: | CustomsItem details. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateCustomsItemResponse.md b/docs/Models/Operations/CreateCustomsItemResponse.md deleted file mode 100644 index d28c7f8..0000000 --- a/docs/Models/Operations/CreateCustomsItemResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateCustomsItemResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `customsItem` | [?\Shippo\API\Models\Components\CustomsItem](../../Models/Components/CustomsItem.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateLiveRateRequest.md b/docs/Models/Operations/CreateLiveRateRequest.md index ed25da4..83c1fea 100644 --- a/docs/Models/Operations/CreateLiveRateRequest.md +++ b/docs/Models/Operations/CreateLiveRateRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `liveRateCreateRequest` | [\Shippo\API\Models\Components\LiveRateCreateRequest](../../Models/Components/LiveRateCreateRequest.md) | :heavy_check_mark: | Generate rates at checkout | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `liveRateCreateRequest` | [Components\LiveRateCreateRequest](../../Models/Components/LiveRateCreateRequest.md) | :heavy_check_mark: | Generate rates at checkout | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateLiveRateResponse.md b/docs/Models/Operations/CreateLiveRateResponse.md deleted file mode 100644 index 5e0de6f..0000000 --- a/docs/Models/Operations/CreateLiveRateResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateLiveRateResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `liveRatePaginatedList` | [?\Shippo\API\Models\Components\LiveRatePaginatedList](../../Models/Components/LiveRatePaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateManifestRequest.md b/docs/Models/Operations/CreateManifestRequest.md index de2c2ac..d15c274 100644 --- a/docs/Models/Operations/CreateManifestRequest.md +++ b/docs/Models/Operations/CreateManifestRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `manifestCreateRequest` | [\Shippo\API\Models\Components\ManifestCreateRequest](../../Models/Components/ManifestCreateRequest.md) | :heavy_check_mark: | Manifest details and contact info. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `manifestCreateRequest` | [Components\ManifestCreateRequest](../../Models/Components/ManifestCreateRequest.md) | :heavy_check_mark: | Manifest details and contact info. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateManifestResponse.md b/docs/Models/Operations/CreateManifestResponse.md deleted file mode 100644 index d64f1ea..0000000 --- a/docs/Models/Operations/CreateManifestResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateManifestResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `manifest` | [?\Shippo\API\Models\Components\Manifest](../../Models/Components/Manifest.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateOrderRequest.md b/docs/Models/Operations/CreateOrderRequest.md index 6bbbf59..895e47c 100644 --- a/docs/Models/Operations/CreateOrderRequest.md +++ b/docs/Models/Operations/CreateOrderRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `orderCreateRequest` | [\Shippo\API\Models\Components\OrderCreateRequest](../../Models/Components/OrderCreateRequest.md) | :heavy_check_mark: | Order details. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `orderCreateRequest` | [Components\OrderCreateRequest](../../Models/Components/OrderCreateRequest.md) | :heavy_check_mark: | Order details. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateOrderResponse.md b/docs/Models/Operations/CreateOrderResponse.md deleted file mode 100644 index 3e9f43d..0000000 --- a/docs/Models/Operations/CreateOrderResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateOrderResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `order` | [?\Shippo\API\Models\Components\Order](../../Models/Components/Order.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateParcelRequest.md b/docs/Models/Operations/CreateParcelRequest.md index 5e6b6f3..34e9b28 100644 --- a/docs/Models/Operations/CreateParcelRequest.md +++ b/docs/Models/Operations/CreateParcelRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `requestBody` | *mixed* | :heavy_check_mark: | Parcel details. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `requestBody` | [Components\ParcelCreateRequest\|Components\ParcelCreateFromTemplateRequest](../../Models/Operations/CreateParcelRequestBody.md) | :heavy_check_mark: | Parcel details. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateParcelRequestBody.md b/docs/Models/Operations/CreateParcelRequestBody.md new file mode 100644 index 0000000..4af8ee2 --- /dev/null +++ b/docs/Models/Operations/CreateParcelRequestBody.md @@ -0,0 +1,25 @@ +# CreateParcelRequestBody + +Parcel details. + + +## Supported Types + +### `Components\ParcelCreateRequest` + +```php +/** +* @var Components\ParcelCreateRequest +*/ +Components\ParcelCreateRequest $value = /* values here */ +``` + +### `Components\ParcelCreateFromTemplateRequest` + +```php +/** +* @var Components\ParcelCreateFromTemplateRequest +*/ +Components\ParcelCreateFromTemplateRequest $value = /* values here */ +``` + diff --git a/docs/Models/Operations/CreateParcelResponse.md b/docs/Models/Operations/CreateParcelResponse.md deleted file mode 100644 index 9a08f56..0000000 --- a/docs/Models/Operations/CreateParcelResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateParcelResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `parcel` | [?\Shippo\API\Models\Components\Parcel](../../Models/Components/Parcel.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreatePickupRequest.md b/docs/Models/Operations/CreatePickupRequest.md index af42bf8..cc2d6da 100644 --- a/docs/Models/Operations/CreatePickupRequest.md +++ b/docs/Models/Operations/CreatePickupRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `pickupBase` | [\Shippo\API\Models\Components\PickupBase](../../Models/Components/PickupBase.md) | :heavy_check_mark: | Shippo’s pickups endpoint allows you to schedule pickups with USPS and DHL Express for eligible shipments that you have already created. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `pickupBase` | [Components\PickupBase](../../Models/Components/PickupBase.md) | :heavy_check_mark: | Shippo’s pickups endpoint allows you to schedule pickups with USPS and DHL Express for eligible shipments that you have already created. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreatePickupResponse.md b/docs/Models/Operations/CreatePickupResponse.md deleted file mode 100644 index c233083..0000000 --- a/docs/Models/Operations/CreatePickupResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreatePickupResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `pickup` | [?\Shippo\API\Models\Components\Pickup](../../Models/Components/Pickup.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateRefundRequest.md b/docs/Models/Operations/CreateRefundRequest.md index fdeebbd..7bead51 100644 --- a/docs/Models/Operations/CreateRefundRequest.md +++ b/docs/Models/Operations/CreateRefundRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `refundRequestBody` | [\Shippo\API\Models\Components\RefundRequestBody](../../Models/Components/RefundRequestBody.md) | :heavy_check_mark: | Refund details | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `refundRequestBody` | [Components\RefundRequestBody](../../Models/Components/RefundRequestBody.md) | :heavy_check_mark: | Refund details | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateRefundResponse.md b/docs/Models/Operations/CreateRefundResponse.md deleted file mode 100644 index 931f86b..0000000 --- a/docs/Models/Operations/CreateRefundResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateRefundResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `refund` | [?\Shippo\API\Models\Components\Refund](../../Models/Components/Refund.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateServiceGroupRequest.md b/docs/Models/Operations/CreateServiceGroupRequest.md index efeb769..5c0a741 100644 --- a/docs/Models/Operations/CreateServiceGroupRequest.md +++ b/docs/Models/Operations/CreateServiceGroupRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `serviceGroupCreateRequest` | [\Shippo\API\Models\Components\ServiceGroupCreateRequest](../../Models/Components/ServiceGroupCreateRequest.md) | :heavy_check_mark: | N/A | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `serviceGroupCreateRequest` | [Components\ServiceGroupCreateRequest](../../Models/Components/ServiceGroupCreateRequest.md) | :heavy_check_mark: | N/A | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateServiceGroupResponse.md b/docs/Models/Operations/CreateServiceGroupResponse.md deleted file mode 100644 index d1a6102..0000000 --- a/docs/Models/Operations/CreateServiceGroupResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateServiceGroupResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `serviceGroup` | [?\Shippo\API\Models\Components\ServiceGroup](../../Models/Components/ServiceGroup.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateShipmentRequest.md b/docs/Models/Operations/CreateShipmentRequest.md index 5c425c2..117420b 100644 --- a/docs/Models/Operations/CreateShipmentRequest.md +++ b/docs/Models/Operations/CreateShipmentRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `shipmentCreateRequest` | [\Shippo\API\Models\Components\ShipmentCreateRequest](../../Models/Components/ShipmentCreateRequest.md) | :heavy_check_mark: | Shipment details and contact info. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shipmentCreateRequest` | [Components\ShipmentCreateRequest](../../Models/Components/ShipmentCreateRequest.md) | :heavy_check_mark: | Shipment details and contact info. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateShipmentResponse.md b/docs/Models/Operations/CreateShipmentResponse.md deleted file mode 100644 index 4323457..0000000 --- a/docs/Models/Operations/CreateShipmentResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateShipmentResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `shipment` | [?\Shippo\API\Models\Components\Shipment](../../Models/Components/Shipment.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateShippoAccountRequest.md b/docs/Models/Operations/CreateShippoAccountRequest.md index 67a492d..59e2190 100644 --- a/docs/Models/Operations/CreateShippoAccountRequest.md +++ b/docs/Models/Operations/CreateShippoAccountRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `shippoAccountUpdateRequest` | [\Shippo\API\Models\Components\ShippoAccountUpdateRequest](../../Models/Components/ShippoAccountUpdateRequest.md) | :heavy_check_mark: | N/A | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoAccountUpdateRequest` | [Components\ShippoAccountUpdateRequest](../../Models/Components/ShippoAccountUpdateRequest.md) | :heavy_check_mark: | N/A | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateShippoAccountResponse.md b/docs/Models/Operations/CreateShippoAccountResponse.md deleted file mode 100644 index 35a5dcc..0000000 --- a/docs/Models/Operations/CreateShippoAccountResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateShippoAccountResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `shippoAccount` | [?\Shippo\API\Models\Components\ShippoAccount](../../Models/Components/ShippoAccount.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateTrackRequest.md b/docs/Models/Operations/CreateTrackRequest.md index 4da4530..a2ce7c9 100644 --- a/docs/Models/Operations/CreateTrackRequest.md +++ b/docs/Models/Operations/CreateTrackRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `tracksRequest` | [\Shippo\API\Models\Components\TracksRequest](../../Models/Components/TracksRequest.md) | :heavy_check_mark: | N/A | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `tracksRequest` | [Components\TracksRequest](../../Models/Components/TracksRequest.md) | :heavy_check_mark: | N/A | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateTrackResponse.md b/docs/Models/Operations/CreateTrackResponse.md deleted file mode 100644 index 8188d3a..0000000 --- a/docs/Models/Operations/CreateTrackResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateTrackResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `track` | [?\Shippo\API\Models\Components\Track](../../Models/Components/Track.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateTransactionRequest.md b/docs/Models/Operations/CreateTransactionRequest.md index 019f8e0..6c8560d 100644 --- a/docs/Models/Operations/CreateTransactionRequest.md +++ b/docs/Models/Operations/CreateTransactionRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `requestBody` | *mixed* | :heavy_check_mark: | Examples. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `requestBody` | [Components\TransactionCreateRequest\|Components\InstantTransactionCreateRequest](../../Models/Operations/CreateTransactionRequestBody.md) | :heavy_check_mark: | Examples. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateTransactionRequestBody.md b/docs/Models/Operations/CreateTransactionRequestBody.md new file mode 100644 index 0000000..c5e5e99 --- /dev/null +++ b/docs/Models/Operations/CreateTransactionRequestBody.md @@ -0,0 +1,25 @@ +# CreateTransactionRequestBody + +Examples. + + +## Supported Types + +### `Components\TransactionCreateRequest` + +```php +/** +* @var Components\TransactionCreateRequest +*/ +Components\TransactionCreateRequest $value = /* values here */ +``` + +### `Components\InstantTransactionCreateRequest` + +```php +/** +* @var Components\InstantTransactionCreateRequest +*/ +Components\InstantTransactionCreateRequest $value = /* values here */ +``` + diff --git a/docs/Models/Operations/CreateTransactionResponse.md b/docs/Models/Operations/CreateTransactionResponse.md deleted file mode 100644 index c3e57e6..0000000 --- a/docs/Models/Operations/CreateTransactionResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateTransactionResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `transaction` | [?\Shippo\API\Models\Components\Transaction](../../Models/Components/Transaction.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateUserParcelTemplateRequest.md b/docs/Models/Operations/CreateUserParcelTemplateRequest.md index 25d556e..74e1ac2 100644 --- a/docs/Models/Operations/CreateUserParcelTemplateRequest.md +++ b/docs/Models/Operations/CreateUserParcelTemplateRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `requestBody` | *mixed* | :heavy_check_mark: | N/A | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `userParcelTemplateCreateRequest` | [Components\UserParcelTemplateWithCarrierTemplateCreateRequest\|Components\UserParcelTemplateWithoutCarrierTemplateCreateRequest](../../Models/Components/UserParcelTemplateCreateRequest.md) | :heavy_check_mark: | N/A | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/CreateUserParcelTemplateResponse.md b/docs/Models/Operations/CreateUserParcelTemplateResponse.md deleted file mode 100644 index 4afc3d2..0000000 --- a/docs/Models/Operations/CreateUserParcelTemplateResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateUserParcelTemplateResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `userParcelTemplate` | [?\Shippo\API\Models\Components\UserParcelTemplate](../../Models/Components/UserParcelTemplate.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CreateWebhookResponse.md b/docs/Models/Operations/CreateWebhookResponse.md deleted file mode 100644 index 65fb34a..0000000 --- a/docs/Models/Operations/CreateWebhookResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateWebhookResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `webhook` | [?\Shippo\API\Models\Components\Webhook](../../Models/Components/Webhook.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/DeleteDefaultParcelTemplateRequest.md b/docs/Models/Operations/DeleteDefaultParcelTemplateRequest.md index bfee103..2451647 100644 --- a/docs/Models/Operations/DeleteDefaultParcelTemplateRequest.md +++ b/docs/Models/Operations/DeleteDefaultParcelTemplateRequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/DeleteDefaultParcelTemplateResponse.md b/docs/Models/Operations/DeleteDefaultParcelTemplateResponse.md deleted file mode 100644 index 9e98afa..0000000 --- a/docs/Models/Operations/DeleteDefaultParcelTemplateResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeleteDefaultParcelTemplateResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/DeleteServiceGroupRequest.md b/docs/Models/Operations/DeleteServiceGroupRequest.md index 6362c48..61d8f07 100644 --- a/docs/Models/Operations/DeleteServiceGroupRequest.md +++ b/docs/Models/Operations/DeleteServiceGroupRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `serviceGroupId` | *string* | :heavy_check_mark: | Object ID of the service group | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `serviceGroupId` | *string* | :heavy_check_mark: | Object ID of the service group | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/DeleteServiceGroupResponse.md b/docs/Models/Operations/DeleteServiceGroupResponse.md deleted file mode 100644 index 3caaaf2..0000000 --- a/docs/Models/Operations/DeleteServiceGroupResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeleteServiceGroupResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/DeleteUserParcelTemplateRequest.md b/docs/Models/Operations/DeleteUserParcelTemplateRequest.md index 7f667e7..9857ebf 100644 --- a/docs/Models/Operations/DeleteUserParcelTemplateRequest.md +++ b/docs/Models/Operations/DeleteUserParcelTemplateRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `userParcelTemplateObjectId` | *string* | :heavy_check_mark: | Object ID of the user parcel template | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `userParcelTemplateObjectId` | *string* | :heavy_check_mark: | Object ID of the user parcel template | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/DeleteUserParcelTemplateResponse.md b/docs/Models/Operations/DeleteUserParcelTemplateResponse.md deleted file mode 100644 index 16240c5..0000000 --- a/docs/Models/Operations/DeleteUserParcelTemplateResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeleteUserParcelTemplateResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/DeleteWebhookResponse.md b/docs/Models/Operations/DeleteWebhookResponse.md deleted file mode 100644 index f6c7994..0000000 --- a/docs/Models/Operations/DeleteWebhookResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteWebhookResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/Models/Operations/GetAddressRequest.md b/docs/Models/Operations/GetAddressRequest.md index ac82847..d81d5b4 100644 --- a/docs/Models/Operations/GetAddressRequest.md +++ b/docs/Models/Operations/GetAddressRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `addressId` | *string* | :heavy_check_mark: | Object ID of the address | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `addressId` | *string* | :heavy_check_mark: | Object ID of the address | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetAddressResponse.md b/docs/Models/Operations/GetAddressResponse.md deleted file mode 100644 index 1e6d164..0000000 --- a/docs/Models/Operations/GetAddressResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetAddressResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `address` | [?\Shippo\API\Models\Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetBatchRequest.md b/docs/Models/Operations/GetBatchRequest.md index f050441..97ccbec 100644 --- a/docs/Models/Operations/GetBatchRequest.md +++ b/docs/Models/Operations/GetBatchRequest.md @@ -3,7 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `batchId` | *string* | :heavy_check_mark: | Object ID of the batch | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `batchId` | *string* | :heavy_check_mark: | Object ID of the batch | | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetBatchResponse.md b/docs/Models/Operations/GetBatchResponse.md deleted file mode 100644 index edf3ea8..0000000 --- a/docs/Models/Operations/GetBatchResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetBatchResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `batch` | [?\Shippo\API\Models\Components\Batch](../../Models/Components/Batch.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetCarrierAccountRequest.md b/docs/Models/Operations/GetCarrierAccountRequest.md index 37fff49..8c59957 100644 --- a/docs/Models/Operations/GetCarrierAccountRequest.md +++ b/docs/Models/Operations/GetCarrierAccountRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `carrierAccountId` | *string* | :heavy_check_mark: | Object ID of the carrier account | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `carrierAccountId` | *string* | :heavy_check_mark: | Object ID of the carrier account | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetCarrierAccountResponse.md b/docs/Models/Operations/GetCarrierAccountResponse.md deleted file mode 100644 index c7a6cbc..0000000 --- a/docs/Models/Operations/GetCarrierAccountResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetCarrierAccountResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `carrierAccount` | [?\Shippo\API\Models\Components\CarrierAccount](../../Models/Components/CarrierAccount.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetCarrierParcelTemplateRequest.md b/docs/Models/Operations/GetCarrierParcelTemplateRequest.md index 9157cb9..854adb5 100644 --- a/docs/Models/Operations/GetCarrierParcelTemplateRequest.md +++ b/docs/Models/Operations/GetCarrierParcelTemplateRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `carrierParcelTemplateToken` | *string* | :heavy_check_mark: | The unique string representation of the carrier parcel template | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `carrierParcelTemplateToken` | *string* | :heavy_check_mark: | The unique string representation of the carrier parcel template | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetCarrierParcelTemplateResponse.md b/docs/Models/Operations/GetCarrierParcelTemplateResponse.md deleted file mode 100644 index 4347e55..0000000 --- a/docs/Models/Operations/GetCarrierParcelTemplateResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetCarrierParcelTemplateResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `carrierParcelTemplate` | [?\Shippo\API\Models\Components\CarrierParcelTemplate](../../Models/Components/CarrierParcelTemplate.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetCarrierRegistrationStatusRequest.md b/docs/Models/Operations/GetCarrierRegistrationStatusRequest.md index f7daaa4..10b5906 100644 --- a/docs/Models/Operations/GetCarrierRegistrationStatusRequest.md +++ b/docs/Models/Operations/GetCarrierRegistrationStatusRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `carrier` | [\Shippo\API\Models\Operations\Carrier](../../Models/Operations/Carrier.md) | :heavy_check_mark: | filter by specific carrier | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `carrier` | [Operations\Carrier](../../Models/Operations/Carrier.md) | :heavy_check_mark: | filter by specific carrier | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetCustomsDeclarationRequest.md b/docs/Models/Operations/GetCustomsDeclarationRequest.md index ff51dea..edd8399 100644 --- a/docs/Models/Operations/GetCustomsDeclarationRequest.md +++ b/docs/Models/Operations/GetCustomsDeclarationRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `customsDeclarationId` | *string* | :heavy_check_mark: | Object ID of the customs declaration | | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `customsDeclarationId` | *string* | :heavy_check_mark: | Object ID of the customs declaration | | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetCustomsDeclarationResponse.md b/docs/Models/Operations/GetCustomsDeclarationResponse.md deleted file mode 100644 index faf94b1..0000000 --- a/docs/Models/Operations/GetCustomsDeclarationResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetCustomsDeclarationResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `customsDeclaration` | [?\Shippo\API\Models\Components\CustomsDeclaration](../../Models/Components/CustomsDeclaration.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetCustomsItemRequest.md b/docs/Models/Operations/GetCustomsItemRequest.md index e6d0f6c..73d5ff6 100644 --- a/docs/Models/Operations/GetCustomsItemRequest.md +++ b/docs/Models/Operations/GetCustomsItemRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `customsItemId` | *string* | :heavy_check_mark: | Object ID of the customs item | | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `customsItemId` | *string* | :heavy_check_mark: | Object ID of the customs item | | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetCustomsItemResponse.md b/docs/Models/Operations/GetCustomsItemResponse.md deleted file mode 100644 index 2b23f15..0000000 --- a/docs/Models/Operations/GetCustomsItemResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetCustomsItemResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `customsItem` | [?\Shippo\API\Models\Components\CustomsItem](../../Models/Components/CustomsItem.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetDefaultParcelTemplateRequest.md b/docs/Models/Operations/GetDefaultParcelTemplateRequest.md index 49b85d9..ce758f8 100644 --- a/docs/Models/Operations/GetDefaultParcelTemplateRequest.md +++ b/docs/Models/Operations/GetDefaultParcelTemplateRequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetDefaultParcelTemplateResponse.md b/docs/Models/Operations/GetDefaultParcelTemplateResponse.md deleted file mode 100644 index 3119b7a..0000000 --- a/docs/Models/Operations/GetDefaultParcelTemplateResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetDefaultParcelTemplateResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `defaultParcelTemplate` | [?\Shippo\API\Models\Components\DefaultParcelTemplate](../../Models/Components/DefaultParcelTemplate.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetManifestRequest.md b/docs/Models/Operations/GetManifestRequest.md index 08f3d5d..385d0a2 100644 --- a/docs/Models/Operations/GetManifestRequest.md +++ b/docs/Models/Operations/GetManifestRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `manifestId` | *string* | :heavy_check_mark: | Object ID of the manifest to update | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `manifestId` | *string* | :heavy_check_mark: | Object ID of the manifest to update | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetManifestResponse.md b/docs/Models/Operations/GetManifestResponse.md deleted file mode 100644 index 7dafaff..0000000 --- a/docs/Models/Operations/GetManifestResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetManifestResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `manifest` | [?\Shippo\API\Models\Components\Manifest](../../Models/Components/Manifest.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetOrderRequest.md b/docs/Models/Operations/GetOrderRequest.md index da20d1c..a2bd7da 100644 --- a/docs/Models/Operations/GetOrderRequest.md +++ b/docs/Models/Operations/GetOrderRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `orderId` | *string* | :heavy_check_mark: | Object ID of the order | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `orderId` | *string* | :heavy_check_mark: | Object ID of the order | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetOrderResponse.md b/docs/Models/Operations/GetOrderResponse.md deleted file mode 100644 index 9a5b9b4..0000000 --- a/docs/Models/Operations/GetOrderResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetOrderResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `order` | [?\Shippo\API\Models\Components\Order](../../Models/Components/Order.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetParcelRequest.md b/docs/Models/Operations/GetParcelRequest.md index 0a1a6d7..be26b0e 100644 --- a/docs/Models/Operations/GetParcelRequest.md +++ b/docs/Models/Operations/GetParcelRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `parcelId` | *string* | :heavy_check_mark: | Object ID of the parcel | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `parcelId` | *string* | :heavy_check_mark: | Object ID of the parcel | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetParcelResponse.md b/docs/Models/Operations/GetParcelResponse.md deleted file mode 100644 index 6c2079e..0000000 --- a/docs/Models/Operations/GetParcelResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetParcelResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `parcel` | [?\Shippo\API\Models\Components\Parcel](../../Models/Components/Parcel.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetRateRequest.md b/docs/Models/Operations/GetRateRequest.md index 2491de3..d4c8a69 100644 --- a/docs/Models/Operations/GetRateRequest.md +++ b/docs/Models/Operations/GetRateRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `rateId` | *string* | :heavy_check_mark: | Object ID of the rate | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `rateId` | *string* | :heavy_check_mark: | Object ID of the rate | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetRateResponse.md b/docs/Models/Operations/GetRateResponse.md deleted file mode 100644 index ef67e43..0000000 --- a/docs/Models/Operations/GetRateResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetRateResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `rate` | [?\Shippo\API\Models\Components\Rate](../../Models/Components/Rate.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetRefundRequest.md b/docs/Models/Operations/GetRefundRequest.md index 3dad487..a11fa21 100644 --- a/docs/Models/Operations/GetRefundRequest.md +++ b/docs/Models/Operations/GetRefundRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `refundId` | *string* | :heavy_check_mark: | Object ID of the refund to update | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `refundId` | *string* | :heavy_check_mark: | Object ID of the refund to update | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetRefundResponse.md b/docs/Models/Operations/GetRefundResponse.md deleted file mode 100644 index b192579..0000000 --- a/docs/Models/Operations/GetRefundResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetRefundResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `refund` | [?\Shippo\API\Models\Components\Refund](../../Models/Components/Refund.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetShipmentRequest.md b/docs/Models/Operations/GetShipmentRequest.md index b7404d0..1b57e98 100644 --- a/docs/Models/Operations/GetShipmentRequest.md +++ b/docs/Models/Operations/GetShipmentRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shipmentId` | *string* | :heavy_check_mark: | Object ID of the shipment to update | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shipmentId` | *string* | :heavy_check_mark: | Object ID of the shipment to update | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetShipmentResponse.md b/docs/Models/Operations/GetShipmentResponse.md deleted file mode 100644 index 555b588..0000000 --- a/docs/Models/Operations/GetShipmentResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetShipmentResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `shipment` | [?\Shippo\API\Models\Components\Shipment](../../Models/Components/Shipment.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetShippoAccountRequest.md b/docs/Models/Operations/GetShippoAccountRequest.md index 8cf77b7..1207539 100644 --- a/docs/Models/Operations/GetShippoAccountRequest.md +++ b/docs/Models/Operations/GetShippoAccountRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shippoAccountId` | *string* | :heavy_check_mark: | Object ID of the ShippoAccount | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoAccountId` | *string* | :heavy_check_mark: | Object ID of the ShippoAccount | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetShippoAccountResponse.md b/docs/Models/Operations/GetShippoAccountResponse.md deleted file mode 100644 index 9708261..0000000 --- a/docs/Models/Operations/GetShippoAccountResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetShippoAccountResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `shippoAccount` | [?\Shippo\API\Models\Components\ShippoAccount](../../Models/Components/ShippoAccount.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetTrackRequest.md b/docs/Models/Operations/GetTrackRequest.md index 5c3aa22..4690df3 100644 --- a/docs/Models/Operations/GetTrackRequest.md +++ b/docs/Models/Operations/GetTrackRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `trackingNumber` | *string* | :heavy_check_mark: | Tracking number | | -| `carrier` | *string* | :heavy_check_mark: | Name of the carrier | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `trackingNumber` | *string* | :heavy_check_mark: | Tracking number | | +| `carrier` | *string* | :heavy_check_mark: | Name of the carrier | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetTrackResponse.md b/docs/Models/Operations/GetTrackResponse.md deleted file mode 100644 index 732f927..0000000 --- a/docs/Models/Operations/GetTrackResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetTrackResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `track` | [?\Shippo\API\Models\Components\Track](../../Models/Components/Track.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetTransactionRequest.md b/docs/Models/Operations/GetTransactionRequest.md index 5863ed1..db7408f 100644 --- a/docs/Models/Operations/GetTransactionRequest.md +++ b/docs/Models/Operations/GetTransactionRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `transactionId` | *string* | :heavy_check_mark: | Object ID of the transaction to update | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `transactionId` | *string* | :heavy_check_mark: | Object ID of the transaction to update | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetTransactionResponse.md b/docs/Models/Operations/GetTransactionResponse.md deleted file mode 100644 index 785f11b..0000000 --- a/docs/Models/Operations/GetTransactionResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetTransactionResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `transaction` | [?\Shippo\API\Models\Components\Transaction](../../Models/Components/Transaction.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetUserParcelTemplateRequest.md b/docs/Models/Operations/GetUserParcelTemplateRequest.md index 3a413eb..aa09d4e 100644 --- a/docs/Models/Operations/GetUserParcelTemplateRequest.md +++ b/docs/Models/Operations/GetUserParcelTemplateRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `userParcelTemplateObjectId` | *string* | :heavy_check_mark: | Object ID of the user parcel template | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `userParcelTemplateObjectId` | *string* | :heavy_check_mark: | Object ID of the user parcel template | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/GetUserParcelTemplateResponse.md b/docs/Models/Operations/GetUserParcelTemplateResponse.md deleted file mode 100644 index 46d4b63..0000000 --- a/docs/Models/Operations/GetUserParcelTemplateResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetUserParcelTemplateResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `userParcelTemplate` | [?\Shippo\API\Models\Components\UserParcelTemplate](../../Models/Components/UserParcelTemplate.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetWebhookResponse.md b/docs/Models/Operations/GetWebhookResponse.md deleted file mode 100644 index 7898ce1..0000000 --- a/docs/Models/Operations/GetWebhookResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetWebhookResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `webhook` | [?\Shippo\API\Models\Components\Webhook](../../Models/Components/Webhook.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/InitiateOauth2SigninRequest.md b/docs/Models/Operations/InitiateOauth2SigninRequest.md index 19334bb..8cf5dc0 100644 --- a/docs/Models/Operations/InitiateOauth2SigninRequest.md +++ b/docs/Models/Operations/InitiateOauth2SigninRequest.md @@ -8,4 +8,4 @@ | `carrierAccountObjectId` | *string* | :heavy_check_mark: | The carrier account ID (UUID) to start a signin process. | | | `redirectUri` | *string* | :heavy_check_mark: | Callback URL. The URL that tells the authorization server where to send the user back to after they approve the request. | | | `state` | *?string* | :heavy_minus_sign: | A random string generated by the consuming application and included in the request to prevent CSRF attacks. The consuming application checks that the same value is returned after the user authorizes Shippo. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/InitiateOauth2SigninResponse.md b/docs/Models/Operations/InitiateOauth2SigninResponse.md index a6f4128..1220994 100644 --- a/docs/Models/Operations/InitiateOauth2SigninResponse.md +++ b/docs/Models/Operations/InitiateOauth2SigninResponse.md @@ -3,12 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `fourHundredApplicationJsonObject` | [?\Shippo\API\Models\Operations\InitiateOauth2SigninResponseBody](../../Models/Operations/InitiateOauth2SigninResponseBody.md) | :heavy_minus_sign: | Invalid parameters provided by the user | -| `fourHundredAndOneApplicationJsonObject` | [?\Shippo\API\Models\Operations\InitiateOauth2SigninCarrierAccountsResponseBody](../../Models/Operations/InitiateOauth2SigninCarrierAccountsResponseBody.md) | :heavy_minus_sign: | Invalid ShippoToken or unsupported carrier account provided by the user | -| `fourHundredAndFourApplicationJsonObject` | [?\Shippo\API\Models\Operations\InitiateOauth2SigninCarrierAccountsResponseResponseBody](../../Models/Operations/InitiateOauth2SigninCarrierAccountsResponseResponseBody.md) | :heavy_minus_sign: | Invalid carrier account provided by the user | -| `headers` | array> | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `headers` | array> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListAddressesRequest.md b/docs/Models/Operations/ListAddressesRequest.md index 5abc89f..807dce9 100644 --- a/docs/Models/Operations/ListAddressesRequest.md +++ b/docs/Models/Operations/ListAddressesRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListAddressesResponse.md b/docs/Models/Operations/ListAddressesResponse.md deleted file mode 100644 index d958383..0000000 --- a/docs/Models/Operations/ListAddressesResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListAddressesResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `addressPaginatedList` | [?\Shippo\API\Models\Components\AddressPaginatedList](../../Models/Components/AddressPaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListCarrierAccountsRequest.md b/docs/Models/Operations/ListCarrierAccountsRequest.md index ffa1cca..5cf64cb 100644 --- a/docs/Models/Operations/ListCarrierAccountsRequest.md +++ b/docs/Models/Operations/ListCarrierAccountsRequest.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `serviceLevels` | *?bool* | :heavy_minus_sign: | Appends the property `service_levels` to each returned carrier account | | -| `carrier` | [?\Shippo\API\Models\Components\CarriersEnum](../../Models/Components/CarriersEnum.md) | :heavy_minus_sign: | Filter the response by the specified carrier | | -| `accountId` | *?string* | :heavy_minus_sign: | Filter the response by the specified carrier account Id | | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `serviceLevels` | *?bool* | :heavy_minus_sign: | Appends the property `service_levels` to each returned carrier account | | +| `carrier` | [?Components\CarriersEnum](../../Models/Components/CarriersEnum.md) | :heavy_minus_sign: | Filter the response by the specified carrier | | +| `accountId` | *?string* | :heavy_minus_sign: | Filter the response by the specified carrier account Id | | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListCarrierAccountsResponse.md b/docs/Models/Operations/ListCarrierAccountsResponse.md deleted file mode 100644 index d1e0c0d..0000000 --- a/docs/Models/Operations/ListCarrierAccountsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListCarrierAccountsResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `carrierAccountPaginatedList` | [?\Shippo\API\Models\Components\CarrierAccountPaginatedList](../../Models/Components/CarrierAccountPaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListCarrierParcelTemplatesRequest.md b/docs/Models/Operations/ListCarrierParcelTemplatesRequest.md index 9a65c1c..f465810 100644 --- a/docs/Models/Operations/ListCarrierParcelTemplatesRequest.md +++ b/docs/Models/Operations/ListCarrierParcelTemplatesRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `include` | [?\Shippo\API\Models\Operations\IncludeT](../../Models/Operations/IncludeT.md) | :heavy_minus_sign: | filter by user or enabled | | -| `carrier` | *?string* | :heavy_minus_sign: | filter by specific carrier | fedex | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `include` | [?Operations\IncludeT](../../Models/Operations/IncludeT.md) | :heavy_minus_sign: | filter by user or enabled | | +| `carrier` | *?string* | :heavy_minus_sign: | filter by specific carrier | fedex | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListCarrierParcelTemplatesResponse.md b/docs/Models/Operations/ListCarrierParcelTemplatesResponse.md deleted file mode 100644 index f202794..0000000 --- a/docs/Models/Operations/ListCarrierParcelTemplatesResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListCarrierParcelTemplatesResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `carrierParcelTemplateList` | [?\Shippo\API\Models\Components\CarrierParcelTemplateList](../../Models/Components/CarrierParcelTemplateList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListCustomsDeclarationsRequest.md b/docs/Models/Operations/ListCustomsDeclarationsRequest.md index 1f2fb51..3ea274f 100644 --- a/docs/Models/Operations/ListCustomsDeclarationsRequest.md +++ b/docs/Models/Operations/ListCustomsDeclarationsRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListCustomsDeclarationsResponse.md b/docs/Models/Operations/ListCustomsDeclarationsResponse.md deleted file mode 100644 index 15d96c9..0000000 --- a/docs/Models/Operations/ListCustomsDeclarationsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListCustomsDeclarationsResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `customsDeclarationPaginatedList` | [?\Shippo\API\Models\Components\CustomsDeclarationPaginatedList](../../Models/Components/CustomsDeclarationPaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListCustomsItemsRequest.md b/docs/Models/Operations/ListCustomsItemsRequest.md index a288cb3..089cc63 100644 --- a/docs/Models/Operations/ListCustomsItemsRequest.md +++ b/docs/Models/Operations/ListCustomsItemsRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListCustomsItemsResponse.md b/docs/Models/Operations/ListCustomsItemsResponse.md deleted file mode 100644 index dcb2f77..0000000 --- a/docs/Models/Operations/ListCustomsItemsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListCustomsItemsResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `customsItemPaginatedList` | [?\Shippo\API\Models\Components\CustomsItemPaginatedList](../../Models/Components/CustomsItemPaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListManifestsRequest.md b/docs/Models/Operations/ListManifestsRequest.md index 1303dff..fd2d929 100644 --- a/docs/Models/Operations/ListManifestsRequest.md +++ b/docs/Models/Operations/ListManifestsRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListManifestsResponse.md b/docs/Models/Operations/ListManifestsResponse.md deleted file mode 100644 index 47c232a..0000000 --- a/docs/Models/Operations/ListManifestsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListManifestsResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `manifestPaginatedList` | [?\Shippo\API\Models\Components\ManifestPaginatedList](../../Models/Components/ManifestPaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListOrdersRequest.md b/docs/Models/Operations/ListOrdersRequest.md index fc52d4a..84255f1 100644 --- a/docs/Models/Operations/ListOrdersRequest.md +++ b/docs/Models/Operations/ListOrdersRequest.md @@ -3,8 +3,12 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | +| `orderStatus` | array<[Components\OrderStatusEnum](../../Models/Components/OrderStatusEnum.md)> | :heavy_minus_sign: | Filter orders by order status | | +| `shopApp` | [?Components\OrderShopAppEnum](../../Models/Components/OrderShopAppEnum.md) | :heavy_minus_sign: | Filter orders by shop app | Shippo | +| `startDate` | *?string* | :heavy_minus_sign: | Filter orders created after the input date and time (ISO 8601 UTC format). This is based on the
`placed_at` field, meaning when the order has been placed, not when the order object was created. | | +| `endDate` | *?string* | :heavy_minus_sign: | Filter orders created before the input date and time (ISO 8601 UTC format). This is based on the
`placed_at` field, meaning when the order has been placed, not when the order object was created. | | \ No newline at end of file diff --git a/docs/Models/Operations/ListOrdersResponse.md b/docs/Models/Operations/ListOrdersResponse.md deleted file mode 100644 index 5565988..0000000 --- a/docs/Models/Operations/ListOrdersResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListOrdersResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `orderPaginatedList` | [?\Shippo\API\Models\Components\OrderPaginatedList](../../Models/Components/OrderPaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListParcelsRequest.md b/docs/Models/Operations/ListParcelsRequest.md index b72c906..2e9006d 100644 --- a/docs/Models/Operations/ListParcelsRequest.md +++ b/docs/Models/Operations/ListParcelsRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListParcelsResponse.md b/docs/Models/Operations/ListParcelsResponse.md deleted file mode 100644 index 62dab53..0000000 --- a/docs/Models/Operations/ListParcelsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListParcelsResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `parcelPaginatedList` | [?\Shippo\API\Models\Components\ParcelPaginatedList](../../Models/Components/ParcelPaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListRefundsRequest.md b/docs/Models/Operations/ListRefundsRequest.md index 6789acb..f634e6b 100644 --- a/docs/Models/Operations/ListRefundsRequest.md +++ b/docs/Models/Operations/ListRefundsRequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListRefundsResponse.md b/docs/Models/Operations/ListRefundsResponse.md deleted file mode 100644 index 6a18a57..0000000 --- a/docs/Models/Operations/ListRefundsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListRefundsResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `refundPaginatedList` | [?\Shippo\API\Models\Components\RefundPaginatedList](../../Models/Components/RefundPaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListServiceGroupsRequest.md b/docs/Models/Operations/ListServiceGroupsRequest.md index 94df3b9..72ab752 100644 --- a/docs/Models/Operations/ListServiceGroupsRequest.md +++ b/docs/Models/Operations/ListServiceGroupsRequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListServiceGroupsResponse.md b/docs/Models/Operations/ListServiceGroupsResponse.md deleted file mode 100644 index a21e508..0000000 --- a/docs/Models/Operations/ListServiceGroupsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListServiceGroupsResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `serviceGroupListResponse` | array<[\Shippo\API\Models\Components\ServiceGroup](../../Models/Components/ServiceGroup.md)> | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListShipmentRatesByCurrencyCodeRequest.md b/docs/Models/Operations/ListShipmentRatesByCurrencyCodeRequest.md index 918c1ce..2ece00a 100644 --- a/docs/Models/Operations/ListShipmentRatesByCurrencyCodeRequest.md +++ b/docs/Models/Operations/ListShipmentRatesByCurrencyCodeRequest.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shipmentId` | *string* | :heavy_check_mark: | Object ID of the shipment to update | | -| `currencyCode` | *string* | :heavy_check_mark: | ISO currency code for the rates | | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shipmentId` | *string* | :heavy_check_mark: | Object ID of the shipment to update | | +| `currencyCode` | *string* | :heavy_check_mark: | ISO currency code for the rates | | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListShipmentRatesByCurrencyCodeResponse.md b/docs/Models/Operations/ListShipmentRatesByCurrencyCodeResponse.md deleted file mode 100644 index d38eaee..0000000 --- a/docs/Models/Operations/ListShipmentRatesByCurrencyCodeResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListShipmentRatesByCurrencyCodeResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `ratePaginatedList` | [?\Shippo\API\Models\Components\RatePaginatedList](../../Models/Components/RatePaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListShipmentRatesRequest.md b/docs/Models/Operations/ListShipmentRatesRequest.md index b7c3c21..51f05df 100644 --- a/docs/Models/Operations/ListShipmentRatesRequest.md +++ b/docs/Models/Operations/ListShipmentRatesRequest.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shipmentId` | *string* | :heavy_check_mark: | Object ID of the shipment to update | | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shipmentId` | *string* | :heavy_check_mark: | Object ID of the shipment to update | | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListShipmentRatesResponse.md b/docs/Models/Operations/ListShipmentRatesResponse.md deleted file mode 100644 index 4a39184..0000000 --- a/docs/Models/Operations/ListShipmentRatesResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListShipmentRatesResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `ratePaginatedList` | [?\Shippo\API\Models\Components\RatePaginatedList](../../Models/Components/RatePaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListShipmentsRequest.md b/docs/Models/Operations/ListShipmentsRequest.md index 4e5d4ed..31f7bf7 100644 --- a/docs/Models/Operations/ListShipmentsRequest.md +++ b/docs/Models/Operations/ListShipmentsRequest.md @@ -3,8 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `pageToken` | *?string* | :heavy_minus_sign: | The page token for paginated results | | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | +| `objectCreatedGt` | *?string* | :heavy_minus_sign: | Object(s) created greater than a provided date and time. | | +| `objectCreatedGte` | *?string* | :heavy_minus_sign: | Object(s) created greater than or equal to a provided date and time. | | +| `objectCreatedLt` | *?string* | :heavy_minus_sign: | Object(s) created lesser than a provided date and time. | | +| `objectCreatedLte` | *?string* | :heavy_minus_sign: | Object(s) created lesser than or equal to a provided date and time. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListShipmentsResponse.md b/docs/Models/Operations/ListShipmentsResponse.md deleted file mode 100644 index bac96b7..0000000 --- a/docs/Models/Operations/ListShipmentsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListShipmentsResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `shipmentPaginatedList` | [?\Shippo\API\Models\Components\ShipmentPaginatedList](../../Models/Components/ShipmentPaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListShippoAccountsRequest.md b/docs/Models/Operations/ListShippoAccountsRequest.md index e9978bf..191e7a4 100644 --- a/docs/Models/Operations/ListShippoAccountsRequest.md +++ b/docs/Models/Operations/ListShippoAccountsRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListShippoAccountsResponse.md b/docs/Models/Operations/ListShippoAccountsResponse.md deleted file mode 100644 index 725c068..0000000 --- a/docs/Models/Operations/ListShippoAccountsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListShippoAccountsResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `shippoAccountPaginatedList` | [?\Shippo\API\Models\Components\ShippoAccountPaginatedList](../../Models/Components/ShippoAccountPaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListTransactionsRequest.md b/docs/Models/Operations/ListTransactionsRequest.md index b067c03..02d0519 100644 --- a/docs/Models/Operations/ListTransactionsRequest.md +++ b/docs/Models/Operations/ListTransactionsRequest.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `rate` | *?string* | :heavy_minus_sign: | Filter by rate ID | | -| `objectStatus` | [?\Shippo\API\Models\Components\TransactionStatusEnum](../../Models/Components/TransactionStatusEnum.md) | :heavy_minus_sign: | Filter by object status | SUCCESS | -| `trackingStatus` | [?\Shippo\API\Models\Components\TrackingStatusEnum](../../Models/Components/TrackingStatusEnum.md) | :heavy_minus_sign: | Filter by tracking status | DELIVERED | -| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `rate` | *?string* | :heavy_minus_sign: | Filter by rate ID | | +| `objectStatus` | [?Components\TransactionStatusEnum](../../Models/Components/TransactionStatusEnum.md) | :heavy_minus_sign: | Filter by object status | SUCCESS | +| `trackingStatus` | [?Components\TrackingStatusEnum](../../Models/Components/TrackingStatusEnum.md) | :heavy_minus_sign: | Filter by tracking status | DELIVERED | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListTransactionsResponse.md b/docs/Models/Operations/ListTransactionsResponse.md deleted file mode 100644 index afb47f7..0000000 --- a/docs/Models/Operations/ListTransactionsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListTransactionsResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `transactionPaginatedList` | [?\Shippo\API\Models\Components\TransactionPaginatedList](../../Models/Components/TransactionPaginatedList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListUserParcelTemplatesRequest.md b/docs/Models/Operations/ListUserParcelTemplatesRequest.md index de086ef..fdee392 100644 --- a/docs/Models/Operations/ListUserParcelTemplatesRequest.md +++ b/docs/Models/Operations/ListUserParcelTemplatesRequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ListUserParcelTemplatesResponse.md b/docs/Models/Operations/ListUserParcelTemplatesResponse.md deleted file mode 100644 index dde9ec7..0000000 --- a/docs/Models/Operations/ListUserParcelTemplatesResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListUserParcelTemplatesResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `userParcelTemplateList` | [?\Shippo\API\Models\Components\UserParcelTemplateList](../../Models/Components/UserParcelTemplateList.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ListWebhooksResponse.md b/docs/Models/Operations/ListWebhooksResponse.md deleted file mode 100644 index b0a21d5..0000000 --- a/docs/Models/Operations/ListWebhooksResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListWebhooksResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `webhookPaginatedList` | [?\Shippo\API\Models\Components\WebhookPaginatedList](../../Models/Components/WebhookPaginatedList.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/PurchaseBatchRequest.md b/docs/Models/Operations/PurchaseBatchRequest.md index 406237b..8278702 100644 --- a/docs/Models/Operations/PurchaseBatchRequest.md +++ b/docs/Models/Operations/PurchaseBatchRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `batchId` | *string* | :heavy_check_mark: | Object ID of the batch | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `batchId` | *string* | :heavy_check_mark: | Object ID of the batch | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/PurchaseBatchResponse.md b/docs/Models/Operations/PurchaseBatchResponse.md deleted file mode 100644 index 0987546..0000000 --- a/docs/Models/Operations/PurchaseBatchResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# PurchaseBatchResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `batch` | [?\Shippo\API\Models\Components\Batch](../../Models/Components/Batch.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/RegisterCarrierAccountRequest.md b/docs/Models/Operations/RegisterCarrierAccountRequest.md index f886555..5982b67 100644 --- a/docs/Models/Operations/RegisterCarrierAccountRequest.md +++ b/docs/Models/Operations/RegisterCarrierAccountRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `requestBody` | *mixed* | :heavy_check_mark: | Examples. | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `requestBody` | [Components\CarrierAccountCanadaPostCreateRequest\|Components\CarrierAccountChronopostCreateRequest\|Components\CarrierAccountColissimoCreateRequest\|Components\CarrierAccountCorreosCreateRequest\|Components\CarrierAccountDeutschePostCreateRequest\|Components\CarrierAccountDHLExpressCreateRequest\|Components\CarrierAccountDpdDeCreateRequest\|Components\CarrierAccountDPDUKCreateRequest\|Components\CarrierAccountFedExCreateRequest\|Components\CarrierAccountHermesUKCreateRequest\|Components\CarrierAccountMondialRelayCreateRequest\|Components\CarrierAccountPosteItalianeCreateRequest\|Components\CarrierAccountUPSCreateRequest\|Components\CarrierAccountUSPSCreateRequest\|Components\CarrierAccountSendleCreateRequest](../../Models/Operations/RegisterCarrierAccountRequestBody.md) | :heavy_check_mark: | Examples. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/RegisterCarrierAccountRequestBody.md b/docs/Models/Operations/RegisterCarrierAccountRequestBody.md new file mode 100644 index 0000000..e4f8e0e --- /dev/null +++ b/docs/Models/Operations/RegisterCarrierAccountRequestBody.md @@ -0,0 +1,142 @@ +# RegisterCarrierAccountRequestBody + +Examples. + + +## Supported Types + +### `Components\CarrierAccountCanadaPostCreateRequest` + +```php +/** +* @var Components\CarrierAccountCanadaPostCreateRequest +*/ +Components\CarrierAccountCanadaPostCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountChronopostCreateRequest` + +```php +/** +* @var Components\CarrierAccountChronopostCreateRequest +*/ +Components\CarrierAccountChronopostCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountColissimoCreateRequest` + +```php +/** +* @var Components\CarrierAccountColissimoCreateRequest +*/ +Components\CarrierAccountColissimoCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountCorreosCreateRequest` + +```php +/** +* @var Components\CarrierAccountCorreosCreateRequest +*/ +Components\CarrierAccountCorreosCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountDeutschePostCreateRequest` + +```php +/** +* @var Components\CarrierAccountDeutschePostCreateRequest +*/ +Components\CarrierAccountDeutschePostCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountDHLExpressCreateRequest` + +```php +/** +* @var Components\CarrierAccountDHLExpressCreateRequest +*/ +Components\CarrierAccountDHLExpressCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountDpdDeCreateRequest` + +```php +/** +* @var Components\CarrierAccountDpdDeCreateRequest +*/ +Components\CarrierAccountDpdDeCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountDPDUKCreateRequest` + +```php +/** +* @var Components\CarrierAccountDPDUKCreateRequest +*/ +Components\CarrierAccountDPDUKCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountFedExCreateRequest` + +```php +/** +* @var Components\CarrierAccountFedExCreateRequest +*/ +Components\CarrierAccountFedExCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountHermesUKCreateRequest` + +```php +/** +* @var Components\CarrierAccountHermesUKCreateRequest +*/ +Components\CarrierAccountHermesUKCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountMondialRelayCreateRequest` + +```php +/** +* @var Components\CarrierAccountMondialRelayCreateRequest +*/ +Components\CarrierAccountMondialRelayCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountPosteItalianeCreateRequest` + +```php +/** +* @var Components\CarrierAccountPosteItalianeCreateRequest +*/ +Components\CarrierAccountPosteItalianeCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountUPSCreateRequest` + +```php +/** +* @var Components\CarrierAccountUPSCreateRequest +*/ +Components\CarrierAccountUPSCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountUSPSCreateRequest` + +```php +/** +* @var Components\CarrierAccountUSPSCreateRequest +*/ +Components\CarrierAccountUSPSCreateRequest $value = /* values here */ +``` + +### `Components\CarrierAccountSendleCreateRequest` + +```php +/** +* @var Components\CarrierAccountSendleCreateRequest +*/ +Components\CarrierAccountSendleCreateRequest $value = /* values here */ +``` + diff --git a/docs/Models/Operations/RegisterCarrierAccountResponse.md b/docs/Models/Operations/RegisterCarrierAccountResponse.md deleted file mode 100644 index 5f1c9a4..0000000 --- a/docs/Models/Operations/RegisterCarrierAccountResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# RegisterCarrierAccountResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `carrierAccount` | [?\Shippo\API\Models\Components\CarrierAccount](../../Models/Components/CarrierAccount.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/RemoveShipmentsFromBatchRequest.md b/docs/Models/Operations/RemoveShipmentsFromBatchRequest.md index 51c7c34..4fcb41b 100644 --- a/docs/Models/Operations/RemoveShipmentsFromBatchRequest.md +++ b/docs/Models/Operations/RemoveShipmentsFromBatchRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `batchId` | *string* | :heavy_check_mark: | Object ID of the batch | | -| `requestBody` | array<*string*> | :heavy_check_mark: | Array of shipments object ids to remove from the batch | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `batchId` | *string* | :heavy_check_mark: | Object ID of the batch | | +| `requestBody` | array<*string*> | :heavy_check_mark: | Array of shipments object ids to remove from the batch | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/RemoveShipmentsFromBatchResponse.md b/docs/Models/Operations/RemoveShipmentsFromBatchResponse.md deleted file mode 100644 index 1ab752d..0000000 --- a/docs/Models/Operations/RemoveShipmentsFromBatchResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# RemoveShipmentsFromBatchResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `batch` | [?\Shippo\API\Models\Components\Batch](../../Models/Components/Batch.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateCarrierAccountRequest.md b/docs/Models/Operations/UpdateCarrierAccountRequest.md index f70b763..31bafd6 100644 --- a/docs/Models/Operations/UpdateCarrierAccountRequest.md +++ b/docs/Models/Operations/UpdateCarrierAccountRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `carrierAccountId` | *string* | :heavy_check_mark: | Object ID of the carrier account | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | -| `carrierAccountBase` | [?\Shippo\API\Models\Components\CarrierAccountBase](../../Models/Components/CarrierAccountBase.md) | :heavy_minus_sign: | Examples. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `carrierAccountId` | *string* | :heavy_check_mark: | Object ID of the carrier account | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | +| `carrierAccountBase` | [?Components\CarrierAccountBase](../../Models/Components/CarrierAccountBase.md) | :heavy_minus_sign: | Examples. | | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateCarrierAccountResponse.md b/docs/Models/Operations/UpdateCarrierAccountResponse.md deleted file mode 100644 index a062e00..0000000 --- a/docs/Models/Operations/UpdateCarrierAccountResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# UpdateCarrierAccountResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `carrierAccount` | [?\Shippo\API\Models\Components\CarrierAccount](../../Models/Components/CarrierAccount.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateDefaultParcelTemplateRequest.md b/docs/Models/Operations/UpdateDefaultParcelTemplateRequest.md index 3d072ee..dcf11a1 100644 --- a/docs/Models/Operations/UpdateDefaultParcelTemplateRequest.md +++ b/docs/Models/Operations/UpdateDefaultParcelTemplateRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | -| `defaultParcelTemplateUpdateRequest` | [?\Shippo\API\Models\Components\DefaultParcelTemplateUpdateRequest](../../Models/Components/DefaultParcelTemplateUpdateRequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | +| `defaultParcelTemplateUpdateRequest` | [?Components\DefaultParcelTemplateUpdateRequest](../../Models/Components/DefaultParcelTemplateUpdateRequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateDefaultParcelTemplateResponse.md b/docs/Models/Operations/UpdateDefaultParcelTemplateResponse.md deleted file mode 100644 index 837c315..0000000 --- a/docs/Models/Operations/UpdateDefaultParcelTemplateResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# UpdateDefaultParcelTemplateResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `defaultParcelTemplate` | [?\Shippo\API\Models\Components\DefaultParcelTemplate](../../Models/Components/DefaultParcelTemplate.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateServiceGroupRequest.md b/docs/Models/Operations/UpdateServiceGroupRequest.md index d93600e..1326e5e 100644 --- a/docs/Models/Operations/UpdateServiceGroupRequest.md +++ b/docs/Models/Operations/UpdateServiceGroupRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | -| `serviceGroupUpdateRequest` | [?\Shippo\API\Models\Components\ServiceGroupUpdateRequest](../../Models/Components/ServiceGroupUpdateRequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | +| `serviceGroupUpdateRequest` | [?Components\ServiceGroupUpdateRequest](../../Models/Components/ServiceGroupUpdateRequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateServiceGroupResponse.md b/docs/Models/Operations/UpdateServiceGroupResponse.md deleted file mode 100644 index 23c45f3..0000000 --- a/docs/Models/Operations/UpdateServiceGroupResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# UpdateServiceGroupResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `serviceGroup` | [?\Shippo\API\Models\Components\ServiceGroup](../../Models/Components/ServiceGroup.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateShippoAccountRequest.md b/docs/Models/Operations/UpdateShippoAccountRequest.md index 895845b..cb377f9 100644 --- a/docs/Models/Operations/UpdateShippoAccountRequest.md +++ b/docs/Models/Operations/UpdateShippoAccountRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `shippoAccountId` | *string* | :heavy_check_mark: | Object ID of the ShippoAccount | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | -| `shippoAccountUpdateRequest` | [?\Shippo\API\Models\Components\ShippoAccountUpdateRequest](../../Models/Components/ShippoAccountUpdateRequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoAccountId` | *string* | :heavy_check_mark: | Object ID of the ShippoAccount | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | +| `shippoAccountUpdateRequest` | [?Components\ShippoAccountUpdateRequest](../../Models/Components/ShippoAccountUpdateRequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateShippoAccountResponse.md b/docs/Models/Operations/UpdateShippoAccountResponse.md deleted file mode 100644 index 79f5a79..0000000 --- a/docs/Models/Operations/UpdateShippoAccountResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# UpdateShippoAccountResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `shippoAccount` | [?\Shippo\API\Models\Components\ShippoAccount](../../Models/Components/ShippoAccount.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateUserParcelTemplateRequest.md b/docs/Models/Operations/UpdateUserParcelTemplateRequest.md index 87e79aa..060b551 100644 --- a/docs/Models/Operations/UpdateUserParcelTemplateRequest.md +++ b/docs/Models/Operations/UpdateUserParcelTemplateRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -| `userParcelTemplateObjectId` | *string* | :heavy_check_mark: | Object ID of the user parcel template | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | -| `userParcelTemplateUpdateRequest` | [?\Shippo\API\Models\Components\UserParcelTemplateUpdateRequest](../../Models/Components/UserParcelTemplateUpdateRequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `userParcelTemplateObjectId` | *string* | :heavy_check_mark: | Object ID of the user parcel template | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | +| `userParcelTemplateUpdateRequest` | [?Components\UserParcelTemplateUpdateRequest](../../Models/Components/UserParcelTemplateUpdateRequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateUserParcelTemplateResponse.md b/docs/Models/Operations/UpdateUserParcelTemplateResponse.md deleted file mode 100644 index 0a60ea0..0000000 --- a/docs/Models/Operations/UpdateUserParcelTemplateResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# UpdateUserParcelTemplateResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `userParcelTemplate` | [?\Shippo\API\Models\Components\UserParcelTemplate](../../Models/Components/UserParcelTemplate.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateWebhookRequest.md b/docs/Models/Operations/UpdateWebhookRequest.md index 29c7951..76c6601 100644 --- a/docs/Models/Operations/UpdateWebhookRequest.md +++ b/docs/Models/Operations/UpdateWebhookRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `webhookId` | *string* | :heavy_check_mark: | Object ID of the webhook to retrieve | -| `webhookUpdateRequest` | [\Shippo\API\Models\Components\WebhookUpdateRequest](../../Models/Components/WebhookUpdateRequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `webhookId` | *string* | :heavy_check_mark: | Object ID of the webhook to retrieve | +| `webhookUpdateRequest` | [Components\WebhookUpdateRequest](../../Models/Components/WebhookUpdateRequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateWebhookResponse.md b/docs/Models/Operations/UpdateWebhookResponse.md deleted file mode 100644 index 99d0214..0000000 --- a/docs/Models/Operations/UpdateWebhookResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateWebhookResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `webhook` | [?\Shippo\API\Models\Components\Webhook](../../Models/Components/Webhook.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ValidateAddressRequest.md b/docs/Models/Operations/ValidateAddressRequest.md index 50211a5..a00ac9a 100644 --- a/docs/Models/Operations/ValidateAddressRequest.md +++ b/docs/Models/Operations/ValidateAddressRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `addressId` | *string* | :heavy_check_mark: | Object ID of the address | | -| `shippoApiVersion` | *?string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `addressId` | *string* | :heavy_check_mark: | Object ID of the address | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | \ No newline at end of file diff --git a/docs/Models/Operations/ValidateAddressResponse.md b/docs/Models/Operations/ValidateAddressResponse.md deleted file mode 100644 index cc1267e..0000000 --- a/docs/Models/Operations/ValidateAddressResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ValidateAddressResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `address` | [?\Shippo\API\Models\Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | N/A | -| `badRequest` | array | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdks/addresses/README.md b/docs/sdks/addresses/README.md index 3ff6bee..878e79f 100644 --- a/docs/sdks/addresses/README.md +++ b/docs/sdks/addresses/README.md @@ -1,5 +1,5 @@ # Addresses - +(*addresses*) ## Overview @@ -20,49 +20,49 @@ Returns a list of all address objects that have been created in this account. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->addresses->list(768578, 99895, '2018-02-08'); - if ($response->addressPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->addresses->list( + page: 1, + results: 5, + shippoApiVersion: '2018-02-08' + +); + +if ($response->addressPaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `page` | *int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\ListAddressesResponse](../../Models/Operations/ListAddressesResponse.md)** +**[?Components\AddressPaginatedList](../../Models/Components/AddressPaginatedList.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## create @@ -71,63 +71,63 @@ Creates a new address object. You can use address objects to create new shipment ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $addressCreateRequest = new Components\AddressCreateRequest(); - $addressCreateRequest->name = 'Shwan Ippotle'; - $addressCreateRequest->company = 'Shippo'; - $addressCreateRequest->street1 = '215 Clayton St.'; - $addressCreateRequest->street2 = ''; - $addressCreateRequest->street3 = ''; - $addressCreateRequest->streetNo = ''; - $addressCreateRequest->city = 'San Francisco'; - $addressCreateRequest->state = 'CA'; - $addressCreateRequest->zip = '94117'; - $addressCreateRequest->country = 'US'; - $addressCreateRequest->phone = '+1 555 341 9393'; - $addressCreateRequest->email = 'shippotle@shippo.com'; - $addressCreateRequest->isResidential = true; - $addressCreateRequest->metadata = 'Customer ID 123456'; - $addressCreateRequest->validate = true; - - $response = $sdk->addresses->create($addressCreateRequest, '2018-02-08'); - - if ($response->address !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$addressCreateRequest = new Components\AddressCreateRequest( + country: 'US', + name: 'Shwan Ippotle', + company: 'Shippo', + street1: '215 Clayton St.', + street3: '', + streetNo: '', + city: 'San Francisco', + state: 'CA', + zip: '94117', + phone: '+1 555 341 9393', + email: 'shippotle@shippo.com', + isResidential: true, + metadata: 'Customer ID 123456', + validate: true, +); + +$response = $sdk->addresses->create( + addressCreateRequest: $addressCreateRequest, + shippoApiVersion: '2018-02-08' + +); + +if ($response->address !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `addressCreateRequest` | [\Shippo\API\Models\Components\AddressCreateRequest](../../Models/Components/AddressCreateRequest.md) | :heavy_check_mark: | Address details. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `addressCreateRequest` | [Components\AddressCreateRequest](../../Models/Components/AddressCreateRequest.md) | :heavy_check_mark: | Address details. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateAddressResponse](../../Models/Operations/CreateAddressResponse.md)** +**[?Components\Address](../../Models/Components/Address.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -136,48 +136,47 @@ Returns an existing address using an object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->addresses->get('', '2018-02-08'); - if ($response->address !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->addresses->get( + addressId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->address !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `addressId` | *string* | :heavy_check_mark: | Object ID of the address | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `addressId` | *string* | :heavy_check_mark: | Object ID of the address | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetAddressResponse](../../Models/Operations/GetAddressResponse.md)** +**[?Components\Address](../../Models/Components/Address.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## validate @@ -186,45 +185,44 @@ Validates an existing address using an object ID ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->addresses->validate('', '2018-02-08'); - if ($response->address !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->addresses->validate( + addressId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->address !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `addressId` | *string* | :heavy_check_mark: | Object ID of the address | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `addressId` | *string* | :heavy_check_mark: | Object ID of the address | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\ValidateAddressResponse](../../Models/Operations/ValidateAddressResponse.md)** +**[?Components\Address](../../Models/Components/Address.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/batches/README.md b/docs/sdks/batches/README.md index 4ae97de..2857f24 100644 --- a/docs/sdks/batches/README.md +++ b/docs/sdks/batches/README.md @@ -1,5 +1,5 @@ # Batches - +(*batches*) ## Overview @@ -29,55 +29,209 @@ Creates a new batch object for purchasing shipping labels for many shipments at ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $batchCreateRequest = new Components\BatchCreateRequest(); - $batchCreateRequest->defaultCarrierAccount = '078870331023437cb917f5187429b093'; - $batchCreateRequest->defaultServicelevelToken = 'usps_priority'; - $batchCreateRequest->labelFiletype = Components\LabelFileTypeEnum::PDF4x6; - $batchCreateRequest->metadata = 'BATCH #1'; - $batchCreateRequest->batchShipments = [ - new Components\BatchShipmentCreateRequest(), - ]; - - $response = $sdk->batches->create($batchCreateRequest, '2018-02-08'); - - if ($response->batch !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$batchCreateRequest = new Components\BatchCreateRequest( + defaultCarrierAccount: '078870331023437cb917f5187429b093', + defaultServicelevelToken: 'usps_priority', + batchShipments: [ + new Components\BatchShipmentCreateRequest( + shipment: new Components\ShipmentCreateRequest( + addressFrom: new Components\AddressCreateRequest( + country: 'US', + name: 'Shwan Ippotle', + company: 'Shippo', + street1: '215 Clayton St.', + street3: '', + streetNo: '', + city: 'San Francisco', + state: 'CA', + zip: '94117', + phone: '+1 555 341 9393', + email: 'shippotle@shippo.com', + isResidential: true, + metadata: 'Customer ID 123456', + validate: true, + ), + addressTo: 'd799c2679e644279b59fe661ac8fa489', + parcels: [ + new Components\ParcelCreateFromTemplateRequest( + massUnit: Components\WeightUnitEnum::Lb, + weight: '1', + template: Components\ParcelTemplateFedExEnum::FedExBox25kg, + extra: new Components\ParcelExtra( + cod: new Components\Cod( + amount: '5.5', + currency: 'USD', + paymentMethod: Components\PaymentMethod::Cash, + ), + insurance: new Components\ParcelInsurance( + amount: '5.5', + content: 'Laptop', + currency: 'USD', + provider: Components\ParcelInsuranceProvider::Ups, + ), + ), + metadata: 'Customer ID 123456', + ), + ], + extra: new Components\ShipmentExtra( + accountsReceivableCustomerAccount: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + appropriationNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + billOfLadingNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + cod: new Components\Cod( + amount: '5.5', + currency: 'USD', + paymentMethod: Components\PaymentMethod::Cash, + ), + codNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + customerReference: new Components\CustomerReference( + refSort: 1, + ), + dealerOrderNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + deptNumber: new Components\DepartmentNumber( + refSort: 3, + ), + fdaProductCode: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + insurance: new Components\Insurance( + amount: '5.5', + currency: 'USD', + ), + invoiceNumber: new Components\InvoiceNumber( + refSort: 2, + ), + manifestNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + modelNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + partNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + poNumber: new Components\PoNumber( + refSort: 2, + ), + productionCode: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + purchaseRequestNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + rmaNumber: new Components\RmaNumber( + refSort: 1, + ), + salespersonNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + serialNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + storeNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + transactionReferenceNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + ), + metadata: 'Customer ID 123456', + shipmentDate: '2021-03-22T12:00:00Z', + addressReturn: 'd799c2679e644279b59fe661ac8fa488', + customsDeclaration: 'adcfdddf8ec64b84ad22772bce3ea37a', + carrierAccounts: [ + '065a4a8c10d24a34ab932163a1b87f52', + '73f706f4bdb94b54a337563840ce52b0', + ], + ), + carrierAccount: 'a4391cd4ab974f478f55dc08b5c8e3b3', + metadata: 'SHIPMENT #1', + servicelevelToken: 'fedex_ground', + ), + ], + labelFiletype: Components\LabelFileTypeEnum::PDF4x6, + metadata: 'BATCH #1', +); + +$response = $sdk->batches->create( + batchCreateRequest: $batchCreateRequest, + shippoApiVersion: '2018-02-08' + +); + +if ($response->batch !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `batchCreateRequest` | [\Shippo\API\Models\Components\BatchCreateRequest](../../Models/Components/BatchCreateRequest.md) | :heavy_check_mark: | Batch details. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `batchCreateRequest` | [Components\BatchCreateRequest](../../Models/Components/BatchCreateRequest.md) | :heavy_check_mark: | Batch details. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateBatchResponse](../../Models/Operations/CreateBatchResponse.md)** +**[?Components\Batch](../../Models/Components/Batch.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -89,48 +243,47 @@ For more details on filtering results, see our guide on API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\AddShipmentsToBatchResponse](../../Models/Operations/AddShipmentsToBatchResponse.md)** +**[?Components\Batch](../../Models/Components/Batch.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## purchase @@ -195,48 +505,47 @@ When all the shipments are purchased, the status will change to `PURCHASED` and ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->batches->purchase('', '2018-02-08'); - if ($response->batch !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->batches->purchase( + batchId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->batch !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `batchId` | *string* | :heavy_check_mark: | Object ID of the batch | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `batchId` | *string* | :heavy_check_mark: | Object ID of the batch | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\PurchaseBatchResponse](../../Models/Operations/PurchaseBatchResponse.md)** +**[?Components\Batch](../../Models/Components/Batch.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## removeShipments @@ -245,48 +554,48 @@ Removes shipments from an existing batch shipment. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->batches->removeShipments('', [ - '', -], '2018-02-08'); - if ($response->batch !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->batches->removeShipments( + batchId: '', + requestBody: [ + '', + ], + shippoApiVersion: '2018-02-08' + +); + +if ($response->batch !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `batchId` | *string* | :heavy_check_mark: | Object ID of the batch | | -| `requestBody` | array<*string*> | :heavy_check_mark: | Array of shipments object ids to remove from the batch | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `batchId` | *string* | :heavy_check_mark: | Object ID of the batch | | +| `requestBody` | array<*string*> | :heavy_check_mark: | Array of shipments object ids to remove from the batch | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\RemoveShipmentsFromBatchResponse](../../Models/Operations/RemoveShipmentsFromBatchResponse.md)** +**[?Components\Batch](../../Models/Components/Batch.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/carrieraccounts/README.md b/docs/sdks/carrieraccounts/README.md index e086e07..2cb6906 100644 --- a/docs/sdks/carrieraccounts/README.md +++ b/docs/sdks/carrieraccounts/README.md @@ -1,5 +1,5 @@ # CarrierAccounts - +(*carrierAccounts*) ## Overview @@ -28,52 +28,45 @@ By default, if the query parameter is omitted, the `service_levels` property wil ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $request = new Operations\ListCarrierAccountsRequest(); - $request->serviceLevels = false; - $request->carrier = Components\CarriersEnum::Posti; - $request->accountId = ''; - $request->page = 99895; - $request->results = 547272;; - - $response = $sdk->carrierAccounts->list($request); - - if ($response->carrierAccountPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$request = new Operations\ListCarrierAccountsRequest(); + +$response = $sdk->carrierAccounts->list( + request: $request +); + +if ($response->carrierAccountPaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `$request` | [\Shippo\API\Models\Operations\ListCarrierAccountsRequest](../../Models/Operations/ListCarrierAccountsRequest.md) | :heavy_check_mark: | The request object to use for the request. | - +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `$request` | [Operations\ListCarrierAccountsRequest](../../Models/Operations/ListCarrierAccountsRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?\Shippo\API\Models\Operations\ListCarrierAccountsResponse](../../Models/Operations/ListCarrierAccountsResponse.md)** +**[?Components\CarrierAccountPaginatedList](../../Models/Components/CarrierAccountPaginatedList.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## create @@ -82,54 +75,63 @@ Creates a new carrier account or connects an existing carrier account to the Shi ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $connectExistingOwnAccountRequest = new Components\ConnectExistingOwnAccountRequest(); - $connectExistingOwnAccountRequest->accountId = '321123'; - $connectExistingOwnAccountRequest->active = false; - $connectExistingOwnAccountRequest->carrier = 'fedex'; - $connectExistingOwnAccountRequest->metadata = 'FEDEX Account'; - $connectExistingOwnAccountRequest->parameters = ''; - $connectExistingOwnAccountRequest->test = false; - - $response = $sdk->carrierAccounts->create($connectExistingOwnAccountRequest, '2018-02-08'); - - if ($response->carrierAccount !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$connectExistingOwnAccountRequest = new Components\ConnectExistingOwnAccountRequest( + accountId: '321123', + carrier: 'fedex', + parameters: new Components\FedExConnectExistingOwnAccountParameters( + firstName: 'Loyal', + lastName: 'Collier', + phoneNumber: '(890) 307-8579', + fromAddressSt: '', + fromAddressCity: '', + fromAddressState: '', + fromAddressZip: '', + fromAddressCountryIso2: '', + ), + metadata: 'FEDEX Account', + test: false, +); + +$response = $sdk->carrierAccounts->create( + connectExistingOwnAccountRequest: $connectExistingOwnAccountRequest, + shippoApiVersion: '2018-02-08' + +); + +if ($response->carrierAccount !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `connectExistingOwnAccountRequest` | [\Shippo\API\Models\Components\ConnectExistingOwnAccountRequest](../../Models/Components/ConnectExistingOwnAccountRequest.md) | :heavy_check_mark: | Examples. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `connectExistingOwnAccountRequest` | [Components\ConnectExistingOwnAccountRequest](../../Models/Components/ConnectExistingOwnAccountRequest.md) | :heavy_check_mark: | Examples. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateCarrierAccountResponse](../../Models/Operations/CreateCarrierAccountResponse.md)** +**[?Components\CarrierAccount](../../Models/Components/CarrierAccount.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -138,48 +140,47 @@ Returns an existing carrier account using an object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->carrierAccounts->get('', '2018-02-08'); - if ($response->carrierAccount !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->carrierAccounts->get( + carrierAccountId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->carrierAccount !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `carrierAccountId` | *string* | :heavy_check_mark: | Object ID of the carrier account | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `carrierAccountId` | *string* | :heavy_check_mark: | Object ID of the carrier account | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetCarrierAccountResponse](../../Models/Operations/GetCarrierAccountResponse.md)** +**[?Components\CarrierAccount](../../Models/Components/CarrierAccount.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## update @@ -188,53 +189,77 @@ Updates an existing carrier account object. The account_id and carrier can't be ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $carrierAccountBase = new Components\CarrierAccountBase(); - $carrierAccountBase->accountId = '****'; - $carrierAccountBase->active = false; - $carrierAccountBase->carrier = 'usps'; - $carrierAccountBase->parameters = ''; - - $response = $sdk->carrierAccounts->update('', '2018-02-08', $carrierAccountBase); - - if ($response->carrierAccount !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$carrierAccountBase = new Components\CarrierAccountBase( + accountId: '****', + carrier: 'usps', + parameters: new Components\UPSConnectExistingOwnAccountParameters( + accountNumber: '94567e', + billingAddressCity: 'San Francisco', + billingAddressCountryIso2: 'US', + billingAddressState: 'CA', + billingAddressStreet1: '731 Market St', + billingAddressZip: '94103', + collecCountryIso2: 'US', + collecZip: '94103', + company: 'Shippo', + email: 'hippo@shippo.com', + fullName: 'Shippo Meister', + hasInvoice: false, + phone: '1112223333', + title: 'Manager', + upsAgreements: false, + aiaCountryIso2: 'US', + billingAddressStreet2: 'STE 200', + currencyCode: 'USD', + invoiceControlid: '1234', + invoiceDate: '20210529', + invoiceNumber: '1112234', + invoiceValue: '11.23', + ), +); + +$response = $sdk->carrierAccounts->update( + carrierAccountId: '', + shippoApiVersion: '2018-02-08', + carrierAccountBase: $carrierAccountBase + +); + +if ($response->carrierAccount !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `carrierAccountId` | *string* | :heavy_check_mark: | Object ID of the carrier account | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | -| `carrierAccountBase` | [\Shippo\API\Models\Components\CarrierAccountBase](../../Models/Components/CarrierAccountBase.md) | :heavy_minus_sign: | Examples. | | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `carrierAccountId` | *string* | :heavy_check_mark: | Object ID of the carrier account | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | +| `carrierAccountBase` | [?Components\CarrierAccountBase](../../Models/Components/CarrierAccountBase.md) | :heavy_minus_sign: | Examples. | | ### Response -**[?\Shippo\API\Models\Operations\UpdateCarrierAccountResponse](../../Models/Operations/UpdateCarrierAccountResponse.md)** +**[?Components\CarrierAccount](../../Models/Components/CarrierAccount.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## initiateOauth2Signin @@ -243,50 +268,51 @@ Used by client applications to setup or reconnect an existing carrier account wi ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - +$request = new Operations\InitiateOauth2SigninRequest( + carrierAccountObjectId: '', + redirectUri: 'https://enlightened-mortise.com/', +); - $response = $sdk->carrierAccounts->initiateOauth2Signin('', 'http://fine-cummerbund.biz', '', '2018-02-08'); +$response = $sdk->carrierAccounts->initiateOauth2Signin( + request: $request +); - if ($response->statusCode === 200) { - // handle response - } -} catch (Throwable $e) { - // handle exception +if ($response->statusCode === 200) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `carrierAccountObjectId` | *string* | :heavy_check_mark: | The carrier account ID (UUID) to start a signin process. | | -| `redirectUri` | *string* | :heavy_check_mark: | Callback URL. The URL that tells the authorization server where to send the user back to after they approve the request. | | -| `state` | *string* | :heavy_minus_sign: | A random string generated by the consuming application and included in the request to prevent CSRF attacks. The consuming application checks that the same value is returned after the user authorizes Shippo. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `$request` | [Operations\InitiateOauth2SigninRequest](../../Models/Operations/InitiateOauth2SigninRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?\Shippo\API\Models\Operations\InitiateOauth2SigninResponse](../../Models/Operations/InitiateOauth2SigninResponse.md)** +**[?Operations\InitiateOauth2SigninResponse](../../Models/Operations/InitiateOauth2SigninResponse.md)** + +### Errors +| Error Type | Status Code | Content Type | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| Errors\InitiateOauth2SigninResponseBody | 400 | application/json | +| Errors\InitiateOauth2SigninCarrierAccountsResponseBody | 401 | application/json | +| Errors\InitiateOauth2SigninCarrierAccountsResponseResponseBody | 404 | application/json | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## register @@ -295,48 +321,51 @@ Adds a Shippo carrier account ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->carrierAccounts->register('', '2018-02-08'); - if ($response->carrierAccount !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->carrierAccounts->register( + requestBody: new Components\CarrierAccountCorreosCreateRequest( + carrier: 'correos', + parameters: new Components\CarrierAccountCorreosCreateRequestParameters(), + ), + shippoApiVersion: '2018-02-08' + +); + +if ($response->carrierAccount !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `requestBody` | *mixed* | :heavy_check_mark: | Examples. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `requestBody` | [Components\CarrierAccountCanadaPostCreateRequest\|Components\CarrierAccountChronopostCreateRequest\|Components\CarrierAccountColissimoCreateRequest\|Components\CarrierAccountCorreosCreateRequest\|Components\CarrierAccountDeutschePostCreateRequest\|Components\CarrierAccountDHLExpressCreateRequest\|Components\CarrierAccountDpdDeCreateRequest\|Components\CarrierAccountDPDUKCreateRequest\|Components\CarrierAccountFedExCreateRequest\|Components\CarrierAccountHermesUKCreateRequest\|Components\CarrierAccountMondialRelayCreateRequest\|Components\CarrierAccountPosteItalianeCreateRequest\|Components\CarrierAccountUPSCreateRequest\|Components\CarrierAccountUSPSCreateRequest\|Components\CarrierAccountSendleCreateRequest](../../Models/Operations/RegisterCarrierAccountRequestBody.md) | :heavy_check_mark: | Examples. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\RegisterCarrierAccountResponse](../../Models/Operations/RegisterCarrierAccountResponse.md)** +**[?Components\CarrierAccount](../../Models/Components/CarrierAccount.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## getRegistrationStatus @@ -345,45 +374,45 @@ Returns the registration status for the given account for the given carrier ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->carrierAccounts->getRegistrationStatus(Operations\Carrier::Usps, '2018-02-08'); - if ($response->carrierAccountRegistrationStatus !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->carrierAccounts->getRegistrationStatus( + carrier: Operations\Carrier::Usps, + shippoApiVersion: '2018-02-08' + +); + +if ($response->carrierAccountRegistrationStatus !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `carrier` | [\Shippo\API\Models\Operations\Carrier](../../Models/Operations/Carrier.md) | :heavy_check_mark: | filter by specific carrier | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `carrier` | [Operations\Carrier](../../Models/Operations/Carrier.md) | :heavy_check_mark: | filter by specific carrier | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetCarrierRegistrationStatusResponse](../../Models/Operations/GetCarrierRegistrationStatusResponse.md)** +**[?Components\CarrierAccountRegistrationStatus](../../Models/Components/CarrierAccountRegistrationStatus.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/carrierparceltemplates/README.md b/docs/sdks/carrierparceltemplates/README.md index cd3aa81..c1f5b94 100644 --- a/docs/sdks/carrierparceltemplates/README.md +++ b/docs/sdks/carrierparceltemplates/README.md @@ -1,5 +1,5 @@ # CarrierParcelTemplates - +(*carrierParcelTemplates*) ## Overview @@ -14,54 +14,61 @@ A carrier parcel template represents a package used for shipping that has preset ## list -List all carrier parcel template objects.
Use the following query string params to filter the results as needed.
  • `include=all` (the default). Includes templates from all carriers
  • `include=user`. Includes templates only from carriers which the user has added (whether or not they're currently enabled)
  • `include=enabled`. includes templates only for carriers which the user has added and enabled
  • `carrier=*token*`. filter by specific carrier, e.g. fedex, usps
+List all carrier parcel template objects.
Use the following query string params to filter the results as needed.
+
    +
  • `include=all` (the default). Includes templates from all carriers
  • +
  • `include=user`. Includes templates only from carriers which the user has added (whether or not they're currently enabled)
  • +
  • `include=enabled`. includes templates only for carriers which the user has added and enabled
  • +
  • `carrier=*token*`. filter by specific carrier, e.g. fedex, usps
  • +
### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->carrierParcelTemplates->list(Operations\IncludeT::Enabled, 'fedex', '2018-02-08'); - if ($response->carrierParcelTemplateList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->carrierParcelTemplates->list( + include: Operations\IncludeT::Enabled, + carrier: 'fedex', + shippoApiVersion: '2018-02-08' + +); + +if ($response->carrierParcelTemplateList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `include` | [\Shippo\API\Models\Operations\IncludeT](../../Models/Operations/IncludeT.md) | :heavy_minus_sign: | filter by user or enabled | | -| `carrier` | *string* | :heavy_minus_sign: | filter by specific carrier | fedex | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `include` | [?Operations\IncludeT](../../Models/Operations/IncludeT.md) | :heavy_minus_sign: | filter by user or enabled | | +| `carrier` | *?string* | :heavy_minus_sign: | filter by specific carrier | fedex | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\ListCarrierParcelTemplatesResponse](../../Models/Operations/ListCarrierParcelTemplatesResponse.md)** +**[?Components\CarrierParcelTemplateList](../../Models/Components/CarrierParcelTemplateList.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -70,45 +77,44 @@ Fetches the parcel template information for a specific carrier parcel template, ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->carrierParcelTemplates->get('', '2018-02-08'); - if ($response->carrierParcelTemplate !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->carrierParcelTemplates->get( + carrierParcelTemplateToken: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->carrierParcelTemplate !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `carrierParcelTemplateToken` | *string* | :heavy_check_mark: | The unique string representation of the carrier parcel template | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `carrierParcelTemplateToken` | *string* | :heavy_check_mark: | The unique string representation of the carrier parcel template | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetCarrierParcelTemplateResponse](../../Models/Operations/GetCarrierParcelTemplateResponse.md)** +**[?Components\CarrierParcelTemplate](../../Models/Components/CarrierParcelTemplate.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/customsdeclarations/README.md b/docs/sdks/customsdeclarations/README.md index 7b48a4f..0cfaf16 100644 --- a/docs/sdks/customsdeclarations/README.md +++ b/docs/sdks/customsdeclarations/README.md @@ -1,5 +1,5 @@ # CustomsDeclarations - +(*customsDeclarations*) ## Overview @@ -20,49 +20,49 @@ Returns a a list of all customs declaration objects ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->customsDeclarations->list(768578, 99895, '2018-02-08'); - if ($response->customsDeclarationPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->customsDeclarations->list( + page: 1, + results: 5, + shippoApiVersion: '2018-02-08' + +); + +if ($response->customsDeclarationPaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `page` | *int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\ListCustomsDeclarationsResponse](../../Models/Operations/ListCustomsDeclarationsResponse.md)** +**[?Components\CustomsDeclarationPaginatedList](../../Models/Components/CustomsDeclarationPaginatedList.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## create @@ -71,91 +71,104 @@ Creates a new customs declaration object ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $customsDeclarationCreateRequest = new Components\CustomsDeclarationCreateRequest(); - $customsDeclarationCreateRequest->aesItn = ''; - $customsDeclarationCreateRequest->b13aFilingOption = Components\CustomsDeclarationB13AFilingOptionEnum::FiledElectronically; - $customsDeclarationCreateRequest->b13aNumber = ''; - $customsDeclarationCreateRequest->certificate = ''; - $customsDeclarationCreateRequest->certify = true; - $customsDeclarationCreateRequest->certifySigner = 'Shawn Ippotle'; - $customsDeclarationCreateRequest->commercialInvoice = false; - $customsDeclarationCreateRequest->contentsExplanation = 'T-Shirt purchase'; - $customsDeclarationCreateRequest->disclaimer = ''; - $customsDeclarationCreateRequest->exporterIdentification = new Components\CustomsExporterIdentification(); - $customsDeclarationCreateRequest->exporterIdentification->eoriNumber = 'PL123456790ABCDE'; - $customsDeclarationCreateRequest->exporterIdentification->taxId = new Components\CustomsTaxIdentification(); - $customsDeclarationCreateRequest->exporterIdentification->taxId->number = '123456789'; - $customsDeclarationCreateRequest->exporterIdentification->taxId->type = Components\CustomsTaxIdentificationType::Ein; - $customsDeclarationCreateRequest->exporterReference = ''; - $customsDeclarationCreateRequest->importerReference = ''; - $customsDeclarationCreateRequest->isVatCollected = false; - $customsDeclarationCreateRequest->invoice = '#123123'; - $customsDeclarationCreateRequest->license = ''; - $customsDeclarationCreateRequest->metadata = 'Order ID #123123'; - $customsDeclarationCreateRequest->notes = ''; - $customsDeclarationCreateRequest->addressImporter = new Components\AddressImporter(); - $customsDeclarationCreateRequest->addressImporter->name = 'Shwan Ippotle'; - $customsDeclarationCreateRequest->addressImporter->company = 'Shippo'; - $customsDeclarationCreateRequest->addressImporter->street1 = 'Blumenstraße'; - $customsDeclarationCreateRequest->addressImporter->street2 = ''; - $customsDeclarationCreateRequest->addressImporter->street3 = ''; - $customsDeclarationCreateRequest->addressImporter->streetNo = '22'; - $customsDeclarationCreateRequest->addressImporter->city = 'München'; - $customsDeclarationCreateRequest->addressImporter->state = 'CA'; - $customsDeclarationCreateRequest->addressImporter->zip = '80331'; - $customsDeclarationCreateRequest->addressImporter->country = 'DE'; - $customsDeclarationCreateRequest->addressImporter->phone = '80331'; - $customsDeclarationCreateRequest->addressImporter->email = 'shippotle@shippo.com'; - $customsDeclarationCreateRequest->addressImporter->isResidential = true; - $customsDeclarationCreateRequest->contentsType = Components\CustomsDeclarationContentsTypeEnum::Merchandise; - $customsDeclarationCreateRequest->eelPfc = Components\CustomsDeclarationEelPfcEnum::NOEEI3037A; - $customsDeclarationCreateRequest->incoterm = Components\CustomsDeclarationIncotermEnum::Ddp; - $customsDeclarationCreateRequest->items = [ - new Components\CustomsItemCreateRequest(), - ]; - $customsDeclarationCreateRequest->nonDeliveryOption = Components\CustomsDeclarationNonDeliveryOptionEnum::Return; - $customsDeclarationCreateRequest->test = true; - - $response = $sdk->customsDeclarations->create($customsDeclarationCreateRequest, '2018-02-08'); - - if ($response->customsDeclaration !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$customsDeclarationCreateRequest = new Components\CustomsDeclarationCreateRequest( + certify: true, + certifySigner: 'Shawn Ippotle', + contentsType: Components\CustomsDeclarationContentsTypeEnum::Merchandise, + items: [ + new Components\CustomsItemCreateRequest( + description: 'T-Shirt', + massUnit: Components\WeightUnitEnum::Lb, + netWeight: '5', + originCountry: '', + quantity: 20, + valueAmount: '200', + valueCurrency: 'USD', + metadata: 'Order ID "123454"', + skuCode: 'HM-123', + hsCode: '0901.21', + ), + ], + nonDeliveryOption: Components\CustomsDeclarationNonDeliveryOptionEnum::Return, + b13aFilingOption: Components\CustomsDeclarationB13AFilingOptionEnum::FiledElectronically, + contentsExplanation: 'T-Shirt purchase', + dutiesPayor: new Components\DutiesPayor( + account: '2323434543', + type: Components\CustomsDeclarationCreateRequestType::ThirdParty, + address: new Components\CustomsDeclarationCreateRequestAddress( + name: 'Patrick Kavanagh', + zip: '80331', + country: 'DE', + ), + ), + exporterIdentification: new Components\CustomsExporterIdentification( + eoriNumber: 'PL123456790ABCDE', + taxId: new Components\CustomsTaxIdentification( + number: '123456789', + type: Components\CustomsTaxIdentificationType::Ein, + ), + ), + invoice: '#123123', + metadata: 'Order ID #123123', + addressImporter: new Components\AddressImporter( + name: 'Shwan Ippotle', + company: 'Shippo', + street1: 'Blumenstraße', + street3: '', + streetNo: '22', + city: 'München', + state: 'CA', + zip: '80331', + country: 'DE', + phone: '80331', + email: 'shippotle@shippo.com', + isResidential: true, + ), + eelPfc: Components\CustomsDeclarationEelPfcEnum::NOEEI3037A, + incoterm: Components\CustomsDeclarationIncotermEnum::Ddp, + test: true, +); + +$response = $sdk->customsDeclarations->create( + customsDeclarationCreateRequest: $customsDeclarationCreateRequest, + shippoApiVersion: '2018-02-08' + +); + +if ($response->customsDeclaration !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `customsDeclarationCreateRequest` | [\Shippo\API\Models\Components\CustomsDeclarationCreateRequest](../../Models/Components/CustomsDeclarationCreateRequest.md) | :heavy_check_mark: | CustomsDeclaration details. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `customsDeclarationCreateRequest` | [Components\CustomsDeclarationCreateRequest](../../Models/Components/CustomsDeclarationCreateRequest.md) | :heavy_check_mark: | CustomsDeclaration details. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateCustomsDeclarationResponse](../../Models/Operations/CreateCustomsDeclarationResponse.md)** +**[?Components\CustomsDeclaration](../../Models/Components/CustomsDeclaration.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -164,46 +177,46 @@ Returns an existing customs declaration using an object ID ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->customsDeclarations->get('', 700347, '2018-02-08'); - if ($response->customsDeclaration !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->customsDeclarations->get( + customsDeclarationId: '', + page: 1, + shippoApiVersion: '2018-02-08' + +); + +if ($response->customsDeclaration !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `customsDeclarationId` | *string* | :heavy_check_mark: | Object ID of the customs declaration | | -| `page` | *int* | :heavy_minus_sign: | The page number you want to select | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `customsDeclarationId` | *string* | :heavy_check_mark: | Object ID of the customs declaration | | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetCustomsDeclarationResponse](../../Models/Operations/GetCustomsDeclarationResponse.md)** +**[?Components\CustomsDeclaration](../../Models/Components/CustomsDeclaration.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/customsitems/README.md b/docs/sdks/customsitems/README.md index 5eb9073..030af26 100644 --- a/docs/sdks/customsitems/README.md +++ b/docs/sdks/customsitems/README.md @@ -1,5 +1,5 @@ # CustomsItems - +(*customsItems*) ## Overview @@ -19,49 +19,49 @@ Returns a list all customs items objects. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->customsItems->list(768578, 99895, '2018-02-08'); - if ($response->customsItemPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->customsItems->list( + page: 1, + results: 25, + shippoApiVersion: '2018-02-08' + +); + +if ($response->customsItemPaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `page` | *int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\ListCustomsItemsResponse](../../Models/Operations/ListCustomsItemsResponse.md)** +**[?Components\CustomsItemPaginatedList](../../Models/Components/CustomsItemPaginatedList.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## create @@ -70,60 +70,59 @@ Creates a new customs item object. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $customsItemCreateRequest = new Components\CustomsItemCreateRequest(); - $customsItemCreateRequest->description = 'T-Shirt'; - $customsItemCreateRequest->eccnEar99 = ''; - $customsItemCreateRequest->massUnit = Components\WeightUnitEnum::Lb; - $customsItemCreateRequest->metadata = 'Order ID "123454"'; - $customsItemCreateRequest->netWeight = '5'; - $customsItemCreateRequest->originCountry = ''; - $customsItemCreateRequest->quantity = 20; - $customsItemCreateRequest->skuCode = 'HM-123'; - $customsItemCreateRequest->hsCode = '0901.21'; - $customsItemCreateRequest->tariffNumber = ''; - $customsItemCreateRequest->valueAmount = '200'; - $customsItemCreateRequest->valueCurrency = 'USD'; - - $response = $sdk->customsItems->create($customsItemCreateRequest, '2018-02-08'); - - if ($response->customsItem !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$customsItemCreateRequest = new Components\CustomsItemCreateRequest( + description: 'T-Shirt', + massUnit: Components\WeightUnitEnum::Lb, + netWeight: '5', + originCountry: '', + quantity: 20, + valueAmount: '200', + valueCurrency: 'USD', + metadata: 'Order ID "123454"', + skuCode: 'HM-123', + hsCode: '0901.21', +); + +$response = $sdk->customsItems->create( + customsItemCreateRequest: $customsItemCreateRequest, + shippoApiVersion: '2018-02-08' + +); + +if ($response->customsItem !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `customsItemCreateRequest` | [\Shippo\API\Models\Components\CustomsItemCreateRequest](../../Models/Components/CustomsItemCreateRequest.md) | :heavy_check_mark: | CustomsItem details. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `customsItemCreateRequest` | [Components\CustomsItemCreateRequest](../../Models/Components/CustomsItemCreateRequest.md) | :heavy_check_mark: | CustomsItem details. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateCustomsItemResponse](../../Models/Operations/CreateCustomsItemResponse.md)** +**[?Components\CustomsItem](../../Models/Components/CustomsItem.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -132,46 +131,46 @@ Returns an existing customs item using an object ID ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->customsItems->get('', 700347, '2018-02-08'); - if ($response->customsItem !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->customsItems->get( + customsItemId: '', + page: 1, + shippoApiVersion: '2018-02-08' + +); + +if ($response->customsItem !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `customsItemId` | *string* | :heavy_check_mark: | Object ID of the customs item | | -| `page` | *int* | :heavy_minus_sign: | The page number you want to select | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `customsItemId` | *string* | :heavy_check_mark: | Object ID of the customs item | | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetCustomsItemResponse](../../Models/Operations/GetCustomsItemResponse.md)** +**[?Components\CustomsItem](../../Models/Components/CustomsItem.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/manifests/README.md b/docs/sdks/manifests/README.md index 95feb04..d78ac93 100644 --- a/docs/sdks/manifests/README.md +++ b/docs/sdks/manifests/README.md @@ -1,5 +1,5 @@ # Manifests - +(*manifests*) ## Overview @@ -25,49 +25,49 @@ Returns a list of all manifest objects. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->manifests->list(768578, 99895, '2018-02-08'); - if ($response->manifestPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->manifests->list( + page: 1, + results: 5, + shippoApiVersion: '2018-02-08' + +); + +if ($response->manifestPaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `page` | *int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100, default 5) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\ListManifestsResponse](../../Models/Operations/ListManifestsResponse.md)** +**[?Components\ManifestPaginatedList](../../Models/Components/ManifestPaginatedList.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## create @@ -76,55 +76,70 @@ Creates a new manifest object. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $manifestCreateRequest = new Components\ManifestCreateRequest(); - $manifestCreateRequest->carrierAccount = 'adcfdddf8ec64b84ad22772bce3ea37a'; - $manifestCreateRequest->shipmentDate = '2014-05-16T23:59:59Z'; - $manifestCreateRequest->transactions = [ - '', - ]; - $manifestCreateRequest->addressFrom = ''; - $manifestCreateRequest->async = false; - - $response = $sdk->manifests->create($manifestCreateRequest, '2018-02-08'); - - if ($response->manifest !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$manifestCreateRequest = new Components\ManifestCreateRequest( + carrierAccount: 'adcfdddf8ec64b84ad22772bce3ea37a', + shipmentDate: '2014-05-16T23:59:59Z', + addressFrom: new Components\AddressCreateRequest( + country: 'US', + name: 'Shwan Ippotle', + company: 'Shippo', + street1: '215 Clayton St.', + street3: '', + streetNo: '', + city: 'San Francisco', + state: 'CA', + zip: '94117', + phone: '+1 555 341 9393', + email: 'shippotle@shippo.com', + isResidential: true, + metadata: 'Customer ID 123456', + validate: true, + ), + transactions: [ + 'adcfdddf8ec64b84ad22772bce3ea37a', + ], +); + +$response = $sdk->manifests->create( + manifestCreateRequest: $manifestCreateRequest, + shippoApiVersion: '2018-02-08' + +); + +if ($response->manifest !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `manifestCreateRequest` | [\Shippo\API\Models\Components\ManifestCreateRequest](../../Models/Components/ManifestCreateRequest.md) | :heavy_check_mark: | Manifest details and contact info. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `manifestCreateRequest` | [Components\ManifestCreateRequest](../../Models/Components/ManifestCreateRequest.md) | :heavy_check_mark: | Manifest details and contact info. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateManifestResponse](../../Models/Operations/CreateManifestResponse.md)** +**[?Components\Manifest](../../Models/Components/Manifest.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -133,45 +148,44 @@ Returns an existing manifest using an object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->manifests->get('', '2018-02-08'); - if ($response->manifest !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->manifests->get( + manifestId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->manifest !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `manifestId` | *string* | :heavy_check_mark: | Object ID of the manifest to update | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `manifestId` | *string* | :heavy_check_mark: | Object ID of the manifest to update | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetManifestResponse](../../Models/Operations/GetManifestResponse.md)** +**[?Components\Manifest](../../Models/Components/Manifest.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/orders/README.md b/docs/sdks/orders/README.md index 3c59266..7fb2e40 100644 --- a/docs/sdks/orders/README.md +++ b/docs/sdks/orders/README.md @@ -1,5 +1,5 @@ # Orders - +(*orders*) ## Overview @@ -30,49 +30,51 @@ Returns a list of all order objects. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - +$request = new Operations\ListOrdersRequest( + orderStatus: [ + Components\OrderStatusEnum::Paid, + ], + shopApp: Components\OrderShopAppEnum::Shippo, +); - $response = $sdk->orders->list(768578, 99895, '2018-02-08'); +$response = $sdk->orders->list( + request: $request +); - if ($response->orderPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +if ($response->orderPaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `page` | *int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `$request` | [Operations\ListOrdersRequest](../../Models/Operations/ListOrdersRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?\Shippo\API\Models\Operations\ListOrdersResponse](../../Models/Operations/ListOrdersResponse.md)** +**[?Components\OrderPaginatedList](../../Models/Components/OrderPaginatedList.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## create @@ -81,96 +83,110 @@ Creates a new order object. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $orderCreateRequest = new Components\OrderCreateRequest(); - $orderCreateRequest->currency = 'USD'; - $orderCreateRequest->notes = 'This customer is a VIP'; - $orderCreateRequest->orderNumber = '#1068'; - $orderCreateRequest->orderStatus = Components\OrderStatusEnum::Paid; - $orderCreateRequest->placedAt = '2016-09-23T01:28:12Z'; - $orderCreateRequest->shippingCost = '12.83'; - $orderCreateRequest->shippingCostCurrency = 'USD'; - $orderCreateRequest->shippingMethod = 'USPS First Class Package'; - $orderCreateRequest->subtotalPrice = '12.1'; - $orderCreateRequest->totalPrice = '24.93'; - $orderCreateRequest->totalTax = '0.0'; - $orderCreateRequest->weight = '0.4'; - $orderCreateRequest->weightUnit = Components\WeightUnitEnum::Lb; - $orderCreateRequest->fromAddress = new Components\AddressCreateRequest(); - $orderCreateRequest->fromAddress->name = 'Shwan Ippotle'; - $orderCreateRequest->fromAddress->company = 'Shippo'; - $orderCreateRequest->fromAddress->street1 = '215 Clayton St.'; - $orderCreateRequest->fromAddress->street2 = ''; - $orderCreateRequest->fromAddress->street3 = ''; - $orderCreateRequest->fromAddress->streetNo = ''; - $orderCreateRequest->fromAddress->city = 'San Francisco'; - $orderCreateRequest->fromAddress->state = 'CA'; - $orderCreateRequest->fromAddress->zip = '94117'; - $orderCreateRequest->fromAddress->country = 'US'; - $orderCreateRequest->fromAddress->phone = '+1 555 341 9393'; - $orderCreateRequest->fromAddress->email = 'shippotle@shippo.com'; - $orderCreateRequest->fromAddress->isResidential = true; - $orderCreateRequest->fromAddress->metadata = 'Customer ID 123456'; - $orderCreateRequest->fromAddress->validate = true; - $orderCreateRequest->toAddress = new Components\AddressCreateRequest(); - $orderCreateRequest->toAddress->name = 'Shwan Ippotle'; - $orderCreateRequest->toAddress->company = 'Shippo'; - $orderCreateRequest->toAddress->street1 = '215 Clayton St.'; - $orderCreateRequest->toAddress->street2 = ''; - $orderCreateRequest->toAddress->street3 = ''; - $orderCreateRequest->toAddress->streetNo = ''; - $orderCreateRequest->toAddress->city = 'San Francisco'; - $orderCreateRequest->toAddress->state = 'CA'; - $orderCreateRequest->toAddress->zip = '94117'; - $orderCreateRequest->toAddress->country = 'US'; - $orderCreateRequest->toAddress->phone = '+1 555 341 9393'; - $orderCreateRequest->toAddress->email = 'shippotle@shippo.com'; - $orderCreateRequest->toAddress->isResidential = true; - $orderCreateRequest->toAddress->metadata = 'Customer ID 123456'; - $orderCreateRequest->toAddress->validate = true; - $orderCreateRequest->lineItems = [ - new Components\LineItemBase(), - ]; - - $response = $sdk->orders->create($orderCreateRequest, '2018-02-08'); - - if ($response->order !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$orderCreateRequest = new Components\OrderCreateRequest( + placedAt: '2016-09-23T01:28:12Z', + toAddress: new Components\AddressCreateRequest( + country: 'US', + name: 'Shwan Ippotle', + company: 'Shippo', + street1: '215 Clayton St.', + street3: '', + streetNo: '', + city: 'San Francisco', + state: 'CA', + zip: '94117', + phone: '+1 555 341 9393', + email: 'shippotle@shippo.com', + isResidential: true, + metadata: 'Customer ID 123456', + validate: true, + ), + currency: 'USD', + notes: 'This customer is a VIP', + orderNumber: '#1068', + orderStatus: Components\OrderStatusEnum::Paid, + shippingCost: '12.83', + shippingCostCurrency: 'USD', + shippingMethod: 'USPS First Class Package', + subtotalPrice: '12.1', + totalPrice: '24.93', + totalTax: '0.0', + weight: '0.4', + weightUnit: Components\WeightUnitEnum::Lb, + fromAddress: new Components\AddressCreateRequest( + country: 'US', + name: 'Shwan Ippotle', + company: 'Shippo', + street1: '215 Clayton St.', + street3: '', + streetNo: '', + city: 'San Francisco', + state: 'CA', + zip: '94117', + phone: '+1 555 341 9393', + email: 'shippotle@shippo.com', + isResidential: true, + metadata: 'Customer ID 123456', + validate: true, + ), + lineItems: [ + new Components\LineItemBase( + currency: 'USD', + manufactureCountry: 'US', + maxDeliveryTime: Utils\Utils::parseDateTime('2016-07-23T00:00:00Z'), + maxShipTime: Utils\Utils::parseDateTime('2016-07-23T00:00:00Z'), + quantity: 20, + sku: 'HM-123', + title: 'Hippo Magazines', + totalPrice: '12.1', + variantTitle: 'June Edition', + weight: '0.4', + weightUnit: Components\WeightUnitEnum::Lb, + ), + ], +); + +$response = $sdk->orders->create( + orderCreateRequest: $orderCreateRequest, + shippoApiVersion: '2018-02-08' + +); + +if ($response->order !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `orderCreateRequest` | [\Shippo\API\Models\Components\OrderCreateRequest](../../Models/Components/OrderCreateRequest.md) | :heavy_check_mark: | Order details. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `orderCreateRequest` | [Components\OrderCreateRequest](../../Models/Components/OrderCreateRequest.md) | :heavy_check_mark: | Order details. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateOrderResponse](../../Models/Operations/CreateOrderResponse.md)** +**[?Components\Order](../../Models/Components/Order.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -179,45 +195,44 @@ Retrieves an existing order using an object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->orders->get('', '2018-02-08'); - if ($response->order !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->orders->get( + orderId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->order !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `orderId` | *string* | :heavy_check_mark: | Object ID of the order | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `orderId` | *string* | :heavy_check_mark: | Object ID of the order | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetOrderResponse](../../Models/Operations/GetOrderResponse.md)** +**[?Components\Order](../../Models/Components/Order.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/parcels/README.md b/docs/sdks/parcels/README.md index b41e438..010b1a2 100644 --- a/docs/sdks/parcels/README.md +++ b/docs/sdks/parcels/README.md @@ -1,5 +1,5 @@ # Parcels - +(*parcels*) ## Overview @@ -23,49 +23,49 @@ Returns a list of all parcel objects. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->parcels->list(768578, 99895, '2018-02-08'); - if ($response->parcelPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->parcels->list( + page: 1, + results: 25, + shippoApiVersion: '2018-02-08' + +); + +if ($response->parcelPaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `page` | *int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\ListParcelsResponse](../../Models/Operations/ListParcelsResponse.md)** +**[?Components\ParcelPaginatedList](../../Models/Components/ParcelPaginatedList.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## create @@ -74,48 +74,69 @@ Creates a new parcel object. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->parcels->create('', '2018-02-08'); - if ($response->parcel !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->parcels->create( + requestBody: new Components\ParcelCreateRequest( + massUnit: Components\WeightUnitEnum::Lb, + weight: '1', + distanceUnit: Components\DistanceUnitEnum::In, + height: '1', + length: '1', + width: '1', + extra: new Components\ParcelExtra( + cod: new Components\Cod( + amount: '5.5', + currency: 'USD', + paymentMethod: Components\PaymentMethod::Cash, + ), + insurance: new Components\ParcelInsurance( + amount: '5.5', + content: 'Laptop', + currency: 'USD', + provider: Components\ParcelInsuranceProvider::Ups, + ), + ), + metadata: 'Customer ID 123456', + ), + shippoApiVersion: '2018-02-08' + +); + +if ($response->parcel !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `requestBody` | *mixed* | :heavy_check_mark: | Parcel details. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `requestBody` | [Components\ParcelCreateRequest\|Components\ParcelCreateFromTemplateRequest](../../Models/Operations/CreateParcelRequestBody.md) | :heavy_check_mark: | Parcel details. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateParcelResponse](../../Models/Operations/CreateParcelResponse.md)** +**[?Components\Parcel](../../Models/Components/Parcel.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -124,45 +145,44 @@ Returns parcel details using an existing parcel object ID (this will not return ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->parcels->get('', '2018-02-08'); - if ($response->parcel !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->parcels->get( + parcelId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->parcel !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `parcelId` | *string* | :heavy_check_mark: | Object ID of the parcel | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `parcelId` | *string* | :heavy_check_mark: | Object ID of the parcel | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetParcelResponse](../../Models/Operations/GetParcelResponse.md)** +**[?Components\Parcel](../../Models/Components/Parcel.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/pickups/README.md b/docs/sdks/pickups/README.md index 7670ba1..076c607 100644 --- a/docs/sdks/pickups/README.md +++ b/docs/sdks/pickups/README.md @@ -1,5 +1,5 @@ # Pickups - +(*pickups*) ## Overview @@ -18,72 +18,74 @@ Creates a pickup object. This request is for a carrier to come to a specified lo ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $pickupBase = new Components\PickupBase(); - $pickupBase->carrierAccount = 'adcfdddf8ec64b84ad22772bce3ea37a'; - $pickupBase->location = new Components\Location(); - $pickupBase->location->address = new Components\AddressCompleteCreateRequest(); - $pickupBase->location->address->name = 'Shwan Ippotle'; - $pickupBase->location->address->company = 'Shippo'; - $pickupBase->location->address->street1 = '215 Clayton St.'; - $pickupBase->location->address->street2 = ''; - $pickupBase->location->address->street3 = ''; - $pickupBase->location->address->streetNo = ''; - $pickupBase->location->address->city = 'San Francisco'; - $pickupBase->location->address->state = 'CA'; - $pickupBase->location->address->zip = '94117'; - $pickupBase->location->address->country = 'US'; - $pickupBase->location->address->phone = '+1 555 341 9393'; - $pickupBase->location->address->email = 'shippotle@shippo.com'; - $pickupBase->location->address->isResidential = true; - $pickupBase->location->address->metadata = 'Customer ID 123456'; - $pickupBase->location->address->validate = true; - $pickupBase->location->buildingLocationType = Components\BuildingLocationType::FrontDoor; - $pickupBase->location->buildingType = Components\BuildingType::Apartment; - $pickupBase->location->instructions = 'Behind screen door'; - $pickupBase->metadata = ''; - $pickupBase->requestedEndTime = DateTime::createFromFormat('Y-m-d\TH:i:s+', '2023-06-18T07:14:55.676Z'); - $pickupBase->requestedStartTime = DateTime::createFromFormat('Y-m-d\TH:i:s+', '2023-06-21T08:42:38.998Z'); - $pickupBase->transactions = [ - '', - ]; - - $response = $sdk->pickups->create($pickupBase, '2018-02-08'); - - if ($response->pickup !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$pickupBase = new Components\PickupBase( + carrierAccount: 'adcfdddf8ec64b84ad22772bce3ea37a', + location: new Components\Location( + address: new Components\AddressCompleteCreateRequest( + name: 'Shwan Ippotle', + street1: '215 Clayton St.', + city: 'San Francisco', + state: 'CA', + zip: '94117', + country: 'US', + company: 'Shippo', + street3: '', + streetNo: '', + phone: '+1 555 341 9393', + email: 'shippotle@shippo.com', + isResidential: true, + metadata: 'Customer ID 123456', + validate: true, + ), + buildingLocationType: Components\BuildingLocationType::FrontDoor, + buildingType: Components\BuildingType::Apartment, + instructions: 'Behind screen door', + ), + requestedEndTime: Utils\Utils::parseDateTime('2023-06-18T07:14:55.338Z'), + requestedStartTime: Utils\Utils::parseDateTime('2023-12-01T17:06:07.804Z'), + transactions: [ + 'adcfdddf8ec64b84ad22772bce3ea37a', + ], +); + +$response = $sdk->pickups->create( + pickupBase: $pickupBase, + shippoApiVersion: '2018-02-08' + +); + +if ($response->pickup !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `pickupBase` | [\Shippo\API\Models\Components\PickupBase](../../Models/Components/PickupBase.md) | :heavy_check_mark: | Shippo’s pickups endpoint allows you to schedule pickups with USPS and DHL Express for eligible shipments that you have already created. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `pickupBase` | [Components\PickupBase](../../Models/Components/PickupBase.md) | :heavy_check_mark: | Shippo’s pickups endpoint allows you to schedule pickups with USPS and DHL Express for eligible shipments that you have already created. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreatePickupResponse](../../Models/Operations/CreatePickupResponse.md)** +**[?Components\Pickup](../../Models/Components/Pickup.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/rates/README.md b/docs/sdks/rates/README.md index e8e27ff..f3072e4 100644 --- a/docs/sdks/rates/README.md +++ b/docs/sdks/rates/README.md @@ -1,5 +1,5 @@ # Rates - +(*rates*) ## Overview @@ -19,48 +19,47 @@ Returns an existing rate using a rate object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->rates->get('', '2018-02-08'); - if ($response->rate !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->rates->get( + rateId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->rate !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `rateId` | *string* | :heavy_check_mark: | Object ID of the rate | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `rateId` | *string* | :heavy_check_mark: | Object ID of the rate | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetRateResponse](../../Models/Operations/GetRateResponse.md)** +**[?Components\Rate](../../Models/Components/Rate.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## listShipmentRates @@ -69,50 +68,47 @@ Returns a paginated list of rates associated with a shipment ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - +$request = new Operations\ListShipmentRatesRequest( + shipmentId: '', +); - $response = $sdk->rates->listShipmentRates('', 253644, 758978, '2018-02-08'); +$response = $sdk->rates->listShipmentRates( + request: $request +); - if ($response->ratePaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +if ($response->ratePaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shipmentId` | *string* | :heavy_check_mark: | Object ID of the shipment to update | | -| `page` | *int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `$request` | [Operations\ListShipmentRatesRequest](../../Models/Operations/ListShipmentRatesRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?\Shippo\API\Models\Operations\ListShipmentRatesResponse](../../Models/Operations/ListShipmentRatesResponse.md)** +**[?Components\RatePaginatedList](../../Models/Components/RatePaginatedList.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## listShipmentRatesByCurrencyCode @@ -127,48 +123,45 @@ Note: re-requesting the rates with a different currency code will re-queue the s ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $request = new Operations\ListShipmentRatesByCurrencyCodeRequest(); - $request->shipmentId = ''; - $request->currencyCode = ''; - $request->page = 129833; - $request->results = 866327;; +$request = new Operations\ListShipmentRatesByCurrencyCodeRequest( + shipmentId: '', + currencyCode: 'USD', +); - $response = $sdk->rates->listShipmentRatesByCurrencyCode($request); +$response = $sdk->rates->listShipmentRatesByCurrencyCode( + request: $request +); - if ($response->ratePaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +if ($response->ratePaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `$request` | [\Shippo\API\Models\Operations\ListShipmentRatesByCurrencyCodeRequest](../../Models/Operations/ListShipmentRatesByCurrencyCodeRequest.md) | :heavy_check_mark: | The request object to use for the request. | - +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `$request` | [Operations\ListShipmentRatesByCurrencyCodeRequest](../../Models/Operations/ListShipmentRatesByCurrencyCodeRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?\Shippo\API\Models\Operations\ListShipmentRatesByCurrencyCodeResponse](../../Models/Operations/ListShipmentRatesByCurrencyCodeResponse.md)** +**[?Components\RatePaginatedList](../../Models/Components/RatePaginatedList.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/ratesatcheckout/README.md b/docs/sdks/ratesatcheckout/README.md index 899f1e1..6a5b742 100644 --- a/docs/sdks/ratesatcheckout/README.md +++ b/docs/sdks/ratesatcheckout/README.md @@ -1,5 +1,5 @@ # RatesAtCheckout - +(*ratesAtCheckout*) ## Overview @@ -30,54 +30,84 @@ template or a fully formed user parcel template object as the parcel value. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $liveRateCreateRequest = new Components\LiveRateCreateRequest(); - $liveRateCreateRequest->addressFrom = ''; - $liveRateCreateRequest->addressTo = ''; - $liveRateCreateRequest->lineItems = [ - new Components\LineItem(), - ]; - $liveRateCreateRequest->parcel = '5df144dca289442cv7a06'; - - $response = $sdk->ratesAtCheckout->create($liveRateCreateRequest, '2018-02-08'); - - if ($response->liveRatePaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$liveRateCreateRequest = new Components\LiveRateCreateRequest( + addressTo: '', + lineItems: [ + new Components\LineItem( + currency: 'USD', + manufactureCountry: 'US', + maxDeliveryTime: Utils\Utils::parseDateTime('2016-07-23T00:00:00Z'), + maxShipTime: Utils\Utils::parseDateTime('2016-07-23T00:00:00Z'), + quantity: 20, + sku: 'HM-123', + title: 'Hippo Magazines', + totalPrice: '12.1', + variantTitle: 'June Edition', + weight: '0.4', + weightUnit: Components\WeightUnitEnum::Lb, + objectId: 'abf7d5675d744b6ea9fdb6f796b28f28', + ), + ], + addressFrom: new Components\AddressCompleteCreateRequest( + name: 'Shwan Ippotle', + street1: '215 Clayton St.', + city: 'San Francisco', + state: 'CA', + zip: '94117', + country: 'US', + company: 'Shippo', + street3: '', + streetNo: '', + phone: '+1 555 341 9393', + email: 'shippotle@shippo.com', + isResidential: true, + metadata: 'Customer ID 123456', + validate: true, + ), + parcel: '5df144dca289442cv7a06', +); + +$response = $sdk->ratesAtCheckout->create( + liveRateCreateRequest: $liveRateCreateRequest, + shippoApiVersion: '2018-02-08' + +); + +if ($response->liveRatePaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `liveRateCreateRequest` | [\Shippo\API\Models\Components\LiveRateCreateRequest](../../Models/Components/LiveRateCreateRequest.md) | :heavy_check_mark: | Generate rates at checkout | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `liveRateCreateRequest` | [Components\LiveRateCreateRequest](../../Models/Components/LiveRateCreateRequest.md) | :heavy_check_mark: | Generate rates at checkout | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateLiveRateResponse](../../Models/Operations/CreateLiveRateResponse.md)** +**[?Components\LiveRatePaginatedList](../../Models/Components/LiveRatePaginatedList.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## getDefaultParcelTemplate @@ -86,47 +116,44 @@ Retrieve and display the currently configured default parcel template for live r ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->ratesAtCheckout->getDefaultParcelTemplate('2018-02-08'); - if ($response->defaultParcelTemplate !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->ratesAtCheckout->getDefaultParcelTemplate( + shippoApiVersion: '2018-02-08' +); + +if ($response->defaultParcelTemplate !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetDefaultParcelTemplateResponse](../../Models/Operations/GetDefaultParcelTemplateResponse.md)** +**[?Components\DefaultParcelTemplate](../../Models/Components/DefaultParcelTemplate.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## updateDefaultParcelTemplate @@ -135,49 +162,50 @@ Update the currently configured default parcel template for live rates. The obje ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $defaultParcelTemplateUpdateRequest = new Components\DefaultParcelTemplateUpdateRequest(); - $defaultParcelTemplateUpdateRequest->objectId = 'b958d3690bb04bb8b2986724872750f5'; +$defaultParcelTemplateUpdateRequest = new Components\DefaultParcelTemplateUpdateRequest( + objectId: 'b958d3690bb04bb8b2986724872750f5', +); - $response = $sdk->ratesAtCheckout->updateDefaultParcelTemplate('2018-02-08', $defaultParcelTemplateUpdateRequest); +$response = $sdk->ratesAtCheckout->updateDefaultParcelTemplate( + shippoApiVersion: '2018-02-08', + defaultParcelTemplateUpdateRequest: $defaultParcelTemplateUpdateRequest - if ($response->defaultParcelTemplate !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +); + +if ($response->defaultParcelTemplate !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | -| `defaultParcelTemplateUpdateRequest` | [\Shippo\API\Models\Components\DefaultParcelTemplateUpdateRequest](../../Models/Components/DefaultParcelTemplateUpdateRequest.md) | :heavy_minus_sign: | N/A | | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | +| `defaultParcelTemplateUpdateRequest` | [?Components\DefaultParcelTemplateUpdateRequest](../../Models/Components/DefaultParcelTemplateUpdateRequest.md) | :heavy_minus_sign: | N/A | | ### Response -**[?\Shippo\API\Models\Operations\UpdateDefaultParcelTemplateResponse](../../Models/Operations/UpdateDefaultParcelTemplateResponse.md)** +**[?Components\DefaultParcelTemplate](../../Models/Components/DefaultParcelTemplate.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## deleteDefaultParcelTemplate @@ -186,44 +214,37 @@ Clears the currently configured default parcel template for live rates. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->ratesAtCheckout->deleteDefaultParcelTemplate('2018-02-08'); - if ($response->statusCode === 200) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->ratesAtCheckout->deleteDefaultParcelTemplate( + shippoApiVersion: '2018-02-08' +); + +if ($response->statusCode === 200) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - - -### Response +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | -**[?\Shippo\API\Models\Operations\DeleteDefaultParcelTemplateResponse](../../Models/Operations/DeleteDefaultParcelTemplateResponse.md)** +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/refunds/README.md b/docs/sdks/refunds/README.md index 5db05a1..3011129 100644 --- a/docs/sdks/refunds/README.md +++ b/docs/sdks/refunds/README.md @@ -1,5 +1,5 @@ # Refunds - +(*refunds*) ## Overview @@ -19,50 +19,51 @@ Creates a new refund object. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $refundRequestBody = new Components\RefundRequestBody(); - $refundRequestBody->async = false; - $refundRequestBody->transaction = '915d94940ea54c3a80cbfa328722f5a1'; +$refundRequestBody = new Components\RefundRequestBody( + transaction: '915d94940ea54c3a80cbfa328722f5a1', + async: false, +); - $response = $sdk->refunds->create($refundRequestBody, '2018-02-08'); +$response = $sdk->refunds->create( + refundRequestBody: $refundRequestBody, + shippoApiVersion: '2018-02-08' - if ($response->refund !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +); + +if ($response->refund !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `refundRequestBody` | [\Shippo\API\Models\Components\RefundRequestBody](../../Models/Components/RefundRequestBody.md) | :heavy_check_mark: | Refund details | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `refundRequestBody` | [Components\RefundRequestBody](../../Models/Components/RefundRequestBody.md) | :heavy_check_mark: | Refund details | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateRefundResponse](../../Models/Operations/CreateRefundResponse.md)** +**[?Components\Refund](../../Models/Components/Refund.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## list @@ -71,47 +72,44 @@ Returns a list all refund objects. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->refunds->list('2018-02-08'); - if ($response->refundPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->refunds->list( + shippoApiVersion: '2018-02-08' +); + +if ($response->refundPaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\ListRefundsResponse](../../Models/Operations/ListRefundsResponse.md)** +**[?Components\RefundPaginatedList](../../Models/Components/RefundPaginatedList.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -120,45 +118,44 @@ Returns an existing rate using a rate object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->refunds->get('', '2018-02-08'); - if ($response->refund !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->refunds->get( + refundId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->refund !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `refundId` | *string* | :heavy_check_mark: | Object ID of the refund to update | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `refundId` | *string* | :heavy_check_mark: | Object ID of the refund to update | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetRefundResponse](../../Models/Operations/GetRefundResponse.md)** +**[?Components\Refund](../../Models/Components/Refund.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/servicegroups/README.md b/docs/sdks/servicegroups/README.md index ecb47ec..9fa8754 100644 --- a/docs/sdks/servicegroups/README.md +++ b/docs/sdks/servicegroups/README.md @@ -1,5 +1,5 @@ # ServiceGroups - +(*serviceGroups*) ## Overview @@ -21,47 +21,44 @@ Returns a list of service group objects. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->serviceGroups->list('2018-02-08'); - if ($response->serviceGroupListResponse !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->serviceGroups->list( + shippoApiVersion: '2018-02-08' +); + +if ($response->serviceGroupListResponse !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\ListServiceGroupsResponse](../../Models/Operations/ListServiceGroupsResponse.md)** +**[?array](../../.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## create @@ -70,59 +67,63 @@ Creates a new service group. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $serviceGroupCreateRequest = new Components\ServiceGroupCreateRequest(); - $serviceGroupCreateRequest->description = 'USPS shipping options'; - $serviceGroupCreateRequest->flatRate = '5'; - $serviceGroupCreateRequest->flatRateCurrency = 'USD'; - $serviceGroupCreateRequest->freeShippingThresholdCurrency = 'USD'; - $serviceGroupCreateRequest->freeShippingThresholdMin = '5'; - $serviceGroupCreateRequest->name = 'USPS Shipping'; - $serviceGroupCreateRequest->rateAdjustment = 15; - $serviceGroupCreateRequest->type = Components\ServiceGroupTypeEnum::FlatRate; - $serviceGroupCreateRequest->serviceLevels = [ - new Components\ServiceGroupAccountAndServiceLevel(), - ]; - - $response = $sdk->serviceGroups->create($serviceGroupCreateRequest, '2018-02-08'); - - if ($response->serviceGroup !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$serviceGroupCreateRequest = new Components\ServiceGroupCreateRequest( + description: 'USPS shipping options', + name: 'USPS Shipping', + type: Components\ServiceGroupTypeEnum::FlatRate, + serviceLevels: [ + new Components\ServiceGroupAccountAndServiceLevel( + accountObjectId: '80feb1633d4a43c898f0058506cfd82d', + serviceLevelToken: 'ups_next_day_air_saver', + ), + ], + flatRate: '5', + flatRateCurrency: 'USD', + freeShippingThresholdCurrency: 'USD', + freeShippingThresholdMin: '5', + rateAdjustment: 15, +); + +$response = $sdk->serviceGroups->create( + serviceGroupCreateRequest: $serviceGroupCreateRequest, + shippoApiVersion: '2018-02-08' + +); + +if ($response->serviceGroup !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `serviceGroupCreateRequest` | [\Shippo\API\Models\Components\ServiceGroupCreateRequest](../../Models/Components/ServiceGroupCreateRequest.md) | :heavy_check_mark: | N/A | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `serviceGroupCreateRequest` | [Components\ServiceGroupCreateRequest](../../Models/Components/ServiceGroupCreateRequest.md) | :heavy_check_mark: | N/A | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateServiceGroupResponse](../../Models/Operations/CreateServiceGroupResponse.md)** +**[?Components\ServiceGroup](../../Models/Components/ServiceGroup.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## update @@ -131,61 +132,65 @@ Updates an existing service group object.
The object_id cannot be updated as ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $serviceGroupUpdateRequest = new Components\ServiceGroupUpdateRequest(); - $serviceGroupUpdateRequest->description = 'USPS shipping options'; - $serviceGroupUpdateRequest->flatRate = '5'; - $serviceGroupUpdateRequest->flatRateCurrency = 'USD'; - $serviceGroupUpdateRequest->freeShippingThresholdCurrency = 'USD'; - $serviceGroupUpdateRequest->freeShippingThresholdMin = '5'; - $serviceGroupUpdateRequest->name = 'USPS Shipping'; - $serviceGroupUpdateRequest->rateAdjustment = 15; - $serviceGroupUpdateRequest->type = Components\ServiceGroupTypeEnum::FlatRate; - $serviceGroupUpdateRequest->objectId = '80feb1633d4a43c898f005850'; - $serviceGroupUpdateRequest->isActive = true; - $serviceGroupUpdateRequest->serviceLevels = [ - new Components\ServiceGroupAccountAndServiceLevel(), - ]; - - $response = $sdk->serviceGroups->update('2018-02-08', $serviceGroupUpdateRequest); - - if ($response->serviceGroup !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$serviceGroupUpdateRequest = new Components\ServiceGroupUpdateRequest( + description: 'USPS shipping options', + name: 'USPS Shipping', + type: Components\ServiceGroupTypeEnum::FlatRate, + objectId: '80feb1633d4a43c898f005850', + isActive: true, + serviceLevels: [ + new Components\ServiceGroupAccountAndServiceLevel( + accountObjectId: '80feb1633d4a43c898f0058506cfd82d', + serviceLevelToken: 'ups_next_day_air_saver', + ), + ], + flatRate: '5', + flatRateCurrency: 'USD', + freeShippingThresholdCurrency: 'USD', + freeShippingThresholdMin: '5', + rateAdjustment: 15, +); + +$response = $sdk->serviceGroups->update( + shippoApiVersion: '2018-02-08', + serviceGroupUpdateRequest: $serviceGroupUpdateRequest + +); + +if ($response->serviceGroup !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | -| `serviceGroupUpdateRequest` | [\Shippo\API\Models\Components\ServiceGroupUpdateRequest](../../Models/Components/ServiceGroupUpdateRequest.md) | :heavy_minus_sign: | N/A | | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | +| `serviceGroupUpdateRequest` | [?Components\ServiceGroupUpdateRequest](../../Models/Components/ServiceGroupUpdateRequest.md) | :heavy_minus_sign: | N/A | | ### Response -**[?\Shippo\API\Models\Operations\UpdateServiceGroupResponse](../../Models/Operations/UpdateServiceGroupResponse.md)** +**[?Components\ServiceGroup](../../Models/Components/ServiceGroup.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## delete @@ -194,45 +199,40 @@ Deletes an existing service group using an object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->serviceGroups->delete('', '2018-02-08'); - if ($response->statusCode === 200) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->serviceGroups->delete( + serviceGroupId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->statusCode === 200) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `serviceGroupId` | *string* | :heavy_check_mark: | Object ID of the service group | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - - -### Response +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `serviceGroupId` | *string* | :heavy_check_mark: | Object ID of the service group | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | -**[?\Shippo\API\Models\Operations\DeleteServiceGroupResponse](../../Models/Operations/DeleteServiceGroupResponse.md)** +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/shipments/README.md b/docs/sdks/shipments/README.md index dd17734..434853b 100644 --- a/docs/sdks/shipments/README.md +++ b/docs/sdks/shipments/README.md @@ -1,5 +1,5 @@ # Shipments - +(*shipments*) ## Overview @@ -40,49 +40,45 @@ Optional path parameters:
### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - +$request = new Operations\ListShipmentsRequest(); - $response = $sdk->shipments->list(768578, 99895, '2018-02-08'); +$response = $sdk->shipments->list( + request: $request +); - if ($response->shipmentPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +if ($response->shipmentPaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `page` | *int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `$request` | [Operations\ListShipmentsRequest](../../Models/Operations/ListShipmentsRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?\Shippo\API\Models\Operations\ListShipmentsResponse](../../Models/Operations/ListShipmentsResponse.md)** +**[?Components\ShipmentPaginatedList](../../Models/Components/ShipmentPaginatedList.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## create @@ -91,195 +87,196 @@ Creates a new shipment object. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $shipmentCreateRequest = new Components\ShipmentCreateRequest(); - $shipmentCreateRequest->extra = new Components\ShipmentExtra(); - $shipmentCreateRequest->extra->accountsReceivableCustomerAccount = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->accountsReceivableCustomerAccount->prefix = 'ABC'; - $shipmentCreateRequest->extra->accountsReceivableCustomerAccount->value = 'value'; - $shipmentCreateRequest->extra->accountsReceivableCustomerAccount->refSort = 1; - $shipmentCreateRequest->extra->alcohol = new Components\Alcohol(); - $shipmentCreateRequest->extra->alcohol->containsAlcohol = false; - $shipmentCreateRequest->extra->alcohol->recipientType = Components\RecipientType::Licensee; - $shipmentCreateRequest->extra->ancillaryEndorsement = Components\AncillaryEndorsement::ForwardingServiceRequested; - $shipmentCreateRequest->extra->appropriationNumber = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->appropriationNumber->prefix = 'ABC'; - $shipmentCreateRequest->extra->appropriationNumber->value = 'value'; - $shipmentCreateRequest->extra->appropriationNumber->refSort = 1; - $shipmentCreateRequest->extra->authorityToLeave = false; - $shipmentCreateRequest->extra->billOfLadingNumber = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->billOfLadingNumber->prefix = 'ABC'; - $shipmentCreateRequest->extra->billOfLadingNumber->value = 'value'; - $shipmentCreateRequest->extra->billOfLadingNumber->refSort = 1; - $shipmentCreateRequest->extra->billing = new Components\Billing(); - $shipmentCreateRequest->extra->billing->account = '68421709'; - $shipmentCreateRequest->extra->billing->country = ''; - $shipmentCreateRequest->extra->billing->participationCode = ''; - $shipmentCreateRequest->extra->billing->type = Components\Type::ThirdPartyConsignee; - $shipmentCreateRequest->extra->billing->zip = '98041'; - $shipmentCreateRequest->extra->bypassAddressValidation = false; - $shipmentCreateRequest->extra->carbonNeutral = false; - $shipmentCreateRequest->extra->carrierHubId = ''; - $shipmentCreateRequest->extra->carrierHubTravelTime = 301510; - $shipmentCreateRequest->extra->cod = new Components\Cod(); - $shipmentCreateRequest->extra->cod->amount = '5.5'; - $shipmentCreateRequest->extra->cod->currency = 'USD'; - $shipmentCreateRequest->extra->cod->paymentMethod = Components\PaymentMethod::Cash; - $shipmentCreateRequest->extra->codNumber = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->codNumber->prefix = 'ABC'; - $shipmentCreateRequest->extra->codNumber->value = 'value'; - $shipmentCreateRequest->extra->codNumber->refSort = 1; - $shipmentCreateRequest->extra->containerType = ''; - $shipmentCreateRequest->extra->criticalPullTime = ''; - $shipmentCreateRequest->extra->customerBranch = ''; - $shipmentCreateRequest->extra->customerReference = new Components\CustomerReference(); - $shipmentCreateRequest->extra->customerReference->prefix = ''; - $shipmentCreateRequest->extra->customerReference->value = ''; - $shipmentCreateRequest->extra->customerReference->refSort = 1; - $shipmentCreateRequest->extra->dangerousGoods = new Components\DangerousGoodsObject(); - $shipmentCreateRequest->extra->dangerousGoods->contains = false; - $shipmentCreateRequest->extra->dangerousGoods->biologicalMaterial = new Components\DangerousGoodsBiologicalMaterial(); - $shipmentCreateRequest->extra->dangerousGoods->biologicalMaterial->contains = false; - $shipmentCreateRequest->extra->dangerousGoods->lithiumBatteries = new Components\DangerousGoodsLithiumBatteries(); - $shipmentCreateRequest->extra->dangerousGoods->lithiumBatteries->contains = false; - $shipmentCreateRequest->extra->dangerousGoodsCode = Components\DangerousGoodsCode::One; - $shipmentCreateRequest->extra->dealerOrderNumber = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->dealerOrderNumber->prefix = 'ABC'; - $shipmentCreateRequest->extra->dealerOrderNumber->value = 'value'; - $shipmentCreateRequest->extra->dealerOrderNumber->refSort = 1; - $shipmentCreateRequest->extra->deliveryInstructions = ''; - $shipmentCreateRequest->extra->deptNumber = new Components\DepartmentNumber(); - $shipmentCreateRequest->extra->deptNumber->prefix = ''; - $shipmentCreateRequest->extra->deptNumber->value = ''; - $shipmentCreateRequest->extra->deptNumber->refSort = 3; - $shipmentCreateRequest->extra->dryIce = new Components\DryIce(); - $shipmentCreateRequest->extra->dryIce->containsDryIce = false; - $shipmentCreateRequest->extra->dryIce->weight = ''; - $shipmentCreateRequest->extra->fdaProductCode = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->fdaProductCode->prefix = 'ABC'; - $shipmentCreateRequest->extra->fdaProductCode->value = 'value'; - $shipmentCreateRequest->extra->fdaProductCode->refSort = 1; - $shipmentCreateRequest->extra->fulfillmentCenter = ''; - $shipmentCreateRequest->extra->insurance = new Components\Insurance(); - $shipmentCreateRequest->extra->insurance->amount = '5.5'; - $shipmentCreateRequest->extra->insurance->content = ''; - $shipmentCreateRequest->extra->insurance->currency = 'USD'; - $shipmentCreateRequest->extra->insurance->provider = Components\Provider::Ontrac; - $shipmentCreateRequest->extra->invoiceNumber = new Components\InvoiceNumber(); - $shipmentCreateRequest->extra->invoiceNumber->prefix = ''; - $shipmentCreateRequest->extra->invoiceNumber->value = ''; - $shipmentCreateRequest->extra->invoiceNumber->refSort = 2; - $shipmentCreateRequest->extra->isReturn = false; - $shipmentCreateRequest->extra->lasershipAttrs = [ - Components\ShipmentExtraLasershipAttributesEnum::Perishable, - ]; - $shipmentCreateRequest->extra->lasershipDeclaredValue = ''; - $shipmentCreateRequest->extra->manifestNumber = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->manifestNumber->prefix = 'ABC'; - $shipmentCreateRequest->extra->manifestNumber->value = 'value'; - $shipmentCreateRequest->extra->manifestNumber->refSort = 1; - $shipmentCreateRequest->extra->modelNumber = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->modelNumber->prefix = 'ABC'; - $shipmentCreateRequest->extra->modelNumber->value = 'value'; - $shipmentCreateRequest->extra->modelNumber->refSort = 1; - $shipmentCreateRequest->extra->partNumber = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->partNumber->prefix = 'ABC'; - $shipmentCreateRequest->extra->partNumber->value = 'value'; - $shipmentCreateRequest->extra->partNumber->refSort = 1; - $shipmentCreateRequest->extra->poNumber = new Components\PoNumber(); - $shipmentCreateRequest->extra->poNumber->prefix = ''; - $shipmentCreateRequest->extra->poNumber->value = ''; - $shipmentCreateRequest->extra->poNumber->refSort = 2; - $shipmentCreateRequest->extra->preferredDeliveryTimeframe = Components\PreferredDeliveryTimeframe::NineteenMillionTwoThousandOneHundred; - $shipmentCreateRequest->extra->premium = false; - $shipmentCreateRequest->extra->productionCode = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->productionCode->prefix = 'ABC'; - $shipmentCreateRequest->extra->productionCode->value = 'value'; - $shipmentCreateRequest->extra->productionCode->refSort = 1; - $shipmentCreateRequest->extra->purchaseRequestNumber = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->purchaseRequestNumber->prefix = 'ABC'; - $shipmentCreateRequest->extra->purchaseRequestNumber->value = 'value'; - $shipmentCreateRequest->extra->purchaseRequestNumber->refSort = 1; - $shipmentCreateRequest->extra->qrCodeRequested = false; - $shipmentCreateRequest->extra->reference1 = ''; - $shipmentCreateRequest->extra->reference2 = ''; - $shipmentCreateRequest->extra->requestRetailRates = false; - $shipmentCreateRequest->extra->returnServiceType = ''; - $shipmentCreateRequest->extra->rmaNumber = new Components\RmaNumber(); - $shipmentCreateRequest->extra->rmaNumber->prefix = ''; - $shipmentCreateRequest->extra->rmaNumber->value = ''; - $shipmentCreateRequest->extra->rmaNumber->refSort = 1; - $shipmentCreateRequest->extra->saturdayDelivery = false; - $shipmentCreateRequest->extra->salespersonNumber = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->salespersonNumber->prefix = 'ABC'; - $shipmentCreateRequest->extra->salespersonNumber->value = 'value'; - $shipmentCreateRequest->extra->salespersonNumber->refSort = 1; - $shipmentCreateRequest->extra->serialNumber = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->serialNumber->prefix = 'ABC'; - $shipmentCreateRequest->extra->serialNumber->value = 'value'; - $shipmentCreateRequest->extra->serialNumber->refSort = 1; - $shipmentCreateRequest->extra->signatureConfirmation = Components\SignatureConfirmation::CarrierConfirmation; - $shipmentCreateRequest->extra->storeNumber = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->storeNumber->prefix = 'ABC'; - $shipmentCreateRequest->extra->storeNumber->value = 'value'; - $shipmentCreateRequest->extra->storeNumber->refSort = 1; - $shipmentCreateRequest->extra->transactionReferenceNumber = new Components\UPSReferenceFields(); - $shipmentCreateRequest->extra->transactionReferenceNumber->prefix = 'ABC'; - $shipmentCreateRequest->extra->transactionReferenceNumber->value = 'value'; - $shipmentCreateRequest->extra->transactionReferenceNumber->refSort = 1; - $shipmentCreateRequest->metadata = 'Customer ID 123456'; - $shipmentCreateRequest->shipmentDate = '2021-03-22T12:00:00Z'; - $shipmentCreateRequest->addressFrom = ''; - $shipmentCreateRequest->addressReturn = ''; - $shipmentCreateRequest->addressTo = ''; - $shipmentCreateRequest->customsDeclaration = ''; - $shipmentCreateRequest->async = false; - $shipmentCreateRequest->carrierAccounts = [ - '', - ]; - $shipmentCreateRequest->parcels = [ - '', - ]; - - $response = $sdk->shipments->create($shipmentCreateRequest, '2018-02-08'); - - if ($response->shipment !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$shipmentCreateRequest = new Components\ShipmentCreateRequest( + addressFrom: new Components\AddressCreateRequest( + country: 'US', + name: 'Shwan Ippotle', + company: 'Shippo', + street1: '215 Clayton St.', + street3: '', + streetNo: '', + city: 'San Francisco', + state: 'CA', + zip: '94117', + phone: '+1 555 341 9393', + email: 'shippotle@shippo.com', + isResidential: true, + metadata: 'Customer ID 123456', + validate: true, + ), + addressTo: 'd799c2679e644279b59fe661ac8fa489', + parcels: [ + new Components\ParcelCreateFromTemplateRequest( + massUnit: Components\WeightUnitEnum::Lb, + weight: '1', + template: Components\ParcelTemplateFedExEnum::FedExBox25kg, + extra: new Components\ParcelExtra( + cod: new Components\Cod( + amount: '5.5', + currency: 'USD', + paymentMethod: Components\PaymentMethod::Cash, + ), + insurance: new Components\ParcelInsurance( + amount: '5.5', + content: 'Laptop', + currency: 'USD', + provider: Components\ParcelInsuranceProvider::Ups, + ), + ), + metadata: 'Customer ID 123456', + ), + ], + extra: new Components\ShipmentExtra( + accountsReceivableCustomerAccount: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + appropriationNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + billOfLadingNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + cod: new Components\Cod( + amount: '5.5', + currency: 'USD', + paymentMethod: Components\PaymentMethod::Cash, + ), + codNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + customerReference: new Components\CustomerReference( + refSort: 1, + ), + dealerOrderNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + deptNumber: new Components\DepartmentNumber( + refSort: 3, + ), + fdaProductCode: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + insurance: new Components\Insurance( + amount: '5.5', + currency: 'USD', + ), + invoiceNumber: new Components\InvoiceNumber( + refSort: 2, + ), + manifestNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + modelNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + partNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + poNumber: new Components\PoNumber( + refSort: 2, + ), + productionCode: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + purchaseRequestNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + rmaNumber: new Components\RmaNumber( + refSort: 1, + ), + salespersonNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + serialNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + storeNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + transactionReferenceNumber: new Components\UPSReferenceFields( + prefix: 'ABC', + value: 'value', + refSort: 1, + ), + ), + metadata: 'Customer ID 123456', + shipmentDate: '2021-03-22T12:00:00Z', + addressReturn: 'd799c2679e644279b59fe661ac8fa488', + customsDeclaration: 'adcfdddf8ec64b84ad22772bce3ea37a', + carrierAccounts: [ + '065a4a8c10d24a34ab932163a1b87f52', + '73f706f4bdb94b54a337563840ce52b0', + ], +); + +$response = $sdk->shipments->create( + shipmentCreateRequest: $shipmentCreateRequest, + shippoApiVersion: '2018-02-08' + +); + +if ($response->shipment !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `shipmentCreateRequest` | [\Shippo\API\Models\Components\ShipmentCreateRequest](../../Models/Components/ShipmentCreateRequest.md) | :heavy_check_mark: | Shipment details and contact info. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shipmentCreateRequest` | [Components\ShipmentCreateRequest](../../Models/Components/ShipmentCreateRequest.md) | :heavy_check_mark: | Shipment details and contact info. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateShipmentResponse](../../Models/Operations/CreateShipmentResponse.md)** +**[?Components\Shipment](../../Models/Components/Shipment.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -288,45 +285,44 @@ Returns an existing shipment using an object ID ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->shipments->get('', '2018-02-08'); - if ($response->shipment !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->shipments->get( + shipmentId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->shipment !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shipmentId` | *string* | :heavy_check_mark: | Object ID of the shipment to update | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shipmentId` | *string* | :heavy_check_mark: | Object ID of the shipment to update | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetShipmentResponse](../../Models/Operations/GetShipmentResponse.md)** +**[?Components\Shipment](../../Models/Components/Shipment.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/shipposdk/README.md b/docs/sdks/shippo/README.md similarity index 88% rename from docs/sdks/shipposdk/README.md rename to docs/sdks/shippo/README.md index f00f187..1ed996b 100644 --- a/docs/sdks/shipposdk/README.md +++ b/docs/sdks/shippo/README.md @@ -1,9 +1,7 @@ -# ShippoSDK - +# Shippo SDK ## Overview Shippo external API.: Use this API to integrate with the Shippo service ### Available Operations - diff --git a/docs/sdks/shippoaccounts/README.md b/docs/sdks/shippoaccounts/README.md index e52864d..74bd5fa 100644 --- a/docs/sdks/shippoaccounts/README.md +++ b/docs/sdks/shippoaccounts/README.md @@ -1,11 +1,11 @@ # ShippoAccounts - +(*shippoAccounts*) ## Overview Shippo Accounts are used by Shippo Platform Accounts to create and manage Managed Shippo Accounts. Managed Shippo Accounts are headless accounts that represent your customers. They are opaque to your end customers, meaning customers do not need to create their own Shippo login or have a billing relationship with Shippo. -They can be used by marketplaces, e-commerce platforms, and third-party logistics providers who want to offer, seamless, built-in shipping functionality to their customers. +They can be used by marketplaces, e-commerce platforms, and third-party logistics providers who want to offer, seamless, built-in shipping functionality to their customers. See our guide for more details. ### Available Operations @@ -17,210 +17,212 @@ They can be used by marketplaces, e-commerce platforms, and third-party logistic ## list -Returns a list of Shippo Accounts objects +Returns a list of Shippo Managed Accounts objects. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->shippoAccounts->list(768578, 99895, '2018-02-08'); - if ($response->shippoAccountPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->shippoAccounts->list( + page: 1, + results: 25, + shippoApiVersion: '2018-02-08' + +); + +if ($response->shippoAccountPaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `page` | *int* | :heavy_minus_sign: | The page number you want to select | | -| `results` | *int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `page` | *?int* | :heavy_minus_sign: | The page number you want to select | | +| `results` | *?int* | :heavy_minus_sign: | The number of results to return per page (max 100) | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\ListShippoAccountsResponse](../../Models/Operations/ListShippoAccountsResponse.md)** +**[?Components\ShippoAccountPaginatedList](../../Models/Components/ShippoAccountPaginatedList.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## create -Creates a Shippo Account object +Creates a new Shippo Managed Account. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $shippoAccountUpdateRequest = new Components\ShippoAccountUpdateRequest(); - $shippoAccountUpdateRequest->email = 'hippo@shippo.com'; - $shippoAccountUpdateRequest->firstName = 'Shippo'; - $shippoAccountUpdateRequest->lastName = 'Meister'; - $shippoAccountUpdateRequest->companyName = 'Acme'; +$shippoAccountUpdateRequest = new Components\ShippoAccountUpdateRequest( + email: 'hippo@shippo.com', + firstName: 'Shippo', + lastName: 'Meister', + companyName: 'Acme', +); + +$response = $sdk->shippoAccounts->create( + shippoAccountUpdateRequest: $shippoAccountUpdateRequest, + shippoApiVersion: '2018-02-08' - $response = $sdk->shippoAccounts->create($shippoAccountUpdateRequest, '2018-02-08'); +); - if ($response->shippoAccount !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +if ($response->shippoAccount !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `shippoAccountUpdateRequest` | [\Shippo\API\Models\Components\ShippoAccountUpdateRequest](../../Models/Components/ShippoAccountUpdateRequest.md) | :heavy_check_mark: | N/A | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoAccountUpdateRequest` | [Components\ShippoAccountUpdateRequest](../../Models/Components/ShippoAccountUpdateRequest.md) | :heavy_check_mark: | N/A | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateShippoAccountResponse](../../Models/Operations/CreateShippoAccountResponse.md)** +**[?Components\ShippoAccount](../../Models/Components/ShippoAccount.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get -Returns a Shippo Account using an object ID +Returns a Shippo Managed Account using an object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->shippoAccounts->get('', '2018-02-08'); - if ($response->shippoAccount !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->shippoAccounts->get( + shippoAccountId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->shippoAccount !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shippoAccountId` | *string* | :heavy_check_mark: | Object ID of the ShippoAccount | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoAccountId` | *string* | :heavy_check_mark: | Object ID of the ShippoAccount | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetShippoAccountResponse](../../Models/Operations/GetShippoAccountResponse.md)** +**[?Components\ShippoAccount](../../Models/Components/ShippoAccount.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## update -Updates a Shippo Account object +Updates a Shippo Managed Account using an object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $shippoAccountUpdateRequest = new Components\ShippoAccountUpdateRequest(); - $shippoAccountUpdateRequest->email = 'hippo@shippo.com'; - $shippoAccountUpdateRequest->firstName = 'Shippo'; - $shippoAccountUpdateRequest->lastName = 'Meister'; - $shippoAccountUpdateRequest->companyName = 'Acme'; +$shippoAccountUpdateRequest = new Components\ShippoAccountUpdateRequest( + email: 'hippo@shippo.com', + firstName: 'Shippo', + lastName: 'Meister', + companyName: 'Acme', +); + +$response = $sdk->shippoAccounts->update( + shippoAccountId: '', + shippoApiVersion: '2018-02-08', + shippoAccountUpdateRequest: $shippoAccountUpdateRequest - $response = $sdk->shippoAccounts->update('', '2018-02-08', $shippoAccountUpdateRequest); +); - if ($response->shippoAccount !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +if ($response->shippoAccount !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `shippoAccountId` | *string* | :heavy_check_mark: | Object ID of the ShippoAccount | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | -| `shippoAccountUpdateRequest` | [\Shippo\API\Models\Components\ShippoAccountUpdateRequest](../../Models/Components/ShippoAccountUpdateRequest.md) | :heavy_minus_sign: | N/A | | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoAccountId` | *string* | :heavy_check_mark: | Object ID of the ShippoAccount | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | +| `shippoAccountUpdateRequest` | [?Components\ShippoAccountUpdateRequest](../../Models/Components/ShippoAccountUpdateRequest.md) | :heavy_minus_sign: | N/A | | ### Response -**[?\Shippo\API\Models\Operations\UpdateShippoAccountResponse](../../Models/Operations/UpdateShippoAccountResponse.md)** +**[?Components\ShippoAccount](../../Models/Components/ShippoAccount.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/trackingstatus/README.md b/docs/sdks/trackingstatus/README.md index ac8e4e0..a3ad999 100644 --- a/docs/sdks/trackingstatus/README.md +++ b/docs/sdks/trackingstatus/README.md @@ -1,5 +1,5 @@ # TrackingStatus - +(*trackingStatus*) ## Overview @@ -27,51 +27,52 @@ Registers a webhook that will send HTTP notifications to you when the status of ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $tracksRequest = new Components\TracksRequest(); - $tracksRequest->carrier = 'usps'; - $tracksRequest->metadata = 'Order 000123'; - $tracksRequest->trackingNumber = '9205590164917312751089'; +$tracksRequest = new Components\TracksRequest( + carrier: 'usps', + trackingNumber: '9205590164917312751089', + metadata: 'Order 000123', +); + +$response = $sdk->trackingStatus->create( + tracksRequest: $tracksRequest, + shippoApiVersion: '2018-02-08' - $response = $sdk->trackingStatus->create($tracksRequest, '2018-02-08'); +); - if ($response->track !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +if ($response->track !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `tracksRequest` | [\Shippo\API\Models\Components\TracksRequest](../../Models/Components/TracksRequest.md) | :heavy_check_mark: | N/A | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `tracksRequest` | [Components\TracksRequest](../../Models/Components/TracksRequest.md) | :heavy_check_mark: | N/A | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateTrackResponse](../../Models/Operations/CreateTrackResponse.md)** +**[?Components\Track](../../Models/Components/Track.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -80,46 +81,46 @@ Returns the tracking status of a shipment using a carrier name and a tracking nu ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->trackingStatus->get('', '', '2018-02-08'); - if ($response->track !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->trackingStatus->get( + trackingNumber: '', + carrier: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->track !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `trackingNumber` | *string* | :heavy_check_mark: | Tracking number | | -| `carrier` | *string* | :heavy_check_mark: | Name of the carrier | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `trackingNumber` | *string* | :heavy_check_mark: | Tracking number | | +| `carrier` | *string* | :heavy_check_mark: | Name of the carrier | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetTrackResponse](../../Models/Operations/GetTrackResponse.md)** +**[?Components\Track](../../Models/Components/Track.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/transactions/README.md b/docs/sdks/transactions/README.md index 7cbe5a4..d408412 100644 --- a/docs/sdks/transactions/README.md +++ b/docs/sdks/transactions/README.md @@ -1,5 +1,5 @@ # Transactions - +(*transactions*) ## Overview @@ -19,52 +19,49 @@ Returns a list of all transaction objects. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $request = new Operations\ListTransactionsRequest(); - $request->rate = ''; - $request->objectStatus = Components\TransactionStatusEnum::Success; - $request->trackingStatus = Components\TrackingStatusEnum::Delivered; - $request->page = 768578; - $request->results = 99895;; - - $response = $sdk->transactions->list($request); - - if ($response->transactionPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$request = new Operations\ListTransactionsRequest( + objectStatus: Components\TransactionStatusEnum::Success, + trackingStatus: Components\TrackingStatusEnum::Delivered, +); + +$response = $sdk->transactions->list( + request: $request +); + +if ($response->transactionPaginatedList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `$request` | [\Shippo\API\Models\Operations\ListTransactionsRequest](../../Models/Operations/ListTransactionsRequest.md) | :heavy_check_mark: | The request object to use for the request. | - +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `$request` | [Operations\ListTransactionsRequest](../../Models/Operations/ListTransactionsRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?\Shippo\API\Models\Operations\ListTransactionsResponse](../../Models/Operations/ListTransactionsResponse.md)** +**[?Components\TransactionPaginatedList](../../Models/Components/TransactionPaginatedList.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## create @@ -73,48 +70,54 @@ Creates a new transaction object and purchases the shipping label using a rate o ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->transactions->create('', '2018-02-08'); - if ($response->transaction !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->transactions->create( + requestBody: new Components\TransactionCreateRequest( + rate: 'ec9f0d3adc9441449c85d315f0997fd5', + async: false, + labelFileType: Components\LabelFileTypeEnum::PDF4x6, + metadata: 'Order ID #12345', + order: 'adcfdddf8ec64b84ad22772bce3ea37a', + ), + shippoApiVersion: '2018-02-08' + +); + +if ($response->transaction !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `requestBody` | *mixed* | :heavy_check_mark: | Examples. | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `requestBody` | [Components\TransactionCreateRequest\|Components\InstantTransactionCreateRequest](../../Models/Operations/CreateTransactionRequestBody.md) | :heavy_check_mark: | Examples. | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateTransactionResponse](../../Models/Operations/CreateTransactionResponse.md)** +**[?Components\Transaction](../../Models/Components/Transaction.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -123,45 +126,44 @@ Returns an existing transaction using an object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->transactions->get('', '2018-02-08'); - if ($response->transaction !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->transactions->get( + transactionId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->transaction !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `transactionId` | *string* | :heavy_check_mark: | Object ID of the transaction to update | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `transactionId` | *string* | :heavy_check_mark: | Object ID of the transaction to update | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetTransactionResponse](../../Models/Operations/GetTransactionResponse.md)** +**[?Components\Transaction](../../Models/Components/Transaction.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/userparceltemplates/README.md b/docs/sdks/userparceltemplates/README.md index 2ee99b8..037b3a2 100644 --- a/docs/sdks/userparceltemplates/README.md +++ b/docs/sdks/userparceltemplates/README.md @@ -1,5 +1,5 @@ # UserParcelTemplates - +(*userParcelTemplates*) ## Overview @@ -26,47 +26,44 @@ Returns a list all of all user parcel template objects. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->userParcelTemplates->list('2018-02-08'); - if ($response->userParcelTemplateList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->userParcelTemplates->list( + shippoApiVersion: '2018-02-08' +); + +if ($response->userParcelTemplateList !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\ListUserParcelTemplatesResponse](../../Models/Operations/ListUserParcelTemplatesResponse.md)** +**[?Components\UserParcelTemplateList](../../Models/Components/UserParcelTemplateList.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## create @@ -81,48 +78,51 @@ and depth, as well as their units." ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->userParcelTemplates->create('', '2018-02-08'); - if ($response->userParcelTemplate !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->userParcelTemplates->create( + userParcelTemplateCreateRequest: new Components\UserParcelTemplateWithCarrierTemplateCreateRequest( + weight: '12', + weightUnit: Components\WeightUnitEnum::Lb, + ), + shippoApiVersion: '2018-02-08' + +); + +if ($response->userParcelTemplate !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `requestBody` | *mixed* | :heavy_check_mark: | N/A | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `userParcelTemplateCreateRequest` | [Components\UserParcelTemplateWithCarrierTemplateCreateRequest\|Components\UserParcelTemplateWithoutCarrierTemplateCreateRequest](../../Models/Components/UserParcelTemplateCreateRequest.md) | :heavy_check_mark: | N/A | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\CreateUserParcelTemplateResponse](../../Models/Operations/CreateUserParcelTemplateResponse.md)** +**[?Components\UserParcelTemplate](../../Models/Components/UserParcelTemplate.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## delete @@ -131,48 +131,43 @@ Deletes a user parcel template using an object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->userParcelTemplates->delete('', '2018-02-08'); - if ($response->statusCode === 200) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->userParcelTemplates->delete( + userParcelTemplateObjectId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->statusCode === 200) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `userParcelTemplateObjectId` | *string* | :heavy_check_mark: | Object ID of the user parcel template | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - - -### Response +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `userParcelTemplateObjectId` | *string* | :heavy_check_mark: | Object ID of the user parcel template | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | -**[?\Shippo\API\Models\Operations\DeleteUserParcelTemplateResponse](../../Models/Operations/DeleteUserParcelTemplateResponse.md)** +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## get @@ -182,48 +177,47 @@ template, identified by the object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->userParcelTemplates->get('', '2018-02-08'); - if ($response->userParcelTemplate !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->userParcelTemplates->get( + userParcelTemplateObjectId: '', + shippoApiVersion: '2018-02-08' + +); + +if ($response->userParcelTemplate !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `userParcelTemplateObjectId` | *string* | :heavy_check_mark: | Object ID of the user parcel template | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `userParcelTemplateObjectId` | *string* | :heavy_check_mark: | Object ID of the user parcel template | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | ### Response -**[?\Shippo\API\Models\Operations\GetUserParcelTemplateResponse](../../Models/Operations/GetUserParcelTemplateResponse.md)** +**[?Components\UserParcelTemplate](../../Models/Components/UserParcelTemplate.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## update @@ -232,53 +226,55 @@ Updates an existing user parcel template. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $userParcelTemplateUpdateRequest = new Components\UserParcelTemplateUpdateRequest(); - $userParcelTemplateUpdateRequest->distanceUnit = Components\DistanceUnitEnum::In; - $userParcelTemplateUpdateRequest->height = '6'; - $userParcelTemplateUpdateRequest->length = '10'; - $userParcelTemplateUpdateRequest->name = 'My Custom Template'; - $userParcelTemplateUpdateRequest->weight = '12'; - $userParcelTemplateUpdateRequest->weightUnit = Components\WeightUnitEnum::Lb; - $userParcelTemplateUpdateRequest->width = '8'; - - $response = $sdk->userParcelTemplates->update('', '2018-02-08', $userParcelTemplateUpdateRequest); - - if ($response->userParcelTemplate !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$userParcelTemplateUpdateRequest = new Components\UserParcelTemplateUpdateRequest( + distanceUnit: Components\DistanceUnitEnum::In, + height: '6', + length: '10', + name: 'My Custom Template', + width: '8', + weight: '12', + weightUnit: Components\WeightUnitEnum::Lb, +); + +$response = $sdk->userParcelTemplates->update( + userParcelTemplateObjectId: '', + shippoApiVersion: '2018-02-08', + userParcelTemplateUpdateRequest: $userParcelTemplateUpdateRequest + +); + +if ($response->userParcelTemplate !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `userParcelTemplateObjectId` | *string* | :heavy_check_mark: | Object ID of the user parcel template | | -| `shippoApiVersion` | *string* | :heavy_minus_sign: | String used to pick a non-default API version to use | 2018-02-08 | -| `userParcelTemplateUpdateRequest` | [\Shippo\API\Models\Components\UserParcelTemplateUpdateRequest](../../Models/Components/UserParcelTemplateUpdateRequest.md) | :heavy_minus_sign: | N/A | | - +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `userParcelTemplateObjectId` | *string* | :heavy_check_mark: | Object ID of the user parcel template | | +| `shippoApiVersion` | *?string* | :heavy_minus_sign: | Optional string used to pick a non-default API version to use. See our API version guide. | 2018-02-08 | +| `userParcelTemplateUpdateRequest` | [?Components\UserParcelTemplateUpdateRequest](../../Models/Components/UserParcelTemplateUpdateRequest.md) | :heavy_minus_sign: | N/A | | ### Response -**[?\Shippo\API\Models\Operations\UpdateUserParcelTemplateResponse](../../Models/Operations/UpdateUserParcelTemplateResponse.md)** +**[?Components\UserParcelTemplate](../../Models/Components/UserParcelTemplate.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md index e3d656c..edbacb2 100644 --- a/docs/sdks/webhooks/README.md +++ b/docs/sdks/webhooks/README.md @@ -1,11 +1,15 @@ # Webhooks - +(*webhooks*) ## Overview Webhooks are a way for Shippo to notify your application when a specific event occurs. For example, when a label is purchased or when a shipment tracking status has changed. You can use webhooks to trigger actions in your application, such as sending an email or updating a database. +# Webhook Payload +The payload is the body of the POST request Shippo sends to the URL specified at the time of webhook registration. + + ### Available Operations * [createWebhook](#createwebhook) - Create a new webhook @@ -21,50 +25,50 @@ Creates a new webhook to send notifications to a URL when a specific event occur ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $request = new Components\WebhookUpdateRequest(); - $request->event = Components\WebhookEventTypeEnum::TrackUpdated; - $request->url = 'https://wobbly-marmalade.org'; - $request->active = false; - $request->isTest = false;; +$request = new Components\WebhookUpdateRequest( + event: Components\WebhookEventTypeEnum::BatchCreated, + url: 'https://example.com/shippo-webhook', + active: true, + isTest: false, +); - $response = $sdk->webhooks->createWebhook($request); +$response = $sdk->webhooks->createWebhook( + request: $request +); - if ($response->webhook !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +if ($response->webhook !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `$request` | [\Shippo\API\Models\Components\WebhookUpdateRequest](../../Models/Components/WebhookUpdateRequest.md) | :heavy_check_mark: | The request object to use for the request. | - +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `$request` | [Components\WebhookUpdateRequest](../../Models/Components/WebhookUpdateRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?\Shippo\API\Models\Operations\CreateWebhookResponse](../../Models/Operations/CreateWebhookResponse.md)** +**[?Components\Webhook](../../Models/Components/Webhook.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## listWebhooks @@ -73,38 +77,38 @@ Returns a list of all webhooks you have created. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $response = $sdk->webhooks->listWebhooks(); - if ($response->webhookPaginatedList !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception + +$response = $sdk->webhooks->listWebhooks( + +); + +if ($response->webhookPaginatedList !== null) { + // handle response } ``` - ### Response -**[?\Shippo\API\Models\Operations\ListWebhooksResponse](../../Models/Operations/ListWebhooksResponse.md)** +**[?Components\WebhookPaginatedList](../../Models/Components/WebhookPaginatedList.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## getWebhook @@ -113,33 +117,26 @@ Returns the details of a specific webhook using the webhook object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->webhooks->getWebhook(''); - if ($response->webhook !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->webhooks->getWebhook( + webhookId: '' +); + +if ($response->webhook !== null) { + // handle response } ``` @@ -149,11 +146,15 @@ try { | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `webhookId` | *string* | :heavy_check_mark: | Object ID of the webhook to retrieve | - ### Response -**[?\Shippo\API\Models\Operations\GetWebhookResponse](../../Models/Operations/GetWebhookResponse.md)** +**[?Components\Webhook](../../Models/Components/Webhook.md)** + +### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## updateWebhook @@ -162,52 +163,53 @@ Updates an existing webhook using the webhook object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - $webhookUpdateRequest = new Components\WebhookUpdateRequest(); - $webhookUpdateRequest->event = Components\WebhookEventTypeEnum::TrackUpdated; - $webhookUpdateRequest->url = 'https://small-cock.info'; - $webhookUpdateRequest->active = false; - $webhookUpdateRequest->isTest = false; +$webhookUpdateRequest = new Components\WebhookUpdateRequest( + event: Components\WebhookEventTypeEnum::BatchCreated, + url: 'https://example.com/shippo-webhook', + active: true, + isTest: false, +); + +$response = $sdk->webhooks->updateWebhook( + webhookId: '', + webhookUpdateRequest: $webhookUpdateRequest - $response = $sdk->webhooks->updateWebhook('', $webhookUpdateRequest); +); - if ($response->webhook !== null) { - // handle response - } -} catch (Throwable $e) { - // handle exception +if ($response->webhook !== null) { + // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `webhookId` | *string* | :heavy_check_mark: | Object ID of the webhook to retrieve | -| `webhookUpdateRequest` | [\Shippo\API\Models\Components\WebhookUpdateRequest](../../Models/Components/WebhookUpdateRequest.md) | :heavy_check_mark: | N/A | - +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `webhookId` | *string* | :heavy_check_mark: | Object ID of the webhook to retrieve | +| `webhookUpdateRequest` | [Components\WebhookUpdateRequest](../../Models/Components/WebhookUpdateRequest.md) | :heavy_check_mark: | N/A | ### Response -**[?\Shippo\API\Models\Operations\UpdateWebhookResponse](../../Models/Operations/UpdateWebhookResponse.md)** +**[?Components\Webhook](../../Models/Components/Webhook.md)** +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | ## deleteWebhook @@ -216,33 +218,26 @@ Deletes a specific webhook using the webhook object ID. ### Example Usage ```php -apiKeyHeader = ''; +$security = ''; -$sdk = API\ShippoSDK::builder() +$sdk = API\Shippo::builder() ->setShippoApiVersion('2018-02-08') ->setSecurity($security)->build(); -try { - - $response = $sdk->webhooks->deleteWebhook(''); - if ($response->statusCode === 200) { - // handle response - } -} catch (Throwable $e) { - // handle exception +$response = $sdk->webhooks->deleteWebhook( + webhookId: '' +); + +if ($response->statusCode === 200) { + // handle response } ``` @@ -252,8 +247,8 @@ try { | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | | `webhookId` | *string* | :heavy_check_mark: | Object ID of the webhook to delete | +### Errors -### Response - -**[?\Shippo\API\Models\Operations\DeleteWebhookResponse](../../Models/Operations/DeleteWebhookResponse.md)** - +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| Errors\SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/phpstan.neon b/phpstan.neon index 14130c0..f623fd1 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,8 +5,7 @@ parameters: reportUnmatchedIgnoredErrors: false - checkGenericClassInNonGenericObjectType: false - ignoreErrors: - '#.*?class ReflectionProperty constructor expects object\|string.*?#' - '#^Strict comparison using === between .*? will always evaluate to false\.$#' + - identifier: missingType.generics diff --git a/phpunit.xml b/phpunit.xml index f939353..d3f71bf 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,26 +1,17 @@ - - - +> - - tests + + ./Tests - - - - src/ - - - - - - - + + + ./src + + - diff --git a/pint.json b/pint.json index 5b64972..e34fd80 100644 --- a/pint.json +++ b/pint.json @@ -12,6 +12,7 @@ "no_blank_lines_after_class_opening": false, "single_line_after_imports": false, "no_trailing_whitespace_in_comment": false, - "single_line_empty_body": false + "single_line_empty_body": false, + "new_with_parentheses": false } -} \ No newline at end of file +} diff --git a/rector.php b/rector.php index 606164e..40eb9bf 100644 --- a/rector.php +++ b/rector.php @@ -1,7 +1,7 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all addresses @@ -28,50 +52,67 @@ public function __construct(SDKConfiguration $sdkConfig) * @param ?int $page * @param ?int $results * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListAddressesResponse + * @return Components\AddressPaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?int $page = null, - ?int $results = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListAddressesResponse { - $request = new \Shippo\API\Models\Operations\ListAddressesRequest(); - $request->page = $page; - $request->results = $results; - $request->shippoApiVersion = $shippoApiVersion; + public function list(?int $page = null, ?int $results = null, ?string $shippoApiVersion = null): Components\AddressPaginatedList + { + $request = new Operations\ListAddressesRequest( + page: $page, + results: $results, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/addresses'); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListAddressesRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListAddressesRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListAddresses', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListAddressesResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->addressPaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\AddressPaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\AddressPaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -79,19 +120,20 @@ public function list( * * Creates a new address object. You can use address objects to create new shipments, calculate rates, and to create orders. * - * @param \Shippo\API\Models\Components\AddressCreateRequest $addressCreateRequest + * @param Components\AddressCreateRequest $addressCreateRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateAddressResponse + * @return Components\Address + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\AddressCreateRequest $addressCreateRequest, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateAddressResponse { - $request = new \Shippo\API\Models\Operations\CreateAddressRequest(); - $request->addressCreateRequest = $addressCreateRequest; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\AddressCreateRequest $addressCreateRequest, ?string $shippoApiVersion = null): Components\Address + { + $request = new Operations\CreateAddressRequest( + addressCreateRequest: $addressCreateRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/addresses'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'addressCreateRequest', 'json'); if ($body === null) { @@ -104,29 +146,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateAddress', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateAddressResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->address = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Address', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Address', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -136,17 +193,18 @@ public function create( * * @param string $addressId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetAddressResponse + * @return Components\Address + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $addressId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetAddressResponse { - $request = new \Shippo\API\Models\Operations\GetAddressRequest(); - $request->addressId = $addressId; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $addressId, ?string $shippoApiVersion = null): Components\Address + { + $request = new Operations\GetAddressRequest( + addressId: $addressId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/addresses/{AddressId}', \Shippo\API\Models\Operations\GetAddressRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/addresses/{AddressId}', Operations\GetAddressRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -154,29 +212,44 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetAddress', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetAddressResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->address = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Address', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Address', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -186,17 +259,18 @@ public function get( * * @param string $addressId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ValidateAddressResponse + * @return Components\Address + * @throws \Shippo\API\Models\Errors\SDKError */ - public function validate( - string $addressId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ValidateAddressResponse { - $request = new \Shippo\API\Models\Operations\ValidateAddressRequest(); - $request->addressId = $addressId; - $request->shippoApiVersion = $shippoApiVersion; + public function validate(string $addressId, ?string $shippoApiVersion = null): Components\Address + { + $request = new Operations\ValidateAddressRequest( + addressId: $addressId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/addresses/{AddressId}/validate', \Shippo\API\Models\Operations\ValidateAddressRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/addresses/{AddressId}/validate', Operations\ValidateAddressRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -204,28 +278,44 @@ public function validate( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ValidateAddress', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ValidateAddressResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->address = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Address', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Address', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/Batches.php b/src/Batches.php index d66b70b..00545d1 100644 --- a/src/Batches.php +++ b/src/Batches.php @@ -1,43 +1,68 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * Create a batch * * Creates a new batch object for purchasing shipping labels for many shipments at once. Batches are created asynchronously. This means that the API response won't include your batch shipments yet. You need to retrieve the batch later to verify that all batch shipments are valid. * - * @param \Shippo\API\Models\Components\BatchCreateRequest $batchCreateRequest + * @param Components\BatchCreateRequest $batchCreateRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateBatchResponse + * @return Components\Batch + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\BatchCreateRequest $batchCreateRequest, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateBatchResponse { - $request = new \Shippo\API\Models\Operations\CreateBatchRequest(); - $request->batchCreateRequest = $batchCreateRequest; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\BatchCreateRequest $batchCreateRequest, ?string $shippoApiVersion = null): Components\Batch + { + $request = new Operations\CreateBatchRequest( + batchCreateRequest: $batchCreateRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/batches'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'batchCreateRequest', 'json'); if ($body === null) { @@ -50,29 +75,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateBatch', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateBatchResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->batch = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Batch', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Batch', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -83,49 +123,63 @@ public function create( * status, for example, by passing a query param like `?object_results=creation_failed`.
* For more details on filtering results, see our guide on filtering. * - * @param string $batchId - * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetBatchResponse + * @param Operations\GetBatchRequest $request + * @return Components\Batch + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $batchId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetBatchResponse { - $request = new \Shippo\API\Models\Operations\GetBatchRequest(); - $request->batchId = $batchId; - $request->shippoApiVersion = $shippoApiVersion; + public function get(Operations\GetBatchRequest $request): Components\Batch + { $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/batches/{BatchId}', \Shippo\API\Models\Operations\GetBatchRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/batches/{BatchId}', Operations\GetBatchRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; + + $qp = Utils\Utils::getQueryParams(Operations\GetBatchRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetBatch', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetBatchResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->batch = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Batch', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Batch', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -133,22 +187,22 @@ public function get( * * Adds batch shipments to an existing batch. * + * @param array $requestBody * @param string $batchId - * @param array<\Shippo\API\Models\Components\BatchShipmentCreateRequest> $requestBody * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\AddShipmentsToBatchResponse + * @return Components\Batch + * @throws \Shippo\API\Models\Errors\SDKError */ - public function addShipments( - string $batchId, - array $requestBody, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\AddShipmentsToBatchResponse { - $request = new \Shippo\API\Models\Operations\AddShipmentsToBatchRequest(); - $request->batchId = $batchId; - $request->requestBody = $requestBody; - $request->shippoApiVersion = $shippoApiVersion; + public function addShipments(array $requestBody, string $batchId, ?string $shippoApiVersion = null): Components\Batch + { + $request = new Operations\AddShipmentsToBatchRequest( + batchId: $batchId, + requestBody: $requestBody, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/batches/{BatchId}/add_shipments', \Shippo\API\Models\Operations\AddShipmentsToBatchRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/batches/{BatchId}/add_shipments', Operations\AddShipmentsToBatchRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); if ($body === null) { @@ -161,29 +215,44 @@ public function addShipments( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('AddShipmentsToBatch', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\AddShipmentsToBatchResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->batch = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Batch', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Batch', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -196,17 +265,18 @@ public function addShipments( * * @param string $batchId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\PurchaseBatchResponse + * @return Components\Batch + * @throws \Shippo\API\Models\Errors\SDKError */ - public function purchase( - string $batchId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\PurchaseBatchResponse { - $request = new \Shippo\API\Models\Operations\PurchaseBatchRequest(); - $request->batchId = $batchId; - $request->shippoApiVersion = $shippoApiVersion; + public function purchase(string $batchId, ?string $shippoApiVersion = null): Components\Batch + { + $request = new Operations\PurchaseBatchRequest( + batchId: $batchId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/batches/{BatchId}/purchase', \Shippo\API\Models\Operations\PurchaseBatchRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/batches/{BatchId}/purchase', Operations\PurchaseBatchRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -214,29 +284,44 @@ public function purchase( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('PurchaseBatch', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\PurchaseBatchResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 202) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->batch = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Batch', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 202) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Batch', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -244,22 +329,22 @@ public function purchase( * * Removes shipments from an existing batch shipment. * - * @param string $batchId * @param array $requestBody + * @param string $batchId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\RemoveShipmentsFromBatchResponse + * @return Components\Batch + * @throws \Shippo\API\Models\Errors\SDKError */ - public function removeShipments( - string $batchId, - array $requestBody, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\RemoveShipmentsFromBatchResponse { - $request = new \Shippo\API\Models\Operations\RemoveShipmentsFromBatchRequest(); - $request->batchId = $batchId; - $request->requestBody = $requestBody; - $request->shippoApiVersion = $shippoApiVersion; + public function removeShipments(array $requestBody, string $batchId, ?string $shippoApiVersion = null): Components\Batch + { + $request = new Operations\RemoveShipmentsFromBatchRequest( + batchId: $batchId, + requestBody: $requestBody, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/batches/{BatchId}/remove_shipments', \Shippo\API\Models\Operations\RemoveShipmentsFromBatchRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/batches/{BatchId}/remove_shipments', Operations\RemoveShipmentsFromBatchRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); if ($body === null) { @@ -272,28 +357,44 @@ public function removeShipments( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('RemoveShipmentsFromBatch', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\RemoveShipmentsFromBatchResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->batch = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Batch', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Batch', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/CarrierAccounts.php b/src/CarrierAccounts.php index dc0fc8e..2a9acde 100644 --- a/src/CarrierAccounts.php +++ b/src/CarrierAccounts.php @@ -1,24 +1,48 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all carrier accounts @@ -29,45 +53,63 @@ public function __construct(SDKConfiguration $sdkConfig) * Using it appends the property `service_levels` to each carrier account.
* By default, if the query parameter is omitted, the `service_levels` property will not be included in the response. * - * @param \Shippo\API\Models\Operations\ListCarrierAccountsRequest $request - * @return \Shippo\API\Models\Operations\ListCarrierAccountsResponse + * @param ?Operations\ListCarrierAccountsRequest $request + * @return Components\CarrierAccountPaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?\Shippo\API\Models\Operations\ListCarrierAccountsRequest $request, - ): \Shippo\API\Models\Operations\ListCarrierAccountsResponse { + public function list(?Operations\ListCarrierAccountsRequest $request = null): Components\CarrierAccountPaginatedList + { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/carrier_accounts'); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListCarrierAccountsRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListCarrierAccountsRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListCarrierAccounts', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListCarrierAccountsResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->carrierAccountPaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CarrierAccountPaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CarrierAccountPaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -75,19 +117,20 @@ public function list( * * Creates a new carrier account or connects an existing carrier account to the Shippo account. * - * @param \Shippo\API\Models\Components\ConnectExistingOwnAccountRequest $connectExistingOwnAccountRequest + * @param Components\ConnectExistingOwnAccountRequest $connectExistingOwnAccountRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateCarrierAccountResponse + * @return Components\CarrierAccount + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\ConnectExistingOwnAccountRequest $connectExistingOwnAccountRequest, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateCarrierAccountResponse { - $request = new \Shippo\API\Models\Operations\CreateCarrierAccountRequest(); - $request->connectExistingOwnAccountRequest = $connectExistingOwnAccountRequest; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\ConnectExistingOwnAccountRequest $connectExistingOwnAccountRequest, ?string $shippoApiVersion = null): Components\CarrierAccount + { + $request = new Operations\CreateCarrierAccountRequest( + connectExistingOwnAccountRequest: $connectExistingOwnAccountRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/carrier_accounts'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'connectExistingOwnAccountRequest', 'json'); if ($body === null) { @@ -100,29 +143,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateCarrierAccount', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateCarrierAccountResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->carrierAccount = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CarrierAccount', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CarrierAccount', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -132,17 +190,18 @@ public function create( * * @param string $carrierAccountId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetCarrierAccountResponse + * @return Components\CarrierAccount + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $carrierAccountId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetCarrierAccountResponse { - $request = new \Shippo\API\Models\Operations\GetCarrierAccountRequest(); - $request->carrierAccountId = $carrierAccountId; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $carrierAccountId, ?string $shippoApiVersion = null): Components\CarrierAccount + { + $request = new Operations\GetCarrierAccountRequest( + carrierAccountId: $carrierAccountId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/carrier_accounts/{CarrierAccountId}', \Shippo\API\Models\Operations\GetCarrierAccountRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/carrier_accounts/{CarrierAccountId}', Operations\GetCarrierAccountRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -150,29 +209,44 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetCarrierAccount', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetCarrierAccountResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->carrierAccount = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CarrierAccount', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CarrierAccount', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -181,21 +255,21 @@ public function get( * Updates an existing carrier account object. The account_id and carrier can't be updated. This is because they form the unique identifier together. * * @param string $carrierAccountId + * @param ?Components\CarrierAccountBase $carrierAccountBase * @param ?string $shippoApiVersion - * @param ?\Shippo\API\Models\Components\CarrierAccountBase $carrierAccountBase - * @return \Shippo\API\Models\Operations\UpdateCarrierAccountResponse + * @return Components\CarrierAccount + * @throws \Shippo\API\Models\Errors\SDKError */ - public function update( - string $carrierAccountId, - ?string $shippoApiVersion = null, - ?\Shippo\API\Models\Components\CarrierAccountBase $carrierAccountBase = null, - ): \Shippo\API\Models\Operations\UpdateCarrierAccountResponse { - $request = new \Shippo\API\Models\Operations\UpdateCarrierAccountRequest(); - $request->carrierAccountId = $carrierAccountId; - $request->shippoApiVersion = $shippoApiVersion; - $request->carrierAccountBase = $carrierAccountBase; + public function update(string $carrierAccountId, ?Components\CarrierAccountBase $carrierAccountBase = null, ?string $shippoApiVersion = null): Components\CarrierAccount + { + $request = new Operations\UpdateCarrierAccountRequest( + carrierAccountId: $carrierAccountId, + shippoApiVersion: $shippoApiVersion, + carrierAccountBase: $carrierAccountBase, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/carrier_accounts/{CarrierAccountId}', \Shippo\API\Models\Operations\UpdateCarrierAccountRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/carrier_accounts/{CarrierAccountId}', Operations\UpdateCarrierAccountRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'carrierAccountBase', 'json'); if ($body !== null) { @@ -207,29 +281,44 @@ public function update( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('PUT', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('PUT', $url); + $hookContext = new HookContext('UpdateCarrierAccount', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\UpdateCarrierAccountResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->carrierAccount = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CarrierAccount', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CarrierAccount', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -237,63 +326,89 @@ public function update( * * Used by client applications to setup or reconnect an existing carrier account with carriers that support OAuth 2.0 * - * @param string $carrierAccountObjectId - * @param string $redirectUri - * @param ?string $state - * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\InitiateOauth2SigninResponse + * @param Operations\InitiateOauth2SigninRequest $request + * @return Operations\InitiateOauth2SigninResponse + * @throws \Shippo\API\Models\Errors\SDKError */ - public function initiateOauth2Signin( - string $carrierAccountObjectId, - string $redirectUri, - ?string $state = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\InitiateOauth2SigninResponse { - $request = new \Shippo\API\Models\Operations\InitiateOauth2SigninRequest(); - $request->carrierAccountObjectId = $carrierAccountObjectId; - $request->redirectUri = $redirectUri; - $request->state = $state; - $request->shippoApiVersion = $shippoApiVersion; + public function initiateOauth2Signin(Operations\InitiateOauth2SigninRequest $request): Operations\InitiateOauth2SigninResponse + { $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/carrier_accounts/{CarrierAccountObjectId}/signin/initiate', \Shippo\API\Models\Operations\InitiateOauth2SigninRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/carrier_accounts/{CarrierAccountObjectId}/signin/initiate', Operations\InitiateOauth2SigninRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\InitiateOauth2SigninRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\InitiateOauth2SigninRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('InitiateOauth2Signin', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); + if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; + } + } + if ($statusCode == 302) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); - $response = new \Shippo\API\Models\Operations\InitiateOauth2SigninResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 302) { - $response->headers = $httpResponse->getHeaders(); - } elseif ($httpResponse->getStatusCode() === 400) { + return new Operations\InitiateOauth2SigninResponse(); + } elseif ($statusCode == 400) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->fourHundredApplicationJsonObject = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Operations\InitiateOauth2SigninResponseBody', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Errors\InitiateOauth2SigninResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($httpResponse->getStatusCode() === 401) { + } elseif ($statusCode == 401) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->fourHundredAndOneApplicationJsonObject = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Operations\InitiateOauth2SigninCarrierAccountsResponseBody', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Errors\InitiateOauth2SigninCarrierAccountsResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($httpResponse->getStatusCode() === 404) { + } elseif ($statusCode == 404) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->fourHundredAndFourApplicationJsonObject = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Operations\InitiateOauth2SigninCarrierAccountsResponseResponseBody', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Errors\InitiateOauth2SigninCarrierAccountsResponseResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } + } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -301,19 +416,20 @@ public function initiateOauth2Signin( * * Adds a Shippo carrier account * - * @param mixed $requestBody + * @param Components\CarrierAccountCanadaPostCreateRequest|Components\CarrierAccountChronopostCreateRequest|Components\CarrierAccountColissimoCreateRequest|Components\CarrierAccountCorreosCreateRequest|Components\CarrierAccountDeutschePostCreateRequest|Components\CarrierAccountDHLExpressCreateRequest|Components\CarrierAccountDpdDeCreateRequest|Components\CarrierAccountDPDUKCreateRequest|Components\CarrierAccountFedExCreateRequest|Components\CarrierAccountHermesUKCreateRequest|Components\CarrierAccountMondialRelayCreateRequest|Components\CarrierAccountPosteItalianeCreateRequest|Components\CarrierAccountUPSCreateRequest|Components\CarrierAccountUSPSCreateRequest|Components\CarrierAccountSendleCreateRequest $requestBody * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\RegisterCarrierAccountResponse + * @return Components\CarrierAccount + * @throws \Shippo\API\Models\Errors\SDKError */ - public function register( - mixed $requestBody, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\RegisterCarrierAccountResponse { - $request = new \Shippo\API\Models\Operations\RegisterCarrierAccountRequest(); - $request->requestBody = $requestBody; - $request->shippoApiVersion = $shippoApiVersion; + public function register(Components\CarrierAccountCanadaPostCreateRequest|Components\CarrierAccountChronopostCreateRequest|Components\CarrierAccountColissimoCreateRequest|Components\CarrierAccountCorreosCreateRequest|Components\CarrierAccountDeutschePostCreateRequest|Components\CarrierAccountDHLExpressCreateRequest|Components\CarrierAccountDpdDeCreateRequest|Components\CarrierAccountDPDUKCreateRequest|Components\CarrierAccountFedExCreateRequest|Components\CarrierAccountHermesUKCreateRequest|Components\CarrierAccountMondialRelayCreateRequest|Components\CarrierAccountPosteItalianeCreateRequest|Components\CarrierAccountUPSCreateRequest|Components\CarrierAccountUSPSCreateRequest|Components\CarrierAccountSendleCreateRequest $requestBody, ?string $shippoApiVersion = null): Components\CarrierAccount + { + $request = new Operations\RegisterCarrierAccountRequest( + requestBody: $requestBody, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/carrier_accounts/register/new'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); if ($body === null) { @@ -326,29 +442,44 @@ public function register( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('RegisterCarrierAccount', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\RegisterCarrierAccountResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->carrierAccount = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CarrierAccount', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CarrierAccount', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -356,49 +487,68 @@ public function register( * * Returns the registration status for the given account for the given carrier * - * @param \Shippo\API\Models\Operations\Carrier $carrier + * @param Operations\Carrier $carrier * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetCarrierRegistrationStatusResponse + * @return Components\CarrierAccountRegistrationStatus + * @throws \Shippo\API\Models\Errors\SDKError */ - public function getRegistrationStatus( - \Shippo\API\Models\Operations\Carrier $carrier, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetCarrierRegistrationStatusResponse { - $request = new \Shippo\API\Models\Operations\GetCarrierRegistrationStatusRequest(); - $request->carrier = $carrier; - $request->shippoApiVersion = $shippoApiVersion; + public function getRegistrationStatus(Operations\Carrier $carrier, ?string $shippoApiVersion = null): Components\CarrierAccountRegistrationStatus + { + $request = new Operations\GetCarrierRegistrationStatusRequest( + carrier: $carrier, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/carrier_accounts/reg-status'); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\GetCarrierRegistrationStatusRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\GetCarrierRegistrationStatusRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetCarrierRegistrationStatus', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetCarrierRegistrationStatusResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->carrierAccountRegistrationStatus = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CarrierAccountRegistrationStatus', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CarrierAccountRegistrationStatus', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/CarrierParcelTemplates.php b/src/CarrierParcelTemplates.php index 15c400b..9a14d77 100644 --- a/src/CarrierParcelTemplates.php +++ b/src/CarrierParcelTemplates.php @@ -1,77 +1,124 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all carrier parcel templates * - * List all carrier parcel template objects.
Use the following query string params to filter the results as needed.
  • `include=all` (the default). Includes templates from all carriers
  • `include=user`. Includes templates only from carriers which the user has added (whether or not they're currently enabled)
  • `include=enabled`. includes templates only for carriers which the user has added and enabled
  • `carrier=*token*`. filter by specific carrier, e.g. fedex, usps
+ * List all carrier parcel template objects.
Use the following query string params to filter the results as needed.
+ *
    + *
  • `include=all` (the default). Includes templates from all carriers
  • + *
  • `include=user`. Includes templates only from carriers which the user has added (whether or not they're currently enabled)
  • + *
  • `include=enabled`. includes templates only for carriers which the user has added and enabled
  • + *
  • `carrier=*token*`. filter by specific carrier, e.g. fedex, usps
  • + *
* - * @param ?\Shippo\API\Models\Operations\IncludeT $include + * @param ?Operations\IncludeT $include * @param ?string $carrier * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListCarrierParcelTemplatesResponse + * @return Components\CarrierParcelTemplateList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?\Shippo\API\Models\Operations\IncludeT $include = null, - ?string $carrier = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListCarrierParcelTemplatesResponse { - $request = new \Shippo\API\Models\Operations\ListCarrierParcelTemplatesRequest(); - $request->include = $include; - $request->carrier = $carrier; - $request->shippoApiVersion = $shippoApiVersion; + public function list(?Operations\IncludeT $include = null, ?string $carrier = null, ?string $shippoApiVersion = null): Components\CarrierParcelTemplateList + { + $request = new Operations\ListCarrierParcelTemplatesRequest( + include: $include, + carrier: $carrier, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/parcel-templates'); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListCarrierParcelTemplatesRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListCarrierParcelTemplatesRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListCarrierParcelTemplates', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListCarrierParcelTemplatesResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->carrierParcelTemplateList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CarrierParcelTemplateList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CarrierParcelTemplateList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -81,17 +128,18 @@ public function list( * * @param string $carrierParcelTemplateToken * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetCarrierParcelTemplateResponse + * @return Components\CarrierParcelTemplate + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $carrierParcelTemplateToken, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetCarrierParcelTemplateResponse { - $request = new \Shippo\API\Models\Operations\GetCarrierParcelTemplateRequest(); - $request->carrierParcelTemplateToken = $carrierParcelTemplateToken; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $carrierParcelTemplateToken, ?string $shippoApiVersion = null): Components\CarrierParcelTemplate + { + $request = new Operations\GetCarrierParcelTemplateRequest( + carrierParcelTemplateToken: $carrierParcelTemplateToken, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/parcel-templates/{CarrierParcelTemplateToken}', \Shippo\API\Models\Operations\GetCarrierParcelTemplateRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/parcel-templates/{CarrierParcelTemplateToken}', Operations\GetCarrierParcelTemplateRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -99,28 +147,44 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetCarrierParcelTemplate', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetCarrierParcelTemplateResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->carrierParcelTemplate = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CarrierParcelTemplate', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CarrierParcelTemplate', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/CustomsDeclarations.php b/src/CustomsDeclarations.php index 2cccea9..a414f1b 100644 --- a/src/CustomsDeclarations.php +++ b/src/CustomsDeclarations.php @@ -1,24 +1,48 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all customs declarations @@ -28,50 +52,67 @@ public function __construct(SDKConfiguration $sdkConfig) * @param ?int $page * @param ?int $results * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListCustomsDeclarationsResponse + * @return Components\CustomsDeclarationPaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?int $page = null, - ?int $results = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListCustomsDeclarationsResponse { - $request = new \Shippo\API\Models\Operations\ListCustomsDeclarationsRequest(); - $request->page = $page; - $request->results = $results; - $request->shippoApiVersion = $shippoApiVersion; + public function list(?int $page = null, ?int $results = null, ?string $shippoApiVersion = null): Components\CustomsDeclarationPaginatedList + { + $request = new Operations\ListCustomsDeclarationsRequest( + page: $page, + results: $results, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/customs/declarations'); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListCustomsDeclarationsRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListCustomsDeclarationsRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListCustomsDeclarations', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListCustomsDeclarationsResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->customsDeclarationPaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CustomsDeclarationPaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CustomsDeclarationPaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -79,19 +120,20 @@ public function list( * * Creates a new customs declaration object * - * @param \Shippo\API\Models\Components\CustomsDeclarationCreateRequest $customsDeclarationCreateRequest + * @param Components\CustomsDeclarationCreateRequest $customsDeclarationCreateRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateCustomsDeclarationResponse + * @return Components\CustomsDeclaration + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\CustomsDeclarationCreateRequest $customsDeclarationCreateRequest, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateCustomsDeclarationResponse { - $request = new \Shippo\API\Models\Operations\CreateCustomsDeclarationRequest(); - $request->customsDeclarationCreateRequest = $customsDeclarationCreateRequest; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\CustomsDeclarationCreateRequest $customsDeclarationCreateRequest, ?string $shippoApiVersion = null): Components\CustomsDeclaration + { + $request = new Operations\CreateCustomsDeclarationRequest( + customsDeclarationCreateRequest: $customsDeclarationCreateRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/customs/declarations'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'customsDeclarationCreateRequest', 'json'); if ($body === null) { @@ -104,29 +146,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateCustomsDeclaration', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateCustomsDeclarationResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->customsDeclaration = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CustomsDeclaration', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CustomsDeclaration', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -137,49 +194,67 @@ public function create( * @param string $customsDeclarationId * @param ?int $page * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetCustomsDeclarationResponse + * @return Components\CustomsDeclaration + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $customsDeclarationId, - ?int $page = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetCustomsDeclarationResponse { - $request = new \Shippo\API\Models\Operations\GetCustomsDeclarationRequest(); - $request->customsDeclarationId = $customsDeclarationId; - $request->page = $page; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $customsDeclarationId, ?int $page = null, ?string $shippoApiVersion = null): Components\CustomsDeclaration + { + $request = new Operations\GetCustomsDeclarationRequest( + customsDeclarationId: $customsDeclarationId, + page: $page, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/customs/declarations/{CustomsDeclarationId}', \Shippo\API\Models\Operations\GetCustomsDeclarationRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/customs/declarations/{CustomsDeclarationId}', Operations\GetCustomsDeclarationRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\GetCustomsDeclarationRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\GetCustomsDeclarationRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetCustomsDeclaration', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetCustomsDeclarationResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->customsDeclaration = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CustomsDeclaration', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CustomsDeclaration', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/CustomsItems.php b/src/CustomsItems.php index 4bfe4dd..2d511ff 100644 --- a/src/CustomsItems.php +++ b/src/CustomsItems.php @@ -1,24 +1,48 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all customs items @@ -28,50 +52,67 @@ public function __construct(SDKConfiguration $sdkConfig) * @param ?int $page * @param ?int $results * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListCustomsItemsResponse + * @return Components\CustomsItemPaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?int $page = null, - ?int $results = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListCustomsItemsResponse { - $request = new \Shippo\API\Models\Operations\ListCustomsItemsRequest(); - $request->page = $page; - $request->results = $results; - $request->shippoApiVersion = $shippoApiVersion; + public function list(?int $page = null, ?int $results = null, ?string $shippoApiVersion = null): Components\CustomsItemPaginatedList + { + $request = new Operations\ListCustomsItemsRequest( + page: $page, + results: $results, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/customs/items'); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListCustomsItemsRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListCustomsItemsRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListCustomsItems', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListCustomsItemsResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->customsItemPaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CustomsItemPaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CustomsItemPaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -79,19 +120,20 @@ public function list( * * Creates a new customs item object. * - * @param \Shippo\API\Models\Components\CustomsItemCreateRequest $customsItemCreateRequest + * @param Components\CustomsItemCreateRequest $customsItemCreateRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateCustomsItemResponse + * @return Components\CustomsItem + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\CustomsItemCreateRequest $customsItemCreateRequest, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateCustomsItemResponse { - $request = new \Shippo\API\Models\Operations\CreateCustomsItemRequest(); - $request->customsItemCreateRequest = $customsItemCreateRequest; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\CustomsItemCreateRequest $customsItemCreateRequest, ?string $shippoApiVersion = null): Components\CustomsItem + { + $request = new Operations\CreateCustomsItemRequest( + customsItemCreateRequest: $customsItemCreateRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/customs/items'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'customsItemCreateRequest', 'json'); if ($body === null) { @@ -104,29 +146,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateCustomsItem', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateCustomsItemResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->customsItem = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CustomsItem', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CustomsItem', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -137,49 +194,67 @@ public function create( * @param string $customsItemId * @param ?int $page * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetCustomsItemResponse + * @return Components\CustomsItem + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $customsItemId, - ?int $page = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetCustomsItemResponse { - $request = new \Shippo\API\Models\Operations\GetCustomsItemRequest(); - $request->customsItemId = $customsItemId; - $request->page = $page; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $customsItemId, ?int $page = null, ?string $shippoApiVersion = null): Components\CustomsItem + { + $request = new Operations\GetCustomsItemRequest( + customsItemId: $customsItemId, + page: $page, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/customs/items/{CustomsItemId}', \Shippo\API\Models\Operations\GetCustomsItemRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/customs/items/{CustomsItemId}', Operations\GetCustomsItemRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\GetCustomsItemRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\GetCustomsItemRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetCustomsItem', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetCustomsItemResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->customsItem = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\CustomsItem', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\CustomsItem', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/Hooks/AfterErrorContext.php b/src/Hooks/AfterErrorContext.php new file mode 100644 index 0000000..9fbd9a0 --- /dev/null +++ b/src/Hooks/AfterErrorContext.php @@ -0,0 +1,32 @@ +operationID, $hookCtx->oauth2Scopes, $hookCtx->securitySource); + } + + /** + * @param string $name + * @param array $args + * @return mixed + */ + public function __call($name, $args): mixed + { + if ($name === 'securitySource') { + return call_user_func_array($this->securitySource, $args); + } + + return null; + } +} diff --git a/src/Hooks/AfterErrorHook.php b/src/Hooks/AfterErrorHook.php new file mode 100644 index 0000000..f079ac8 --- /dev/null +++ b/src/Hooks/AfterErrorHook.php @@ -0,0 +1,17 @@ +operationID, $hookCtx->oauth2Scopes, $hookCtx->securitySource); + } +} diff --git a/src/Hooks/AfterSuccessHook.php b/src/Hooks/AfterSuccessHook.php new file mode 100644 index 0000000..5cfe525 --- /dev/null +++ b/src/Hooks/AfterSuccessHook.php @@ -0,0 +1,17 @@ +operationID, $hookCtx->oauth2Scopes, $hookCtx->securitySource); + } + + /** + * @param string $name + * @param array $args + * @return mixed + */ + public function __call($name, $args): mixed + { + if ($name === 'securitySource') { + return call_user_func_array($this->securitySource, $args); + } + + return null; + } +} diff --git a/src/Hooks/BeforeRequestHook.php b/src/Hooks/BeforeRequestHook.php new file mode 100644 index 0000000..4020bfc --- /dev/null +++ b/src/Hooks/BeforeRequestHook.php @@ -0,0 +1,17 @@ +clientID = $clientID; + $this->clientSecret = $clientSecret; + $this->tokenURL = $tokenURL; + } +} diff --git a/src/Hooks/ErrorResponseContext.php b/src/Hooks/ErrorResponseContext.php new file mode 100644 index 0000000..5b295b6 --- /dev/null +++ b/src/Hooks/ErrorResponseContext.php @@ -0,0 +1,23 @@ +response = $response; + $this->e = $e; + } +} diff --git a/src/Hooks/FailEarlyException.php b/src/Hooks/FailEarlyException.php new file mode 100644 index 0000000..11f769a --- /dev/null +++ b/src/Hooks/FailEarlyException.php @@ -0,0 +1,14 @@ + $oauth2Scopes; + */ + public ?array $oauth2Scopes; + /** + * @var ?\Closure(): ?mixed $securitySource + */ + public ?\Closure $securitySource; + + /** + * @param string $operationID + * @param ?array $oauth2Scopes + * @param ?\Closure(): ?mixed $securitySource + */ + public function __construct(string $operationID, ?array $oauth2Scopes, ?\Closure $securitySource) + { + $this->operationID = $operationID; + $this->oauth2Scopes = $oauth2Scopes; + $this->securitySource = $securitySource; + } + /** + * @param string $name + * @param array $args + * @return mixed + */ + public function __call($name, $args): mixed + { + if ($name === 'securitySource') { + return call_user_func_array($this->securitySource, $args); + } + + return null; + } +} diff --git a/src/Hooks/HookRegistration.php b/src/Hooks/HookRegistration.php new file mode 100644 index 0000000..c8ce8c3 --- /dev/null +++ b/src/Hooks/HookRegistration.php @@ -0,0 +1,28 @@ +registerSDKInitHook($myHook); + // $hooks->registerBeforeRequestHook($myHook); + // $hooks->registerAfterSuccessHook($myHook); + // $hooks->registerAfterErrorHook($myHook); + } +} diff --git a/src/Hooks/Hooks.php b/src/Hooks/Hooks.php new file mode 100644 index 0000000..1b7ab60 --- /dev/null +++ b/src/Hooks/Hooks.php @@ -0,0 +1,20 @@ + $sdkInitHooks + */ + private array $sdkInitHooks = []; + /** + * @var array $beforeRequestHooks + */ + private array $beforeRequestHooks = []; + /** + * @var array $afterSuccessHooks + */ + private array $afterSuccessHooks = []; + /** + * @var array $afterErrorHooks + */ + private array $afterErrorHooks = []; + + public function __construct() + { + HookRegistration::initHooks($this); + } + + public function registerSDKInitHook(SDKInitHook $hook): void + { + $this->sdkInitHooks[] = $hook; + } + + public function registerBeforeRequestHook(BeforeRequestHook $hook): void + { + $this->beforeRequestHooks[] = $hook; + } + + public function registerAfterSuccessHook(AfterSuccessHook $hook): void + { + $this->afterSuccessHooks[] = $hook; + } + + public function registerAfterErrorHook(AfterErrorHook $hook): void + { + $this->afterErrorHooks[] = $hook; + } + + public function sdkInit(string $baseUrl, \GuzzleHttp\ClientInterface $client): SDKRequestContext + { + $rc = new SDKRequestContext($baseUrl, $client); + foreach ($this->sdkInitHooks as $hook) { + try { + $rc = $hook->sdkInit($rc->url, $rc->client); + } catch (\Exception $e) { + throw new \Exception('An error occurred while calling SDKInit hook.', $e->getCode(), $e); + } + + } + + return $rc; + } + + public function beforeRequest(BeforeRequestContext $context, RequestInterface $request): RequestInterface + { + foreach ($this->beforeRequestHooks as $hook) { + try { + $request = $hook->beforeRequest($context, $request); + } catch (\Exception $e) { + throw new \Exception('An error occurred while calling BeforeRequest hook.', $e->getCode(), $e); + } + } + + return $request; + } + + public function afterSuccess(AfterSuccessContext $context, ResponseInterface $response): ResponseInterface + { + foreach ($this->afterSuccessHooks as $hook) { + try { + $response = $hook->afterSuccess($context, $response); + } catch (\Exception $e) { + throw new \Exception('An error occurred while calling AfterSuccess hook.', $e->getCode(), $e); + } + } + + return $response; + } + + public function afterError(AfterErrorContext $context, ?ResponseInterface $response, ?\Throwable $exception): ResponseInterface + { + $errorContext = new ErrorResponseContext($response, $exception); + foreach ($this->afterErrorHooks as $hook) { + try { + $errorContext = $hook->afterError($context, $errorContext->response, $errorContext->e); + } catch (FailEarlyException $e) { + throw $e; + } catch (\Exception $e) { + throw new \Exception('An error occurred while calling AfterError hook.', $e->getCode(), $e); + } + } + if ($errorContext->e !== null) { + throw $errorContext->e; + } else { + return $errorContext->response; + } + } +} diff --git a/src/Hooks/SDKInitHook.php b/src/Hooks/SDKInitHook.php new file mode 100644 index 0000000..80aac02 --- /dev/null +++ b/src/Hooks/SDKInitHook.php @@ -0,0 +1,15 @@ +url = $url; + $this->client = $client; + } +} diff --git a/src/Hooks/Session.php b/src/Hooks/Session.php new file mode 100644 index 0000000..2daa3d1 --- /dev/null +++ b/src/Hooks/Session.php @@ -0,0 +1,37 @@ + scopes + */ + public array $scopes; + public ?LocalTime $expiresAt; + + /** + * @param Credentials $credentials + * @param string $token + * @param array $scopes + * @param ?LocalTime $expiresAt + */ + public function __construct(Credentials $credentials, string $token, array $scopes, ?LocalTime $expiresAt = null) + { + $this->credentials = $credentials; + $this->token = $token; + $this->scopes = $scopes; + $this->expiresAt = $expiresAt; + } +} diff --git a/src/Hooks/TokenResponse.php b/src/Hooks/TokenResponse.php new file mode 100644 index 0000000..cb97632 --- /dev/null +++ b/src/Hooks/TokenResponse.php @@ -0,0 +1,17 @@ +sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all manifests @@ -28,50 +52,67 @@ public function __construct(SDKConfiguration $sdkConfig) * @param ?int $page * @param ?int $results * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListManifestsResponse + * @return Components\ManifestPaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?int $page = null, - ?int $results = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListManifestsResponse { - $request = new \Shippo\API\Models\Operations\ListManifestsRequest(); - $request->page = $page; - $request->results = $results; - $request->shippoApiVersion = $shippoApiVersion; + public function list(?int $page = null, ?int $results = null, ?string $shippoApiVersion = null): Components\ManifestPaginatedList + { + $request = new Operations\ListManifestsRequest( + page: $page, + results: $results, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/manifests'); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListManifestsRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListManifestsRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListManifests', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListManifestsResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->manifestPaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\ManifestPaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\ManifestPaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -79,19 +120,20 @@ public function list( * * Creates a new manifest object. * - * @param \Shippo\API\Models\Components\ManifestCreateRequest $manifestCreateRequest + * @param Components\ManifestCreateRequest $manifestCreateRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateManifestResponse + * @return Components\Manifest + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\ManifestCreateRequest $manifestCreateRequest, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateManifestResponse { - $request = new \Shippo\API\Models\Operations\CreateManifestRequest(); - $request->manifestCreateRequest = $manifestCreateRequest; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\ManifestCreateRequest $manifestCreateRequest, ?string $shippoApiVersion = null): Components\Manifest + { + $request = new Operations\CreateManifestRequest( + manifestCreateRequest: $manifestCreateRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/manifests'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'manifestCreateRequest', 'json'); if ($body === null) { @@ -104,29 +146,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateManifest', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateManifestResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->manifest = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Manifest', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Manifest', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -136,17 +193,18 @@ public function create( * * @param string $manifestId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetManifestResponse + * @return Components\Manifest + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $manifestId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetManifestResponse { - $request = new \Shippo\API\Models\Operations\GetManifestRequest(); - $request->manifestId = $manifestId; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $manifestId, ?string $shippoApiVersion = null): Components\Manifest + { + $request = new Operations\GetManifestRequest( + manifestId: $manifestId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/manifests/{ManifestId}', \Shippo\API\Models\Operations\GetManifestRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/manifests/{ManifestId}', Operations\GetManifestRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -154,28 +212,44 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetManifest', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetManifestResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->manifest = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Manifest', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Manifest', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/Models/Components/Address.php b/src/Models/Components/Address.php index 6da2b2f..97b1059 100644 --- a/src/Models/Components/Address.php +++ b/src/Models/Components/Address.php @@ -1,7 +1,7 @@ Official ISO Website. + * If using country names, please ensure they are spelled correctly and in English. Country names are converted to country codes. + * Refer to this guide for a list of country codes. * Sending a country is always required. * * @var string $country */ - #[\JMS\Serializer\Annotation\SerializedName('country')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('country')] public string $country; /** @@ -140,9 +131,8 @@ class Address * * @var ?string $phone */ - #[\JMS\Serializer\Annotation\SerializedName('phone')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('phone')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $phone = null; /** @@ -150,14 +140,16 @@ class Address * * @var ?string $email */ - #[\JMS\Serializer\Annotation\SerializedName('email')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('email')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $email = null; - #[\JMS\Serializer\Annotation\SerializedName('is_residential')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?bool $isResidential + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('is_residential')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $isResidential = null; /** @@ -167,9 +159,8 @@ class Address * * @var ?string $metadata */ - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; /** @@ -180,39 +171,37 @@ class Address * * @var ?bool $isComplete */ - #[\JMS\Serializer\Annotation\SerializedName('is_complete')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('is_complete')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $isComplete = null; /** * Latitude of address * - * @var mixed $latitude + * @var float|string|null $latitude */ - #[\JMS\Serializer\Annotation\SerializedName('latitude')] - #[\JMS\Serializer\Annotation\Type('mixed')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] - public mixed $latitude = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('latitude')] + #[\Speakeasy\Serializer\Annotation\Type('float|string')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public float|string|null $latitude = null; /** * Longitude of address * - * @var mixed $longitude + * @var float|string|null $longitude */ - #[\JMS\Serializer\Annotation\SerializedName('longitude')] - #[\JMS\Serializer\Annotation\Type('mixed')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] - public mixed $longitude = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('longitude')] + #[\Speakeasy\Serializer\Annotation\Type('float|string')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public float|string|null $longitude = null; /** * Date and time of Address creation. * * @var ?\DateTime $objectCreated */ - #[\JMS\Serializer\Annotation\SerializedName('object_created')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectCreated = null; /** @@ -222,9 +211,8 @@ class Address * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; /** @@ -232,9 +220,8 @@ class Address * * @var ?string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectOwner = null; /** @@ -245,9 +232,8 @@ class Address * * @var ?\DateTime $objectUpdated */ - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectUpdated = null; /** @@ -255,11 +241,11 @@ class Address * * generated during validation. Children keys are is_valid(boolean) and messages(array). * - * @var ?\Shippo\API\Models\Components\AddressValidationResults $validationResults + * @var ?AddressValidationResults $validationResults */ - #[\JMS\Serializer\Annotation\SerializedName('validation_results')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\AddressValidationResults')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('validation_results')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\AddressValidationResults|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?AddressValidationResults $validationResults = null; /** @@ -267,35 +253,59 @@ class Address * * @var ?bool $test */ - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; - public function __construct() + /** + * @param string $country + * @param ?string $name + * @param ?string $company + * @param ?string $street1 + * @param ?string $street2 + * @param ?string $street3 + * @param ?string $streetNo + * @param ?string $city + * @param ?string $state + * @param ?string $zip + * @param ?string $phone + * @param ?string $email + * @param ?bool $isResidential + * @param ?string $metadata + * @param ?bool $isComplete + * @param float|string|null $latitude + * @param float|string|null $longitude + * @param ?\DateTime $objectCreated + * @param ?string $objectId + * @param ?string $objectOwner + * @param ?\DateTime $objectUpdated + * @param ?AddressValidationResults $validationResults + * @param ?bool $test + */ + public function __construct(string $country, ?string $name = null, ?string $company = null, ?string $street1 = null, ?string $street2 = null, ?string $street3 = null, ?string $streetNo = null, ?string $city = null, ?string $state = null, ?string $zip = null, ?string $phone = null, ?string $email = null, ?bool $isResidential = null, ?string $metadata = null, ?bool $isComplete = null, float|string|null $latitude = null, float|string|null $longitude = null, ?\DateTime $objectCreated = null, ?string $objectId = null, ?string $objectOwner = null, ?\DateTime $objectUpdated = null, ?AddressValidationResults $validationResults = null, ?bool $test = null) { - $this->name = null; - $this->company = null; - $this->street1 = null; - $this->street2 = null; - $this->street3 = null; - $this->streetNo = null; - $this->city = null; - $this->state = null; - $this->zip = null; - $this->country = ''; - $this->phone = null; - $this->email = null; - $this->isResidential = null; - $this->metadata = null; - $this->isComplete = null; - $this->latitude = null; - $this->longitude = null; - $this->objectCreated = null; - $this->objectId = null; - $this->objectOwner = null; - $this->objectUpdated = null; - $this->validationResults = null; - $this->test = null; + $this->country = $country; + $this->name = $name; + $this->company = $company; + $this->street1 = $street1; + $this->street2 = $street2; + $this->street3 = $street3; + $this->streetNo = $streetNo; + $this->city = $city; + $this->state = $state; + $this->zip = $zip; + $this->phone = $phone; + $this->email = $email; + $this->isResidential = $isResidential; + $this->metadata = $metadata; + $this->isComplete = $isComplete; + $this->latitude = $latitude; + $this->longitude = $longitude; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->objectUpdated = $objectUpdated; + $this->validationResults = $validationResults; + $this->test = $test; } } \ No newline at end of file diff --git a/src/Models/Components/AddressCompleteCreateRequest.php b/src/Models/Components/AddressCompleteCreateRequest.php index bb92072..d6b0287 100644 --- a/src/Models/Components/AddressCompleteCreateRequest.php +++ b/src/Models/Components/AddressCompleteCreateRequest.php @@ -1,7 +1,7 @@ Official ISO Website. + * If using country names, please ensure they are spelled correctly and in English. Country names are converted to country codes. + * Refer to this guide for a list of country codes. * Sending a country is always required. * * @var string $country */ - #[\JMS\Serializer\Annotation\SerializedName('country')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('country')] public string $country; /** @@ -135,9 +126,8 @@ class AddressCompleteCreateRequest * * @var ?string $phone */ - #[\JMS\Serializer\Annotation\SerializedName('phone')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('phone')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $phone = null; /** @@ -145,14 +135,16 @@ class AddressCompleteCreateRequest * * @var ?string $email */ - #[\JMS\Serializer\Annotation\SerializedName('email')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('email')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $email = null; - #[\JMS\Serializer\Annotation\SerializedName('is_residential')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?bool $isResidential + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('is_residential')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $isResidential = null; /** @@ -162,32 +154,51 @@ class AddressCompleteCreateRequest * * @var ?string $metadata */ - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; - #[\JMS\Serializer\Annotation\SerializedName('validate')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?bool $validate + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('validate')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $validate = null; - public function __construct() + /** + * @param string $name + * @param string $street1 + * @param string $city + * @param string $state + * @param string $zip + * @param string $country + * @param ?string $company + * @param ?string $street2 + * @param ?string $street3 + * @param ?string $streetNo + * @param ?string $phone + * @param ?string $email + * @param ?bool $isResidential + * @param ?string $metadata + * @param ?bool $validate + */ + public function __construct(string $name, string $street1, string $city, string $state, string $zip, string $country, ?string $company = null, ?string $street2 = null, ?string $street3 = null, ?string $streetNo = null, ?string $phone = null, ?string $email = null, ?bool $isResidential = null, ?string $metadata = null, ?bool $validate = null) { - $this->name = ''; - $this->company = null; - $this->street1 = ''; - $this->street2 = null; - $this->street3 = null; - $this->streetNo = null; - $this->city = ''; - $this->state = ''; - $this->zip = ''; - $this->country = ''; - $this->phone = null; - $this->email = null; - $this->isResidential = null; - $this->metadata = null; - $this->validate = null; + $this->name = $name; + $this->street1 = $street1; + $this->city = $city; + $this->state = $state; + $this->zip = $zip; + $this->country = $country; + $this->company = $company; + $this->street2 = $street2; + $this->street3 = $street3; + $this->streetNo = $streetNo; + $this->phone = $phone; + $this->email = $email; + $this->isResidential = $isResidential; + $this->metadata = $metadata; + $this->validate = $validate; } } \ No newline at end of file diff --git a/src/Models/Components/AddressCreateRequest.php b/src/Models/Components/AddressCreateRequest.php index 1ec99cd..01adb39 100644 --- a/src/Models/Components/AddressCreateRequest.php +++ b/src/Models/Components/AddressCreateRequest.php @@ -1,7 +1,7 @@ Official ISO Website. + * If using country names, please ensure they are spelled correctly and in English. Country names are converted to country codes. + * Refer to this guide for a list of country codes. * Sending a country is always required. * * @var string $country */ - #[\JMS\Serializer\Annotation\SerializedName('country')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('country')] public string $country; /** @@ -140,9 +131,8 @@ class AddressCreateRequest * * @var ?string $phone */ - #[\JMS\Serializer\Annotation\SerializedName('phone')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('phone')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $phone = null; /** @@ -150,14 +140,16 @@ class AddressCreateRequest * * @var ?string $email */ - #[\JMS\Serializer\Annotation\SerializedName('email')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('email')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $email = null; - #[\JMS\Serializer\Annotation\SerializedName('is_residential')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?bool $isResidential + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('is_residential')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $isResidential = null; /** @@ -167,9 +159,8 @@ class AddressCreateRequest * * @var ?string $metadata */ - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; /** @@ -177,27 +168,43 @@ class AddressCreateRequest * * @var ?bool $validate */ - #[\JMS\Serializer\Annotation\SerializedName('validate')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('validate')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $validate = null; - public function __construct() + /** + * @param string $country + * @param ?string $name + * @param ?string $company + * @param ?string $street1 + * @param ?string $street2 + * @param ?string $street3 + * @param ?string $streetNo + * @param ?string $city + * @param ?string $state + * @param ?string $zip + * @param ?string $phone + * @param ?string $email + * @param ?bool $isResidential + * @param ?string $metadata + * @param ?bool $validate + */ + public function __construct(string $country, ?string $name = null, ?string $company = null, ?string $street1 = null, ?string $street2 = null, ?string $street3 = null, ?string $streetNo = null, ?string $city = null, ?string $state = null, ?string $zip = null, ?string $phone = null, ?string $email = null, ?bool $isResidential = null, ?string $metadata = null, ?bool $validate = null) { - $this->name = null; - $this->company = null; - $this->street1 = null; - $this->street2 = null; - $this->street3 = null; - $this->streetNo = null; - $this->city = null; - $this->state = null; - $this->zip = null; - $this->country = ''; - $this->phone = null; - $this->email = null; - $this->isResidential = null; - $this->metadata = null; - $this->validate = null; + $this->country = $country; + $this->name = $name; + $this->company = $company; + $this->street1 = $street1; + $this->street2 = $street2; + $this->street3 = $street3; + $this->streetNo = $streetNo; + $this->city = $city; + $this->state = $state; + $this->zip = $zip; + $this->phone = $phone; + $this->email = $email; + $this->isResidential = $isResidential; + $this->metadata = $metadata; + $this->validate = $validate; } } \ No newline at end of file diff --git a/src/Models/Components/AddressImporter.php b/src/Models/Components/AddressImporter.php index 37b6e98..3ebcec6 100644 --- a/src/Models/Components/AddressImporter.php +++ b/src/Models/Components/AddressImporter.php @@ -1,7 +1,7 @@ name = null; - $this->company = null; - $this->street1 = null; - $this->street2 = null; - $this->street3 = null; - $this->streetNo = null; - $this->city = null; - $this->state = null; - $this->zip = null; - $this->country = null; - $this->phone = null; - $this->email = null; - $this->isResidential = null; + $this->name = $name; + $this->company = $company; + $this->street1 = $street1; + $this->street2 = $street2; + $this->street3 = $street3; + $this->streetNo = $streetNo; + $this->city = $city; + $this->state = $state; + $this->zip = $zip; + $this->country = $country; + $this->phone = $phone; + $this->email = $email; + $this->isResidential = $isResidential; } } \ No newline at end of file diff --git a/src/Models/Components/AddressPaginatedList.php b/src/Models/Components/AddressPaginatedList.php index 7297b41..aa06a0c 100644 --- a/src/Models/Components/AddressPaginatedList.php +++ b/src/Models/Components/AddressPaginatedList.php @@ -1,7 +1,7 @@ $results + * @var ?array
$results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Address>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array
$results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/AddressValidationResults.php b/src/Models/Components/AddressValidationResults.php index bc3aca0..a2aa611 100644 --- a/src/Models/Components/AddressValidationResults.php +++ b/src/Models/Components/AddressValidationResults.php @@ -1,7 +1,7 @@ $messages + * @var ?array $messages */ - #[\JMS\Serializer\Annotation\SerializedName('messages')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('messages')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\AddressValidationResultsMessage>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $messages = null; - public function __construct() + /** + * @param ?bool $isValid + * @param ?array $messages + */ + public function __construct(?bool $isValid = null, ?array $messages = null) { - $this->isValid = null; - $this->messages = null; + $this->isValid = $isValid; + $this->messages = $messages; } } \ No newline at end of file diff --git a/src/Models/Components/AddressValidationResultsMessage.php b/src/Models/Components/AddressValidationResultsMessage.php index 21d9d2e..b2e71f5 100644 --- a/src/Models/Components/AddressValidationResultsMessage.php +++ b/src/Models/Components/AddressValidationResultsMessage.php @@ -1,7 +1,7 @@ code = null; - $this->source = null; - $this->text = null; - $this->type = null; + $this->code = $code; + $this->source = $source; + $this->text = $text; + $this->type = $type; } } \ No newline at end of file diff --git a/src/Models/Components/AddressValidationResultsMessageCodeEnum.php b/src/Models/Components/AddressValidationResultsMessageCodeEnum.php index ca14470..761ad7e 100644 --- a/src/Models/Components/AddressValidationResultsMessageCodeEnum.php +++ b/src/Models/Components/AddressValidationResultsMessageCodeEnum.php @@ -1,7 +1,7 @@ ')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('recipient_type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\RecipientType|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?RecipientType $recipientType = null; - public function __construct() + /** + * @param ?bool $containsAlcohol + * @param ?RecipientType $recipientType + */ + public function __construct(?bool $containsAlcohol = null, ?RecipientType $recipientType = null) { - $this->containsAlcohol = null; - $this->recipientType = null; + $this->containsAlcohol = $containsAlcohol; + $this->recipientType = $recipientType; } } \ No newline at end of file diff --git a/src/Models/Components/AncillaryEndorsement.php b/src/Models/Components/AncillaryEndorsement.php index 332bfc9..52c65b5 100644 --- a/src/Models/Components/AncillaryEndorsement.php +++ b/src/Models/Components/AncillaryEndorsement.php @@ -1,7 +1,7 @@ ')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CarrierAccountWithExtraInfoType|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?CarrierAccountWithExtraInfoType $type = null; /** * Current authentication status. Possible values: 'disconnected' (authorization lost, reconnect needed), 'connected' (authorized and active), 'authorization_pending' (awaiting initial authorization flow). * - * @var ?\Shippo\API\Models\Components\CarrierAccountWithExtraInfoStatus $status + * @var ?CarrierAccountWithExtraInfoStatus $status */ - #[\JMS\Serializer\Annotation\SerializedName('status')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CarrierAccountWithExtraInfoStatus|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?CarrierAccountWithExtraInfoStatus $status = null; - public function __construct() + /** + * @param ?CarrierAccountWithExtraInfoType $type + * @param ?CarrierAccountWithExtraInfoStatus $status + */ + public function __construct(?CarrierAccountWithExtraInfoType $type = null, ?CarrierAccountWithExtraInfoStatus $status = null) { - $this->type = null; - $this->status = null; + $this->type = $type; + $this->status = $status; } } \ No newline at end of file diff --git a/src/Models/Components/Batch.php b/src/Models/Components/Batch.php index 327cbde..82757d7 100644 --- a/src/Models/Components/Batch.php +++ b/src/Models/Components/Batch.php @@ -1,7 +1,7 @@ the Shippo dashboard. * - * @var ?\Shippo\API\Models\Components\LabelFileTypeEnum $labelFiletype + * @var ?LabelFileTypeEnum $labelFiletype */ - #[\JMS\Serializer\Annotation\SerializedName('label_filetype')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('label_filetype')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\LabelFileTypeEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?LabelFileTypeEnum $labelFiletype = null; /** @@ -52,13 +50,16 @@ class Batch * * @var ?string $metadata */ - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; - #[\JMS\Serializer\Annotation\SerializedName('batch_shipments')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\BatchShipmentPaginatedList')] + /** + * + * @var BatchShipmentPaginatedList $batchShipments + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('batch_shipments')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\BatchShipmentPaginatedList')] public BatchShipmentPaginatedList $batchShipments; /** @@ -66,8 +67,8 @@ class Batch * * @var array $labelUrl */ - #[\JMS\Serializer\Annotation\SerializedName('label_url')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('label_url')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $labelUrl; /** @@ -75,8 +76,7 @@ class Batch * * @var string $objectCreated */ - #[\JMS\Serializer\Annotation\SerializedName('object_created')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] public string $objectCreated; /** @@ -84,8 +84,7 @@ class Batch * * @var string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] public string $objectId; /** @@ -93,17 +92,16 @@ class Batch * * @var string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] public string $objectOwner; /** * An object containing the following counts:
`creation_succeeded`
`creation_failed`
`purchase_succeeded`
`purchase_failed` * - * @var \Shippo\API\Models\Components\ObjectResults $objectResults + * @var ObjectResults $objectResults */ - #[\JMS\Serializer\Annotation\SerializedName('object_results')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\ObjectResults')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_results')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ObjectResults')] public ObjectResults $objectResults; /** @@ -111,8 +109,7 @@ class Batch * * @var string $objectUpdated */ - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] public string $objectUpdated; /** @@ -123,31 +120,49 @@ class Batch * Batches that are in the `PURCHASING` state are being purchased
* `PURCHASED` batches are finished purchasing. * - * @var \Shippo\API\Models\Components\BatchStatus $status + * @var BatchStatus $status */ - #[\JMS\Serializer\Annotation\SerializedName('status')] - #[\JMS\Serializer\Annotation\Type('enum')] + #[\Speakeasy\Serializer\Annotation\SerializedName('status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\BatchStatus')] public BatchStatus $status; - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?bool $test + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; - public function __construct() + /** + * @param string $defaultCarrierAccount + * @param string $defaultServicelevelToken + * @param BatchShipmentPaginatedList $batchShipments + * @param array $labelUrl + * @param string $objectCreated + * @param string $objectId + * @param string $objectOwner + * @param ObjectResults $objectResults + * @param string $objectUpdated + * @param BatchStatus $status + * @param ?LabelFileTypeEnum $labelFiletype + * @param ?string $metadata + * @param ?bool $test + */ + public function __construct(string $defaultCarrierAccount, string $defaultServicelevelToken, BatchShipmentPaginatedList $batchShipments, array $labelUrl, string $objectCreated, string $objectId, string $objectOwner, ObjectResults $objectResults, string $objectUpdated, BatchStatus $status, ?LabelFileTypeEnum $labelFiletype = null, ?string $metadata = null, ?bool $test = null) { - $this->defaultCarrierAccount = ''; - $this->defaultServicelevelToken = ''; - $this->labelFiletype = null; - $this->metadata = null; - $this->batchShipments = new \Shippo\API\Models\Components\BatchShipmentPaginatedList(); - $this->labelUrl = []; - $this->objectCreated = ''; - $this->objectId = ''; - $this->objectOwner = ''; - $this->objectResults = new \Shippo\API\Models\Components\ObjectResults(); - $this->objectUpdated = ''; - $this->status = \Shippo\API\Models\Components\BatchStatus::Validating; - $this->test = null; + $this->defaultCarrierAccount = $defaultCarrierAccount; + $this->defaultServicelevelToken = $defaultServicelevelToken; + $this->batchShipments = $batchShipments; + $this->labelUrl = $labelUrl; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->objectResults = $objectResults; + $this->objectUpdated = $objectUpdated; + $this->status = $status; + $this->labelFiletype = $labelFiletype; + $this->metadata = $metadata; + $this->test = $test; } } \ No newline at end of file diff --git a/src/Models/Components/BatchCreateRequest.php b/src/Models/Components/BatchCreateRequest.php index 32abfd9..cab407b 100644 --- a/src/Models/Components/BatchCreateRequest.php +++ b/src/Models/Components/BatchCreateRequest.php @@ -1,7 +1,7 @@ the Shippo dashboard. * - * @var ?\Shippo\API\Models\Components\LabelFileTypeEnum $labelFiletype + * @var ?LabelFileTypeEnum $labelFiletype */ - #[\JMS\Serializer\Annotation\SerializedName('label_filetype')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('label_filetype')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\LabelFileTypeEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?LabelFileTypeEnum $labelFiletype = null; /** @@ -52,26 +50,32 @@ class BatchCreateRequest * * @var ?string $metadata */ - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; /** * Array of BatchShipment objects. The response keeps the same order as in the request array. * - * @var array<\Shippo\API\Models\Components\BatchShipmentCreateRequest> $batchShipments + * @var array $batchShipments */ - #[\JMS\Serializer\Annotation\SerializedName('batch_shipments')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('batch_shipments')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\BatchShipmentCreateRequest>')] public array $batchShipments; - public function __construct() + /** + * @param string $defaultCarrierAccount + * @param string $defaultServicelevelToken + * @param array $batchShipments + * @param ?LabelFileTypeEnum $labelFiletype + * @param ?string $metadata + */ + public function __construct(string $defaultCarrierAccount, string $defaultServicelevelToken, array $batchShipments, ?LabelFileTypeEnum $labelFiletype = null, ?string $metadata = null) { - $this->defaultCarrierAccount = ''; - $this->defaultServicelevelToken = ''; - $this->labelFiletype = null; - $this->metadata = null; - $this->batchShipments = []; + $this->defaultCarrierAccount = $defaultCarrierAccount; + $this->defaultServicelevelToken = $defaultServicelevelToken; + $this->batchShipments = $batchShipments; + $this->labelFiletype = $labelFiletype; + $this->metadata = $metadata; } } \ No newline at end of file diff --git a/src/Models/Components/BatchShipment.php b/src/Models/Components/BatchShipment.php index caeffe9..62a3713 100644 --- a/src/Models/Components/BatchShipment.php +++ b/src/Models/Components/BatchShipment.php @@ -1,7 +1,7 @@ $messages */ - #[\JMS\Serializer\Annotation\SerializedName('messages')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('messages')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $messages = null; /** @@ -61,8 +58,7 @@ class BatchShipment * * @var string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] public string $objectId; /** @@ -70,8 +66,7 @@ class BatchShipment * * @var string $shipment */ - #[\JMS\Serializer\Annotation\SerializedName('shipment')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('shipment')] public string $shipment; /** @@ -81,10 +76,10 @@ class BatchShipment * Batch shipments with the status `TRANSACTION_FAILED` were not able to be purchased and the error will be displayed on the message field
* `INCOMPLETE` batch shipments have an issue with the Address and will need to be removed, fixed, and added to the batch again. * - * @var \Shippo\API\Models\Components\Status $status + * @var Status $status */ - #[\JMS\Serializer\Annotation\SerializedName('status')] - #[\JMS\Serializer\Annotation\Type('enum')] + #[\Speakeasy\Serializer\Annotation\SerializedName('status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\Status')] public Status $status; /** @@ -92,20 +87,29 @@ class BatchShipment * * @var ?string $transaction */ - #[\JMS\Serializer\Annotation\SerializedName('transaction')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('transaction')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $transaction = null; - public function __construct() + /** + * @param string $objectId + * @param string $shipment + * @param Status $status + * @param ?string $carrierAccount + * @param ?string $metadata + * @param ?string $servicelevelToken + * @param ?array $messages + * @param ?string $transaction + */ + public function __construct(string $objectId, string $shipment, Status $status, ?string $carrierAccount = null, ?string $metadata = null, ?string $servicelevelToken = null, ?array $messages = null, ?string $transaction = null) { - $this->carrierAccount = null; - $this->metadata = null; - $this->servicelevelToken = null; - $this->messages = null; - $this->objectId = ''; - $this->shipment = ''; - $this->status = \Shippo\API\Models\Components\Status::Invalid; - $this->transaction = null; + $this->objectId = $objectId; + $this->shipment = $shipment; + $this->status = $status; + $this->carrierAccount = $carrierAccount; + $this->metadata = $metadata; + $this->servicelevelToken = $servicelevelToken; + $this->messages = $messages; + $this->transaction = $transaction; } } \ No newline at end of file diff --git a/src/Models/Components/BatchShipmentCreateRequest.php b/src/Models/Components/BatchShipmentCreateRequest.php index d5fbb94..c5d1d45 100644 --- a/src/Models/Components/BatchShipmentCreateRequest.php +++ b/src/Models/Components/BatchShipmentCreateRequest.php @@ -1,7 +1,7 @@ carrierAccount = null; - $this->metadata = null; - $this->servicelevelToken = null; - $this->shipment = new \Shippo\API\Models\Components\ShipmentCreateRequest(); + $this->shipment = $shipment; + $this->carrierAccount = $carrierAccount; + $this->metadata = $metadata; + $this->servicelevelToken = $servicelevelToken; } } \ No newline at end of file diff --git a/src/Models/Components/BatchShipmentPaginatedList.php b/src/Models/Components/BatchShipmentPaginatedList.php index 8dfca30..6abd82d 100644 --- a/src/Models/Components/BatchShipmentPaginatedList.php +++ b/src/Models/Components/BatchShipmentPaginatedList.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\BatchShipment>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/BatchStatus.php b/src/Models/Components/BatchStatus.php index 623ed6c..6c09ecd 100644 --- a/src/Models/Components/BatchStatus.php +++ b/src/Models/Components/BatchStatus.php @@ -1,7 +1,7 @@ ')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\Type|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?Type $type = null; /** @@ -57,17 +54,23 @@ class Billing * * @var ?string $zip */ - #[\JMS\Serializer\Annotation\SerializedName('zip')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('zip')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $zip = null; - public function __construct() + /** + * @param ?string $account + * @param ?string $country + * @param ?string $participationCode + * @param ?Type $type + * @param ?string $zip + */ + public function __construct(?string $account = null, ?string $country = null, ?string $participationCode = null, ?Type $type = null, ?string $zip = null) { - $this->account = null; - $this->country = null; - $this->participationCode = null; - $this->type = null; - $this->zip = null; + $this->account = $account; + $this->country = $country; + $this->participationCode = $participationCode; + $this->type = $type; + $this->zip = $zip; } } \ No newline at end of file diff --git a/src/Models/Components/BuildingLocationType.php b/src/Models/Components/BuildingLocationType.php index e29dee6..95856c0 100644 --- a/src/Models/Components/BuildingLocationType.php +++ b/src/Models/Components/BuildingLocationType.php @@ -1,7 +1,7 @@ |FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters|null $parameters + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('parameters')] + #[\Speakeasy\Serializer\Annotation\Type('array|\Shippo\API\Models\Components\FedExConnectExistingOwnAccountParameters|\Shippo\API\Models\Components\UPSConnectExistingOwnAccountParameters')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public array|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters|null $parameters = null; /** * Carrier name, see Carriers
* * @var mixed $carrierName */ - #[\JMS\Serializer\Annotation\SerializedName('carrier_name')] - #[\JMS\Serializer\Annotation\Type('mixed')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('carrier_name')] + #[\Speakeasy\Serializer\Annotation\Type('mixed')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public mixed $carrierName = null; - #[\JMS\Serializer\Annotation\SerializedName('is_shippo_account')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?bool $isShippoAccount + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('is_shippo_account')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $isShippoAccount = null; - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?string $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; /** @@ -76,9 +83,8 @@ class CarrierAccount * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; /** @@ -86,19 +92,18 @@ class CarrierAccount * * @var ?string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectOwner = null; /** * $serviceLevels * - * @var ?array<\Shippo\API\Models\Components\CarrierAccountServiceLevel> $serviceLevels + * @var ?array $serviceLevels */ - #[\JMS\Serializer\Annotation\SerializedName('service_levels')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('service_levels')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\CarrierAccountServiceLevel>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $serviceLevels = null; /** @@ -106,23 +111,35 @@ class CarrierAccount * * @var ?bool $test */ - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; - public function __construct() + /** + * @param string $accountId + * @param string $carrier + * @param ?bool $active + * @param array|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters|null $parameters + * @param mixed $carrierName + * @param ?bool $isShippoAccount + * @param ?string $metadata + * @param ?string $objectId + * @param ?string $objectOwner + * @param ?array $serviceLevels + * @param ?bool $test + */ + public function __construct(string $accountId, string $carrier, ?bool $active = null, array|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters|null $parameters = null, mixed $carrierName = null, ?bool $isShippoAccount = null, ?string $metadata = null, ?string $objectId = null, ?string $objectOwner = null, ?array $serviceLevels = null, ?bool $test = null) { - $this->accountId = ''; - $this->active = null; - $this->carrier = ''; - $this->parameters = null; - $this->carrierName = null; - $this->isShippoAccount = null; - $this->metadata = null; - $this->objectId = null; - $this->objectOwner = null; - $this->serviceLevels = null; - $this->test = null; + $this->accountId = $accountId; + $this->carrier = $carrier; + $this->active = $active; + $this->parameters = $parameters; + $this->carrierName = $carrierName; + $this->isShippoAccount = $isShippoAccount; + $this->metadata = $metadata; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->serviceLevels = $serviceLevels; + $this->test = $test; } } \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountBase.php b/src/Models/Components/CarrierAccountBase.php index 1d1088e..513cafd 100644 --- a/src/Models/Components/CarrierAccountBase.php +++ b/src/Models/Components/CarrierAccountBase.php @@ -1,7 +1,7 @@ |FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters|null $parameters + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('parameters')] + #[\Speakeasy\Serializer\Annotation\Type('array|\Shippo\API\Models\Components\FedExConnectExistingOwnAccountParameters|\Shippo\API\Models\Components\UPSConnectExistingOwnAccountParameters')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public array|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters|null $parameters = null; - public function __construct() + /** + * @param string $accountId + * @param string $carrier + * @param ?bool $active + * @param array|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters|null $parameters + */ + public function __construct(string $accountId, string $carrier, ?bool $active = null, array|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters|null $parameters = null) { - $this->accountId = ''; - $this->active = null; - $this->carrier = ''; - $this->parameters = null; + $this->accountId = $accountId; + $this->carrier = $carrier; + $this->active = $active; + $this->parameters = $parameters; } } \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountCanadaPostCreateParameters.php b/src/Models/Components/CarrierAccountCanadaPostCreateParameters.php new file mode 100644 index 0000000..75ffa1c --- /dev/null +++ b/src/Models/Components/CarrierAccountCanadaPostCreateParameters.php @@ -0,0 +1,66 @@ +canadaPostTerms = $canadaPostTerms; + $this->company = $company; + $this->email = $email; + $this->fullName = $fullName; + $this->phone = $phone; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountCanadaPostCreateRequest.php b/src/Models/Components/CarrierAccountCanadaPostCreateRequest.php new file mode 100644 index 0000000..39becd8 --- /dev/null +++ b/src/Models/Components/CarrierAccountCanadaPostCreateRequest.php @@ -0,0 +1,38 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountChronopostCreateRequest.php b/src/Models/Components/CarrierAccountChronopostCreateRequest.php new file mode 100644 index 0000000..6702738 --- /dev/null +++ b/src/Models/Components/CarrierAccountChronopostCreateRequest.php @@ -0,0 +1,38 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountChronopostCreateRequestParameters.php b/src/Models/Components/CarrierAccountChronopostCreateRequestParameters.php new file mode 100644 index 0000000..80b60bb --- /dev/null +++ b/src/Models/Components/CarrierAccountChronopostCreateRequestParameters.php @@ -0,0 +1,18 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountColissimoCreateRequestParameters.php b/src/Models/Components/CarrierAccountColissimoCreateRequestParameters.php new file mode 100644 index 0000000..e05ece2 --- /dev/null +++ b/src/Models/Components/CarrierAccountColissimoCreateRequestParameters.php @@ -0,0 +1,18 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountCorreosCreateRequestParameters.php b/src/Models/Components/CarrierAccountCorreosCreateRequestParameters.php new file mode 100644 index 0000000..709d56f --- /dev/null +++ b/src/Models/Components/CarrierAccountCorreosCreateRequestParameters.php @@ -0,0 +1,18 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountDHLExpressCreateRequestParameters.php b/src/Models/Components/CarrierAccountDHLExpressCreateRequestParameters.php new file mode 100644 index 0000000..7959fef --- /dev/null +++ b/src/Models/Components/CarrierAccountDHLExpressCreateRequestParameters.php @@ -0,0 +1,29 @@ +userAcceptedTermsAndConditions = $userAcceptedTermsAndConditions; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountDPDUKCreateRequest.php b/src/Models/Components/CarrierAccountDPDUKCreateRequest.php new file mode 100644 index 0000000..c70f404 --- /dev/null +++ b/src/Models/Components/CarrierAccountDPDUKCreateRequest.php @@ -0,0 +1,38 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountDPDUKCreateRequestParameters.php b/src/Models/Components/CarrierAccountDPDUKCreateRequestParameters.php new file mode 100644 index 0000000..3267fdc --- /dev/null +++ b/src/Models/Components/CarrierAccountDPDUKCreateRequestParameters.php @@ -0,0 +1,18 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountDeutschePostCreateRequestParameters.php b/src/Models/Components/CarrierAccountDeutschePostCreateRequestParameters.php new file mode 100644 index 0000000..baf8905 --- /dev/null +++ b/src/Models/Components/CarrierAccountDeutschePostCreateRequestParameters.php @@ -0,0 +1,18 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountDpdDeCreateRequestParameters.php b/src/Models/Components/CarrierAccountDpdDeCreateRequestParameters.php new file mode 100644 index 0000000..8c8a831 --- /dev/null +++ b/src/Models/Components/CarrierAccountDpdDeCreateRequestParameters.php @@ -0,0 +1,18 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountFedExCreateRequestParameters.php b/src/Models/Components/CarrierAccountFedExCreateRequestParameters.php new file mode 100644 index 0000000..04c648c --- /dev/null +++ b/src/Models/Components/CarrierAccountFedExCreateRequestParameters.php @@ -0,0 +1,18 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountHermesUKCreateRequestParameters.php b/src/Models/Components/CarrierAccountHermesUKCreateRequestParameters.php new file mode 100644 index 0000000..1521fd2 --- /dev/null +++ b/src/Models/Components/CarrierAccountHermesUKCreateRequestParameters.php @@ -0,0 +1,18 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountMondialRelayCreateRequestParameters.php b/src/Models/Components/CarrierAccountMondialRelayCreateRequestParameters.php new file mode 100644 index 0000000..7aa82ae --- /dev/null +++ b/src/Models/Components/CarrierAccountMondialRelayCreateRequestParameters.php @@ -0,0 +1,18 @@ + $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\CarrierAccountWithExtraInfo>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountPosteItalianeCreateRequest.php b/src/Models/Components/CarrierAccountPosteItalianeCreateRequest.php new file mode 100644 index 0000000..55bea9b --- /dev/null +++ b/src/Models/Components/CarrierAccountPosteItalianeCreateRequest.php @@ -0,0 +1,38 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountPosteItalianeCreateRequestParameters.php b/src/Models/Components/CarrierAccountPosteItalianeCreateRequestParameters.php new file mode 100644 index 0000000..a5928f0 --- /dev/null +++ b/src/Models/Components/CarrierAccountPosteItalianeCreateRequestParameters.php @@ -0,0 +1,18 @@ +")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?\DateTime $objectCreated + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectCreated = null; - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?string $objectOwner + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectOwner = null; - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?\DateTime $objectUpdated + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectUpdated = null; - #[\JMS\Serializer\Annotation\SerializedName('status')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?string $status + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('status')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $status = null; - public function __construct() + /** + * @param ?string $carrierAccount + * @param ?\DateTime $objectCreated + * @param ?string $objectOwner + * @param ?\DateTime $objectUpdated + * @param ?string $status + */ + public function __construct(?string $carrierAccount = null, ?\DateTime $objectCreated = null, ?string $objectOwner = null, ?\DateTime $objectUpdated = null, ?string $status = null) { - $this->carrierAccount = null; - $this->objectCreated = null; - $this->objectOwner = null; - $this->objectUpdated = null; - $this->status = null; + $this->carrierAccount = $carrierAccount; + $this->objectCreated = $objectCreated; + $this->objectOwner = $objectOwner; + $this->objectUpdated = $objectUpdated; + $this->status = $status; } } \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountSendleCreateRequest.php b/src/Models/Components/CarrierAccountSendleCreateRequest.php new file mode 100644 index 0000000..6955b40 --- /dev/null +++ b/src/Models/Components/CarrierAccountSendleCreateRequest.php @@ -0,0 +1,38 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountSendleCreateRequestParameters.php b/src/Models/Components/CarrierAccountSendleCreateRequestParameters.php new file mode 100644 index 0000000..9b06a98 --- /dev/null +++ b/src/Models/Components/CarrierAccountSendleCreateRequestParameters.php @@ -0,0 +1,18 @@ +name = null; - $this->token = null; - $this->supportsReturnLabels = null; + $this->name = $name; + $this->token = $token; + $this->supportsReturnLabels = $supportsReturnLabels; } } \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountUPSCreateRequest.php b/src/Models/Components/CarrierAccountUPSCreateRequest.php new file mode 100644 index 0000000..50e4b4c --- /dev/null +++ b/src/Models/Components/CarrierAccountUPSCreateRequest.php @@ -0,0 +1,39 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountUPSCreateRequestParameters.php b/src/Models/Components/CarrierAccountUPSCreateRequestParameters.php new file mode 100644 index 0000000..386cafc --- /dev/null +++ b/src/Models/Components/CarrierAccountUPSCreateRequestParameters.php @@ -0,0 +1,198 @@ +billingAddressCity = $billingAddressCity; + $this->billingAddressCountryIso2 = $billingAddressCountryIso2; + $this->billingAddressState = $billingAddressState; + $this->billingAddressStreet1 = $billingAddressStreet1; + $this->billingAddressZip = $billingAddressZip; + $this->pickupAddressCity = $pickupAddressCity; + $this->pickupAddressCountryIso2 = $pickupAddressCountryIso2; + $this->pickupAddressState = $pickupAddressState; + $this->pickupAddressStreet1 = $pickupAddressStreet1; + $this->pickupAddressZip = $pickupAddressZip; + $this->upsAgreements = $upsAgreements; + $this->billingAddressStreet2 = $billingAddressStreet2; + $this->company = $company; + $this->email = $email; + $this->fullName = $fullName; + $this->phone = $phone; + $this->pickupAddressSameAsBillingAddress = $pickupAddressSameAsBillingAddress; + $this->pickupAddressStreet2 = $pickupAddressStreet2; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountUSPSCreateRequest.php b/src/Models/Components/CarrierAccountUSPSCreateRequest.php new file mode 100644 index 0000000..0950dc3 --- /dev/null +++ b/src/Models/Components/CarrierAccountUSPSCreateRequest.php @@ -0,0 +1,38 @@ +carrier = $carrier; + $this->parameters = $parameters; + } +} \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountUSPSCreateRequestParameters.php b/src/Models/Components/CarrierAccountUSPSCreateRequestParameters.php new file mode 100644 index 0000000..99091a6 --- /dev/null +++ b/src/Models/Components/CarrierAccountUSPSCreateRequestParameters.php @@ -0,0 +1,18 @@ +|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters|null $parameters + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('parameters')] + #[\Speakeasy\Serializer\Annotation\Type('array|\Shippo\API\Models\Components\FedExConnectExistingOwnAccountParameters|\Shippo\API\Models\Components\UPSConnectExistingOwnAccountParameters')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public array|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters|null $parameters = null; /** * Carrier name, see Carriers
* * @var mixed $carrierName */ - #[\JMS\Serializer\Annotation\SerializedName('carrier_name')] - #[\JMS\Serializer\Annotation\Type('mixed')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('carrier_name')] + #[\Speakeasy\Serializer\Annotation\Type('mixed')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public mixed $carrierName = null; - #[\JMS\Serializer\Annotation\SerializedName('is_shippo_account')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?bool $isShippoAccount + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('is_shippo_account')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $isShippoAccount = null; - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?string $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; /** @@ -76,9 +83,8 @@ class CarrierAccountWithExtraInfo * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; /** @@ -86,19 +92,18 @@ class CarrierAccountWithExtraInfo * * @var ?string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectOwner = null; /** * $serviceLevels * - * @var ?array<\Shippo\API\Models\Components\CarrierAccountServiceLevel> $serviceLevels + * @var ?array $serviceLevels */ - #[\JMS\Serializer\Annotation\SerializedName('service_levels')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('service_levels')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\CarrierAccountServiceLevel>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $serviceLevels = null; /** @@ -106,34 +111,47 @@ class CarrierAccountWithExtraInfo * * @var ?bool $test */ - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; /** * Holds internal state relevant to users. * - * @var ?\Shippo\API\Models\Components\ObjectInfo $objectInfo + * @var ?ObjectInfo $objectInfo */ - #[\JMS\Serializer\Annotation\SerializedName('object_info')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\ObjectInfo')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_info')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ObjectInfo|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?ObjectInfo $objectInfo = null; - public function __construct() + /** + * @param string $accountId + * @param string $carrier + * @param ?bool $active + * @param array|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters|null $parameters + * @param mixed $carrierName + * @param ?bool $isShippoAccount + * @param ?string $metadata + * @param ?string $objectId + * @param ?string $objectOwner + * @param ?array $serviceLevels + * @param ?bool $test + * @param ?ObjectInfo $objectInfo + */ + public function __construct(string $accountId, string $carrier, ?bool $active = null, array|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters|null $parameters = null, mixed $carrierName = null, ?bool $isShippoAccount = null, ?string $metadata = null, ?string $objectId = null, ?string $objectOwner = null, ?array $serviceLevels = null, ?bool $test = null, ?ObjectInfo $objectInfo = null) { - $this->accountId = ''; - $this->active = null; - $this->carrier = ''; - $this->parameters = null; - $this->carrierName = null; - $this->isShippoAccount = null; - $this->metadata = null; - $this->objectId = null; - $this->objectOwner = null; - $this->serviceLevels = null; - $this->test = null; - $this->objectInfo = null; + $this->accountId = $accountId; + $this->carrier = $carrier; + $this->active = $active; + $this->parameters = $parameters; + $this->carrierName = $carrierName; + $this->isShippoAccount = $isShippoAccount; + $this->metadata = $metadata; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->serviceLevels = $serviceLevels; + $this->test = $test; + $this->objectInfo = $objectInfo; } } \ No newline at end of file diff --git a/src/Models/Components/CarrierAccountWithExtraInfoStatus.php b/src/Models/Components/CarrierAccountWithExtraInfoStatus.php index 5ea8dac..5fc2587 100644 --- a/src/Models/Components/CarrierAccountWithExtraInfoStatus.php +++ b/src/Models/Components/CarrierAccountWithExtraInfoStatus.php @@ -1,7 +1,7 @@ ')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('distance_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\DistanceUnitEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?DistanceUnitEnum $distanceUnit = null; /** @@ -36,29 +35,26 @@ class CarrierParcelTemplate * * @var ?string $height */ - #[\JMS\Serializer\Annotation\SerializedName('height')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('height')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $height = null; /** * True if the carrier parcel template allows custom dimensions, such as USPS Softpack. * - * @var ?string $isVariableDimensions + * @var ?bool $isVariableDimensions */ - #[\JMS\Serializer\Annotation\SerializedName('is_variable_dimensions')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] - public ?string $isVariableDimensions = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('is_variable_dimensions')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $isVariableDimensions = null; /** * The length of the package, in units specified by the distance_unit attribute * * @var ?string $length */ - #[\JMS\Serializer\Annotation\SerializedName('length')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('length')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $length = null; /** @@ -66,9 +62,8 @@ class CarrierParcelTemplate * * @var ?string $name */ - #[\JMS\Serializer\Annotation\SerializedName('name')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('name')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $name = null; /** @@ -76,9 +71,8 @@ class CarrierParcelTemplate * * @var ?string $token */ - #[\JMS\Serializer\Annotation\SerializedName('token')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('token')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $token = null; /** @@ -86,20 +80,29 @@ class CarrierParcelTemplate * * @var ?string $width */ - #[\JMS\Serializer\Annotation\SerializedName('width')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('width')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $width = null; - public function __construct() + /** + * @param ?string $carrier + * @param ?DistanceUnitEnum $distanceUnit + * @param ?string $height + * @param ?bool $isVariableDimensions + * @param ?string $length + * @param ?string $name + * @param ?string $token + * @param ?string $width + */ + public function __construct(?string $carrier = null, ?DistanceUnitEnum $distanceUnit = null, ?string $height = null, ?bool $isVariableDimensions = null, ?string $length = null, ?string $name = null, ?string $token = null, ?string $width = null) { - $this->carrier = null; - $this->distanceUnit = null; - $this->height = null; - $this->isVariableDimensions = null; - $this->length = null; - $this->name = null; - $this->token = null; - $this->width = null; + $this->carrier = $carrier; + $this->distanceUnit = $distanceUnit; + $this->height = $height; + $this->isVariableDimensions = $isVariableDimensions; + $this->length = $length; + $this->name = $name; + $this->token = $token; + $this->width = $width; } } \ No newline at end of file diff --git a/src/Models/Components/CarrierParcelTemplateList.php b/src/Models/Components/CarrierParcelTemplateList.php index 3e4038e..da08f18 100644 --- a/src/Models/Components/CarrierParcelTemplateList.php +++ b/src/Models/Components/CarrierParcelTemplateList.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\CarrierParcelTemplate>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?array $results + */ + public function __construct(?array $results = null) { - $this->results = null; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/CarriersEnum.php b/src/Models/Components/CarriersEnum.php index 0d662e6..a103a1b 100644 --- a/src/Models/Components/CarriersEnum.php +++ b/src/Models/Components/CarriersEnum.php @@ -1,7 +1,7 @@ UPS for details). * If no payment_method inputted the value defaults to "ANY".) * - * @var ?\Shippo\API\Models\Components\PaymentMethod $paymentMethod + * @var ?PaymentMethod $paymentMethod */ - #[\JMS\Serializer\Annotation\SerializedName('payment_method')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('payment_method')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\PaymentMethod|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?PaymentMethod $paymentMethod = null; - public function __construct() + /** + * @param ?string $amount + * @param ?string $currency + * @param ?PaymentMethod $paymentMethod + */ + public function __construct(?string $amount = null, ?string $currency = null, ?PaymentMethod $paymentMethod = null) { - $this->amount = null; - $this->currency = null; - $this->paymentMethod = null; + $this->amount = $amount; + $this->currency = $currency; + $this->paymentMethod = $paymentMethod; } } \ No newline at end of file diff --git a/src/Models/Components/ConnectExistingOwnAccountRequest.php b/src/Models/Components/ConnectExistingOwnAccountRequest.php index 7f82b79..0e01439 100644 --- a/src/Models/Components/ConnectExistingOwnAccountRequest.php +++ b/src/Models/Components/ConnectExistingOwnAccountRequest.php @@ -1,7 +1,7 @@ |FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters $parameters + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('parameters')] + #[\Speakeasy\Serializer\Annotation\Type('array|\Shippo\API\Models\Components\FedExConnectExistingOwnAccountParameters|\Shippo\API\Models\Components\UPSConnectExistingOwnAccountParameters')] + public array|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters $parameters; - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?bool $test + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; - public function __construct() + /** + * @param string $accountId + * @param string $carrier + * @param array|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters $parameters + * @param ?bool $active + * @param ?string $metadata + * @param ?bool $test + */ + public function __construct(string $accountId, string $carrier, array|FedExConnectExistingOwnAccountParameters|UPSConnectExistingOwnAccountParameters $parameters, ?bool $active = null, ?string $metadata = null, ?bool $test = null) { - $this->accountId = ''; - $this->active = null; - $this->carrier = ''; - $this->metadata = null; - $this->parameters = null; - $this->test = null; + $this->accountId = $accountId; + $this->carrier = $carrier; + $this->parameters = $parameters; + $this->active = $active; + $this->metadata = $metadata; + $this->test = $test; } } \ No newline at end of file diff --git a/src/Models/Components/CoreRate.php b/src/Models/Components/CoreRate.php new file mode 100644 index 0000000..729e8a3 --- /dev/null +++ b/src/Models/Components/CoreRate.php @@ -0,0 +1,128 @@ +official ISO 4217 currency codes are used, e.g. `USD` or `EUR`. + * + * @var ?string $currency + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('currency')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $currency = null; + + /** + * Currency used in the recipient's country, refers to `amount_local`. + * + * The official ISO 4217 currency codes are used, e.g. `USD` or "EUR". + * + * @var ?string $currencyLocal + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('currency_local')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $currencyLocal = null; + + /** + * Unique identifier of the Rate object. + * + * @var ?string $objectId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $objectId = null; + + /** + * Carrier offering the rate, e.g., `FedEx` or `Deutsche Post DHL`. + * + * @var ?string $provider + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('provider')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $provider = null; + + /** + * Object ID of the carrier account that has been used to retrieve the rate. + * + * @var ?string $carrierAccount + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('carrier_account')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $carrierAccount = null; + + /** + * Service level name, e.g. `Priority Mail` or `FedEx Ground®`. + * + * A service level commonly defines the transit time of a Shipment (e.g., Express vs. Standard), + * along with other properties. These names vary depending on the provider.
+ * See Service Levels. + * + * @var ?string $servicelevelName + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('servicelevel_name')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $servicelevelName = null; + + /** + * Token of the Rate's servicelevel, e.g. `usps_priority` or `fedex_ground`. + * + * See servicelevels. + * + * @var ?string $servicelevelToken + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('servicelevel_token')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $servicelevelToken = null; + + /** + * @param ?string $amount + * @param ?string $amountLocal + * @param ?string $currency + * @param ?string $currencyLocal + * @param ?string $objectId + * @param ?string $provider + * @param ?string $carrierAccount + * @param ?string $servicelevelName + * @param ?string $servicelevelToken + */ + public function __construct(?string $amount = null, ?string $amountLocal = null, ?string $currency = null, ?string $currencyLocal = null, ?string $objectId = null, ?string $provider = null, ?string $carrierAccount = null, ?string $servicelevelName = null, ?string $servicelevelToken = null) + { + $this->amount = $amount; + $this->amountLocal = $amountLocal; + $this->currency = $currency; + $this->currencyLocal = $currencyLocal; + $this->objectId = $objectId; + $this->provider = $provider; + $this->carrierAccount = $carrierAccount; + $this->servicelevelName = $servicelevelName; + $this->servicelevelToken = $servicelevelToken; + } +} \ No newline at end of file diff --git a/src/Models/Components/CreatedBy.php b/src/Models/Components/CreatedBy.php index 0068b53..1111a4c 100644 --- a/src/Models/Components/CreatedBy.php +++ b/src/Models/Components/CreatedBy.php @@ -1,7 +1,7 @@ firstName = null; - $this->lastName = null; - $this->username = null; + $this->firstName = $firstName; + $this->lastName = $lastName; + $this->username = $username; } } \ No newline at end of file diff --git a/src/Models/Components/CustomerReference.php b/src/Models/Components/CustomerReference.php index cc272de..6970360 100644 --- a/src/Models/Components/CustomerReference.php +++ b/src/Models/Components/CustomerReference.php @@ -1,7 +1,7 @@ prefix = null; - $this->value = null; - $this->refSort = null; + $this->prefix = $prefix; + $this->value = $value; + $this->refSort = $refSort; } } \ No newline at end of file diff --git a/src/Models/Components/CustomsDeclaration.php b/src/Models/Components/CustomsDeclaration.php index cd92331..ff486d5 100644 --- a/src/Models/Components/CustomsDeclaration.php +++ b/src/Models/Components/CustomsDeclaration.php @@ -1,7 +1,7 @@ $items */ - #[\JMS\Serializer\Annotation\SerializedName('items')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('items')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $items; /** @@ -263,8 +257,7 @@ class CustomsDeclaration * * @var string $nonDeliveryOption */ - #[\JMS\Serializer\Annotation\SerializedName('non_delivery_option')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('non_delivery_option')] public string $nonDeliveryOption; /** @@ -272,9 +265,8 @@ class CustomsDeclaration * * @var ?\DateTime $objectCreated */ - #[\JMS\Serializer\Annotation\SerializedName('object_created')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectCreated = null; /** @@ -282,9 +274,8 @@ class CustomsDeclaration * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; /** @@ -292,19 +283,18 @@ class CustomsDeclaration * * @var ?string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectOwner = null; /** * Indicates the validity of the enclosing object * - * @var ?\Shippo\API\Models\Components\ObjectStateEnum $objectState + * @var ?ObjectStateEnum $objectState */ - #[\JMS\Serializer\Annotation\SerializedName('object_state')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_state')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ObjectStateEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?ObjectStateEnum $objectState = null; /** @@ -312,9 +302,8 @@ class CustomsDeclaration * * @var ?\DateTime $objectUpdated */ - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectUpdated = null; /** @@ -322,42 +311,75 @@ class CustomsDeclaration * * @var ?bool $test */ - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; - public function __construct() + /** + * @param bool $certify + * @param string $certifySigner + * @param string $contentsType + * @param array $items + * @param string $nonDeliveryOption + * @param ?string $aesItn + * @param ?string $b13aFilingOption + * @param ?string $b13aNumber + * @param ?string $certificate + * @param ?bool $commercialInvoice + * @param ?string $contentsExplanation + * @param ?string $disclaimer + * @param ?CustomsDeclarationDutiesPayor $dutiesPayor + * @param ?CustomsExporterIdentification $exporterIdentification + * @param ?string $exporterReference + * @param ?string $importerReference + * @param ?bool $isVatCollected + * @param ?string $invoice + * @param ?string $license + * @param ?string $metadata + * @param ?string $notes + * @param ?string $addressImporter + * @param ?string $eelPfc + * @param ?string $incoterm + * @param ?CustomsInvoicedCharges $invoicedCharges + * @param ?\DateTime $objectCreated + * @param ?string $objectId + * @param ?string $objectOwner + * @param ?ObjectStateEnum $objectState + * @param ?\DateTime $objectUpdated + * @param ?bool $test + */ + public function __construct(bool $certify, string $certifySigner, string $contentsType, array $items, string $nonDeliveryOption, ?string $aesItn = null, ?string $b13aFilingOption = null, ?string $b13aNumber = null, ?string $certificate = null, ?bool $commercialInvoice = null, ?string $contentsExplanation = null, ?string $disclaimer = null, ?CustomsDeclarationDutiesPayor $dutiesPayor = null, ?CustomsExporterIdentification $exporterIdentification = null, ?string $exporterReference = null, ?string $importerReference = null, ?bool $isVatCollected = null, ?string $invoice = null, ?string $license = null, ?string $metadata = null, ?string $notes = null, ?string $addressImporter = null, ?string $eelPfc = null, ?string $incoterm = null, ?CustomsInvoicedCharges $invoicedCharges = null, ?\DateTime $objectCreated = null, ?string $objectId = null, ?string $objectOwner = null, ?ObjectStateEnum $objectState = null, ?\DateTime $objectUpdated = null, ?bool $test = null) { - $this->aesItn = null; - $this->b13aFilingOption = null; - $this->b13aNumber = null; - $this->certificate = null; - $this->certify = false; - $this->certifySigner = ''; - $this->commercialInvoice = null; - $this->contentsExplanation = null; - $this->disclaimer = null; - $this->exporterIdentification = null; - $this->exporterReference = null; - $this->importerReference = null; - $this->isVatCollected = null; - $this->invoice = null; - $this->license = null; - $this->metadata = null; - $this->notes = null; - $this->addressImporter = null; - $this->contentsType = ''; - $this->eelPfc = null; - $this->incoterm = null; - $this->invoicedCharges = null; - $this->items = []; - $this->nonDeliveryOption = ''; - $this->objectCreated = null; - $this->objectId = null; - $this->objectOwner = null; - $this->objectState = null; - $this->objectUpdated = null; - $this->test = null; + $this->certify = $certify; + $this->certifySigner = $certifySigner; + $this->contentsType = $contentsType; + $this->items = $items; + $this->nonDeliveryOption = $nonDeliveryOption; + $this->aesItn = $aesItn; + $this->b13aFilingOption = $b13aFilingOption; + $this->b13aNumber = $b13aNumber; + $this->certificate = $certificate; + $this->commercialInvoice = $commercialInvoice; + $this->contentsExplanation = $contentsExplanation; + $this->disclaimer = $disclaimer; + $this->dutiesPayor = $dutiesPayor; + $this->exporterIdentification = $exporterIdentification; + $this->exporterReference = $exporterReference; + $this->importerReference = $importerReference; + $this->isVatCollected = $isVatCollected; + $this->invoice = $invoice; + $this->license = $license; + $this->metadata = $metadata; + $this->notes = $notes; + $this->addressImporter = $addressImporter; + $this->eelPfc = $eelPfc; + $this->incoterm = $incoterm; + $this->invoicedCharges = $invoicedCharges; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->objectState = $objectState; + $this->objectUpdated = $objectUpdated; + $this->test = $test; } } \ No newline at end of file diff --git a/src/Models/Components/CustomsDeclarationAddress.php b/src/Models/Components/CustomsDeclarationAddress.php new file mode 100644 index 0000000..e01ab92 --- /dev/null +++ b/src/Models/Components/CustomsDeclarationAddress.php @@ -0,0 +1,52 @@ +name = $name; + $this->zip = $zip; + $this->country = $country; + } +} \ No newline at end of file diff --git a/src/Models/Components/CustomsDeclarationB13AFilingOptionEnum.php b/src/Models/Components/CustomsDeclarationB13AFilingOptionEnum.php index 1cb8712..cd3518a 100644 --- a/src/Models/Components/CustomsDeclarationB13AFilingOptionEnum.php +++ b/src/Models/Components/CustomsDeclarationB13AFilingOptionEnum.php @@ -1,7 +1,7 @@ ')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?CustomsDeclarationB13AFilingOptionEnum $b13aFilingOption + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('b13a_filing_option')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CustomsDeclarationB13AFilingOptionEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?CustomsDeclarationB13AFilingOptionEnum $b13aFilingOption = null; /** @@ -37,9 +40,8 @@ class CustomsDeclarationCreateRequest * * @var ?string $b13aNumber */ - #[\JMS\Serializer\Annotation\SerializedName('b13a_number')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('b13a_number')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $b13aNumber = null; /** @@ -47,9 +49,8 @@ class CustomsDeclarationCreateRequest * * @var ?string $certificate */ - #[\JMS\Serializer\Annotation\SerializedName('certificate')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('certificate')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $certificate = null; /** @@ -57,8 +58,7 @@ class CustomsDeclarationCreateRequest * * @var bool $certify */ - #[\JMS\Serializer\Annotation\SerializedName('certify')] - #[\JMS\Serializer\Annotation\Type('bool')] + #[\Speakeasy\Serializer\Annotation\SerializedName('certify')] public bool $certify; /** @@ -68,13 +68,15 @@ class CustomsDeclarationCreateRequest * * @var string $certifySigner */ - #[\JMS\Serializer\Annotation\SerializedName('certify_signer')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('certify_signer')] public string $certifySigner; - #[\JMS\Serializer\Annotation\SerializedName('commercial_invoice')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?bool $commercialInvoice + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('commercial_invoice')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $commercialInvoice = null; /** @@ -84,9 +86,8 @@ class CustomsDeclarationCreateRequest * * @var ?string $contentsExplanation */ - #[\JMS\Serializer\Annotation\SerializedName('contents_explanation')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('contents_explanation')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $contentsExplanation = null; /** @@ -94,19 +95,28 @@ class CustomsDeclarationCreateRequest * * @var ?string $disclaimer */ - #[\JMS\Serializer\Annotation\SerializedName('disclaimer')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('disclaimer')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $disclaimer = null; + /** + * Specifies who will pay the duties for the shipment. Only accepted for FedEx shipments. + * + * @var ?DutiesPayor $dutiesPayor + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('duties_payor')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\DutiesPayor|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?DutiesPayor $dutiesPayor = null; + /** * Additional exporter identification that may be required to ship in certain countries * - * @var ?\Shippo\API\Models\Components\CustomsExporterIdentification $exporterIdentification + * @var ?CustomsExporterIdentification $exporterIdentification */ - #[\JMS\Serializer\Annotation\SerializedName('exporter_identification')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\CustomsExporterIdentification')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('exporter_identification')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CustomsExporterIdentification|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?CustomsExporterIdentification $exporterIdentification = null; /** @@ -114,9 +124,8 @@ class CustomsDeclarationCreateRequest * * @var ?string $exporterReference */ - #[\JMS\Serializer\Annotation\SerializedName('exporter_reference')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('exporter_reference')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $exporterReference = null; /** @@ -124,9 +133,8 @@ class CustomsDeclarationCreateRequest * * @var ?string $importerReference */ - #[\JMS\Serializer\Annotation\SerializedName('importer_reference')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('importer_reference')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $importerReference = null; /** @@ -134,9 +142,8 @@ class CustomsDeclarationCreateRequest * * @var ?bool $isVatCollected */ - #[\JMS\Serializer\Annotation\SerializedName('is_vat_collected')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('is_vat_collected')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $isVatCollected = null; /** @@ -144,9 +151,8 @@ class CustomsDeclarationCreateRequest * * @var ?string $invoice */ - #[\JMS\Serializer\Annotation\SerializedName('invoice')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('invoice')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $invoice = null; /** @@ -154,9 +160,8 @@ class CustomsDeclarationCreateRequest * * @var ?string $license */ - #[\JMS\Serializer\Annotation\SerializedName('license')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('license')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $license = null; /** @@ -166,9 +171,8 @@ class CustomsDeclarationCreateRequest * * @var ?string $metadata */ - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; /** @@ -176,78 +180,124 @@ class CustomsDeclarationCreateRequest * * @var ?string $notes */ - #[\JMS\Serializer\Annotation\SerializedName('notes')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('notes')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $notes = null; /** * Object that represents the address of the importer * - * @var ?\Shippo\API\Models\Components\AddressImporter $addressImporter + * @var ?AddressImporter $addressImporter */ - #[\JMS\Serializer\Annotation\SerializedName('address_importer')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\AddressImporter')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('address_importer')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\AddressImporter|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?AddressImporter $addressImporter = null; - #[\JMS\Serializer\Annotation\SerializedName('contents_type')] - #[\JMS\Serializer\Annotation\Type('enum')] + /** + * + * @var CustomsDeclarationContentsTypeEnum $contentsType + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('contents_type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CustomsDeclarationContentsTypeEnum')] public CustomsDeclarationContentsTypeEnum $contentsType; - #[\JMS\Serializer\Annotation\SerializedName('eel_pfc')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?CustomsDeclarationEelPfcEnum $eelPfc + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('eel_pfc')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CustomsDeclarationEelPfcEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?CustomsDeclarationEelPfcEnum $eelPfc = null; - #[\JMS\Serializer\Annotation\SerializedName('incoterm')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?CustomsDeclarationIncotermEnum $incoterm + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('incoterm')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CustomsDeclarationIncotermEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?CustomsDeclarationIncotermEnum $incoterm = null; /** * $items * - * @var array<\Shippo\API\Models\Components\CustomsItemCreateRequest> $items + * @var array $items */ - #[\JMS\Serializer\Annotation\SerializedName('items')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('items')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\CustomsItemCreateRequest>')] public array $items; - #[\JMS\Serializer\Annotation\SerializedName('non_delivery_option')] - #[\JMS\Serializer\Annotation\Type('enum')] + /** + * + * @var CustomsDeclarationNonDeliveryOptionEnum $nonDeliveryOption + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('non_delivery_option')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CustomsDeclarationNonDeliveryOptionEnum')] public CustomsDeclarationNonDeliveryOptionEnum $nonDeliveryOption; - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?bool $test + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; - public function __construct() + /** + * @param bool $certify + * @param string $certifySigner + * @param CustomsDeclarationContentsTypeEnum $contentsType + * @param array $items + * @param CustomsDeclarationNonDeliveryOptionEnum $nonDeliveryOption + * @param ?string $aesItn + * @param ?CustomsDeclarationB13AFilingOptionEnum $b13aFilingOption + * @param ?string $b13aNumber + * @param ?string $certificate + * @param ?bool $commercialInvoice + * @param ?string $contentsExplanation + * @param ?string $disclaimer + * @param ?DutiesPayor $dutiesPayor + * @param ?CustomsExporterIdentification $exporterIdentification + * @param ?string $exporterReference + * @param ?string $importerReference + * @param ?bool $isVatCollected + * @param ?string $invoice + * @param ?string $license + * @param ?string $metadata + * @param ?string $notes + * @param ?AddressImporter $addressImporter + * @param ?CustomsDeclarationEelPfcEnum $eelPfc + * @param ?CustomsDeclarationIncotermEnum $incoterm + * @param ?bool $test + */ + public function __construct(bool $certify, string $certifySigner, CustomsDeclarationContentsTypeEnum $contentsType, array $items, CustomsDeclarationNonDeliveryOptionEnum $nonDeliveryOption, ?string $aesItn = null, ?CustomsDeclarationB13AFilingOptionEnum $b13aFilingOption = null, ?string $b13aNumber = null, ?string $certificate = null, ?bool $commercialInvoice = null, ?string $contentsExplanation = null, ?string $disclaimer = null, ?DutiesPayor $dutiesPayor = null, ?CustomsExporterIdentification $exporterIdentification = null, ?string $exporterReference = null, ?string $importerReference = null, ?bool $isVatCollected = null, ?string $invoice = null, ?string $license = null, ?string $metadata = null, ?string $notes = null, ?AddressImporter $addressImporter = null, ?CustomsDeclarationEelPfcEnum $eelPfc = null, ?CustomsDeclarationIncotermEnum $incoterm = null, ?bool $test = null) { - $this->aesItn = null; - $this->b13aFilingOption = null; - $this->b13aNumber = null; - $this->certificate = null; - $this->certify = false; - $this->certifySigner = ''; - $this->commercialInvoice = null; - $this->contentsExplanation = null; - $this->disclaimer = null; - $this->exporterIdentification = null; - $this->exporterReference = null; - $this->importerReference = null; - $this->isVatCollected = null; - $this->invoice = null; - $this->license = null; - $this->metadata = null; - $this->notes = null; - $this->addressImporter = null; - $this->contentsType = \Shippo\API\Models\Components\CustomsDeclarationContentsTypeEnum::Documents; - $this->eelPfc = null; - $this->incoterm = null; - $this->items = []; - $this->nonDeliveryOption = \Shippo\API\Models\Components\CustomsDeclarationNonDeliveryOptionEnum::Abandon; - $this->test = null; + $this->certify = $certify; + $this->certifySigner = $certifySigner; + $this->contentsType = $contentsType; + $this->items = $items; + $this->nonDeliveryOption = $nonDeliveryOption; + $this->aesItn = $aesItn; + $this->b13aFilingOption = $b13aFilingOption; + $this->b13aNumber = $b13aNumber; + $this->certificate = $certificate; + $this->commercialInvoice = $commercialInvoice; + $this->contentsExplanation = $contentsExplanation; + $this->disclaimer = $disclaimer; + $this->dutiesPayor = $dutiesPayor; + $this->exporterIdentification = $exporterIdentification; + $this->exporterReference = $exporterReference; + $this->importerReference = $importerReference; + $this->isVatCollected = $isVatCollected; + $this->invoice = $invoice; + $this->license = $license; + $this->metadata = $metadata; + $this->notes = $notes; + $this->addressImporter = $addressImporter; + $this->eelPfc = $eelPfc; + $this->incoterm = $incoterm; + $this->test = $test; } } \ No newline at end of file diff --git a/src/Models/Components/CustomsDeclarationCreateRequestAddress.php b/src/Models/Components/CustomsDeclarationCreateRequestAddress.php new file mode 100644 index 0000000..6bd4910 --- /dev/null +++ b/src/Models/Components/CustomsDeclarationCreateRequestAddress.php @@ -0,0 +1,52 @@ +name = $name; + $this->zip = $zip; + $this->country = $country; + } +} \ No newline at end of file diff --git a/src/Models/Components/CustomsDeclarationCreateRequestType.php b/src/Models/Components/CustomsDeclarationCreateRequestType.php new file mode 100644 index 0000000..ed56b57 --- /dev/null +++ b/src/Models/Components/CustomsDeclarationCreateRequestType.php @@ -0,0 +1,18 @@ +account = $account; + $this->type = $type; + $this->address = $address; + } +} \ No newline at end of file diff --git a/src/Models/Components/CustomsDeclarationEelPfcEnum.php b/src/Models/Components/CustomsDeclarationEelPfcEnum.php index e837c2f..720c110 100644 --- a/src/Models/Components/CustomsDeclarationEelPfcEnum.php +++ b/src/Models/Components/CustomsDeclarationEelPfcEnum.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\CustomsDeclaration>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/CustomsDeclarationType.php b/src/Models/Components/CustomsDeclarationType.php new file mode 100644 index 0000000..6116243 --- /dev/null +++ b/src/Models/Components/CustomsDeclarationType.php @@ -0,0 +1,18 @@ +eoriNumber = null; - $this->taxId = null; + $this->eoriNumber = $eoriNumber; + $this->taxId = $taxId; } } \ No newline at end of file diff --git a/src/Models/Components/CustomsInvoicedCharges.php b/src/Models/Components/CustomsInvoicedCharges.php index 95aa411..ecc798c 100644 --- a/src/Models/Components/CustomsInvoicedCharges.php +++ b/src/Models/Components/CustomsInvoicedCharges.php @@ -1,7 +1,7 @@ currency = ''; - $this->totalShipping = null; - $this->totalTaxes = null; - $this->totalDuties = null; - $this->otherFees = null; + $this->currency = $currency; + $this->totalShipping = $totalShipping; + $this->totalTaxes = $totalTaxes; + $this->totalDuties = $totalDuties; + $this->otherFees = $otherFees; } } \ No newline at end of file diff --git a/src/Models/Components/CustomsItem.php b/src/Models/Components/CustomsItem.php index 2cc9f0c..f1a5aeb 100644 --- a/src/Models/Components/CustomsItem.php +++ b/src/Models/Components/CustomsItem.php @@ -1,7 +1,7 @@ ')] + #[\Speakeasy\Serializer\Annotation\SerializedName('mass_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\WeightUnitEnum')] public WeightUnitEnum $massUnit; /** @@ -46,9 +44,8 @@ class CustomsItem * * @var ?string $metadata */ - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; /** @@ -56,8 +53,7 @@ class CustomsItem * * @var string $netWeight */ - #[\JMS\Serializer\Annotation\SerializedName('net_weight')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('net_weight')] public string $netWeight; /** @@ -67,8 +63,7 @@ class CustomsItem * * @var string $originCountry */ - #[\JMS\Serializer\Annotation\SerializedName('origin_country')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('origin_country')] public string $originCountry; /** @@ -76,8 +71,7 @@ class CustomsItem * * @var int $quantity */ - #[\JMS\Serializer\Annotation\SerializedName('quantity')] - #[\JMS\Serializer\Annotation\Type('int')] + #[\Speakeasy\Serializer\Annotation\SerializedName('quantity')] public int $quantity; /** @@ -85,29 +79,26 @@ class CustomsItem * * @var ?string $skuCode */ - #[\JMS\Serializer\Annotation\SerializedName('sku_code')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('sku_code')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $skuCode = null; /** - * HS code of the item, which is required by some carriers. + * HS code of the item, which is required by some carriers. If `tariff_number` is not provided, `hs_code` will be used. If both `hs_code` and `tariff_number` are provided, `tariff_number` will be used. 50 character limit. * * @var ?string $hsCode */ - #[\JMS\Serializer\Annotation\SerializedName('hs_code')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('hs_code')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $hsCode = null; /** - * The tariff number of the item. + * The tariff number of the item. If `tariff_number` is not provided, `hs_code` will be used. If both `hs_code` and `tariff_number` are provided, `tariff_number` will be used. 12 character limit. * * @var ?string $tariffNumber */ - #[\JMS\Serializer\Annotation\SerializedName('tariff_number')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('tariff_number')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $tariffNumber = null; /** @@ -115,8 +106,7 @@ class CustomsItem * * @var string $valueAmount */ - #[\JMS\Serializer\Annotation\SerializedName('value_amount')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('value_amount')] public string $valueAmount; /** @@ -126,8 +116,7 @@ class CustomsItem * * @var string $valueCurrency */ - #[\JMS\Serializer\Annotation\SerializedName('value_currency')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('value_currency')] public string $valueCurrency; /** @@ -135,9 +124,8 @@ class CustomsItem * * @var ?\DateTime $objectCreated */ - #[\JMS\Serializer\Annotation\SerializedName('object_created')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectCreated = null; /** @@ -145,9 +133,8 @@ class CustomsItem * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; /** @@ -155,19 +142,18 @@ class CustomsItem * * @var ?string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectOwner = null; /** * Indicates the validity of the enclosing object * - * @var ?\Shippo\API\Models\Components\ObjectStateEnum $objectState + * @var ?ObjectStateEnum $objectState */ - #[\JMS\Serializer\Annotation\SerializedName('object_state')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_state')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ObjectStateEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?ObjectStateEnum $objectState = null; /** @@ -175,9 +161,8 @@ class CustomsItem * * @var ?\DateTime $objectUpdated */ - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectUpdated = null; /** @@ -185,30 +170,49 @@ class CustomsItem * * @var ?bool $test */ - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; - public function __construct() + /** + * @param string $description + * @param WeightUnitEnum $massUnit + * @param string $netWeight + * @param string $originCountry + * @param int $quantity + * @param string $valueAmount + * @param string $valueCurrency + * @param ?string $eccnEar99 + * @param ?string $metadata + * @param ?string $skuCode + * @param ?string $hsCode + * @param ?string $tariffNumber + * @param ?\DateTime $objectCreated + * @param ?string $objectId + * @param ?string $objectOwner + * @param ?ObjectStateEnum $objectState + * @param ?\DateTime $objectUpdated + * @param ?bool $test + */ + public function __construct(string $description, WeightUnitEnum $massUnit, string $netWeight, string $originCountry, int $quantity, string $valueAmount, string $valueCurrency, ?string $eccnEar99 = null, ?string $metadata = null, ?string $skuCode = null, ?string $hsCode = null, ?string $tariffNumber = null, ?\DateTime $objectCreated = null, ?string $objectId = null, ?string $objectOwner = null, ?ObjectStateEnum $objectState = null, ?\DateTime $objectUpdated = null, ?bool $test = null) { - $this->description = ''; - $this->eccnEar99 = null; - $this->massUnit = \Shippo\API\Models\Components\WeightUnitEnum::G; - $this->metadata = null; - $this->netWeight = ''; - $this->originCountry = ''; - $this->quantity = 0; - $this->skuCode = null; - $this->hsCode = null; - $this->tariffNumber = null; - $this->valueAmount = ''; - $this->valueCurrency = ''; - $this->objectCreated = null; - $this->objectId = null; - $this->objectOwner = null; - $this->objectState = null; - $this->objectUpdated = null; - $this->test = null; + $this->description = $description; + $this->massUnit = $massUnit; + $this->netWeight = $netWeight; + $this->originCountry = $originCountry; + $this->quantity = $quantity; + $this->valueAmount = $valueAmount; + $this->valueCurrency = $valueCurrency; + $this->eccnEar99 = $eccnEar99; + $this->metadata = $metadata; + $this->skuCode = $skuCode; + $this->hsCode = $hsCode; + $this->tariffNumber = $tariffNumber; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->objectState = $objectState; + $this->objectUpdated = $objectUpdated; + $this->test = $test; } } \ No newline at end of file diff --git a/src/Models/Components/CustomsItemCreateRequest.php b/src/Models/Components/CustomsItemCreateRequest.php index 4106dc9..cc444c9 100644 --- a/src/Models/Components/CustomsItemCreateRequest.php +++ b/src/Models/Components/CustomsItemCreateRequest.php @@ -1,7 +1,7 @@ ')] + #[\Speakeasy\Serializer\Annotation\SerializedName('mass_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\WeightUnitEnum')] public WeightUnitEnum $massUnit; /** @@ -46,9 +44,8 @@ class CustomsItemCreateRequest * * @var ?string $metadata */ - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; /** @@ -56,8 +53,7 @@ class CustomsItemCreateRequest * * @var string $netWeight */ - #[\JMS\Serializer\Annotation\SerializedName('net_weight')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('net_weight')] public string $netWeight; /** @@ -67,8 +63,7 @@ class CustomsItemCreateRequest * * @var string $originCountry */ - #[\JMS\Serializer\Annotation\SerializedName('origin_country')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('origin_country')] public string $originCountry; /** @@ -76,8 +71,7 @@ class CustomsItemCreateRequest * * @var int $quantity */ - #[\JMS\Serializer\Annotation\SerializedName('quantity')] - #[\JMS\Serializer\Annotation\Type('int')] + #[\Speakeasy\Serializer\Annotation\SerializedName('quantity')] public int $quantity; /** @@ -85,29 +79,26 @@ class CustomsItemCreateRequest * * @var ?string $skuCode */ - #[\JMS\Serializer\Annotation\SerializedName('sku_code')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('sku_code')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $skuCode = null; /** - * HS code of the item, which is required by some carriers. + * HS code of the item, which is required by some carriers. If `tariff_number` is not provided, `hs_code` will be used. If both `hs_code` and `tariff_number` are provided, `tariff_number` will be used. 50 character limit. * * @var ?string $hsCode */ - #[\JMS\Serializer\Annotation\SerializedName('hs_code')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('hs_code')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $hsCode = null; /** - * The tariff number of the item. + * The tariff number of the item. If `tariff_number` is not provided, `hs_code` will be used. If both `hs_code` and `tariff_number` are provided, `tariff_number` will be used. 12 character limit. * * @var ?string $tariffNumber */ - #[\JMS\Serializer\Annotation\SerializedName('tariff_number')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('tariff_number')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $tariffNumber = null; /** @@ -115,8 +106,7 @@ class CustomsItemCreateRequest * * @var string $valueAmount */ - #[\JMS\Serializer\Annotation\SerializedName('value_amount')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('value_amount')] public string $valueAmount; /** @@ -126,23 +116,36 @@ class CustomsItemCreateRequest * * @var string $valueCurrency */ - #[\JMS\Serializer\Annotation\SerializedName('value_currency')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('value_currency')] public string $valueCurrency; - public function __construct() + /** + * @param string $description + * @param WeightUnitEnum $massUnit + * @param string $netWeight + * @param string $originCountry + * @param int $quantity + * @param string $valueAmount + * @param string $valueCurrency + * @param ?string $eccnEar99 + * @param ?string $metadata + * @param ?string $skuCode + * @param ?string $hsCode + * @param ?string $tariffNumber + */ + public function __construct(string $description, WeightUnitEnum $massUnit, string $netWeight, string $originCountry, int $quantity, string $valueAmount, string $valueCurrency, ?string $eccnEar99 = null, ?string $metadata = null, ?string $skuCode = null, ?string $hsCode = null, ?string $tariffNumber = null) { - $this->description = ''; - $this->eccnEar99 = null; - $this->massUnit = \Shippo\API\Models\Components\WeightUnitEnum::G; - $this->metadata = null; - $this->netWeight = ''; - $this->originCountry = ''; - $this->quantity = 0; - $this->skuCode = null; - $this->hsCode = null; - $this->tariffNumber = null; - $this->valueAmount = ''; - $this->valueCurrency = ''; + $this->description = $description; + $this->massUnit = $massUnit; + $this->netWeight = $netWeight; + $this->originCountry = $originCountry; + $this->quantity = $quantity; + $this->valueAmount = $valueAmount; + $this->valueCurrency = $valueCurrency; + $this->eccnEar99 = $eccnEar99; + $this->metadata = $metadata; + $this->skuCode = $skuCode; + $this->hsCode = $hsCode; + $this->tariffNumber = $tariffNumber; } } \ No newline at end of file diff --git a/src/Models/Components/CustomsItemPaginatedList.php b/src/Models/Components/CustomsItemPaginatedList.php index 40e8fb2..aec1833 100644 --- a/src/Models/Components/CustomsItemPaginatedList.php +++ b/src/Models/Components/CustomsItemPaginatedList.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\CustomsItem>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/CustomsTaxIdentification.php b/src/Models/Components/CustomsTaxIdentification.php index e7eb45e..f049fed 100644 --- a/src/Models/Components/CustomsTaxIdentification.php +++ b/src/Models/Components/CustomsTaxIdentification.php @@ -1,7 +1,7 @@ ')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CustomsTaxIdentificationType|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?CustomsTaxIdentificationType $type = null; - public function __construct() + /** + * @param ?string $number + * @param ?CustomsTaxIdentificationType $type + */ + public function __construct(?string $number = null, ?CustomsTaxIdentificationType $type = null) { - $this->number = null; - $this->type = null; + $this->number = $number; + $this->type = $type; } } \ No newline at end of file diff --git a/src/Models/Components/CustomsTaxIdentificationType.php b/src/Models/Components/CustomsTaxIdentificationType.php index 931493d..f640e5b 100644 --- a/src/Models/Components/CustomsTaxIdentificationType.php +++ b/src/Models/Components/CustomsTaxIdentificationType.php @@ -1,7 +1,7 @@ contains = null; + $this->contains = $contains; } } \ No newline at end of file diff --git a/src/Models/Components/DangerousGoodsCode.php b/src/Models/Components/DangerousGoodsCode.php index 80f6916..ac8830d 100644 --- a/src/Models/Components/DangerousGoodsCode.php +++ b/src/Models/Components/DangerousGoodsCode.php @@ -1,7 +1,7 @@ contains = null; + $this->contains = $contains; } } \ No newline at end of file diff --git a/src/Models/Components/DangerousGoodsObject.php b/src/Models/Components/DangerousGoodsObject.php index 382bab1..97f0e1a 100644 --- a/src/Models/Components/DangerousGoodsObject.php +++ b/src/Models/Components/DangerousGoodsObject.php @@ -1,7 +1,7 @@ contains = null; - $this->biologicalMaterial = null; - $this->lithiumBatteries = null; + $this->contains = $contains; + $this->biologicalMaterial = $biologicalMaterial; + $this->lithiumBatteries = $lithiumBatteries; } } \ No newline at end of file diff --git a/src/Models/Components/DefaultParcelTemplate.php b/src/Models/Components/DefaultParcelTemplate.php index 7c5bb38..edec124 100644 --- a/src/Models/Components/DefaultParcelTemplate.php +++ b/src/Models/Components/DefaultParcelTemplate.php @@ -1,7 +1,7 @@ result = null; + $this->result = $result; } } \ No newline at end of file diff --git a/src/Models/Components/DefaultParcelTemplateUpdateRequest.php b/src/Models/Components/DefaultParcelTemplateUpdateRequest.php index b36ca68..6b2eb3a 100644 --- a/src/Models/Components/DefaultParcelTemplateUpdateRequest.php +++ b/src/Models/Components/DefaultParcelTemplateUpdateRequest.php @@ -1,7 +1,7 @@ objectId = null; + $this->objectId = $objectId; } } \ No newline at end of file diff --git a/src/Models/Components/DepartmentNumber.php b/src/Models/Components/DepartmentNumber.php index fd80351..1dc6307 100644 --- a/src/Models/Components/DepartmentNumber.php +++ b/src/Models/Components/DepartmentNumber.php @@ -1,7 +1,7 @@ prefix = null; - $this->value = null; - $this->refSort = null; + $this->prefix = $prefix; + $this->value = $value; + $this->refSort = $refSort; } } \ No newline at end of file diff --git a/src/Models/Components/DistanceUnitEnum.php b/src/Models/Components/DistanceUnitEnum.php index 902faa9..14afc63 100644 --- a/src/Models/Components/DistanceUnitEnum.php +++ b/src/Models/Components/DistanceUnitEnum.php @@ -1,7 +1,7 @@ containsDryIce = null; - $this->weight = null; + $this->containsDryIce = $containsDryIce; + $this->weight = $weight; } } \ No newline at end of file diff --git a/src/Models/Components/DutiesPayor.php b/src/Models/Components/DutiesPayor.php new file mode 100644 index 0000000..01541a6 --- /dev/null +++ b/src/Models/Components/DutiesPayor.php @@ -0,0 +1,54 @@ +account = $account; + $this->type = $type; + $this->address = $address; + } +} \ No newline at end of file diff --git a/src/Models/Components/FedExConnectExistingOwnAccountParameters.php b/src/Models/Components/FedExConnectExistingOwnAccountParameters.php new file mode 100644 index 0000000..93721aa --- /dev/null +++ b/src/Models/Components/FedExConnectExistingOwnAccountParameters.php @@ -0,0 +1,99 @@ +firstName = $firstName; + $this->lastName = $lastName; + $this->phoneNumber = $phoneNumber; + $this->fromAddressSt = $fromAddressSt; + $this->fromAddressCity = $fromAddressCity; + $this->fromAddressState = $fromAddressState; + $this->fromAddressZip = $fromAddressZip; + $this->fromAddressCountryIso2 = $fromAddressCountryIso2; + } +} \ No newline at end of file diff --git a/src/Models/Components/InstantTransactionCreateRequest.php b/src/Models/Components/InstantTransactionCreateRequest.php new file mode 100644 index 0000000..8e33ef8 --- /dev/null +++ b/src/Models/Components/InstantTransactionCreateRequest.php @@ -0,0 +1,88 @@ +carrierAccount = $carrierAccount; + $this->servicelevelToken = $servicelevelToken; + $this->shipment = $shipment; + $this->async = $async; + $this->labelFileType = $labelFileType; + $this->metadata = $metadata; + $this->order = $order; + } +} \ No newline at end of file diff --git a/src/Models/Components/Insurance.php b/src/Models/Components/Insurance.php index b903aae..1c94e8e 100644 --- a/src/Models/Components/Insurance.php +++ b/src/Models/Components/Insurance.php @@ -1,7 +1,7 @@ XCover, specify
`amount`, `content`, and `currency`.
Alternatively, you can choose carrier provided insurance by additionally specifying `provider` (UPS, FedEx and OnTrac only).

If you do not want to add insurance to you shipment, do not set these parameters. */ +/** + * Insurance - To add 3rd party insurance powered by XCover, + * + * specify
`amount`, `content`, and `currency`.
Alternatively, you can choose carrier provided insurance + * by additionally specifying `provider` (UPS, FedEx and OnTrac only).

If you do not want to add insurance + * to your shipment, do not set these parameters. + */ class Insurance { /** @@ -17,9 +23,8 @@ class Insurance * * @var ?string $amount */ - #[\JMS\Serializer\Annotation\SerializedName('amount')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('amount')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $amount = null; /** @@ -27,9 +32,8 @@ class Insurance * * @var ?string $content */ - #[\JMS\Serializer\Annotation\SerializedName('content')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('content')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $content = null; /** @@ -39,26 +43,31 @@ class Insurance * * @var ?string $currency */ - #[\JMS\Serializer\Annotation\SerializedName('currency')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('currency')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $currency = null; /** * To have insurance cover provided by a carrier directly instead of Shippo's provider (XCover), set `provider` to `FEDEX`, `UPS`, or `ONTRAC`. * - * @var ?\Shippo\API\Models\Components\Provider $provider + * @var ?Provider $provider */ - #[\JMS\Serializer\Annotation\SerializedName('provider')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('provider')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\Provider|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?Provider $provider = null; - public function __construct() + /** + * @param ?string $amount + * @param ?string $content + * @param ?string $currency + * @param ?Provider $provider + */ + public function __construct(?string $amount = null, ?string $content = null, ?string $currency = null, ?Provider $provider = null) { - $this->amount = null; - $this->content = null; - $this->currency = null; - $this->provider = null; + $this->amount = $amount; + $this->content = $content; + $this->currency = $currency; + $this->provider = $provider; } } \ No newline at end of file diff --git a/src/Models/Components/InvoiceNumber.php b/src/Models/Components/InvoiceNumber.php index c6e429f..cd5f025 100644 --- a/src/Models/Components/InvoiceNumber.php +++ b/src/Models/Components/InvoiceNumber.php @@ -1,7 +1,7 @@ prefix = null; - $this->value = null; - $this->refSort = null; + $this->prefix = $prefix; + $this->value = $value; + $this->refSort = $refSort; } } \ No newline at end of file diff --git a/src/Models/Components/LabelFileType.php b/src/Models/Components/LabelFileType.php new file mode 100644 index 0000000..455a1aa --- /dev/null +++ b/src/Models/Components/LabelFileType.php @@ -0,0 +1,23 @@ +")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('max_delivery_time')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $maxDeliveryTime = null; /** @@ -52,9 +49,8 @@ class LineItem * * @var ?\DateTime $maxShipTime */ - #[\JMS\Serializer\Annotation\SerializedName('max_ship_time')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('max_ship_time')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $maxShipTime = null; /** @@ -62,9 +58,8 @@ class LineItem * * @var ?int $quantity */ - #[\JMS\Serializer\Annotation\SerializedName('quantity')] - #[\JMS\Serializer\Annotation\Type('int')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('quantity')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?int $quantity = null; /** @@ -72,9 +67,8 @@ class LineItem * * @var ?string $sku */ - #[\JMS\Serializer\Annotation\SerializedName('sku')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('sku')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $sku = null; /** @@ -82,9 +76,8 @@ class LineItem * * @var ?string $title */ - #[\JMS\Serializer\Annotation\SerializedName('title')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('title')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $title = null; /** @@ -92,9 +85,8 @@ class LineItem * * @var ?string $totalPrice */ - #[\JMS\Serializer\Annotation\SerializedName('total_price')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('total_price')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $totalPrice = null; /** @@ -105,9 +97,8 @@ class LineItem * * @var ?string $variantTitle */ - #[\JMS\Serializer\Annotation\SerializedName('variant_title')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('variant_title')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $variantTitle = null; /** @@ -117,19 +108,18 @@ class LineItem * * @var ?string $weight */ - #[\JMS\Serializer\Annotation\SerializedName('weight')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $weight = null; /** * The unit used for weight. * - * @var ?\Shippo\API\Models\Components\WeightUnitEnum $weightUnit + * @var ?WeightUnitEnum $weightUnit */ - #[\JMS\Serializer\Annotation\SerializedName('weight_unit')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\WeightUnitEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?WeightUnitEnum $weightUnit = null; /** @@ -137,24 +127,37 @@ class LineItem * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; - public function __construct() + /** + * @param ?string $currency + * @param ?string $manufactureCountry + * @param ?\DateTime $maxDeliveryTime + * @param ?\DateTime $maxShipTime + * @param ?int $quantity + * @param ?string $sku + * @param ?string $title + * @param ?string $totalPrice + * @param ?string $variantTitle + * @param ?string $weight + * @param ?WeightUnitEnum $weightUnit + * @param ?string $objectId + */ + public function __construct(?string $currency = null, ?string $manufactureCountry = null, ?\DateTime $maxDeliveryTime = null, ?\DateTime $maxShipTime = null, ?int $quantity = null, ?string $sku = null, ?string $title = null, ?string $totalPrice = null, ?string $variantTitle = null, ?string $weight = null, ?WeightUnitEnum $weightUnit = null, ?string $objectId = null) { - $this->currency = null; - $this->manufactureCountry = null; - $this->maxDeliveryTime = null; - $this->maxShipTime = null; - $this->quantity = null; - $this->sku = null; - $this->title = null; - $this->totalPrice = null; - $this->variantTitle = null; - $this->weight = null; - $this->weightUnit = null; - $this->objectId = null; + $this->currency = $currency; + $this->manufactureCountry = $manufactureCountry; + $this->maxDeliveryTime = $maxDeliveryTime; + $this->maxShipTime = $maxShipTime; + $this->quantity = $quantity; + $this->sku = $sku; + $this->title = $title; + $this->totalPrice = $totalPrice; + $this->variantTitle = $variantTitle; + $this->weight = $weight; + $this->weightUnit = $weightUnit; + $this->objectId = $objectId; } } \ No newline at end of file diff --git a/src/Models/Components/LineItemBase.php b/src/Models/Components/LineItemBase.php index ae61036..58184c0 100644 --- a/src/Models/Components/LineItemBase.php +++ b/src/Models/Components/LineItemBase.php @@ -1,7 +1,7 @@ ")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('max_delivery_time')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $maxDeliveryTime = null; /** @@ -52,9 +49,8 @@ class LineItemBase * * @var ?\DateTime $maxShipTime */ - #[\JMS\Serializer\Annotation\SerializedName('max_ship_time')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('max_ship_time')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $maxShipTime = null; /** @@ -62,9 +58,8 @@ class LineItemBase * * @var ?int $quantity */ - #[\JMS\Serializer\Annotation\SerializedName('quantity')] - #[\JMS\Serializer\Annotation\Type('int')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('quantity')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?int $quantity = null; /** @@ -72,9 +67,8 @@ class LineItemBase * * @var ?string $sku */ - #[\JMS\Serializer\Annotation\SerializedName('sku')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('sku')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $sku = null; /** @@ -82,9 +76,8 @@ class LineItemBase * * @var ?string $title */ - #[\JMS\Serializer\Annotation\SerializedName('title')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('title')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $title = null; /** @@ -92,9 +85,8 @@ class LineItemBase * * @var ?string $totalPrice */ - #[\JMS\Serializer\Annotation\SerializedName('total_price')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('total_price')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $totalPrice = null; /** @@ -105,9 +97,8 @@ class LineItemBase * * @var ?string $variantTitle */ - #[\JMS\Serializer\Annotation\SerializedName('variant_title')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('variant_title')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $variantTitle = null; /** @@ -117,33 +108,45 @@ class LineItemBase * * @var ?string $weight */ - #[\JMS\Serializer\Annotation\SerializedName('weight')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $weight = null; /** * The unit used for weight. * - * @var ?\Shippo\API\Models\Components\WeightUnitEnum $weightUnit + * @var ?WeightUnitEnum $weightUnit */ - #[\JMS\Serializer\Annotation\SerializedName('weight_unit')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\WeightUnitEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?WeightUnitEnum $weightUnit = null; - public function __construct() + /** + * @param ?string $currency + * @param ?string $manufactureCountry + * @param ?\DateTime $maxDeliveryTime + * @param ?\DateTime $maxShipTime + * @param ?int $quantity + * @param ?string $sku + * @param ?string $title + * @param ?string $totalPrice + * @param ?string $variantTitle + * @param ?string $weight + * @param ?WeightUnitEnum $weightUnit + */ + public function __construct(?string $currency = null, ?string $manufactureCountry = null, ?\DateTime $maxDeliveryTime = null, ?\DateTime $maxShipTime = null, ?int $quantity = null, ?string $sku = null, ?string $title = null, ?string $totalPrice = null, ?string $variantTitle = null, ?string $weight = null, ?WeightUnitEnum $weightUnit = null) { - $this->currency = null; - $this->manufactureCountry = null; - $this->maxDeliveryTime = null; - $this->maxShipTime = null; - $this->quantity = null; - $this->sku = null; - $this->title = null; - $this->totalPrice = null; - $this->variantTitle = null; - $this->weight = null; - $this->weightUnit = null; + $this->currency = $currency; + $this->manufactureCountry = $manufactureCountry; + $this->maxDeliveryTime = $maxDeliveryTime; + $this->maxShipTime = $maxShipTime; + $this->quantity = $quantity; + $this->sku = $sku; + $this->title = $title; + $this->totalPrice = $totalPrice; + $this->variantTitle = $variantTitle; + $this->weight = $weight; + $this->weightUnit = $weightUnit; } } \ No newline at end of file diff --git a/src/Models/Components/LiveRate.php b/src/Models/Components/LiveRate.php index 1660c9b..88bdb83 100644 --- a/src/Models/Components/LiveRate.php +++ b/src/Models/Components/LiveRate.php @@ -1,7 +1,7 @@ amount = null; - $this->amountLocal = null; - $this->currency = null; - $this->currencyLocal = null; - $this->estimatedDays = null; - $this->title = null; + $this->amount = $amount; + $this->amountLocal = $amountLocal; + $this->currency = $currency; + $this->currencyLocal = $currencyLocal; + $this->estimatedDays = $estimatedDays; + $this->title = $title; } } \ No newline at end of file diff --git a/src/Models/Components/LiveRateCreateRequest.php b/src/Models/Components/LiveRateCreateRequest.php index d7b3a29..491933d 100644 --- a/src/Models/Components/LiveRateCreateRequest.php +++ b/src/Models/Components/LiveRateCreateRequest.php @@ -1,7 +1,7 @@ $lineItems + * @var array $lineItems */ - #[\JMS\Serializer\Annotation\SerializedName('line_items')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('line_items')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\LineItem>')] public array $lineItems; /** * Object ID for an existing User Parcel Template OR a fully formed Parcel object. * - * @var mixed $parcel + * @var string|Parcel|null $parcel */ - #[\JMS\Serializer\Annotation\SerializedName('parcel')] - #[\JMS\Serializer\Annotation\Type('mixed')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] - public mixed $parcel = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('parcel')] + #[\Speakeasy\Serializer\Annotation\Type('string|\Shippo\API\Models\Components\Parcel')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public string|Parcel|null $parcel = null; - public function __construct() + /** + * @param string|AddressCompleteCreateRequest $addressTo + * @param array $lineItems + * @param string|AddressCompleteCreateRequest|null $addressFrom + * @param string|Parcel|null $parcel + */ + public function __construct(string|AddressCompleteCreateRequest $addressTo, array $lineItems, string|AddressCompleteCreateRequest|null $addressFrom = null, string|Parcel|null $parcel = null) { - $this->addressFrom = null; - $this->addressTo = null; - $this->lineItems = []; - $this->parcel = null; + $this->addressTo = $addressTo; + $this->lineItems = $lineItems; + $this->addressFrom = $addressFrom; + $this->parcel = $parcel; } } \ No newline at end of file diff --git a/src/Models/Components/LiveRatePaginatedList.php b/src/Models/Components/LiveRatePaginatedList.php index 85548b5..26d441c 100644 --- a/src/Models/Components/LiveRatePaginatedList.php +++ b/src/Models/Components/LiveRatePaginatedList.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\LiveRate>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?int $count + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?int $count = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->count = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->count = $count; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/Location.php b/src/Models/Components/Location.php index 4f40712..5e23884 100644 --- a/src/Models/Components/Location.php +++ b/src/Models/Components/Location.php @@ -1,7 +1,7 @@ ')] + #[\Speakeasy\Serializer\Annotation\SerializedName('building_location_type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\BuildingLocationType')] public BuildingLocationType $buildingLocationType; /** * The type of building where the pickup is located. * - * @var ?\Shippo\API\Models\Components\BuildingType $buildingType + * @var ?BuildingType $buildingType */ - #[\JMS\Serializer\Annotation\SerializedName('building_type')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('building_type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\BuildingType|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?BuildingType $buildingType = null; /** @@ -50,16 +50,21 @@ class Location * * @var ?string $instructions */ - #[\JMS\Serializer\Annotation\SerializedName('instructions')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('instructions')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $instructions = null; - public function __construct() + /** + * @param AddressCompleteCreateRequest $address + * @param BuildingLocationType $buildingLocationType + * @param ?BuildingType $buildingType + * @param ?string $instructions + */ + public function __construct(AddressCompleteCreateRequest $address, BuildingLocationType $buildingLocationType, ?BuildingType $buildingType = null, ?string $instructions = null) { - $this->address = new \Shippo\API\Models\Components\AddressCompleteCreateRequest(); - $this->buildingLocationType = \Shippo\API\Models\Components\BuildingLocationType::BackDoor; - $this->buildingType = null; - $this->instructions = null; + $this->address = $address; + $this->buildingLocationType = $buildingLocationType; + $this->buildingType = $buildingType; + $this->instructions = $instructions; } } \ No newline at end of file diff --git a/src/Models/Components/Manifest.php b/src/Models/Components/Manifest.php index 5fe4a78..eedc292 100644 --- a/src/Models/Components/Manifest.php +++ b/src/Models/Components/Manifest.php @@ -1,7 +1,7 @@ $transactions */ - #[\JMS\Serializer\Annotation\SerializedName('transactions')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('transactions')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $transactions = null; /** @@ -50,8 +48,7 @@ class Manifest * * @var string $addressFrom */ - #[\JMS\Serializer\Annotation\SerializedName('address_from')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('address_from')] public string $addressFrom; /** @@ -59,8 +56,8 @@ class Manifest * * @var array $documents */ - #[\JMS\Serializer\Annotation\SerializedName('documents')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('documents')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $documents; /** @@ -68,9 +65,9 @@ class Manifest * * @var ?array $errors */ - #[\JMS\Serializer\Annotation\SerializedName('errors')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('errors')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $errors = null; /** @@ -78,8 +75,7 @@ class Manifest * * @var \DateTime $objectCreated */ - #[\JMS\Serializer\Annotation\SerializedName('object_created')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] public \DateTime $objectCreated; /** @@ -87,8 +83,7 @@ class Manifest * * @var string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] public string $objectId; /** @@ -96,8 +91,7 @@ class Manifest * * @var string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] public string $objectOwner; /** @@ -105,31 +99,43 @@ class Manifest * * @var \DateTime $objectUpdated */ - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] public \DateTime $objectUpdated; /** * Indicates the status of the manifest. * - * @var \Shippo\API\Models\Components\ManifestStatus $status + * @var ManifestStatus $status */ - #[\JMS\Serializer\Annotation\SerializedName('status')] - #[\JMS\Serializer\Annotation\Type('enum')] + #[\Speakeasy\Serializer\Annotation\SerializedName('status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ManifestStatus')] public ManifestStatus $status; - public function __construct() + /** + * @param string $carrierAccount + * @param string $shipmentDate + * @param string $addressFrom + * @param array $documents + * @param \DateTime $objectCreated + * @param string $objectId + * @param string $objectOwner + * @param \DateTime $objectUpdated + * @param ManifestStatus $status + * @param ?array $transactions + * @param ?array $errors + */ + public function __construct(string $carrierAccount, string $shipmentDate, string $addressFrom, array $documents, \DateTime $objectCreated, string $objectId, string $objectOwner, \DateTime $objectUpdated, ManifestStatus $status, ?array $transactions = null, ?array $errors = null) { - $this->carrierAccount = ''; - $this->shipmentDate = ''; - $this->transactions = null; - $this->addressFrom = ''; - $this->documents = []; - $this->errors = null; - $this->objectCreated = new \DateTime(); - $this->objectId = ''; - $this->objectOwner = ''; - $this->objectUpdated = new \DateTime(); - $this->status = \Shippo\API\Models\Components\ManifestStatus::Queued; + $this->carrierAccount = $carrierAccount; + $this->shipmentDate = $shipmentDate; + $this->addressFrom = $addressFrom; + $this->documents = $documents; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->objectUpdated = $objectUpdated; + $this->status = $status; + $this->transactions = $transactions; + $this->errors = $errors; } } \ No newline at end of file diff --git a/src/Models/Components/ManifestCreateRequest.php b/src/Models/Components/ManifestCreateRequest.php index cb3f7cd..931d9a0 100644 --- a/src/Models/Components/ManifestCreateRequest.php +++ b/src/Models/Components/ManifestCreateRequest.php @@ -1,7 +1,7 @@ $transactions */ - #[\JMS\Serializer\Annotation\SerializedName('transactions')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('transactions')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $transactions = null; - #[\JMS\Serializer\Annotation\SerializedName('address_from')] - #[\JMS\Serializer\Annotation\Type('mixed')] - public mixed $addressFrom; + /** + * + * @var AddressCreateRequest|string $addressFrom + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('address_from')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\AddressCreateRequest|string')] + public AddressCreateRequest|string $addressFrom; - #[\JMS\Serializer\Annotation\SerializedName('async')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?bool $async + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('async')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $async = null; - public function __construct() + /** + * @param string $carrierAccount + * @param string $shipmentDate + * @param AddressCreateRequest|string $addressFrom + * @param ?array $transactions + * @param ?bool $async + */ + public function __construct(string $carrierAccount, string $shipmentDate, AddressCreateRequest|string $addressFrom, ?array $transactions = null, ?bool $async = null) { - $this->carrierAccount = ''; - $this->shipmentDate = ''; - $this->transactions = null; - $this->addressFrom = null; - $this->async = null; + $this->carrierAccount = $carrierAccount; + $this->shipmentDate = $shipmentDate; + $this->addressFrom = $addressFrom; + $this->transactions = $transactions; + $this->async = $async; } } \ No newline at end of file diff --git a/src/Models/Components/ManifestPaginatedList.php b/src/Models/Components/ManifestPaginatedList.php index 5636a95..f0d1055 100644 --- a/src/Models/Components/ManifestPaginatedList.php +++ b/src/Models/Components/ManifestPaginatedList.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Manifest>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/ManifestStatus.php b/src/Models/Components/ManifestStatus.php index 697cf4f..ac903aa 100644 --- a/src/Models/Components/ManifestStatus.php +++ b/src/Models/Components/ManifestStatus.php @@ -1,7 +1,7 @@ authentication = null; + $this->authentication = $authentication; } } \ No newline at end of file diff --git a/src/Models/Components/ObjectResults.php b/src/Models/Components/ObjectResults.php index 0523b45..d10c628 100644 --- a/src/Models/Components/ObjectResults.php +++ b/src/Models/Components/ObjectResults.php @@ -1,7 +1,7 @@ `creation_succeeded`
`creation_failed`
`purchase_succeeded`
`purchase_failed` */ class ObjectResults { - #[\JMS\Serializer\Annotation\SerializedName('creation_failed')] - #[\JMS\Serializer\Annotation\Type('int')] + /** + * + * @var int $creationFailed + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('creation_failed')] public int $creationFailed; - #[\JMS\Serializer\Annotation\SerializedName('creation_succeeded')] - #[\JMS\Serializer\Annotation\Type('int')] + /** + * + * @var int $creationSucceeded + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('creation_succeeded')] public int $creationSucceeded; - #[\JMS\Serializer\Annotation\SerializedName('purchase_failed')] - #[\JMS\Serializer\Annotation\Type('int')] + /** + * + * @var int $purchaseFailed + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('purchase_failed')] public int $purchaseFailed; - #[\JMS\Serializer\Annotation\SerializedName('purchase_succeeded')] - #[\JMS\Serializer\Annotation\Type('int')] + /** + * + * @var int $purchaseSucceeded + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('purchase_succeeded')] public int $purchaseSucceeded; - public function __construct() + /** + * @param int $creationFailed + * @param int $creationSucceeded + * @param int $purchaseFailed + * @param int $purchaseSucceeded + */ + public function __construct(int $creationFailed, int $creationSucceeded, int $purchaseFailed, int $purchaseSucceeded) { - $this->creationFailed = 0; - $this->creationSucceeded = 0; - $this->purchaseFailed = 0; - $this->purchaseSucceeded = 0; + $this->creationFailed = $creationFailed; + $this->creationSucceeded = $creationSucceeded; + $this->purchaseFailed = $purchaseFailed; + $this->purchaseSucceeded = $purchaseSucceeded; } } \ No newline at end of file diff --git a/src/Models/Components/ObjectState.php b/src/Models/Components/ObjectState.php index b102975..cdf7487 100644 --- a/src/Models/Components/ObjectState.php +++ b/src/Models/Components/ObjectState.php @@ -1,7 +1,7 @@ ')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('order_status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\OrderStatusEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?OrderStatusEnum $orderStatus = null; /** @@ -60,8 +57,7 @@ class Order * * @var string $placedAt */ - #[\JMS\Serializer\Annotation\SerializedName('placed_at')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('placed_at')] public string $placedAt; /** @@ -69,9 +65,8 @@ class Order * * @var ?string $shippingCost */ - #[\JMS\Serializer\Annotation\SerializedName('shipping_cost')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('shipping_cost')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $shippingCost = null; /** @@ -81,9 +76,8 @@ class Order * * @var ?string $shippingCostCurrency */ - #[\JMS\Serializer\Annotation\SerializedName('shipping_cost_currency')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('shipping_cost_currency')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $shippingCostCurrency = null; /** @@ -93,14 +87,16 @@ class Order * * @var ?string $shippingMethod */ - #[\JMS\Serializer\Annotation\SerializedName('shipping_method')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('shipping_method')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $shippingMethod = null; - #[\JMS\Serializer\Annotation\SerializedName('subtotal_price')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?string $subtotalPrice + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('subtotal_price')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $subtotalPrice = null; /** @@ -108,9 +104,8 @@ class Order * * @var ?string $totalPrice */ - #[\JMS\Serializer\Annotation\SerializedName('total_price')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('total_price')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $totalPrice = null; /** @@ -118,9 +113,8 @@ class Order * * @var ?string $totalTax */ - #[\JMS\Serializer\Annotation\SerializedName('total_tax')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('total_tax')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $totalTax = null; /** @@ -128,38 +122,37 @@ class Order * * @var ?string $weight */ - #[\JMS\Serializer\Annotation\SerializedName('weight')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $weight = null; /** * The unit used for weight. * - * @var ?\Shippo\API\Models\Components\WeightUnitEnum $weightUnit + * @var ?WeightUnitEnum $weightUnit */ - #[\JMS\Serializer\Annotation\SerializedName('weight_unit')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\WeightUnitEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?WeightUnitEnum $weightUnit = null; /** * Address object of the sender / seller. Will be returned expanded by default. * - * @var ?\Shippo\API\Models\Components\Address $fromAddress + * @var ?Address $fromAddress */ - #[\JMS\Serializer\Annotation\SerializedName('from_address')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\Address')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('from_address')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\Address|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?Address $fromAddress = null; /** * Address object of the recipient / buyer. Will be returned expanded by default. * - * @var \Shippo\API\Models\Components\Address $toAddress + * @var Address $toAddress */ - #[\JMS\Serializer\Annotation\SerializedName('to_address')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\Address')] + #[\Speakeasy\Serializer\Annotation\SerializedName('to_address')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\Address')] public Address $toAddress; /** @@ -167,11 +160,11 @@ class Order * * All objects will be returned expanded by default. * - * @var ?array<\Shippo\API\Models\Components\LineItem> $lineItems + * @var ?array $lineItems */ - #[\JMS\Serializer\Annotation\SerializedName('line_items')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('line_items')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\LineItem>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $lineItems = null; /** @@ -179,9 +172,8 @@ class Order * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; /** @@ -189,9 +181,8 @@ class Order * * @var ?string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectOwner = null; /** @@ -199,46 +190,68 @@ class Order * * Orders created via the Shippo API or dashboard will have the value "Shippo". * - * @var ?\Shippo\API\Models\Components\ShopApp $shopApp + * @var ?OrderShopAppEnum $shopApp */ - #[\JMS\Serializer\Annotation\SerializedName('shop_app')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] - public ?ShopApp $shopApp = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('shop_app')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\OrderShopAppEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?OrderShopAppEnum $shopApp = null; /** * Array of transaction objects representing all shipping labels purchased for this order. * * All objects are returned expanded with a limited number of fields by default. * - * @var ?array $transactions + * @var ?array $transactions */ - #[\JMS\Serializer\Annotation\SerializedName('transactions')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('transactions')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Transactions>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $transactions = null; - public function __construct() + /** + * @param string $placedAt + * @param Address $toAddress + * @param ?string $currency + * @param ?string $notes + * @param ?string $orderNumber + * @param ?OrderStatusEnum $orderStatus + * @param ?string $shippingCost + * @param ?string $shippingCostCurrency + * @param ?string $shippingMethod + * @param ?string $subtotalPrice + * @param ?string $totalPrice + * @param ?string $totalTax + * @param ?string $weight + * @param ?WeightUnitEnum $weightUnit + * @param ?Address $fromAddress + * @param ?array $lineItems + * @param ?string $objectId + * @param ?string $objectOwner + * @param ?OrderShopAppEnum $shopApp + * @param ?array $transactions + */ + public function __construct(string $placedAt, Address $toAddress, ?string $currency = null, ?string $notes = null, ?string $orderNumber = null, ?OrderStatusEnum $orderStatus = null, ?string $shippingCost = null, ?string $shippingCostCurrency = null, ?string $shippingMethod = null, ?string $subtotalPrice = null, ?string $totalPrice = null, ?string $totalTax = null, ?string $weight = null, ?WeightUnitEnum $weightUnit = null, ?Address $fromAddress = null, ?array $lineItems = null, ?string $objectId = null, ?string $objectOwner = null, ?OrderShopAppEnum $shopApp = null, ?array $transactions = null) { - $this->currency = null; - $this->notes = null; - $this->orderNumber = null; - $this->orderStatus = null; - $this->placedAt = ''; - $this->shippingCost = null; - $this->shippingCostCurrency = null; - $this->shippingMethod = null; - $this->subtotalPrice = null; - $this->totalPrice = null; - $this->totalTax = null; - $this->weight = null; - $this->weightUnit = null; - $this->fromAddress = null; - $this->toAddress = new \Shippo\API\Models\Components\Address(); - $this->lineItems = null; - $this->objectId = null; - $this->objectOwner = null; - $this->shopApp = null; - $this->transactions = null; + $this->placedAt = $placedAt; + $this->toAddress = $toAddress; + $this->currency = $currency; + $this->notes = $notes; + $this->orderNumber = $orderNumber; + $this->orderStatus = $orderStatus; + $this->shippingCost = $shippingCost; + $this->shippingCostCurrency = $shippingCostCurrency; + $this->shippingMethod = $shippingMethod; + $this->subtotalPrice = $subtotalPrice; + $this->totalPrice = $totalPrice; + $this->totalTax = $totalTax; + $this->weight = $weight; + $this->weightUnit = $weightUnit; + $this->fromAddress = $fromAddress; + $this->lineItems = $lineItems; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->shopApp = $shopApp; + $this->transactions = $transactions; } } \ No newline at end of file diff --git a/src/Models/Components/OrderCreateRequest.php b/src/Models/Components/OrderCreateRequest.php index 2c8c926..c7ac9f5 100644 --- a/src/Models/Components/OrderCreateRequest.php +++ b/src/Models/Components/OrderCreateRequest.php @@ -1,7 +1,7 @@ ')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('order_status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\OrderStatusEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?OrderStatusEnum $orderStatus = null; /** @@ -60,8 +57,7 @@ class OrderCreateRequest * * @var string $placedAt */ - #[\JMS\Serializer\Annotation\SerializedName('placed_at')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('placed_at')] public string $placedAt; /** @@ -69,9 +65,8 @@ class OrderCreateRequest * * @var ?string $shippingCost */ - #[\JMS\Serializer\Annotation\SerializedName('shipping_cost')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('shipping_cost')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $shippingCost = null; /** @@ -81,9 +76,8 @@ class OrderCreateRequest * * @var ?string $shippingCostCurrency */ - #[\JMS\Serializer\Annotation\SerializedName('shipping_cost_currency')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('shipping_cost_currency')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $shippingCostCurrency = null; /** @@ -93,14 +87,16 @@ class OrderCreateRequest * * @var ?string $shippingMethod */ - #[\JMS\Serializer\Annotation\SerializedName('shipping_method')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('shipping_method')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $shippingMethod = null; - #[\JMS\Serializer\Annotation\SerializedName('subtotal_price')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?string $subtotalPrice + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('subtotal_price')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $subtotalPrice = null; /** @@ -108,9 +104,8 @@ class OrderCreateRequest * * @var ?string $totalPrice */ - #[\JMS\Serializer\Annotation\SerializedName('total_price')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('total_price')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $totalPrice = null; /** @@ -118,9 +113,8 @@ class OrderCreateRequest * * @var ?string $totalTax */ - #[\JMS\Serializer\Annotation\SerializedName('total_tax')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('total_tax')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $totalTax = null; /** @@ -128,38 +122,37 @@ class OrderCreateRequest * * @var ?string $weight */ - #[\JMS\Serializer\Annotation\SerializedName('weight')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $weight = null; /** * The unit used for weight. * - * @var ?\Shippo\API\Models\Components\WeightUnitEnum $weightUnit + * @var ?WeightUnitEnum $weightUnit */ - #[\JMS\Serializer\Annotation\SerializedName('weight_unit')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\WeightUnitEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?WeightUnitEnum $weightUnit = null; /** * Address object of the sender / seller. Will be returned expanded by default.. * - * @var ?\Shippo\API\Models\Components\AddressCreateRequest $fromAddress + * @var ?AddressCreateRequest $fromAddress */ - #[\JMS\Serializer\Annotation\SerializedName('from_address')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\AddressCreateRequest')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('from_address')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\AddressCreateRequest|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?AddressCreateRequest $fromAddress = null; /** * Address object of the recipient / buyer. Will be returned expanded by default. * - * @var \Shippo\API\Models\Components\AddressCreateRequest $toAddress + * @var AddressCreateRequest $toAddress */ - #[\JMS\Serializer\Annotation\SerializedName('to_address')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\AddressCreateRequest')] + #[\Speakeasy\Serializer\Annotation\SerializedName('to_address')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\AddressCreateRequest')] public AddressCreateRequest $toAddress; /** @@ -167,30 +160,48 @@ class OrderCreateRequest * * All objects will be returned expanded by default. * - * @var ?array<\Shippo\API\Models\Components\LineItemBase> $lineItems + * @var ?array $lineItems */ - #[\JMS\Serializer\Annotation\SerializedName('line_items')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('line_items')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\LineItemBase>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $lineItems = null; - public function __construct() + /** + * @param string $placedAt + * @param AddressCreateRequest $toAddress + * @param ?string $currency + * @param ?string $notes + * @param ?string $orderNumber + * @param ?OrderStatusEnum $orderStatus + * @param ?string $shippingCost + * @param ?string $shippingCostCurrency + * @param ?string $shippingMethod + * @param ?string $subtotalPrice + * @param ?string $totalPrice + * @param ?string $totalTax + * @param ?string $weight + * @param ?WeightUnitEnum $weightUnit + * @param ?AddressCreateRequest $fromAddress + * @param ?array $lineItems + */ + public function __construct(string $placedAt, AddressCreateRequest $toAddress, ?string $currency = null, ?string $notes = null, ?string $orderNumber = null, ?OrderStatusEnum $orderStatus = null, ?string $shippingCost = null, ?string $shippingCostCurrency = null, ?string $shippingMethod = null, ?string $subtotalPrice = null, ?string $totalPrice = null, ?string $totalTax = null, ?string $weight = null, ?WeightUnitEnum $weightUnit = null, ?AddressCreateRequest $fromAddress = null, ?array $lineItems = null) { - $this->currency = null; - $this->notes = null; - $this->orderNumber = null; - $this->orderStatus = null; - $this->placedAt = ''; - $this->shippingCost = null; - $this->shippingCostCurrency = null; - $this->shippingMethod = null; - $this->subtotalPrice = null; - $this->totalPrice = null; - $this->totalTax = null; - $this->weight = null; - $this->weightUnit = null; - $this->fromAddress = null; - $this->toAddress = new \Shippo\API\Models\Components\AddressCreateRequest(); - $this->lineItems = null; + $this->placedAt = $placedAt; + $this->toAddress = $toAddress; + $this->currency = $currency; + $this->notes = $notes; + $this->orderNumber = $orderNumber; + $this->orderStatus = $orderStatus; + $this->shippingCost = $shippingCost; + $this->shippingCostCurrency = $shippingCostCurrency; + $this->shippingMethod = $shippingMethod; + $this->subtotalPrice = $subtotalPrice; + $this->totalPrice = $totalPrice; + $this->totalTax = $totalTax; + $this->weight = $weight; + $this->weightUnit = $weightUnit; + $this->fromAddress = $fromAddress; + $this->lineItems = $lineItems; } } \ No newline at end of file diff --git a/src/Models/Components/OrderPaginatedList.php b/src/Models/Components/OrderPaginatedList.php index 0b1a093..a4bc3fd 100644 --- a/src/Models/Components/OrderPaginatedList.php +++ b/src/Models/Components/OrderPaginatedList.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Order>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/ShopApp.php b/src/Models/Components/OrderShopAppEnum.php similarity index 84% rename from src/Models/Components/ShopApp.php rename to src/Models/Components/OrderShopAppEnum.php index fa40e8e..69680b1 100644 --- a/src/Models/Components/ShopApp.php +++ b/src/Models/Components/OrderShopAppEnum.php @@ -1,7 +1,7 @@ Parcel Extra table below for all available services. * - * @var ?\Shippo\API\Models\Components\ParcelExtra $extra + * @var ?ParcelExtra $extra */ - #[\JMS\Serializer\Annotation\SerializedName('extra')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\ParcelExtra')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('extra')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ParcelExtra|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?ParcelExtra $extra = null; - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?string $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; /** * The unit used for weight. * - * @var \Shippo\API\Models\Components\WeightUnitEnum $massUnit + * @var WeightUnitEnum $massUnit */ - #[\JMS\Serializer\Annotation\SerializedName('mass_unit')] - #[\JMS\Serializer\Annotation\Type('enum')] + #[\Speakeasy\Serializer\Annotation\SerializedName('mass_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\WeightUnitEnum')] public WeightUnitEnum $massUnit; /** @@ -42,17 +45,16 @@ class Parcel * * @var string $weight */ - #[\JMS\Serializer\Annotation\SerializedName('weight')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight')] public string $weight; /** * The measure unit used for length, width and height. * - * @var \Shippo\API\Models\Components\DistanceUnitEnum $distanceUnit + * @var DistanceUnitEnum $distanceUnit */ - #[\JMS\Serializer\Annotation\SerializedName('distance_unit')] - #[\JMS\Serializer\Annotation\Type('enum')] + #[\Speakeasy\Serializer\Annotation\SerializedName('distance_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\DistanceUnitEnum')] public DistanceUnitEnum $distanceUnit; /** @@ -60,8 +62,7 @@ class Parcel * * @var string $height */ - #[\JMS\Serializer\Annotation\SerializedName('height')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('height')] public string $height; /** @@ -69,8 +70,7 @@ class Parcel * * @var string $length */ - #[\JMS\Serializer\Annotation\SerializedName('length')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('length')] public string $length; /** @@ -78,8 +78,7 @@ class Parcel * * @var string $width */ - #[\JMS\Serializer\Annotation\SerializedName('width')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('width')] public string $width; /** @@ -87,9 +86,8 @@ class Parcel * * @var ?\DateTime $objectCreated */ - #[\JMS\Serializer\Annotation\SerializedName('object_created')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectCreated = null; /** @@ -97,9 +95,8 @@ class Parcel * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; /** @@ -107,19 +104,18 @@ class Parcel * * @var ?string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectOwner = null; /** * A Parcel will only be valid when all required values have been sent and validated successfully. * - * @var ?\Shippo\API\Models\Components\ObjectState $objectState + * @var ?ObjectState $objectState */ - #[\JMS\Serializer\Annotation\SerializedName('object_state')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_state')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ObjectState|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?ObjectState $objectState = null; /** @@ -127,47 +123,62 @@ class Parcel * * @var ?\DateTime $objectUpdated */ - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectUpdated = null; /** * If template is passed, `length`, `width`, `height`, and `distance_unit` are not required * - * @var mixed $template + * @var ParcelTemplateFedExEnum|ParcelTemplateUPSEnum|ParcelTemplateUSPSEnum|ParcelTemplateDHLeCommerceEnum|ParcelTemplateDPDUKEnum|ParcelTemplateCouriersPleaseEnum|ParcelTemplateAramexAustraliaEnum|null $template */ - #[\JMS\Serializer\Annotation\SerializedName('template')] - #[\JMS\Serializer\Annotation\Type('mixed')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] - public mixed $template = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('template')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ParcelTemplateFedExEnum|\Shippo\API\Models\Components\ParcelTemplateUPSEnum|\Shippo\API\Models\Components\ParcelTemplateUSPSEnum|\Shippo\API\Models\Components\ParcelTemplateDHLeCommerceEnum|\Shippo\API\Models\Components\ParcelTemplateDPDUKEnum|\Shippo\API\Models\Components\ParcelTemplateCouriersPleaseEnum|\Shippo\API\Models\Components\ParcelTemplateAramexAustraliaEnum')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ParcelTemplateFedExEnum|ParcelTemplateUPSEnum|ParcelTemplateUSPSEnum|ParcelTemplateDHLeCommerceEnum|ParcelTemplateDPDUKEnum|ParcelTemplateCouriersPleaseEnum|ParcelTemplateAramexAustraliaEnum|null $template = null; /** * Indicates whether the object has been created in test mode. * * @var ?bool $test */ - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; - public function __construct() + /** + * @param WeightUnitEnum $massUnit + * @param string $weight + * @param DistanceUnitEnum $distanceUnit + * @param string $height + * @param string $length + * @param string $width + * @param ?ParcelExtra $extra + * @param ?string $metadata + * @param ?\DateTime $objectCreated + * @param ?string $objectId + * @param ?string $objectOwner + * @param ?ObjectState $objectState + * @param ?\DateTime $objectUpdated + * @param ParcelTemplateFedExEnum|ParcelTemplateUPSEnum|ParcelTemplateUSPSEnum|ParcelTemplateDHLeCommerceEnum|ParcelTemplateDPDUKEnum|ParcelTemplateCouriersPleaseEnum|ParcelTemplateAramexAustraliaEnum|null $template + * @param ?bool $test + */ + public function __construct(WeightUnitEnum $massUnit, string $weight, DistanceUnitEnum $distanceUnit, string $height, string $length, string $width, ?ParcelExtra $extra = null, ?string $metadata = null, ?\DateTime $objectCreated = null, ?string $objectId = null, ?string $objectOwner = null, ?ObjectState $objectState = null, ?\DateTime $objectUpdated = null, ParcelTemplateFedExEnum|ParcelTemplateUPSEnum|ParcelTemplateUSPSEnum|ParcelTemplateDHLeCommerceEnum|ParcelTemplateDPDUKEnum|ParcelTemplateCouriersPleaseEnum|ParcelTemplateAramexAustraliaEnum|null $template = null, ?bool $test = null) { - $this->extra = null; - $this->metadata = null; - $this->massUnit = \Shippo\API\Models\Components\WeightUnitEnum::G; - $this->weight = ''; - $this->distanceUnit = \Shippo\API\Models\Components\DistanceUnitEnum::Cm; - $this->height = ''; - $this->length = ''; - $this->width = ''; - $this->objectCreated = null; - $this->objectId = null; - $this->objectOwner = null; - $this->objectState = null; - $this->objectUpdated = null; - $this->template = null; - $this->test = null; + $this->massUnit = $massUnit; + $this->weight = $weight; + $this->distanceUnit = $distanceUnit; + $this->height = $height; + $this->length = $length; + $this->width = $width; + $this->extra = $extra; + $this->metadata = $metadata; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->objectState = $objectState; + $this->objectUpdated = $objectUpdated; + $this->template = $template; + $this->test = $test; } } \ No newline at end of file diff --git a/src/Models/Components/ParcelCreateFromTemplateRequest.php b/src/Models/Components/ParcelCreateFromTemplateRequest.php new file mode 100644 index 0000000..9f751c6 --- /dev/null +++ b/src/Models/Components/ParcelCreateFromTemplateRequest.php @@ -0,0 +1,75 @@ +Parcel Extra table below for all available services. + * + * @var ?ParcelExtra $extra + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('extra')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ParcelExtra|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?ParcelExtra $extra = null; + + /** + * + * @var ?string $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $metadata = null; + + /** + * The unit used for weight. + * + * @var WeightUnitEnum $massUnit + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('mass_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\WeightUnitEnum')] + public WeightUnitEnum $massUnit; + + /** + * Weight of the parcel. Up to six digits in front and four digits after the decimal separator are accepted. + * + * @var string $weight + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('weight')] + public string $weight; + + /** + * If template is passed, `length`, `width`, `height`, and `distance_unit` are not required + * + * @var ParcelTemplateFedExEnum|ParcelTemplateUPSEnum|ParcelTemplateUSPSEnum|ParcelTemplateDHLeCommerceEnum|ParcelTemplateDPDUKEnum|ParcelTemplateCouriersPleaseEnum|ParcelTemplateAramexAustraliaEnum $template + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('template')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ParcelTemplateFedExEnum|\Shippo\API\Models\Components\ParcelTemplateUPSEnum|\Shippo\API\Models\Components\ParcelTemplateUSPSEnum|\Shippo\API\Models\Components\ParcelTemplateDHLeCommerceEnum|\Shippo\API\Models\Components\ParcelTemplateDPDUKEnum|\Shippo\API\Models\Components\ParcelTemplateCouriersPleaseEnum|\Shippo\API\Models\Components\ParcelTemplateAramexAustraliaEnum')] + public ParcelTemplateFedExEnum|ParcelTemplateUPSEnum|ParcelTemplateUSPSEnum|ParcelTemplateDHLeCommerceEnum|ParcelTemplateDPDUKEnum|ParcelTemplateCouriersPleaseEnum|ParcelTemplateAramexAustraliaEnum $template; + + /** + * @param WeightUnitEnum $massUnit + * @param string $weight + * @param ParcelTemplateFedExEnum|ParcelTemplateUPSEnum|ParcelTemplateUSPSEnum|ParcelTemplateDHLeCommerceEnum|ParcelTemplateDPDUKEnum|ParcelTemplateCouriersPleaseEnum|ParcelTemplateAramexAustraliaEnum $template + * @param ?ParcelExtra $extra + * @param ?string $metadata + */ + public function __construct(WeightUnitEnum $massUnit, string $weight, ParcelTemplateFedExEnum|ParcelTemplateUPSEnum|ParcelTemplateUSPSEnum|ParcelTemplateDHLeCommerceEnum|ParcelTemplateDPDUKEnum|ParcelTemplateCouriersPleaseEnum|ParcelTemplateAramexAustraliaEnum $template, ?ParcelExtra $extra = null, ?string $metadata = null) + { + $this->massUnit = $massUnit; + $this->weight = $weight; + $this->template = $template; + $this->extra = $extra; + $this->metadata = $metadata; + } +} \ No newline at end of file diff --git a/src/Models/Components/ParcelCreateRequest.php b/src/Models/Components/ParcelCreateRequest.php new file mode 100644 index 0000000..0534a05 --- /dev/null +++ b/src/Models/Components/ParcelCreateRequest.php @@ -0,0 +1,105 @@ +Parcel Extra table below for all available services. + * + * @var ?ParcelExtra $extra + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('extra')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ParcelExtra|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?ParcelExtra $extra = null; + + /** + * + * @var ?string $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $metadata = null; + + /** + * The unit used for weight. + * + * @var WeightUnitEnum $massUnit + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('mass_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\WeightUnitEnum')] + public WeightUnitEnum $massUnit; + + /** + * Weight of the parcel. Up to six digits in front and four digits after the decimal separator are accepted. + * + * @var string $weight + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('weight')] + public string $weight; + + /** + * The measure unit used for length, width and height. + * + * @var DistanceUnitEnum $distanceUnit + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('distance_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\DistanceUnitEnum')] + public DistanceUnitEnum $distanceUnit; + + /** + * Height of the parcel. Up to six digits in front and four digits after the decimal separator are accepted. + * + * @var string $height + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('height')] + public string $height; + + /** + * Length of the Parcel. Up to six digits in front and four digits after the decimal separator are accepted. + * + * @var string $length + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('length')] + public string $length; + + /** + * Width of the Parcel. Up to six digits in front and four digits after the decimal separator are accepted. + * + * @var string $width + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('width')] + public string $width; + + /** + * @param WeightUnitEnum $massUnit + * @param string $weight + * @param DistanceUnitEnum $distanceUnit + * @param string $height + * @param string $length + * @param string $width + * @param ?ParcelExtra $extra + * @param ?string $metadata + */ + public function __construct(WeightUnitEnum $massUnit, string $weight, DistanceUnitEnum $distanceUnit, string $height, string $length, string $width, ?ParcelExtra $extra = null, ?string $metadata = null) + { + $this->massUnit = $massUnit; + $this->weight = $weight; + $this->distanceUnit = $distanceUnit; + $this->height = $height; + $this->length = $length; + $this->width = $width; + $this->extra = $extra; + $this->metadata = $metadata; + } +} \ No newline at end of file diff --git a/src/Models/Components/ParcelExtra.php b/src/Models/Components/ParcelExtra.php index e24371b..a3c818f 100644 --- a/src/Models/Components/ParcelExtra.php +++ b/src/Models/Components/ParcelExtra.php @@ -1,7 +1,7 @@
If you do not want to add insurance to you parcel, do not set these parameters. * - * @var ?\Shippo\API\Models\Components\ParcelInsurance $insurance + * @var ?ParcelInsurance $insurance */ - #[\JMS\Serializer\Annotation\SerializedName('insurance')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\ParcelInsurance')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('insurance')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ParcelInsurance|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?ParcelInsurance $insurance = null; /** @@ -41,9 +41,8 @@ class ParcelExtra * * @var ?string $reference1 */ - #[\JMS\Serializer\Annotation\SerializedName('reference_1')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('reference_1')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $reference1 = null; /** @@ -51,16 +50,21 @@ class ParcelExtra * * @var ?string $reference2 */ - #[\JMS\Serializer\Annotation\SerializedName('reference_2')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('reference_2')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $reference2 = null; - public function __construct() + /** + * @param ?Cod $cod + * @param ?ParcelInsurance $insurance + * @param ?string $reference1 + * @param ?string $reference2 + */ + public function __construct(?Cod $cod = null, ?ParcelInsurance $insurance = null, ?string $reference1 = null, ?string $reference2 = null) { - $this->cod = null; - $this->insurance = null; - $this->reference1 = null; - $this->reference2 = null; + $this->cod = $cod; + $this->insurance = $insurance; + $this->reference1 = $reference1; + $this->reference2 = $reference2; } } \ No newline at end of file diff --git a/src/Models/Components/ParcelInsurance.php b/src/Models/Components/ParcelInsurance.php index bb43d0f..ad1a9d5 100644 --- a/src/Models/Components/ParcelInsurance.php +++ b/src/Models/Components/ParcelInsurance.php @@ -1,7 +1,7 @@ ')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('provider')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ParcelInsuranceProvider|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?ParcelInsuranceProvider $provider = null; - public function __construct() + /** + * @param ?string $amount + * @param ?string $content + * @param ?string $currency + * @param ?ParcelInsuranceProvider $provider + */ + public function __construct(?string $amount = null, ?string $content = null, ?string $currency = null, ?ParcelInsuranceProvider $provider = null) { - $this->amount = null; - $this->content = null; - $this->currency = null; - $this->provider = null; + $this->amount = $amount; + $this->content = $content; + $this->currency = $currency; + $this->provider = $provider; } } \ No newline at end of file diff --git a/src/Models/Components/ParcelInsuranceProvider.php b/src/Models/Components/ParcelInsuranceProvider.php index 38d5354..a6fa505 100644 --- a/src/Models/Components/ParcelInsuranceProvider.php +++ b/src/Models/Components/ParcelInsuranceProvider.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Parcel>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/ParcelTemplateAramexAustraliaEnum.php b/src/Models/Components/ParcelTemplateAramexAustraliaEnum.php new file mode 100644 index 0000000..b403690 --- /dev/null +++ b/src/Models/Components/ParcelTemplateAramexAustraliaEnum.php @@ -0,0 +1,28 @@ +servicelevels. - * - * @var ?string $token - */ - #[\JMS\Serializer\Annotation\SerializedName('token')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] - public ?string $token = null; - - /** - * Unique, extended version of the Service Level "token". - * - * Guaranteed to be unique across all Service Levels, and may help offer insight into the specific Service Level it describes. - * - * @var ?string $extendedToken - */ - #[\JMS\Serializer\Annotation\SerializedName('extended_token')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] - public ?string $extendedToken = null; - - public function __construct() - { - $this->name = null; - $this->terms = null; - $this->token = null; - $this->extendedToken = null; - } -} \ No newline at end of file diff --git a/src/Models/Components/PaymentMethod.php b/src/Models/Components/PaymentMethod.php index 235a2be..ac4a470 100644 --- a/src/Models/Components/PaymentMethod.php +++ b/src/Models/Components/PaymentMethod.php @@ -1,7 +1,7 @@ ")] + #[\Speakeasy\Serializer\Annotation\SerializedName('requested_end_time')] public \DateTime $requestedEndTime; /** @@ -61,8 +58,7 @@ class Pickup * * @var \DateTime $requestedStartTime */ - #[\JMS\Serializer\Annotation\SerializedName('requested_start_time')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] + #[\Speakeasy\Serializer\Annotation\SerializedName('requested_start_time')] public \DateTime $requestedStartTime; /** @@ -70,8 +66,8 @@ class Pickup * * @var array $transactions */ - #[\JMS\Serializer\Annotation\SerializedName('transactions')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('transactions')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $transactions; /** @@ -79,9 +75,8 @@ class Pickup * * @var ?\DateTime $objectCreated */ - #[\JMS\Serializer\Annotation\SerializedName('object_created')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectCreated = null; /** @@ -89,9 +84,8 @@ class Pickup * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; /** @@ -99,9 +93,8 @@ class Pickup * * @var ?\DateTime $objectUpdated */ - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectUpdated = null; /** @@ -111,9 +104,8 @@ class Pickup * * @var ?string $confirmedStartTime */ - #[\JMS\Serializer\Annotation\SerializedName('confirmed_start_time')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('confirmed_start_time')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $confirmedStartTime = null; /** @@ -123,9 +115,8 @@ class Pickup * * @var ?string $confirmedEndTime */ - #[\JMS\Serializer\Annotation\SerializedName('confirmed_end_time')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('confirmed_end_time')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $confirmedEndTime = null; /** @@ -136,19 +127,18 @@ class Pickup * * @var ?string $cancelByTime */ - #[\JMS\Serializer\Annotation\SerializedName('cancel_by_time')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('cancel_by_time')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $cancelByTime = null; /** * Indicates the status of the pickup. * - * @var ?\Shippo\API\Models\Components\PickupStatus $status + * @var ?PickupStatus $status */ - #[\JMS\Serializer\Annotation\SerializedName('status')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\PickupStatus|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?PickupStatus $status = null; /** @@ -158,9 +148,8 @@ class Pickup * * @var ?string $confirmationCode */ - #[\JMS\Serializer\Annotation\SerializedName('confirmation_code')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('confirmation_code')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $confirmationCode = null; /** @@ -168,9 +157,8 @@ class Pickup * * @var ?string $timezone */ - #[\JMS\Serializer\Annotation\SerializedName('timezone')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('timezone')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $timezone = null; /** @@ -178,9 +166,9 @@ class Pickup * * @var ?array $messages */ - #[\JMS\Serializer\Annotation\SerializedName('messages')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('messages')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $messages = null; /** @@ -188,29 +176,47 @@ class Pickup * * @var ?bool $isTest */ - #[\JMS\Serializer\Annotation\SerializedName('is_test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('is_test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $isTest = null; - public function __construct() + /** + * @param string $carrierAccount + * @param Location $location + * @param \DateTime $requestedEndTime + * @param \DateTime $requestedStartTime + * @param array $transactions + * @param ?string $metadata + * @param ?\DateTime $objectCreated + * @param ?string $objectId + * @param ?\DateTime $objectUpdated + * @param ?string $confirmedStartTime + * @param ?string $confirmedEndTime + * @param ?string $cancelByTime + * @param ?PickupStatus $status + * @param ?string $confirmationCode + * @param ?string $timezone + * @param ?array $messages + * @param ?bool $isTest + */ + public function __construct(string $carrierAccount, Location $location, \DateTime $requestedEndTime, \DateTime $requestedStartTime, array $transactions, ?string $metadata = null, ?\DateTime $objectCreated = null, ?string $objectId = null, ?\DateTime $objectUpdated = null, ?string $confirmedStartTime = null, ?string $confirmedEndTime = null, ?string $cancelByTime = null, ?PickupStatus $status = null, ?string $confirmationCode = null, ?string $timezone = null, ?array $messages = null, ?bool $isTest = null) { - $this->carrierAccount = ''; - $this->location = new \Shippo\API\Models\Components\Location(); - $this->metadata = null; - $this->requestedEndTime = new \DateTime(); - $this->requestedStartTime = new \DateTime(); - $this->transactions = []; - $this->objectCreated = null; - $this->objectId = null; - $this->objectUpdated = null; - $this->confirmedStartTime = null; - $this->confirmedEndTime = null; - $this->cancelByTime = null; - $this->status = null; - $this->confirmationCode = null; - $this->timezone = null; - $this->messages = null; - $this->isTest = null; + $this->carrierAccount = $carrierAccount; + $this->location = $location; + $this->requestedEndTime = $requestedEndTime; + $this->requestedStartTime = $requestedStartTime; + $this->transactions = $transactions; + $this->metadata = $metadata; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectUpdated = $objectUpdated; + $this->confirmedStartTime = $confirmedStartTime; + $this->confirmedEndTime = $confirmedEndTime; + $this->cancelByTime = $cancelByTime; + $this->status = $status; + $this->confirmationCode = $confirmationCode; + $this->timezone = $timezone; + $this->messages = $messages; + $this->isTest = $isTest; } } \ No newline at end of file diff --git a/src/Models/Components/PickupBase.php b/src/Models/Components/PickupBase.php index f3755ca..15170f2 100644 --- a/src/Models/Components/PickupBase.php +++ b/src/Models/Components/PickupBase.php @@ -1,7 +1,7 @@ ")] + #[\Speakeasy\Serializer\Annotation\SerializedName('requested_end_time')] public \DateTime $requestedEndTime; /** @@ -61,8 +58,7 @@ class PickupBase * * @var \DateTime $requestedStartTime */ - #[\JMS\Serializer\Annotation\SerializedName('requested_start_time')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] + #[\Speakeasy\Serializer\Annotation\SerializedName('requested_start_time')] public \DateTime $requestedStartTime; /** @@ -70,17 +66,25 @@ class PickupBase * * @var array $transactions */ - #[\JMS\Serializer\Annotation\SerializedName('transactions')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('transactions')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $transactions; - public function __construct() + /** + * @param string $carrierAccount + * @param Location $location + * @param \DateTime $requestedEndTime + * @param \DateTime $requestedStartTime + * @param array $transactions + * @param ?string $metadata + */ + public function __construct(string $carrierAccount, Location $location, \DateTime $requestedEndTime, \DateTime $requestedStartTime, array $transactions, ?string $metadata = null) { - $this->carrierAccount = ''; - $this->location = new \Shippo\API\Models\Components\Location(); - $this->metadata = null; - $this->requestedEndTime = new \DateTime(); - $this->requestedStartTime = new \DateTime(); - $this->transactions = []; + $this->carrierAccount = $carrierAccount; + $this->location = $location; + $this->requestedEndTime = $requestedEndTime; + $this->requestedStartTime = $requestedStartTime; + $this->transactions = $transactions; + $this->metadata = $metadata; } } \ No newline at end of file diff --git a/src/Models/Components/PickupStatus.php b/src/Models/Components/PickupStatus.php index b41e8e1..0cffde8 100644 --- a/src/Models/Components/PickupStatus.php +++ b/src/Models/Components/PickupStatus.php @@ -1,7 +1,7 @@ prefix = null; - $this->value = null; - $this->refSort = null; + $this->prefix = $prefix; + $this->value = $value; + $this->refSort = $refSort; } } \ No newline at end of file diff --git a/src/Models/Components/PreferredDeliveryTimeframe.php b/src/Models/Components/PreferredDeliveryTimeframe.php index 999b052..4e07bc4 100644 --- a/src/Models/Components/PreferredDeliveryTimeframe.php +++ b/src/Models/Components/PreferredDeliveryTimeframe.php @@ -1,7 +1,7 @@ $attributes + * @var array $attributes */ - #[\JMS\Serializer\Annotation\SerializedName('attributes')] - #[\JMS\Serializer\Annotation\Type('array>')] + #[\Speakeasy\Serializer\Annotation\SerializedName('attributes')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Attributes>')] public array $attributes; /** @@ -77,8 +72,7 @@ class Rate * * @var string $carrierAccount */ - #[\JMS\Serializer\Annotation\SerializedName('carrier_account')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('carrier_account')] public string $carrierAccount; /** @@ -88,9 +82,8 @@ class Rate * * @var ?string $durationTerms */ - #[\JMS\Serializer\Annotation\SerializedName('duration_terms')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('duration_terms')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $durationTerms = null; /** @@ -101,9 +94,8 @@ class Rate * * @var ?int $estimatedDays */ - #[\JMS\Serializer\Annotation\SerializedName('estimated_days')] - #[\JMS\Serializer\Annotation\Type('int')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('estimated_days')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?int $estimatedDays = null; /** @@ -114,19 +106,18 @@ class Rate * * @var ?string $includedInsurancePrice */ - #[\JMS\Serializer\Annotation\SerializedName('included_insurance_price')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('included_insurance_price')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $includedInsurancePrice = null; /** * $messages * - * @var ?array<\Shippo\API\Models\Components\ResponseMessage> $messages + * @var ?array $messages */ - #[\JMS\Serializer\Annotation\SerializedName('messages')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('messages')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\ResponseMessage>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $messages = null; /** @@ -134,8 +125,7 @@ class Rate * * @var \DateTime $objectCreated */ - #[\JMS\Serializer\Annotation\SerializedName('object_created')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] public \DateTime $objectCreated; /** @@ -143,8 +133,7 @@ class Rate * * @var string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] public string $objectId; /** @@ -152,8 +141,7 @@ class Rate * * @var string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] public string $objectOwner; /** @@ -161,8 +149,7 @@ class Rate * * @var string $provider */ - #[\JMS\Serializer\Annotation\SerializedName('provider')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('provider')] public string $provider; /** @@ -172,9 +159,8 @@ class Rate * * @var ?string $providerImage75 */ - #[\JMS\Serializer\Annotation\SerializedName('provider_image_75')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('provider_image_75')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $providerImage75 = null; /** @@ -184,17 +170,23 @@ class Rate * * @var ?string $providerImage200 */ - #[\JMS\Serializer\Annotation\SerializedName('provider_image_200')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('provider_image_200')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $providerImage200 = null; - #[\JMS\Serializer\Annotation\SerializedName('servicelevel')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\ServiceLevelWithParent')] + /** + * + * @var ServiceLevelWithParent $servicelevel + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('servicelevel')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ServiceLevelWithParent')] public ServiceLevelWithParent $servicelevel; - #[\JMS\Serializer\Annotation\SerializedName('shipment')] - #[\JMS\Serializer\Annotation\Type('string')] + /** + * + * @var string $shipment + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('shipment')] public string $shipment; /** @@ -202,9 +194,8 @@ class Rate * * @var ?bool $test */ - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; /** @@ -212,33 +203,55 @@ class Rate * * @var ?string $zone */ - #[\JMS\Serializer\Annotation\SerializedName('zone')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('zone')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $zone = null; - public function __construct() + /** + * @param string $amount + * @param string $amountLocal + * @param string $currency + * @param string $currencyLocal + * @param array $attributes + * @param string $carrierAccount + * @param \DateTime $objectCreated + * @param string $objectId + * @param string $objectOwner + * @param string $provider + * @param ServiceLevelWithParent $servicelevel + * @param string $shipment + * @param ?string $arrivesBy + * @param ?string $durationTerms + * @param ?int $estimatedDays + * @param ?string $includedInsurancePrice + * @param ?array $messages + * @param ?string $providerImage75 + * @param ?string $providerImage200 + * @param ?bool $test + * @param ?string $zone + */ + public function __construct(string $amount, string $amountLocal, string $currency, string $currencyLocal, array $attributes, string $carrierAccount, \DateTime $objectCreated, string $objectId, string $objectOwner, string $provider, ServiceLevelWithParent $servicelevel, string $shipment, ?string $arrivesBy = null, ?string $durationTerms = null, ?int $estimatedDays = null, ?string $includedInsurancePrice = null, ?array $messages = null, ?string $providerImage75 = null, ?string $providerImage200 = null, ?bool $test = null, ?string $zone = null) { - $this->amount = ''; - $this->amountLocal = ''; - $this->currency = ''; - $this->currencyLocal = ''; - $this->arrivesBy = null; - $this->attributes = []; - $this->carrierAccount = ''; - $this->durationTerms = null; - $this->estimatedDays = null; - $this->includedInsurancePrice = null; - $this->messages = null; - $this->objectCreated = new \DateTime(); - $this->objectId = ''; - $this->objectOwner = ''; - $this->provider = ''; - $this->providerImage75 = null; - $this->providerImage200 = null; - $this->servicelevel = new \Shippo\API\Models\Components\ServiceLevelWithParent(); - $this->shipment = ''; - $this->test = null; - $this->zone = null; + $this->amount = $amount; + $this->amountLocal = $amountLocal; + $this->currency = $currency; + $this->currencyLocal = $currencyLocal; + $this->attributes = $attributes; + $this->carrierAccount = $carrierAccount; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->provider = $provider; + $this->servicelevel = $servicelevel; + $this->shipment = $shipment; + $this->arrivesBy = $arrivesBy; + $this->durationTerms = $durationTerms; + $this->estimatedDays = $estimatedDays; + $this->includedInsurancePrice = $includedInsurancePrice; + $this->messages = $messages; + $this->providerImage75 = $providerImage75; + $this->providerImage200 = $providerImage200; + $this->test = $test; + $this->zone = $zone; } } \ No newline at end of file diff --git a/src/Models/Components/RatePaginatedList.php b/src/Models/Components/RatePaginatedList.php index 201aaec..ac68326 100644 --- a/src/Models/Components/RatePaginatedList.php +++ b/src/Models/Components/RatePaginatedList.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Rate>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/RecipientType.php b/src/Models/Components/RecipientType.php index e7a16f1..7523d1d 100644 --- a/src/Models/Components/RecipientType.php +++ b/src/Models/Components/RecipientType.php @@ -1,7 +1,7 @@ ")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectCreated = null; /** @@ -26,9 +25,8 @@ class Refund * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; /** @@ -36,9 +34,8 @@ class Refund * * @var ?string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectOwner = null; /** @@ -46,19 +43,18 @@ class Refund * * @var ?\DateTime $objectUpdated */ - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectUpdated = null; /** * Indicates the status of the Refund. * - * @var ?\Shippo\API\Models\Components\RefundStatus $status + * @var ?RefundStatus $status */ - #[\JMS\Serializer\Annotation\SerializedName('status')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\RefundStatus|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?RefundStatus $status = null; /** @@ -66,9 +62,8 @@ class Refund * * @var ?bool $test */ - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; /** @@ -76,19 +71,27 @@ class Refund * * @var ?string $transaction */ - #[\JMS\Serializer\Annotation\SerializedName('transaction')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('transaction')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $transaction = null; - public function __construct() + /** + * @param ?\DateTime $objectCreated + * @param ?string $objectId + * @param ?string $objectOwner + * @param ?\DateTime $objectUpdated + * @param ?RefundStatus $status + * @param ?bool $test + * @param ?string $transaction + */ + public function __construct(?\DateTime $objectCreated = null, ?string $objectId = null, ?string $objectOwner = null, ?\DateTime $objectUpdated = null, ?RefundStatus $status = null, ?bool $test = null, ?string $transaction = null) { - $this->objectCreated = null; - $this->objectId = null; - $this->objectOwner = null; - $this->objectUpdated = null; - $this->status = null; - $this->test = null; - $this->transaction = null; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->objectUpdated = $objectUpdated; + $this->status = $status; + $this->test = $test; + $this->transaction = $transaction; } } \ No newline at end of file diff --git a/src/Models/Components/RefundPaginatedList.php b/src/Models/Components/RefundPaginatedList.php index be3dc22..5253cb7 100644 --- a/src/Models/Components/RefundPaginatedList.php +++ b/src/Models/Components/RefundPaginatedList.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Refund>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/RefundRequestBody.php b/src/Models/Components/RefundRequestBody.php index 2278ee0..9bebad1 100644 --- a/src/Models/Components/RefundRequestBody.php +++ b/src/Models/Components/RefundRequestBody.php @@ -1,7 +1,7 @@ async = null; - $this->transaction = ''; + $this->transaction = $transaction; + $this->async = $async; } } \ No newline at end of file diff --git a/src/Models/Components/RefundStatus.php b/src/Models/Components/RefundStatus.php index 11db7ff..1fbbf2d 100644 --- a/src/Models/Components/RefundStatus.php +++ b/src/Models/Components/RefundStatus.php @@ -1,7 +1,7 @@ source = null; - $this->code = null; - $this->text = null; + $this->source = $source; + $this->code = $code; + $this->text = $text; } } \ No newline at end of file diff --git a/src/Models/Components/RmaNumber.php b/src/Models/Components/RmaNumber.php index 97b4b62..9f0ba95 100644 --- a/src/Models/Components/RmaNumber.php +++ b/src/Models/Components/RmaNumber.php @@ -1,7 +1,7 @@ prefix = null; - $this->value = null; - $this->refSort = null; + $this->prefix = $prefix; + $this->value = $value; + $this->refSort = $refSort; } } \ No newline at end of file diff --git a/src/Models/Components/Security.php b/src/Models/Components/Security.php index 9129bb1..715c25f 100644 --- a/src/Models/Components/Security.php +++ b/src/Models/Components/Security.php @@ -1,7 +1,7 @@ apiKeyHeader = ''; + $this->apiKeyHeader = $apiKeyHeader; } } \ No newline at end of file diff --git a/src/Models/Components/ServiceGroup.php b/src/Models/Components/ServiceGroup.php index 9ca96df..15c5458 100644 --- a/src/Models/Components/ServiceGroup.php +++ b/src/Models/Components/ServiceGroup.php @@ -1,7 +1,7 @@ `LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
`FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
`FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` + * The type of the service group.
+ * + * `LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
+ * `FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
+ * `FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` * - * @var \Shippo\API\Models\Components\ServiceGroupTypeEnum $type + * @var ServiceGroupTypeEnum $type */ - #[\JMS\Serializer\Annotation\SerializedName('type')] - #[\JMS\Serializer\Annotation\Type('enum')] + #[\Speakeasy\Serializer\Annotation\SerializedName('type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ServiceGroupTypeEnum')] public ServiceGroupTypeEnum $type; /** @@ -98,8 +98,7 @@ class ServiceGroup * * @var string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] public string $objectId; /** @@ -107,32 +106,44 @@ class ServiceGroup * * @var ?bool $isActive */ - #[\JMS\Serializer\Annotation\SerializedName('is_active')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('is_active')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $isActive = null; /** * $serviceLevels * - * @var array<\Shippo\API\Models\Components\ServiceLevelWithParent> $serviceLevels + * @var array $serviceLevels */ - #[\JMS\Serializer\Annotation\SerializedName('service_levels')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('service_levels')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\ServiceGroupAccountAndServiceLevel>')] public array $serviceLevels; - public function __construct() + /** + * @param string $description + * @param string $name + * @param ServiceGroupTypeEnum $type + * @param string $objectId + * @param array $serviceLevels + * @param ?string $flatRate + * @param ?string $flatRateCurrency + * @param ?string $freeShippingThresholdCurrency + * @param ?string $freeShippingThresholdMin + * @param ?int $rateAdjustment + * @param ?bool $isActive + */ + public function __construct(string $description, string $name, ServiceGroupTypeEnum $type, string $objectId, array $serviceLevels, ?string $flatRate = null, ?string $flatRateCurrency = null, ?string $freeShippingThresholdCurrency = null, ?string $freeShippingThresholdMin = null, ?int $rateAdjustment = null, ?bool $isActive = null) { - $this->description = ''; - $this->flatRate = null; - $this->flatRateCurrency = null; - $this->freeShippingThresholdCurrency = null; - $this->freeShippingThresholdMin = null; - $this->name = ''; - $this->rateAdjustment = null; - $this->type = \Shippo\API\Models\Components\ServiceGroupTypeEnum::LiveRate; - $this->objectId = ''; - $this->isActive = null; - $this->serviceLevels = []; + $this->description = $description; + $this->name = $name; + $this->type = $type; + $this->objectId = $objectId; + $this->serviceLevels = $serviceLevels; + $this->flatRate = $flatRate; + $this->flatRateCurrency = $flatRateCurrency; + $this->freeShippingThresholdCurrency = $freeShippingThresholdCurrency; + $this->freeShippingThresholdMin = $freeShippingThresholdMin; + $this->rateAdjustment = $rateAdjustment; + $this->isActive = $isActive; } } \ No newline at end of file diff --git a/src/Models/Components/ServiceGroupAccountAndServiceLevel.php b/src/Models/Components/ServiceGroupAccountAndServiceLevel.php index 0ecd0b8..e2b2369 100644 --- a/src/Models/Components/ServiceGroupAccountAndServiceLevel.php +++ b/src/Models/Components/ServiceGroupAccountAndServiceLevel.php @@ -1,7 +1,7 @@ accountObjectId = null; - $this->serviceLevelToken = null; + $this->accountObjectId = $accountObjectId; + $this->serviceLevelToken = $serviceLevelToken; } } \ No newline at end of file diff --git a/src/Models/Components/ServiceGroupCreateRequest.php b/src/Models/Components/ServiceGroupCreateRequest.php index d39d22a..d3d1a5a 100644 --- a/src/Models/Components/ServiceGroupCreateRequest.php +++ b/src/Models/Components/ServiceGroupCreateRequest.php @@ -1,7 +1,7 @@ `LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
`FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
`FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` + * The type of the service group.
+ * + * `LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
+ * `FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
+ * `FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` * - * @var \Shippo\API\Models\Components\ServiceGroupTypeEnum $type + * @var ServiceGroupTypeEnum $type */ - #[\JMS\Serializer\Annotation\SerializedName('type')] - #[\JMS\Serializer\Annotation\Type('enum')] + #[\Speakeasy\Serializer\Annotation\SerializedName('type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ServiceGroupTypeEnum')] public ServiceGroupTypeEnum $type; /** * $serviceLevels * - * @var array<\Shippo\API\Models\Components\ServiceGroupAccountAndServiceLevel> $serviceLevels + * @var array $serviceLevels */ - #[\JMS\Serializer\Annotation\SerializedName('service_levels')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('service_levels')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\ServiceGroupAccountAndServiceLevel>')] public array $serviceLevels; - public function __construct() + /** + * @param string $description + * @param string $name + * @param ServiceGroupTypeEnum $type + * @param array $serviceLevels + * @param ?string $flatRate + * @param ?string $flatRateCurrency + * @param ?string $freeShippingThresholdCurrency + * @param ?string $freeShippingThresholdMin + * @param ?int $rateAdjustment + */ + public function __construct(string $description, string $name, ServiceGroupTypeEnum $type, array $serviceLevels, ?string $flatRate = null, ?string $flatRateCurrency = null, ?string $freeShippingThresholdCurrency = null, ?string $freeShippingThresholdMin = null, ?int $rateAdjustment = null) { - $this->description = ''; - $this->flatRate = null; - $this->flatRateCurrency = null; - $this->freeShippingThresholdCurrency = null; - $this->freeShippingThresholdMin = null; - $this->name = ''; - $this->rateAdjustment = null; - $this->type = \Shippo\API\Models\Components\ServiceGroupTypeEnum::LiveRate; - $this->serviceLevels = []; + $this->description = $description; + $this->name = $name; + $this->type = $type; + $this->serviceLevels = $serviceLevels; + $this->flatRate = $flatRate; + $this->flatRateCurrency = $flatRateCurrency; + $this->freeShippingThresholdCurrency = $freeShippingThresholdCurrency; + $this->freeShippingThresholdMin = $freeShippingThresholdMin; + $this->rateAdjustment = $rateAdjustment; } } \ No newline at end of file diff --git a/src/Models/Components/ServiceGroupTypeEnum.php b/src/Models/Components/ServiceGroupTypeEnum.php index 8461489..703f7a1 100644 --- a/src/Models/Components/ServiceGroupTypeEnum.php +++ b/src/Models/Components/ServiceGroupTypeEnum.php @@ -1,7 +1,7 @@ `LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
`FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
`FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` */ +/** + * The type of the service group.
+ * + * `LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
+ * `FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
+ * `FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` + */ enum ServiceGroupTypeEnum: string { case LiveRate = 'LIVE_RATE'; diff --git a/src/Models/Components/ServiceGroupUpdateRequest.php b/src/Models/Components/ServiceGroupUpdateRequest.php index ffb5f30..069c54d 100644 --- a/src/Models/Components/ServiceGroupUpdateRequest.php +++ b/src/Models/Components/ServiceGroupUpdateRequest.php @@ -1,7 +1,7 @@ `LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
`FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
`FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` + * The type of the service group.
+ * + * `LIVE_RATE` - Shippo will make a rating request and return real-time rates for the shipping group, only falling back to the specified flat rate amount if no rates match a service level in the service group.
+ * `FLAT_RATE` - Returns a shipping option with the specified flat rate amount.
+ * `FREE_SHIPPING` - Returns a shipping option with a price of $0 only if the total cost of items exceeds the amount defined by `free_shipping_threshold_min` * - * @var \Shippo\API\Models\Components\ServiceGroupTypeEnum $type + * @var ServiceGroupTypeEnum $type */ - #[\JMS\Serializer\Annotation\SerializedName('type')] - #[\JMS\Serializer\Annotation\Type('enum')] + #[\Speakeasy\Serializer\Annotation\SerializedName('type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ServiceGroupTypeEnum')] public ServiceGroupTypeEnum $type; /** @@ -98,8 +98,7 @@ class ServiceGroupUpdateRequest * * @var string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] public string $objectId; /** @@ -107,31 +106,43 @@ class ServiceGroupUpdateRequest * * @var bool $isActive */ - #[\JMS\Serializer\Annotation\SerializedName('is_active')] - #[\JMS\Serializer\Annotation\Type('bool')] + #[\Speakeasy\Serializer\Annotation\SerializedName('is_active')] public bool $isActive; /** * $serviceLevels * - * @var array<\Shippo\API\Models\Components\ServiceGroupAccountAndServiceLevel> $serviceLevels + * @var array $serviceLevels */ - #[\JMS\Serializer\Annotation\SerializedName('service_levels')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('service_levels')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\ServiceGroupAccountAndServiceLevel>')] public array $serviceLevels; - public function __construct() + /** + * @param string $description + * @param string $name + * @param ServiceGroupTypeEnum $type + * @param string $objectId + * @param bool $isActive + * @param array $serviceLevels + * @param ?string $flatRate + * @param ?string $flatRateCurrency + * @param ?string $freeShippingThresholdCurrency + * @param ?string $freeShippingThresholdMin + * @param ?int $rateAdjustment + */ + public function __construct(string $description, string $name, ServiceGroupTypeEnum $type, string $objectId, bool $isActive, array $serviceLevels, ?string $flatRate = null, ?string $flatRateCurrency = null, ?string $freeShippingThresholdCurrency = null, ?string $freeShippingThresholdMin = null, ?int $rateAdjustment = null) { - $this->description = ''; - $this->flatRate = null; - $this->flatRateCurrency = null; - $this->freeShippingThresholdCurrency = null; - $this->freeShippingThresholdMin = null; - $this->name = ''; - $this->rateAdjustment = null; - $this->type = \Shippo\API\Models\Components\ServiceGroupTypeEnum::LiveRate; - $this->objectId = ''; - $this->isActive = false; - $this->serviceLevels = []; + $this->description = $description; + $this->name = $name; + $this->type = $type; + $this->objectId = $objectId; + $this->isActive = $isActive; + $this->serviceLevels = $serviceLevels; + $this->flatRate = $flatRate; + $this->flatRateCurrency = $flatRateCurrency; + $this->freeShippingThresholdCurrency = $freeShippingThresholdCurrency; + $this->freeShippingThresholdMin = $freeShippingThresholdMin; + $this->rateAdjustment = $rateAdjustment; } } \ No newline at end of file diff --git a/src/Models/Components/ServiceLevel.php b/src/Models/Components/ServiceLevel.php index e13db11..c495005 100644 --- a/src/Models/Components/ServiceLevel.php +++ b/src/Models/Components/ServiceLevel.php @@ -1,7 +1,7 @@ name = null; - $this->terms = null; - $this->token = null; - $this->extendedToken = null; + $this->name = $name; + $this->terms = $terms; + $this->token = $token; + $this->extendedToken = $extendedToken; } } \ No newline at end of file diff --git a/src/Models/Components/ServiceLevelAPCPostalEnum.php b/src/Models/Components/ServiceLevelAPCPostalEnum.php new file mode 100644 index 0000000..4cc6bb2 --- /dev/null +++ b/src/Models/Components/ServiceLevelAPCPostalEnum.php @@ -0,0 +1,38 @@ +name = null; - $this->terms = null; - $this->token = null; - $this->extendedToken = null; - $this->parentServicelevel = null; + $this->name = $name; + $this->terms = $terms; + $this->token = $token; + $this->extendedToken = $extendedToken; + $this->parentServicelevel = $parentServicelevel; } } \ No newline at end of file diff --git a/src/Models/Components/ServiceLevelePostGlobalEnum.php b/src/Models/Components/ServiceLevelePostGlobalEnum.php new file mode 100644 index 0000000..71227ca --- /dev/null +++ b/src/Models/Components/ServiceLevelePostGlobalEnum.php @@ -0,0 +1,46 @@ +Address object of the sender / seller. Will be returned expanded by default. * - * @var \Shippo\API\Models\Components\Address $addressFrom + * @var Address $addressFrom */ - #[\JMS\Serializer\Annotation\SerializedName('address_from')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\Address')] + #[\Speakeasy\Serializer\Annotation\SerializedName('address_from')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\Address')] public Address $addressFrom; /** @@ -59,20 +57,20 @@ class Shipment * (Only available for UPS, USPS, and Fedex shipments).
* If this field is not set, your shipments will be returned to the address_from. * - * @var ?\Shippo\API\Models\Components\Address $addressReturn + * @var ?Address $addressReturn */ - #[\JMS\Serializer\Annotation\SerializedName('address_return')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\Address')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('address_return')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\Address|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?Address $addressReturn = null; /** * Address object of the recipient / buyer. Will be returned expanded by default. * - * @var \Shippo\API\Models\Components\Address $addressTo + * @var Address $addressTo */ - #[\JMS\Serializer\Annotation\SerializedName('address_to')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\Address')] + #[\Speakeasy\Serializer\Annotation\SerializedName('address_to')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\Address')] public Address $addressTo; /** @@ -83,22 +81,26 @@ class Shipment * * @var array $carrierAccounts */ - #[\JMS\Serializer\Annotation\SerializedName('carrier_accounts')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('carrier_accounts')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $carrierAccounts; - #[\JMS\Serializer\Annotation\SerializedName('customs_declaration')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\CustomsDeclaration')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?CustomsDeclaration $customsDeclaration + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customs_declaration')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CustomsDeclaration|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?CustomsDeclaration $customsDeclaration = null; /** * $messages * - * @var array<\Shippo\API\Models\Components\ResponseMessage> $messages + * @var array $messages */ - #[\JMS\Serializer\Annotation\SerializedName('messages')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('messages')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\ResponseMessage>')] public array $messages; /** @@ -106,8 +108,7 @@ class Shipment * * @var \DateTime $objectCreated */ - #[\JMS\Serializer\Annotation\SerializedName('object_created')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] public \DateTime $objectCreated; /** @@ -115,8 +116,7 @@ class Shipment * * @var string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] public string $objectId; /** @@ -124,8 +124,7 @@ class Shipment * * @var string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] public string $objectOwner; /** @@ -133,17 +132,16 @@ class Shipment * * @var \DateTime $objectUpdated */ - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] public \DateTime $objectUpdated; /** * List of Parcel objects to be shipped. * - * @var array<\Shippo\API\Models\Components\Parcel> $parcels + * @var array $parcels */ - #[\JMS\Serializer\Annotation\SerializedName('parcels')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('parcels')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Parcel>')] public array $parcels; /** @@ -152,10 +150,10 @@ class Shipment * this will be populated with all available rates in the response. Otherwise rates will be created * asynchronously and this array will initially be empty. * - * @var array<\Shippo\API\Models\Components\Rate> $rates + * @var array $rates */ - #[\JMS\Serializer\Annotation\SerializedName('rates')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('rates')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Rate>')] public array $rates; /** @@ -165,10 +163,10 @@ class Shipment * `Success` shipments have been processed successfully, meaning that rate generation has concluded. * `Error` does not occur currently and is reserved for future use. * - * @var \Shippo\API\Models\Components\ShipmentStatus $status + * @var ShipmentStatus $status */ - #[\JMS\Serializer\Annotation\SerializedName('status')] - #[\JMS\Serializer\Annotation\Type('enum')] + #[\Speakeasy\Serializer\Annotation\SerializedName('status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ShipmentStatus')] public ShipmentStatus $status; /** @@ -176,29 +174,47 @@ class Shipment * * @var ?bool $test */ - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; - public function __construct() + /** + * @param string $metadata + * @param Address $addressFrom + * @param Address $addressTo + * @param array $carrierAccounts + * @param array $messages + * @param \DateTime $objectCreated + * @param string $objectId + * @param string $objectOwner + * @param \DateTime $objectUpdated + * @param array $parcels + * @param array $rates + * @param ShipmentStatus $status + * @param ?ShipmentExtra $extra + * @param ?string $shipmentDate + * @param ?Address $addressReturn + * @param ?CustomsDeclaration $customsDeclaration + * @param ?bool $test + */ + public function __construct(string $metadata, Address $addressFrom, Address $addressTo, array $carrierAccounts, array $messages, \DateTime $objectCreated, string $objectId, string $objectOwner, \DateTime $objectUpdated, array $parcels, array $rates, ShipmentStatus $status, ?ShipmentExtra $extra = null, ?string $shipmentDate = null, ?Address $addressReturn = null, ?CustomsDeclaration $customsDeclaration = null, ?bool $test = null) { - $this->extra = null; - $this->metadata = ''; - $this->shipmentDate = null; - $this->addressFrom = new \Shippo\API\Models\Components\Address(); - $this->addressReturn = null; - $this->addressTo = new \Shippo\API\Models\Components\Address(); - $this->carrierAccounts = []; - $this->customsDeclaration = null; - $this->messages = []; - $this->objectCreated = new \DateTime(); - $this->objectId = ''; - $this->objectOwner = ''; - $this->objectUpdated = new \DateTime(); - $this->parcels = []; - $this->rates = []; - $this->status = \Shippo\API\Models\Components\ShipmentStatus::Error; - $this->test = null; + $this->metadata = $metadata; + $this->addressFrom = $addressFrom; + $this->addressTo = $addressTo; + $this->carrierAccounts = $carrierAccounts; + $this->messages = $messages; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->objectUpdated = $objectUpdated; + $this->parcels = $parcels; + $this->rates = $rates; + $this->status = $status; + $this->extra = $extra; + $this->shipmentDate = $shipmentDate; + $this->addressReturn = $addressReturn; + $this->customsDeclaration = $customsDeclaration; + $this->test = $test; } } \ No newline at end of file diff --git a/src/Models/Components/ShipmentCreateRequest.php b/src/Models/Components/ShipmentCreateRequest.php index 37b40f5..990dfb0 100644 --- a/src/Models/Components/ShipmentCreateRequest.php +++ b/src/Models/Components/ShipmentCreateRequest.php @@ -1,7 +1,7 @@ $carrierAccounts */ - #[\JMS\Serializer\Annotation\SerializedName('carrier_accounts')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('carrier_accounts')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $carrierAccounts = null; /** @@ -84,21 +101,33 @@ class ShipmentCreateRequest * * @var array $parcels */ - #[\JMS\Serializer\Annotation\SerializedName('parcels')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('parcels')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $parcels; - public function __construct() + /** + * @param AddressCreateRequest|string $addressFrom + * @param AddressCreateRequest|string $addressTo + * @param array $parcels + * @param ?ShipmentExtra $extra + * @param ?string $metadata + * @param ?string $shipmentDate + * @param AddressCreateRequest|string|null $addressReturn + * @param CustomsDeclarationCreateRequest|string|null $customsDeclaration + * @param ?bool $async + * @param ?array $carrierAccounts + */ + public function __construct(AddressCreateRequest|string $addressFrom, AddressCreateRequest|string $addressTo, array $parcels, ?ShipmentExtra $extra = null, ?string $metadata = null, ?string $shipmentDate = null, AddressCreateRequest|string|null $addressReturn = null, CustomsDeclarationCreateRequest|string|null $customsDeclaration = null, ?bool $async = null, ?array $carrierAccounts = null) { - $this->extra = null; - $this->metadata = null; - $this->shipmentDate = null; - $this->addressFrom = null; - $this->addressReturn = null; - $this->addressTo = null; - $this->customsDeclaration = null; - $this->async = null; - $this->carrierAccounts = null; - $this->parcels = []; + $this->addressFrom = $addressFrom; + $this->addressTo = $addressTo; + $this->parcels = $parcels; + $this->extra = $extra; + $this->metadata = $metadata; + $this->shipmentDate = $shipmentDate; + $this->addressReturn = $addressReturn; + $this->customsDeclaration = $customsDeclaration; + $this->async = $async; + $this->carrierAccounts = $carrierAccounts; } } \ No newline at end of file diff --git a/src/Models/Components/ShipmentExtra.php b/src/Models/Components/ShipmentExtra.php index 47820c7..769b7f3 100644 --- a/src/Models/Components/ShipmentExtra.php +++ b/src/Models/Components/ShipmentExtra.php @@ -1,7 +1,7 @@ ')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('ancillary_endorsement')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\AncillaryEndorsement|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?AncillaryEndorsement $ancillaryEndorsement = null; - #[\JMS\Serializer\Annotation\SerializedName('appropriation_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $appropriationNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('appropriation_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $appropriationNumber = null; /** @@ -50,24 +58,27 @@ class ShipmentExtra * * @var ?bool $authorityToLeave */ - #[\JMS\Serializer\Annotation\SerializedName('authority_to_leave')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('authority_to_leave')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $authorityToLeave = null; - #[\JMS\Serializer\Annotation\SerializedName('bill_of_lading_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $billOfLadingNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('bill_of_lading_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $billOfLadingNumber = null; /** * Specify billing details (UPS, FedEx, and DHL Germany only). * - * @var ?\Shippo\API\Models\Components\Billing $billing + * @var ?Billing $billing */ - #[\JMS\Serializer\Annotation\SerializedName('billing')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\Billing')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('billing')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\Billing|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?Billing $billing = null; /** @@ -75,9 +86,8 @@ class ShipmentExtra * * @var ?bool $bypassAddressValidation */ - #[\JMS\Serializer\Annotation\SerializedName('bypass_address_validation')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('bypass_address_validation')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $bypassAddressValidation = null; /** @@ -85,9 +95,8 @@ class ShipmentExtra * * @var ?bool $carbonNeutral */ - #[\JMS\Serializer\Annotation\SerializedName('carbon_neutral')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('carbon_neutral')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $carbonNeutral = null; /** @@ -95,9 +104,8 @@ class ShipmentExtra * * @var ?string $carrierHubId */ - #[\JMS\Serializer\Annotation\SerializedName('carrier_hub_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('carrier_hub_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $carrierHubId = null; /** @@ -105,24 +113,27 @@ class ShipmentExtra * * @var ?int $carrierHubTravelTime */ - #[\JMS\Serializer\Annotation\SerializedName('carrier_hub_travel_time')] - #[\JMS\Serializer\Annotation\Type('int')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('carrier_hub_travel_time')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?int $carrierHubTravelTime = null; /** * Specify collection on delivery details (UPS only). * - * @var ?\Shippo\API\Models\Components\Cod $cod + * @var ?Cod $cod */ - #[\JMS\Serializer\Annotation\SerializedName('COD')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\Cod')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('COD')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\Cod|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?Cod $cod = null; - #[\JMS\Serializer\Annotation\SerializedName('cod_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $codNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('cod_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $codNumber = null; /** @@ -130,9 +141,8 @@ class ShipmentExtra * * @var ?string $containerType */ - #[\JMS\Serializer\Annotation\SerializedName('container_type')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('container_type')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $containerType = null; /** @@ -142,9 +152,8 @@ class ShipmentExtra * * @var ?string $criticalPullTime */ - #[\JMS\Serializer\Annotation\SerializedName('critical_pull_time')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('critical_pull_time')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $criticalPullTime = null; /** @@ -152,19 +161,18 @@ class ShipmentExtra * * @var ?string $customerBranch */ - #[\JMS\Serializer\Annotation\SerializedName('customer_branch')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_branch')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $customerBranch = null; /** * Specify the reference field on the label (FedEx and UPS only). * - * @var ?\Shippo\API\Models\Components\CustomerReference $customerReference + * @var ?CustomerReference $customerReference */ - #[\JMS\Serializer\Annotation\SerializedName('customer_reference')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\CustomerReference')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_reference')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CustomerReference|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?CustomerReference $customerReference = null; /** @@ -173,26 +181,30 @@ class ShipmentExtra * are provided, only certain USPS service levels will be eligible. For more information, see our * guide on hazardous or dangerous materials shipping. * - * @var ?\Shippo\API\Models\Components\DangerousGoodsObject $dangerousGoods + * @var ?DangerousGoodsObject $dangerousGoods */ - #[\JMS\Serializer\Annotation\SerializedName('dangerous_goods')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\DangerousGoodsObject')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('dangerous_goods')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\DangerousGoodsObject|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?DangerousGoodsObject $dangerousGoods = null; /** * Dangerous Goods Code (DHL eCommerce only). See Category Codes * - * @var ?\Shippo\API\Models\Components\DangerousGoodsCode $dangerousGoodsCode + * @var ?DangerousGoodsCode $dangerousGoodsCode */ - #[\JMS\Serializer\Annotation\SerializedName('dangerous_goods_code')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('dangerous_goods_code')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\DangerousGoodsCode|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?DangerousGoodsCode $dangerousGoodsCode = null; - #[\JMS\Serializer\Annotation\SerializedName('dealer_order_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $dealerOrderNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('dealer_order_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $dealerOrderNumber = null; /** @@ -200,34 +212,37 @@ class ShipmentExtra * * @var ?string $deliveryInstructions */ - #[\JMS\Serializer\Annotation\SerializedName('delivery_instructions')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('delivery_instructions')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $deliveryInstructions = null; /** * Specify the department number field on the label (FedEx and UPS only). * - * @var ?\Shippo\API\Models\Components\DepartmentNumber $deptNumber + * @var ?DepartmentNumber $deptNumber */ - #[\JMS\Serializer\Annotation\SerializedName('dept_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\DepartmentNumber')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('dept_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\DepartmentNumber|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?DepartmentNumber $deptNumber = null; /** * Specify that the package contains Dry Ice (FedEx, Veho, and UPS only). * - * @var ?\Shippo\API\Models\Components\DryIce $dryIce + * @var ?DryIce $dryIce */ - #[\JMS\Serializer\Annotation\SerializedName('dry_ice')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\DryIce')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('dry_ice')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\DryIce|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?DryIce $dryIce = null; - #[\JMS\Serializer\Annotation\SerializedName('fda_product_code')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $fdaProductCode + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('fda_product_code')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $fdaProductCode = null; /** @@ -235,29 +250,32 @@ class ShipmentExtra * * @var ?string $fulfillmentCenter */ - #[\JMS\Serializer\Annotation\SerializedName('fulfillment_center')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('fulfillment_center')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $fulfillmentCenter = null; /** - * To add 3rd party insurance powered by XCover, specify
`amount`, `content`, and `currency`.
Alternatively, you can choose carrier provided insurance by additionally specifying `provider` (UPS, FedEx and OnTrac only).

If you do not want to add insurance to you shipment, do not set these parameters. + * To add 3rd party insurance powered by XCover, * - * @var ?\Shippo\API\Models\Components\Insurance $insurance + * specify
`amount`, `content`, and `currency`.
Alternatively, you can choose carrier provided insurance + * by additionally specifying `provider` (UPS, FedEx and OnTrac only).

If you do not want to add insurance + * to your shipment, do not set these parameters. + * + * @var ?Insurance $insurance */ - #[\JMS\Serializer\Annotation\SerializedName('insurance')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\Insurance')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('insurance')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\Insurance|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?Insurance $insurance = null; /** * Specify the invoice number field on the label (FedEx and UPS only). * - * @var ?\Shippo\API\Models\Components\InvoiceNumber $invoiceNumber + * @var ?InvoiceNumber $invoiceNumber */ - #[\JMS\Serializer\Annotation\SerializedName('invoice_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\InvoiceNumber')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('invoice_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\InvoiceNumber|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?InvoiceNumber $invoiceNumber = null; /** @@ -265,19 +283,18 @@ class ShipmentExtra * * @var ?bool $isReturn */ - #[\JMS\Serializer\Annotation\SerializedName('is_return')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('is_return')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $isReturn = null; /** * Specify Lasership Attributes (Lasership only). Multiple options accepted. * - * @var ?array<\Shippo\API\Models\Components\ShipmentExtraLasershipAttributesEnum> $lasershipAttrs + * @var ?array $lasershipAttrs */ - #[\JMS\Serializer\Annotation\SerializedName('lasership_attrs')] - #[\JMS\Serializer\Annotation\Type('array>')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('lasership_attrs')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\ShipmentExtraLasershipAttributesEnum>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $lasershipAttrs = null; /** @@ -285,44 +302,55 @@ class ShipmentExtra * * @var ?string $lasershipDeclaredValue */ - #[\JMS\Serializer\Annotation\SerializedName('lasership_declared_value')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('lasership_declared_value')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $lasershipDeclaredValue = null; - #[\JMS\Serializer\Annotation\SerializedName('manifest_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $manifestNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('manifest_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $manifestNumber = null; - #[\JMS\Serializer\Annotation\SerializedName('model_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $modelNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('model_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $modelNumber = null; - #[\JMS\Serializer\Annotation\SerializedName('part_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $partNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('part_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $partNumber = null; /** * Specify the PO number field on the label (FedEx and UPS only). * - * @var ?\Shippo\API\Models\Components\PoNumber $poNumber + * @var ?PoNumber $poNumber */ - #[\JMS\Serializer\Annotation\SerializedName('po_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\PoNumber')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('po_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\PoNumber|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?PoNumber $poNumber = null; /** * Required for DHL Germany Paket Sameday. Designates a desired timeframe for delivery. Format is `HHMMHHMM` * - * @var ?\Shippo\API\Models\Components\PreferredDeliveryTimeframe $preferredDeliveryTimeframe + * @var ?PreferredDeliveryTimeframe $preferredDeliveryTimeframe */ - #[\JMS\Serializer\Annotation\SerializedName('preferred_delivery_timeframe')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('preferred_delivery_timeframe')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\PreferredDeliveryTimeframe|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?PreferredDeliveryTimeframe $preferredDeliveryTimeframe = null; /** @@ -330,19 +358,26 @@ class ShipmentExtra * * @var ?bool $premium */ - #[\JMS\Serializer\Annotation\SerializedName('premium')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('premium')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $premium = null; - #[\JMS\Serializer\Annotation\SerializedName('production_code')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $productionCode + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('production_code')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $productionCode = null; - #[\JMS\Serializer\Annotation\SerializedName('purchase_request_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $purchaseRequestNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('purchase_request_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $purchaseRequestNumber = null; /** @@ -350,9 +385,8 @@ class ShipmentExtra * * @var ?bool $qrCodeRequested */ - #[\JMS\Serializer\Annotation\SerializedName('qr_code_requested')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('qr_code_requested')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $qrCodeRequested = null; /** @@ -360,9 +394,8 @@ class ShipmentExtra * * @var ?string $reference1 */ - #[\JMS\Serializer\Annotation\SerializedName('reference_1')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('reference_1')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $reference1 = null; /** @@ -370,9 +403,8 @@ class ShipmentExtra * * @var ?string $reference2 */ - #[\JMS\Serializer\Annotation\SerializedName('reference_2')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('reference_2')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $reference2 = null; /** @@ -380,29 +412,28 @@ class ShipmentExtra * * @var ?bool $requestRetailRates */ - #[\JMS\Serializer\Annotation\SerializedName('request_retail_rates')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('request_retail_rates')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $requestRetailRates = null; /** * Request additional return option for return shipments (UPS and Lasership only). * - * @var mixed $returnServiceType + * @var ShipmentExtraReturnServiceTypeUPSEnum|ShipmentExtraReturnServiceTypeLasershipEnum|null $returnServiceType */ - #[\JMS\Serializer\Annotation\SerializedName('return_service_type')] - #[\JMS\Serializer\Annotation\Type('mixed')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] - public mixed $returnServiceType = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('return_service_type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ShipmentExtraReturnServiceTypeUPSEnum|\Shippo\API\Models\Components\ShipmentExtraReturnServiceTypeLasershipEnum')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ShipmentExtraReturnServiceTypeUPSEnum|ShipmentExtraReturnServiceTypeLasershipEnum|null $returnServiceType = null; /** * Specify the RMA number field on the label (FedEx and UPS only). * - * @var ?\Shippo\API\Models\Components\RmaNumber $rmaNumber + * @var ?RmaNumber $rmaNumber */ - #[\JMS\Serializer\Annotation\SerializedName('rma_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\RmaNumber')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('rma_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\RmaNumber|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?RmaNumber $rmaNumber = null; /** @@ -410,19 +441,26 @@ class ShipmentExtra * * @var ?bool $saturdayDelivery */ - #[\JMS\Serializer\Annotation\SerializedName('saturday_delivery')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('saturday_delivery')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $saturdayDelivery = null; - #[\JMS\Serializer\Annotation\SerializedName('salesperson_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $salespersonNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('salesperson_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $salespersonNumber = null; - #[\JMS\Serializer\Annotation\SerializedName('serial_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $serialNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('serial_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $serialNumber = null; /** @@ -430,74 +468,134 @@ class ShipmentExtra * * or Indirect signature (FedEx only) or Carrier Confirmation (Deutsche Post only). * - * @var ?\Shippo\API\Models\Components\SignatureConfirmation $signatureConfirmation + * @var ?SignatureConfirmation $signatureConfirmation */ - #[\JMS\Serializer\Annotation\SerializedName('signature_confirmation')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('signature_confirmation')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\SignatureConfirmation|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?SignatureConfirmation $signatureConfirmation = null; - #[\JMS\Serializer\Annotation\SerializedName('store_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $storeNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('store_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $storeNumber = null; - #[\JMS\Serializer\Annotation\SerializedName('transaction_reference_number')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\UPSReferenceFields')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?UPSReferenceFields $transactionReferenceNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('transaction_reference_number')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\UPSReferenceFields|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?UPSReferenceFields $transactionReferenceNumber = null; - public function __construct() + /** + * @param ?UPSReferenceFields $accountsReceivableCustomerAccount + * @param ?Alcohol $alcohol + * @param ?AncillaryEndorsement $ancillaryEndorsement + * @param ?UPSReferenceFields $appropriationNumber + * @param ?bool $authorityToLeave + * @param ?UPSReferenceFields $billOfLadingNumber + * @param ?Billing $billing + * @param ?bool $bypassAddressValidation + * @param ?bool $carbonNeutral + * @param ?string $carrierHubId + * @param ?int $carrierHubTravelTime + * @param ?Cod $cod + * @param ?UPSReferenceFields $codNumber + * @param ?string $containerType + * @param ?string $criticalPullTime + * @param ?string $customerBranch + * @param ?CustomerReference $customerReference + * @param ?DangerousGoodsObject $dangerousGoods + * @param ?DangerousGoodsCode $dangerousGoodsCode + * @param ?UPSReferenceFields $dealerOrderNumber + * @param ?string $deliveryInstructions + * @param ?DepartmentNumber $deptNumber + * @param ?DryIce $dryIce + * @param ?UPSReferenceFields $fdaProductCode + * @param ?string $fulfillmentCenter + * @param ?Insurance $insurance + * @param ?InvoiceNumber $invoiceNumber + * @param ?bool $isReturn + * @param ?array $lasershipAttrs + * @param ?string $lasershipDeclaredValue + * @param ?UPSReferenceFields $manifestNumber + * @param ?UPSReferenceFields $modelNumber + * @param ?UPSReferenceFields $partNumber + * @param ?PoNumber $poNumber + * @param ?PreferredDeliveryTimeframe $preferredDeliveryTimeframe + * @param ?bool $premium + * @param ?UPSReferenceFields $productionCode + * @param ?UPSReferenceFields $purchaseRequestNumber + * @param ?bool $qrCodeRequested + * @param ?string $reference1 + * @param ?string $reference2 + * @param ?bool $requestRetailRates + * @param ShipmentExtraReturnServiceTypeUPSEnum|ShipmentExtraReturnServiceTypeLasershipEnum|null $returnServiceType + * @param ?RmaNumber $rmaNumber + * @param ?bool $saturdayDelivery + * @param ?UPSReferenceFields $salespersonNumber + * @param ?UPSReferenceFields $serialNumber + * @param ?SignatureConfirmation $signatureConfirmation + * @param ?UPSReferenceFields $storeNumber + * @param ?UPSReferenceFields $transactionReferenceNumber + */ + public function __construct(?UPSReferenceFields $accountsReceivableCustomerAccount = null, ?Alcohol $alcohol = null, ?AncillaryEndorsement $ancillaryEndorsement = null, ?UPSReferenceFields $appropriationNumber = null, ?bool $authorityToLeave = null, ?UPSReferenceFields $billOfLadingNumber = null, ?Billing $billing = null, ?bool $bypassAddressValidation = null, ?bool $carbonNeutral = null, ?string $carrierHubId = null, ?int $carrierHubTravelTime = null, ?Cod $cod = null, ?UPSReferenceFields $codNumber = null, ?string $containerType = null, ?string $criticalPullTime = null, ?string $customerBranch = null, ?CustomerReference $customerReference = null, ?DangerousGoodsObject $dangerousGoods = null, ?DangerousGoodsCode $dangerousGoodsCode = null, ?UPSReferenceFields $dealerOrderNumber = null, ?string $deliveryInstructions = null, ?DepartmentNumber $deptNumber = null, ?DryIce $dryIce = null, ?UPSReferenceFields $fdaProductCode = null, ?string $fulfillmentCenter = null, ?Insurance $insurance = null, ?InvoiceNumber $invoiceNumber = null, ?bool $isReturn = null, ?array $lasershipAttrs = null, ?string $lasershipDeclaredValue = null, ?UPSReferenceFields $manifestNumber = null, ?UPSReferenceFields $modelNumber = null, ?UPSReferenceFields $partNumber = null, ?PoNumber $poNumber = null, ?PreferredDeliveryTimeframe $preferredDeliveryTimeframe = null, ?bool $premium = null, ?UPSReferenceFields $productionCode = null, ?UPSReferenceFields $purchaseRequestNumber = null, ?bool $qrCodeRequested = null, ?string $reference1 = null, ?string $reference2 = null, ?bool $requestRetailRates = null, ShipmentExtraReturnServiceTypeUPSEnum|ShipmentExtraReturnServiceTypeLasershipEnum|null $returnServiceType = null, ?RmaNumber $rmaNumber = null, ?bool $saturdayDelivery = null, ?UPSReferenceFields $salespersonNumber = null, ?UPSReferenceFields $serialNumber = null, ?SignatureConfirmation $signatureConfirmation = null, ?UPSReferenceFields $storeNumber = null, ?UPSReferenceFields $transactionReferenceNumber = null) { - $this->accountsReceivableCustomerAccount = null; - $this->alcohol = null; - $this->ancillaryEndorsement = null; - $this->appropriationNumber = null; - $this->authorityToLeave = null; - $this->billOfLadingNumber = null; - $this->billing = null; - $this->bypassAddressValidation = null; - $this->carbonNeutral = null; - $this->carrierHubId = null; - $this->carrierHubTravelTime = null; - $this->cod = null; - $this->codNumber = null; - $this->containerType = null; - $this->criticalPullTime = null; - $this->customerBranch = null; - $this->customerReference = null; - $this->dangerousGoods = null; - $this->dangerousGoodsCode = null; - $this->dealerOrderNumber = null; - $this->deliveryInstructions = null; - $this->deptNumber = null; - $this->dryIce = null; - $this->fdaProductCode = null; - $this->fulfillmentCenter = null; - $this->insurance = null; - $this->invoiceNumber = null; - $this->isReturn = null; - $this->lasershipAttrs = null; - $this->lasershipDeclaredValue = null; - $this->manifestNumber = null; - $this->modelNumber = null; - $this->partNumber = null; - $this->poNumber = null; - $this->preferredDeliveryTimeframe = null; - $this->premium = null; - $this->productionCode = null; - $this->purchaseRequestNumber = null; - $this->qrCodeRequested = null; - $this->reference1 = null; - $this->reference2 = null; - $this->requestRetailRates = null; - $this->returnServiceType = null; - $this->rmaNumber = null; - $this->saturdayDelivery = null; - $this->salespersonNumber = null; - $this->serialNumber = null; - $this->signatureConfirmation = null; - $this->storeNumber = null; - $this->transactionReferenceNumber = null; + $this->accountsReceivableCustomerAccount = $accountsReceivableCustomerAccount; + $this->alcohol = $alcohol; + $this->ancillaryEndorsement = $ancillaryEndorsement; + $this->appropriationNumber = $appropriationNumber; + $this->authorityToLeave = $authorityToLeave; + $this->billOfLadingNumber = $billOfLadingNumber; + $this->billing = $billing; + $this->bypassAddressValidation = $bypassAddressValidation; + $this->carbonNeutral = $carbonNeutral; + $this->carrierHubId = $carrierHubId; + $this->carrierHubTravelTime = $carrierHubTravelTime; + $this->cod = $cod; + $this->codNumber = $codNumber; + $this->containerType = $containerType; + $this->criticalPullTime = $criticalPullTime; + $this->customerBranch = $customerBranch; + $this->customerReference = $customerReference; + $this->dangerousGoods = $dangerousGoods; + $this->dangerousGoodsCode = $dangerousGoodsCode; + $this->dealerOrderNumber = $dealerOrderNumber; + $this->deliveryInstructions = $deliveryInstructions; + $this->deptNumber = $deptNumber; + $this->dryIce = $dryIce; + $this->fdaProductCode = $fdaProductCode; + $this->fulfillmentCenter = $fulfillmentCenter; + $this->insurance = $insurance; + $this->invoiceNumber = $invoiceNumber; + $this->isReturn = $isReturn; + $this->lasershipAttrs = $lasershipAttrs; + $this->lasershipDeclaredValue = $lasershipDeclaredValue; + $this->manifestNumber = $manifestNumber; + $this->modelNumber = $modelNumber; + $this->partNumber = $partNumber; + $this->poNumber = $poNumber; + $this->preferredDeliveryTimeframe = $preferredDeliveryTimeframe; + $this->premium = $premium; + $this->productionCode = $productionCode; + $this->purchaseRequestNumber = $purchaseRequestNumber; + $this->qrCodeRequested = $qrCodeRequested; + $this->reference1 = $reference1; + $this->reference2 = $reference2; + $this->requestRetailRates = $requestRetailRates; + $this->returnServiceType = $returnServiceType; + $this->rmaNumber = $rmaNumber; + $this->saturdayDelivery = $saturdayDelivery; + $this->salespersonNumber = $salespersonNumber; + $this->serialNumber = $serialNumber; + $this->signatureConfirmation = $signatureConfirmation; + $this->storeNumber = $storeNumber; + $this->transactionReferenceNumber = $transactionReferenceNumber; } } \ No newline at end of file diff --git a/src/Models/Components/ShipmentExtraLasershipAttributesEnum.php b/src/Models/Components/ShipmentExtraLasershipAttributesEnum.php index 2e3bce8..dbd936b 100644 --- a/src/Models/Components/ShipmentExtraLasershipAttributesEnum.php +++ b/src/Models/Components/ShipmentExtraLasershipAttributesEnum.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Shipment>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/ShipmentStatus.php b/src/Models/Components/ShipmentStatus.php index 422b30f..dee4b4f 100644 --- a/src/Models/Components/ShipmentStatus.php +++ b/src/Models/Components/ShipmentStatus.php @@ -1,7 +1,7 @@ ")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?\DateTime $objectCreated + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectCreated = null; - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?string $objectId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?\DateTime $objectUpdated + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectUpdated = null; - public function __construct() + /** + * @param string $email + * @param string $firstName + * @param string $lastName + * @param ?string $companyName + * @param ?\DateTime $objectCreated + * @param ?string $objectId + * @param ?\DateTime $objectUpdated + */ + public function __construct(string $email, string $firstName, string $lastName, ?string $companyName = null, ?\DateTime $objectCreated = null, ?string $objectId = null, ?\DateTime $objectUpdated = null) { - $this->email = ''; - $this->firstName = ''; - $this->lastName = ''; - $this->companyName = null; - $this->objectCreated = null; - $this->objectId = null; - $this->objectUpdated = null; + $this->email = $email; + $this->firstName = $firstName; + $this->lastName = $lastName; + $this->companyName = $companyName; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectUpdated = $objectUpdated; } } \ No newline at end of file diff --git a/src/Models/Components/ShippoAccountPaginatedList.php b/src/Models/Components/ShippoAccountPaginatedList.php index 1121605..0af07e8 100644 --- a/src/Models/Components/ShippoAccountPaginatedList.php +++ b/src/Models/Components/ShippoAccountPaginatedList.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\ShippoAccount>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/ShippoAccountUpdateRequest.php b/src/Models/Components/ShippoAccountUpdateRequest.php index b1d89c8..59a27ea 100644 --- a/src/Models/Components/ShippoAccountUpdateRequest.php +++ b/src/Models/Components/ShippoAccountUpdateRequest.php @@ -1,7 +1,7 @@ email = ''; - $this->firstName = ''; - $this->lastName = ''; - $this->companyName = ''; + $this->email = $email; + $this->firstName = $firstName; + $this->lastName = $lastName; + $this->companyName = $companyName; } } \ No newline at end of file diff --git a/src/Models/Components/SignatureConfirmation.php b/src/Models/Components/SignatureConfirmation.php index 090c411..80cfaad 100644 --- a/src/Models/Components/SignatureConfirmation.php +++ b/src/Models/Components/SignatureConfirmation.php @@ -1,7 +1,7 @@ ")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('eta')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $eta = null; /** @@ -55,8 +53,8 @@ class Track * * @var array $messages */ - #[\JMS\Serializer\Annotation\SerializedName('messages')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('messages')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $messages; /** @@ -64,9 +62,8 @@ class Track * * @var ?string $metadata */ - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; /** @@ -74,14 +71,17 @@ class Track * * @var ?\DateTime $originalEta */ - #[\JMS\Serializer\Annotation\SerializedName('original_eta')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('original_eta')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $originalEta = null; - #[\JMS\Serializer\Annotation\SerializedName('servicelevel')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\ServiceLevelWithParent')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?ServiceLevelWithParent $servicelevel + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('servicelevel')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ServiceLevelWithParent|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?ServiceLevelWithParent $servicelevel = null; /** @@ -89,10 +89,10 @@ class Track * * It contains a full history of all tracking statuses, starting with the earlier tracking event first. * - * @var array<\Shippo\API\Models\Components\TrackingStatus> $trackingHistory + * @var array $trackingHistory */ - #[\JMS\Serializer\Annotation\SerializedName('tracking_history')] - #[\JMS\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\SerializedName('tracking_history')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\TrackingStatus>')] public array $trackingHistory; /** @@ -100,18 +100,17 @@ class Track * * @var string $trackingNumber */ - #[\JMS\Serializer\Annotation\SerializedName('tracking_number')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('tracking_number')] public string $trackingNumber; /** * The latest tracking information of this shipment. * - * @var ?\Shippo\API\Models\Components\TrackingStatus $trackingStatus + * @var ?TrackingStatus $trackingStatus */ - #[\JMS\Serializer\Annotation\SerializedName('tracking_status')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\TrackingStatus')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('tracking_status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\TrackingStatus|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?TrackingStatus $trackingStatus = null; /** @@ -121,24 +120,37 @@ class Track * * @var ?string $transaction */ - #[\JMS\Serializer\Annotation\SerializedName('transaction')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('transaction')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $transaction = null; - public function __construct() + /** + * @param string $carrier + * @param array $messages + * @param array $trackingHistory + * @param string $trackingNumber + * @param ?TrackingStatusLocationBase $addressFrom + * @param ?TrackingStatusLocationBase $addressTo + * @param ?\DateTime $eta + * @param ?string $metadata + * @param ?\DateTime $originalEta + * @param ?ServiceLevelWithParent $servicelevel + * @param ?TrackingStatus $trackingStatus + * @param ?string $transaction + */ + public function __construct(string $carrier, array $messages, array $trackingHistory, string $trackingNumber, ?TrackingStatusLocationBase $addressFrom = null, ?TrackingStatusLocationBase $addressTo = null, ?\DateTime $eta = null, ?string $metadata = null, ?\DateTime $originalEta = null, ?ServiceLevelWithParent $servicelevel = null, ?TrackingStatus $trackingStatus = null, ?string $transaction = null) { - $this->addressFrom = null; - $this->addressTo = null; - $this->carrier = ''; - $this->eta = null; - $this->messages = []; - $this->metadata = null; - $this->originalEta = null; - $this->servicelevel = null; - $this->trackingHistory = []; - $this->trackingNumber = ''; - $this->trackingStatus = null; - $this->transaction = null; + $this->carrier = $carrier; + $this->messages = $messages; + $this->trackingHistory = $trackingHistory; + $this->trackingNumber = $trackingNumber; + $this->addressFrom = $addressFrom; + $this->addressTo = $addressTo; + $this->eta = $eta; + $this->metadata = $metadata; + $this->originalEta = $originalEta; + $this->servicelevel = $servicelevel; + $this->trackingStatus = $trackingStatus; + $this->transaction = $transaction; } } \ No newline at end of file diff --git a/src/Models/Components/TrackingStatus.php b/src/Models/Components/TrackingStatus.php index 4c6c6ad..960b819 100644 --- a/src/Models/Components/TrackingStatus.php +++ b/src/Models/Components/TrackingStatus.php @@ -1,7 +1,7 @@ ")] + /** + * + * @var \DateTime $objectCreated + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] public \DateTime $objectCreated; - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] + /** + * + * @var string $objectId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] public string $objectId; - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] + /** + * + * @var \DateTime $objectUpdated + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] public \DateTime $objectUpdated; /** * Indicates the high level status of the shipment. * - * @var \Shippo\API\Models\Components\TrackingStatusEnum $status + * @var TrackingStatusEnum $status */ - #[\JMS\Serializer\Annotation\SerializedName('status')] - #[\JMS\Serializer\Annotation\Type('enum')] + #[\Speakeasy\Serializer\Annotation\SerializedName('status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\TrackingStatusEnum')] public TrackingStatusEnum $status; /** * A finer-grained classification of the tracking event. * - * @var ?\Shippo\API\Models\Components\TrackingStatusSubstatus $substatus + * @var ?TrackingStatusSubstatus $substatus */ - #[\JMS\Serializer\Annotation\SerializedName('substatus')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\TrackingStatusSubstatus')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('substatus')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\TrackingStatusSubstatus|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?TrackingStatusSubstatus $substatus = null; /** @@ -58,9 +67,8 @@ class TrackingStatus * * @var ?\DateTime $statusDate */ - #[\JMS\Serializer\Annotation\SerializedName('status_date')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('status_date')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $statusDate = null; /** @@ -68,19 +76,28 @@ class TrackingStatus * * @var string $statusDetails */ - #[\JMS\Serializer\Annotation\SerializedName('status_details')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('status_details')] public string $statusDetails; - public function __construct() + /** + * @param \DateTime $objectCreated + * @param string $objectId + * @param \DateTime $objectUpdated + * @param TrackingStatusEnum $status + * @param string $statusDetails + * @param ?TrackingStatusLocationBase $location + * @param ?TrackingStatusSubstatus $substatus + * @param ?\DateTime $statusDate + */ + public function __construct(\DateTime $objectCreated, string $objectId, \DateTime $objectUpdated, TrackingStatusEnum $status, string $statusDetails, ?TrackingStatusLocationBase $location = null, ?TrackingStatusSubstatus $substatus = null, ?\DateTime $statusDate = null) { - $this->location = null; - $this->objectCreated = new \DateTime(); - $this->objectId = ''; - $this->objectUpdated = new \DateTime(); - $this->status = \Shippo\API\Models\Components\TrackingStatusEnum::Unknown; - $this->substatus = null; - $this->statusDate = null; - $this->statusDetails = ''; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectUpdated = $objectUpdated; + $this->status = $status; + $this->statusDetails = $statusDetails; + $this->location = $location; + $this->substatus = $substatus; + $this->statusDate = $statusDate; } } \ No newline at end of file diff --git a/src/Models/Components/TrackingStatusEnum.php b/src/Models/Components/TrackingStatusEnum.php index d00766b..fd56edd 100644 --- a/src/Models/Components/TrackingStatusEnum.php +++ b/src/Models/Components/TrackingStatusEnum.php @@ -1,7 +1,7 @@ city = null; - $this->country = null; - $this->state = null; - $this->zip = null; + $this->city = $city; + $this->country = $country; + $this->state = $state; + $this->zip = $zip; } } \ No newline at end of file diff --git a/src/Models/Components/TrackingStatusSubstatus.php b/src/Models/Components/TrackingStatusSubstatus.php index b968297..1ece928 100644 --- a/src/Models/Components/TrackingStatusSubstatus.php +++ b/src/Models/Components/TrackingStatusSubstatus.php @@ -1,7 +1,7 @@ code = ''; - $this->text = ''; - $this->actionRequired = false; + $this->code = $code; + $this->text = $text; + $this->actionRequired = $actionRequired; } } \ No newline at end of file diff --git a/src/Models/Components/TracksRequest.php b/src/Models/Components/TracksRequest.php index dbc6ee4..b917787 100644 --- a/src/Models/Components/TracksRequest.php +++ b/src/Models/Components/TracksRequest.php @@ -1,7 +1,7 @@ carrier = ''; - $this->metadata = null; - $this->trackingNumber = ''; + $this->carrier = $carrier; + $this->trackingNumber = $trackingNumber; + $this->metadata = $metadata; } } \ No newline at end of file diff --git a/src/Models/Components/Transaction.php b/src/Models/Components/Transaction.php index b0743b5..7668054 100644 --- a/src/Models/Components/Transaction.php +++ b/src/Models/Components/Transaction.php @@ -1,7 +1,7 @@ the Shippo dashboard. * - * @var ?\Shippo\API\Models\Components\LabelFileTypeEnum $labelFileType + * @var ?LabelFileTypeEnum $labelFileType */ - #[\JMS\Serializer\Annotation\SerializedName('label_file_type')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('label_file_type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\LabelFileTypeEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?LabelFileTypeEnum $labelFileType = null; /** @@ -57,19 +59,18 @@ class Transaction * * @var ?string $labelUrl */ - #[\JMS\Serializer\Annotation\SerializedName('label_url')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('label_url')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $labelUrl = null; /** * $messages * - * @var ?array<\Shippo\API\Models\Components\ResponseMessage> $messages + * @var ?array $messages */ - #[\JMS\Serializer\Annotation\SerializedName('messages')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('messages')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\ResponseMessage>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $messages = null; /** @@ -79,9 +80,8 @@ class Transaction * * @var ?string $metadata */ - #[\JMS\Serializer\Annotation\SerializedName('metadata')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $metadata = null; /** @@ -89,9 +89,8 @@ class Transaction * * @var ?\DateTime $objectCreated */ - #[\JMS\Serializer\Annotation\SerializedName('object_created')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectCreated = null; /** @@ -99,9 +98,8 @@ class Transaction * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; /** @@ -109,19 +107,18 @@ class Transaction * * @var ?string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectOwner = null; /** * Indicates the validity of the enclosing object * - * @var ?\Shippo\API\Models\Components\ObjectStateEnum $objectState + * @var ?ObjectStateEnum $objectState */ - #[\JMS\Serializer\Annotation\SerializedName('object_state')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_state')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\ObjectStateEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?ObjectStateEnum $objectState = null; /** @@ -129,11 +126,19 @@ class Transaction * * @var ?\DateTime $objectUpdated */ - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectUpdated = null; + /** + * Object ID of the Parcel object that is being shipped. + * + * @var ?string $parcel + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('parcel')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $parcel = null; + /** * A URL pointing directly to the QR code in PNG format. * @@ -141,9 +146,8 @@ class Transaction * * @var ?string $qrCodeUrl */ - #[\JMS\Serializer\Annotation\SerializedName('qr_code_url')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('qr_code_url')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $qrCodeUrl = null; /** @@ -153,21 +157,21 @@ class Transaction * this field will be a simplified Rate object in the Transaction model returned from the POST request. *
Note, only rates less than 7 days old can be purchased to ensure up-to-date pricing. * - * @var mixed $rate + * @var CoreRate|string|null $rate */ - #[\JMS\Serializer\Annotation\SerializedName('rate')] - #[\JMS\Serializer\Annotation\Type('mixed')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] - public mixed $rate = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('rate')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CoreRate|string')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public CoreRate|string|null $rate = null; /** * Indicates the status of the Transaction. * - * @var ?\Shippo\API\Models\Components\TransactionStatusEnum $status + * @var ?TransactionStatusEnum $status */ - #[\JMS\Serializer\Annotation\SerializedName('status')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\TransactionStatusEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?TransactionStatusEnum $status = null; /** @@ -175,9 +179,8 @@ class Transaction * * @var ?bool $test */ - #[\JMS\Serializer\Annotation\SerializedName('test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $test = null; /** @@ -187,19 +190,18 @@ class Transaction * * @var ?string $trackingNumber */ - #[\JMS\Serializer\Annotation\SerializedName('tracking_number')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('tracking_number')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $trackingNumber = null; /** * Indicates the high level status of the shipment. * - * @var ?\Shippo\API\Models\Components\TrackingStatusEnum $trackingStatus + * @var ?TrackingStatusEnum $trackingStatus */ - #[\JMS\Serializer\Annotation\SerializedName('tracking_status')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('tracking_status')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\TrackingStatusEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?TrackingStatusEnum $trackingStatus = null; /** @@ -209,31 +211,53 @@ class Transaction * * @var ?string $trackingUrlProvider */ - #[\JMS\Serializer\Annotation\SerializedName('tracking_url_provider')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('tracking_url_provider')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $trackingUrlProvider = null; - public function __construct() + /** + * @param ?string $commercialInvoiceUrl + * @param ?string $eta + * @param ?LabelFileTypeEnum $labelFileType + * @param ?string $labelUrl + * @param ?array $messages + * @param ?string $metadata + * @param ?\DateTime $objectCreated + * @param ?string $objectId + * @param ?string $objectOwner + * @param ?ObjectStateEnum $objectState + * @param ?\DateTime $objectUpdated + * @param ?string $parcel + * @param ?string $qrCodeUrl + * @param CoreRate|string|null $rate + * @param ?TransactionStatusEnum $status + * @param ?bool $test + * @param ?string $trackingNumber + * @param ?TrackingStatusEnum $trackingStatus + * @param ?string $trackingUrlProvider + * @param ?CreatedBy $createdBy + */ + public function __construct(?string $commercialInvoiceUrl = null, ?string $eta = null, ?LabelFileTypeEnum $labelFileType = null, ?string $labelUrl = null, ?array $messages = null, ?string $metadata = null, ?\DateTime $objectCreated = null, ?string $objectId = null, ?string $objectOwner = null, ?ObjectStateEnum $objectState = null, ?\DateTime $objectUpdated = null, ?string $parcel = null, ?string $qrCodeUrl = null, CoreRate|string|null $rate = null, ?TransactionStatusEnum $status = null, ?bool $test = null, ?string $trackingNumber = null, ?TrackingStatusEnum $trackingStatus = null, ?string $trackingUrlProvider = null, ?CreatedBy $createdBy = null) { - $this->commercialInvoiceUrl = null; - $this->createdBy = null; - $this->eta = null; - $this->labelFileType = null; - $this->labelUrl = null; - $this->messages = null; - $this->metadata = null; - $this->objectCreated = null; - $this->objectId = null; - $this->objectOwner = null; - $this->objectState = null; - $this->objectUpdated = null; - $this->qrCodeUrl = null; - $this->rate = null; - $this->status = null; - $this->test = null; - $this->trackingNumber = null; - $this->trackingStatus = null; - $this->trackingUrlProvider = null; + $this->commercialInvoiceUrl = $commercialInvoiceUrl; + $this->eta = $eta; + $this->labelFileType = $labelFileType; + $this->labelUrl = $labelUrl; + $this->messages = $messages; + $this->metadata = $metadata; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->objectState = $objectState; + $this->objectUpdated = $objectUpdated; + $this->parcel = $parcel; + $this->qrCodeUrl = $qrCodeUrl; + $this->rate = $rate; + $this->status = $status; + $this->test = $test; + $this->trackingNumber = $trackingNumber; + $this->trackingStatus = $trackingStatus; + $this->trackingUrlProvider = $trackingUrlProvider; + $this->createdBy = $createdBy; } } \ No newline at end of file diff --git a/src/Models/Components/TransactionCreateRequest.php b/src/Models/Components/TransactionCreateRequest.php new file mode 100644 index 0000000..6f85da0 --- /dev/null +++ b/src/Models/Components/TransactionCreateRequest.php @@ -0,0 +1,72 @@ +label. If empty, will use the default format set from + * + * the Shippo dashboard. + * + * @var ?LabelFileTypeEnum $labelFileType + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('label_file_type')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\LabelFileTypeEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?LabelFileTypeEnum $labelFileType = null; + + /** + * + * @var ?string $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $metadata = null; + + /** + * + * @var string $rate + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('rate')] + public string $rate; + + /** + * + * @var ?string $order + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('order')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $order = null; + + /** + * @param string $rate + * @param ?bool $async + * @param ?LabelFileTypeEnum $labelFileType + * @param ?string $metadata + * @param ?string $order + */ + public function __construct(string $rate, ?LabelFileTypeEnum $labelFileType = null, ?string $metadata = null, ?string $order = null, ?bool $async = true) + { + $this->rate = $rate; + $this->async = $async; + $this->labelFileType = $labelFileType; + $this->metadata = $metadata; + $this->order = $order; + } +} \ No newline at end of file diff --git a/src/Models/Components/TransactionPaginatedList.php b/src/Models/Components/TransactionPaginatedList.php index 26daed9..4a1c5b5 100644 --- a/src/Models/Components/TransactionPaginatedList.php +++ b/src/Models/Components/TransactionPaginatedList.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Transaction>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/TransactionStatusEnum.php b/src/Models/Components/TransactionStatusEnum.php index c03f1d8..58db4f7 100644 --- a/src/Models/Components/TransactionStatusEnum.php +++ b/src/Models/Components/TransactionStatusEnum.php @@ -1,7 +1,7 @@ carrier accounts tutorial page for the parameters per carrier.
+ * To protect account information, this field will be masked in any API response. + */ +class UPSConnectExistingOwnAccountParameters +{ + /** + * The UPS account number + * + * @var string $accountNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('account_number')] + public string $accountNumber; + + /** + * Only required if has_invoice is true. Country associated with the account that issued the invoice + * + * @var ?string $aiaCountryIso2 + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('aia_country_iso2')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $aiaCountryIso2 = null; + + /** + * + * @var string $billingAddressCity + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('billing_address_city')] + public string $billingAddressCity; + + /** + * + * @var string $billingAddressCountryIso2 + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('billing_address_country_iso2')] + public string $billingAddressCountryIso2; + + /** + * + * @var string $billingAddressState + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('billing_address_state')] + public string $billingAddressState; + + /** + * + * @var string $billingAddressStreet1 + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('billing_address_street1')] + public string $billingAddressStreet1; + + /** + * Empty string acceptable for billing_address_street2 + * + * @var ?string $billingAddressStreet2 + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('billing_address_street2')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $billingAddressStreet2 = null; + + /** + * + * @var string $billingAddressZip + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('billing_address_zip')] + public string $billingAddressZip; + + /** + * + * @var string $collecCountryIso2 + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('collec_country_iso2')] + public string $collecCountryIso2; + + /** + * Zip code of the collection/pickup address + * + * @var string $collecZip + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('collec_zip')] + public string $collecZip; + + /** + * Company name. Full name is acceptable in this field if the user has no company name + * + * @var string $company + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('company')] + public string $company; + + /** + * Only required if has_invoice is true. 3-letter currency code associated with invoice_value + * + * @var ?string $currencyCode + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('currency_code')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $currencyCode = null; + + /** + * + * @var string $email + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('email')] + public string $email; + + /** + * + * @var string $fullName + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('full_name')] + public string $fullName; + + /** + * true if user has been issued a UPS invoice within the past 90 days for the US or Canada; and 45 days for any other countries. User can use data from any of the last 3 invoices + * + * @var bool $hasInvoice + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('has_invoice')] + public bool $hasInvoice; + + /** + * Only required if aia_country_iso2 is US and has_invoice is true. + * + * @var ?string $invoiceControlid + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('invoice_controlid')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $invoiceControlid = null; + + /** + * Only required if has_invoice is true. Date the invoice was issued. yyyymmdd format + * + * @var ?string $invoiceDate + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('invoice_date')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $invoiceDate = null; + + /** + * + * @var ?string $invoiceNumber + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('invoice_number')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $invoiceNumber = null; + + /** + * Only required if has_invoice is true. Max 16 digits before decimal and 2 digits after decimal + * + * @var ?string $invoiceValue + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('invoice_value')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $invoiceValue = null; + + /** + * + * @var string $phone + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('phone')] + public string $phone; + + /** + * User's title, e.g. including but not limited to Manager, Doctor, Artist, Engineer, Mr, Ms, Mrs, Mx + * + * @var string $title + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('title')] + public string $title; + + /** + * Whether the user agrees to the UPS terms and conditions or not. Error 400 will be returned if passed in as false + * + * @var bool $upsAgreements + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('ups_agreements')] + public bool $upsAgreements; + + /** + * @param string $accountNumber + * @param string $billingAddressCity + * @param string $billingAddressCountryIso2 + * @param string $billingAddressState + * @param string $billingAddressStreet1 + * @param string $billingAddressZip + * @param string $collecCountryIso2 + * @param string $collecZip + * @param string $company + * @param string $email + * @param string $fullName + * @param bool $hasInvoice + * @param string $phone + * @param string $title + * @param bool $upsAgreements + * @param ?string $aiaCountryIso2 + * @param ?string $billingAddressStreet2 + * @param ?string $currencyCode + * @param ?string $invoiceControlid + * @param ?string $invoiceDate + * @param ?string $invoiceNumber + * @param ?string $invoiceValue + */ + public function __construct(string $accountNumber, string $billingAddressCity, string $billingAddressCountryIso2, string $billingAddressState, string $billingAddressStreet1, string $billingAddressZip, string $collecCountryIso2, string $collecZip, string $company, string $email, string $fullName, bool $hasInvoice, string $phone, string $title, bool $upsAgreements, ?string $aiaCountryIso2 = null, ?string $billingAddressStreet2 = null, ?string $currencyCode = null, ?string $invoiceControlid = null, ?string $invoiceDate = null, ?string $invoiceNumber = null, ?string $invoiceValue = null) + { + $this->accountNumber = $accountNumber; + $this->billingAddressCity = $billingAddressCity; + $this->billingAddressCountryIso2 = $billingAddressCountryIso2; + $this->billingAddressState = $billingAddressState; + $this->billingAddressStreet1 = $billingAddressStreet1; + $this->billingAddressZip = $billingAddressZip; + $this->collecCountryIso2 = $collecCountryIso2; + $this->collecZip = $collecZip; + $this->company = $company; + $this->email = $email; + $this->fullName = $fullName; + $this->hasInvoice = $hasInvoice; + $this->phone = $phone; + $this->title = $title; + $this->upsAgreements = $upsAgreements; + $this->aiaCountryIso2 = $aiaCountryIso2; + $this->billingAddressStreet2 = $billingAddressStreet2; + $this->currencyCode = $currencyCode; + $this->invoiceControlid = $invoiceControlid; + $this->invoiceDate = $invoiceDate; + $this->invoiceNumber = $invoiceNumber; + $this->invoiceValue = $invoiceValue; + } +} \ No newline at end of file diff --git a/src/Models/Components/UPSReferenceFields.php b/src/Models/Components/UPSReferenceFields.php index 73cbfe6..c8aa2b9 100644 --- a/src/Models/Components/UPSReferenceFields.php +++ b/src/Models/Components/UPSReferenceFields.php @@ -1,7 +1,7 @@ prefix = null; - $this->value = null; - $this->refSort = null; + $this->prefix = $prefix; + $this->value = $value; + $this->refSort = $refSort; } } \ No newline at end of file diff --git a/src/Models/Components/UserParcelTemplate.php b/src/Models/Components/UserParcelTemplate.php index c8629ea..65b8f21 100644 --- a/src/Models/Components/UserParcelTemplate.php +++ b/src/Models/Components/UserParcelTemplate.php @@ -1,7 +1,7 @@ ')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('distance_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\DistanceUnitEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?DistanceUnitEnum $distanceUnit = null; /** @@ -26,9 +26,8 @@ class UserParcelTemplate * * @var ?string $height */ - #[\JMS\Serializer\Annotation\SerializedName('height')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('height')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $height = null; /** @@ -36,9 +35,8 @@ class UserParcelTemplate * * @var ?string $length */ - #[\JMS\Serializer\Annotation\SerializedName('length')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('length')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $length = null; /** @@ -46,9 +44,8 @@ class UserParcelTemplate * * @var ?string $name */ - #[\JMS\Serializer\Annotation\SerializedName('name')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('name')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $name = null; /** @@ -56,19 +53,18 @@ class UserParcelTemplate * * @var ?string $weight */ - #[\JMS\Serializer\Annotation\SerializedName('weight')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $weight = null; /** * The unit used for weight. * - * @var ?\Shippo\API\Models\Components\WeightUnitEnum $weightUnit + * @var ?WeightUnitEnum $weightUnit */ - #[\JMS\Serializer\Annotation\SerializedName('weight_unit')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\WeightUnitEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?WeightUnitEnum $weightUnit = null; /** @@ -76,9 +72,8 @@ class UserParcelTemplate * * @var ?string $width */ - #[\JMS\Serializer\Annotation\SerializedName('width')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('width')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $width = null; /** @@ -86,9 +81,8 @@ class UserParcelTemplate * * @var ?\DateTime $objectCreated */ - #[\JMS\Serializer\Annotation\SerializedName('object_created')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectCreated = null; /** @@ -96,9 +90,8 @@ class UserParcelTemplate * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; /** @@ -106,9 +99,8 @@ class UserParcelTemplate * * @var ?string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectOwner = null; /** @@ -116,29 +108,46 @@ class UserParcelTemplate * * @var ?\DateTime $objectUpdated */ - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectUpdated = null; - #[\JMS\Serializer\Annotation\SerializedName('template')] - #[\JMS\Serializer\Annotation\Type('Shippo\API\Models\Components\CarrierParcelTemplate')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + /** + * + * @var ?CarrierParcelTemplate $template + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('template')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\CarrierParcelTemplate|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?CarrierParcelTemplate $template = null; - public function __construct() + /** + * @param ?DistanceUnitEnum $distanceUnit + * @param ?string $height + * @param ?string $length + * @param ?string $name + * @param ?string $weight + * @param ?WeightUnitEnum $weightUnit + * @param ?string $width + * @param ?\DateTime $objectCreated + * @param ?string $objectId + * @param ?string $objectOwner + * @param ?\DateTime $objectUpdated + * @param ?CarrierParcelTemplate $template + */ + public function __construct(?DistanceUnitEnum $distanceUnit = null, ?string $height = null, ?string $length = null, ?string $name = null, ?string $weight = null, ?WeightUnitEnum $weightUnit = null, ?string $width = null, ?\DateTime $objectCreated = null, ?string $objectId = null, ?string $objectOwner = null, ?\DateTime $objectUpdated = null, ?CarrierParcelTemplate $template = null) { - $this->distanceUnit = null; - $this->height = null; - $this->length = null; - $this->name = null; - $this->weight = null; - $this->weightUnit = null; - $this->width = null; - $this->objectCreated = null; - $this->objectId = null; - $this->objectOwner = null; - $this->objectUpdated = null; - $this->template = null; + $this->distanceUnit = $distanceUnit; + $this->height = $height; + $this->length = $length; + $this->name = $name; + $this->weight = $weight; + $this->weightUnit = $weightUnit; + $this->width = $width; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectOwner = $objectOwner; + $this->objectUpdated = $objectUpdated; + $this->template = $template; } } \ No newline at end of file diff --git a/src/Models/Components/UserParcelTemplateList.php b/src/Models/Components/UserParcelTemplateList.php index d73a37c..e0b113b 100644 --- a/src/Models/Components/UserParcelTemplateList.php +++ b/src/Models/Components/UserParcelTemplateList.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\UserParcelTemplate>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?array $results + */ + public function __construct(?array $results = null) { - $this->results = null; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/UserParcelTemplateUpdateRequest.php b/src/Models/Components/UserParcelTemplateUpdateRequest.php index 70fdf17..a327e26 100644 --- a/src/Models/Components/UserParcelTemplateUpdateRequest.php +++ b/src/Models/Components/UserParcelTemplateUpdateRequest.php @@ -1,7 +1,7 @@ ')] + #[\Speakeasy\Serializer\Annotation\SerializedName('distance_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\DistanceUnitEnum')] public DistanceUnitEnum $distanceUnit; /** @@ -25,8 +25,7 @@ class UserParcelTemplateUpdateRequest * * @var string $height */ - #[\JMS\Serializer\Annotation\SerializedName('height')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('height')] public string $height; /** @@ -34,8 +33,7 @@ class UserParcelTemplateUpdateRequest * * @var string $length */ - #[\JMS\Serializer\Annotation\SerializedName('length')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('length')] public string $length; /** @@ -43,8 +41,7 @@ class UserParcelTemplateUpdateRequest * * @var string $name */ - #[\JMS\Serializer\Annotation\SerializedName('name')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('name')] public string $name; /** @@ -52,19 +49,18 @@ class UserParcelTemplateUpdateRequest * * @var ?string $weight */ - #[\JMS\Serializer\Annotation\SerializedName('weight')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $weight = null; /** * The unit used for weight. * - * @var ?\Shippo\API\Models\Components\WeightUnitEnum $weightUnit + * @var ?WeightUnitEnum $weightUnit */ - #[\JMS\Serializer\Annotation\SerializedName('weight_unit')] - #[\JMS\Serializer\Annotation\Type('enum')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('weight_unit')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\WeightUnitEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?WeightUnitEnum $weightUnit = null; /** @@ -72,18 +68,26 @@ class UserParcelTemplateUpdateRequest * * @var string $width */ - #[\JMS\Serializer\Annotation\SerializedName('width')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('width')] public string $width; - public function __construct() + /** + * @param DistanceUnitEnum $distanceUnit + * @param string $height + * @param string $length + * @param string $name + * @param string $width + * @param ?string $weight + * @param ?WeightUnitEnum $weightUnit + */ + public function __construct(DistanceUnitEnum $distanceUnit, string $height, string $length, string $name, string $width, ?string $weight = null, ?WeightUnitEnum $weightUnit = null) { - $this->distanceUnit = \Shippo\API\Models\Components\DistanceUnitEnum::Cm; - $this->height = ''; - $this->length = ''; - $this->name = ''; - $this->weight = null; - $this->weightUnit = null; - $this->width = ''; + $this->distanceUnit = $distanceUnit; + $this->height = $height; + $this->length = $length; + $this->name = $name; + $this->width = $width; + $this->weight = $weight; + $this->weightUnit = $weightUnit; } } \ No newline at end of file diff --git a/src/Models/Components/UserParcelTemplateWithCarrierTemplateCreateRequest.php b/src/Models/Components/UserParcelTemplateWithCarrierTemplateCreateRequest.php new file mode 100644 index 0000000..6c36cad --- /dev/null +++ b/src/Models/Components/UserParcelTemplateWithCarrierTemplateCreateRequest.php @@ -0,0 +1,53 @@ +template = $template; + $this->weight = $weight; + $this->weightUnit = $weightUnit; + } +} \ No newline at end of file diff --git a/src/Models/Components/UserParcelTemplateWithoutCarrierTemplateCreateRequest.php b/src/Models/Components/UserParcelTemplateWithoutCarrierTemplateCreateRequest.php new file mode 100644 index 0000000..5b18be8 --- /dev/null +++ b/src/Models/Components/UserParcelTemplateWithoutCarrierTemplateCreateRequest.php @@ -0,0 +1,93 @@ +distanceUnit = $distanceUnit; + $this->height = $height; + $this->length = $length; + $this->name = $name; + $this->width = $width; + $this->weight = $weight; + $this->weightUnit = $weightUnit; + } +} \ No newline at end of file diff --git a/src/Models/Components/Webhook.php b/src/Models/Components/Webhook.php index 77173a2..aa26f5c 100644 --- a/src/Models/Components/Webhook.php +++ b/src/Models/Components/Webhook.php @@ -1,7 +1,7 @@ ")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_created')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectCreated = null; /** @@ -64,9 +59,8 @@ class Webhook * * @var ?string $objectId */ - #[\JMS\Serializer\Annotation\SerializedName('object_id')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectId = null; /** @@ -74,9 +68,8 @@ class Webhook * * @var ?\DateTime $objectUpdated */ - #[\JMS\Serializer\Annotation\SerializedName('object_updated')] - #[\JMS\Serializer\Annotation\Type("DateTime<'Y-m-d\TH:i:s.up'>")] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_updated')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?\DateTime $objectUpdated = null; /** @@ -84,20 +77,29 @@ class Webhook * * @var ?string $objectOwner */ - #[\JMS\Serializer\Annotation\SerializedName('object_owner')] - #[\JMS\Serializer\Annotation\Type('string')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('object_owner')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $objectOwner = null; - public function __construct() + /** + * @param string $event + * @param string $url + * @param ?bool $active + * @param ?bool $isTest + * @param ?\DateTime $objectCreated + * @param ?string $objectId + * @param ?\DateTime $objectUpdated + * @param ?string $objectOwner + */ + public function __construct(string $event, string $url, ?bool $active = null, ?bool $isTest = null, ?\DateTime $objectCreated = null, ?string $objectId = null, ?\DateTime $objectUpdated = null, ?string $objectOwner = null) { - $this->event = ''; - $this->url = ''; - $this->active = null; - $this->isTest = null; - $this->objectCreated = null; - $this->objectId = null; - $this->objectUpdated = null; - $this->objectOwner = null; + $this->event = $event; + $this->url = $url; + $this->active = $active; + $this->isTest = $isTest; + $this->objectCreated = $objectCreated; + $this->objectId = $objectId; + $this->objectUpdated = $objectUpdated; + $this->objectOwner = $objectOwner; } } \ No newline at end of file diff --git a/src/Models/Components/WebhookEventTypeEnum.php b/src/Models/Components/WebhookEventTypeEnum.php index c6380ca..0c2dd4a 100644 --- a/src/Models/Components/WebhookEventTypeEnum.php +++ b/src/Models/Components/WebhookEventTypeEnum.php @@ -1,7 +1,7 @@ $results + * @var ?array $results */ - #[\JMS\Serializer\Annotation\SerializedName('results')] - #[\JMS\Serializer\Annotation\Type('array')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('results')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Shippo\API\Models\Components\Webhook>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $results = null; - public function __construct() + /** + * @param ?string $next + * @param ?string $previous + * @param ?int $count + * @param ?array $results + */ + public function __construct(?string $next = null, ?string $previous = null, ?int $count = null, ?array $results = null) { - $this->next = null; - $this->previous = null; - $this->count = null; - $this->results = null; + $this->next = $next; + $this->previous = $previous; + $this->count = $count; + $this->results = $results; } } \ No newline at end of file diff --git a/src/Models/Components/WebhookPayloadBatch.php b/src/Models/Components/WebhookPayloadBatch.php new file mode 100644 index 0000000..110d59f --- /dev/null +++ b/src/Models/Components/WebhookPayloadBatch.php @@ -0,0 +1,54 @@ +event = $event; + $this->test = $test; + $this->data = $data; + } +} \ No newline at end of file diff --git a/src/Models/Components/WebhookPayloadTrack.php b/src/Models/Components/WebhookPayloadTrack.php new file mode 100644 index 0000000..4fa1648 --- /dev/null +++ b/src/Models/Components/WebhookPayloadTrack.php @@ -0,0 +1,54 @@ +event = $event; + $this->test = $test; + $this->data = $data; + } +} \ No newline at end of file diff --git a/src/Models/Components/WebhookPayloadTransaction.php b/src/Models/Components/WebhookPayloadTransaction.php new file mode 100644 index 0000000..794057c --- /dev/null +++ b/src/Models/Components/WebhookPayloadTransaction.php @@ -0,0 +1,54 @@ +event = $event; + $this->test = $test; + $this->data = $data; + } +} \ No newline at end of file diff --git a/src/Models/Components/WebhookUpdateRequest.php b/src/Models/Components/WebhookUpdateRequest.php index 1053328..8279243 100644 --- a/src/Models/Components/WebhookUpdateRequest.php +++ b/src/Models/Components/WebhookUpdateRequest.php @@ -1,7 +1,7 @@ ')] + /** + * Type of event that triggered the webhook. + * + * @var WebhookEventTypeEnum $event + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('event')] + #[\Speakeasy\Serializer\Annotation\Type('\Shippo\API\Models\Components\WebhookEventTypeEnum')] public WebhookEventTypeEnum $event; /** @@ -20,8 +25,7 @@ class WebhookUpdateRequest * * @var string $url */ - #[\JMS\Serializer\Annotation\SerializedName('url')] - #[\JMS\Serializer\Annotation\Type('string')] + #[\Speakeasy\Serializer\Annotation\SerializedName('url')] public string $url; /** @@ -29,9 +33,8 @@ class WebhookUpdateRequest * * @var ?bool $active */ - #[\JMS\Serializer\Annotation\SerializedName('active')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('active')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $active = null; /** @@ -39,16 +42,21 @@ class WebhookUpdateRequest * * @var ?bool $isTest */ - #[\JMS\Serializer\Annotation\SerializedName('is_test')] - #[\JMS\Serializer\Annotation\Type('bool')] - #[\JMS\Serializer\Annotation\SkipWhenEmpty] + #[\Speakeasy\Serializer\Annotation\SerializedName('is_test')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $isTest = null; - public function __construct() + /** + * @param WebhookEventTypeEnum $event + * @param string $url + * @param ?bool $active + * @param ?bool $isTest + */ + public function __construct(WebhookEventTypeEnum $event, string $url, ?bool $active = null, ?bool $isTest = null) { - $this->event = \Shippo\API\Models\Components\WebhookEventTypeEnum::TransactionCreated; - $this->url = ''; - $this->active = null; - $this->isTest = null; + $this->event = $event; + $this->url = $url; + $this->active = $active; + $this->isTest = $isTest; } } \ No newline at end of file diff --git a/src/Models/Components/WeightUnitEnum.php b/src/Models/Components/WeightUnitEnum.php index c087cdd..bd0e6dc 100644 --- a/src/Models/Components/WeightUnitEnum.php +++ b/src/Models/Components/WeightUnitEnum.php @@ -1,7 +1,7 @@ title = $title; + $this->detail = $detail; + } + + public function toException(): InitiateOauth2SigninCarrierAccountsResponseBodyThrowable + { + $serializer = Utils\JSON::createSerializer(); + $message = $serializer->serialize($this, 'json'); + $code = -1; + + return new InitiateOauth2SigninCarrierAccountsResponseBodyThrowable($message, (int) $code, $this); + } +} \ No newline at end of file diff --git a/src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseBodyThrowable.php b/src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseBodyThrowable.php new file mode 100644 index 0000000..78fd9ca --- /dev/null +++ b/src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseBodyThrowable.php @@ -0,0 +1,20 @@ +container = $container; + } +} \ No newline at end of file diff --git a/src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBody.php b/src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBody.php new file mode 100644 index 0000000..e02b6e5 --- /dev/null +++ b/src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBody.php @@ -0,0 +1,50 @@ +title = $title; + $this->detail = $detail; + } + + public function toException(): InitiateOauth2SigninCarrierAccountsResponseResponseBodyThrowable + { + $serializer = Utils\JSON::createSerializer(); + $message = $serializer->serialize($this, 'json'); + $code = -1; + + return new InitiateOauth2SigninCarrierAccountsResponseResponseBodyThrowable($message, (int) $code, $this); + } +} \ No newline at end of file diff --git a/src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBodyThrowable.php b/src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBodyThrowable.php new file mode 100644 index 0000000..f406c6e --- /dev/null +++ b/src/Models/Errors/InitiateOauth2SigninCarrierAccountsResponseResponseBodyThrowable.php @@ -0,0 +1,20 @@ +container = $container; + } +} \ No newline at end of file diff --git a/src/Models/Errors/InitiateOauth2SigninResponseBody.php b/src/Models/Errors/InitiateOauth2SigninResponseBody.php new file mode 100644 index 0000000..a79fc76 --- /dev/null +++ b/src/Models/Errors/InitiateOauth2SigninResponseBody.php @@ -0,0 +1,50 @@ +title = $title; + $this->detail = $detail; + } + + public function toException(): InitiateOauth2SigninResponseBodyThrowable + { + $serializer = Utils\JSON::createSerializer(); + $message = $serializer->serialize($this, 'json'); + $code = -1; + + return new InitiateOauth2SigninResponseBodyThrowable($message, (int) $code, $this); + } +} \ No newline at end of file diff --git a/src/Models/Errors/InitiateOauth2SigninResponseBodyThrowable.php b/src/Models/Errors/InitiateOauth2SigninResponseBodyThrowable.php new file mode 100644 index 0000000..f96e134 --- /dev/null +++ b/src/Models/Errors/InitiateOauth2SigninResponseBodyThrowable.php @@ -0,0 +1,20 @@ +container = $container; + } +} \ No newline at end of file diff --git a/src/Models/Errors/SDKError.php b/src/Models/Errors/SDKError.php new file mode 100644 index 0000000..4dd46ef --- /dev/null +++ b/src/Models/Errors/SDKError.php @@ -0,0 +1,32 @@ +message = $message; + $code = $statusCode; + $this->statusCode = $statusCode; + $this->body = $body; + $this->rawResponse = $rawResponse; + parent::__construct($message, $code, null); + } + + public function __toString(): string + { + return "$this->message: Status $this->statusCode $this->body"; + } + +} \ No newline at end of file diff --git a/src/Models/Operations/AddShipmentsToBatchRequest.php b/src/Models/Operations/AddShipmentsToBatchRequest.php index 86b9b94..1d302cb 100644 --- a/src/Models/Operations/AddShipmentsToBatchRequest.php +++ b/src/Models/Operations/AddShipmentsToBatchRequest.php @@ -1,13 +1,14 @@ $requestBody + * @var array $requestBody */ #[SpeakeasyMetadata('request:mediaType=application/json')] public array $requestBody; /** - * String used to pick a non-default API version to use + * Optional string used to pick a non-default API version to use. See our API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $batchId + * @param array $requestBody + * @param ?string $shippoApiVersion + */ + public function __construct(string $batchId, array $requestBody, ?string $shippoApiVersion = null) { - $this->batchId = ''; - $this->requestBody = []; - $this->shippoApiVersion = null; + $this->batchId = $batchId; + $this->requestBody = $requestBody; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/AddShipmentsToBatchResponse.php b/src/Models/Operations/AddShipmentsToBatchResponse.php deleted file mode 100644 index 2956eab..0000000 --- a/src/Models/Operations/AddShipmentsToBatchResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->batch = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/Carrier.php b/src/Models/Operations/Carrier.php index 773e9b3..46dfb81 100644 --- a/src/Models/Operations/Carrier.php +++ b/src/Models/Operations/Carrier.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\AddressCreateRequest $addressCreateRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\AddressCreateRequest $addressCreateRequest, ?string $shippoApiVersion = null) { - $this->addressCreateRequest = new \Shippo\API\Models\Components\AddressCreateRequest(); - $this->shippoApiVersion = null; + $this->addressCreateRequest = $addressCreateRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateAddressResponse.php b/src/Models/Operations/CreateAddressResponse.php deleted file mode 100644 index f42d3b8..0000000 --- a/src/Models/Operations/CreateAddressResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->address = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateBatchRequest.php b/src/Models/Operations/CreateBatchRequest.php index 41e191d..e088016 100644 --- a/src/Models/Operations/CreateBatchRequest.php +++ b/src/Models/Operations/CreateBatchRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\BatchCreateRequest $batchCreateRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\BatchCreateRequest $batchCreateRequest, ?string $shippoApiVersion = null) { - $this->batchCreateRequest = new \Shippo\API\Models\Components\BatchCreateRequest(); - $this->shippoApiVersion = null; + $this->batchCreateRequest = $batchCreateRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateBatchResponse.php b/src/Models/Operations/CreateBatchResponse.php deleted file mode 100644 index 29868be..0000000 --- a/src/Models/Operations/CreateBatchResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->batch = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateCarrierAccountRequest.php b/src/Models/Operations/CreateCarrierAccountRequest.php index 4d5172f..e9eb106 100644 --- a/src/Models/Operations/CreateCarrierAccountRequest.php +++ b/src/Models/Operations/CreateCarrierAccountRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\ConnectExistingOwnAccountRequest $connectExistingOwnAccountRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\ConnectExistingOwnAccountRequest $connectExistingOwnAccountRequest, ?string $shippoApiVersion = null) { - $this->connectExistingOwnAccountRequest = new \Shippo\API\Models\Components\ConnectExistingOwnAccountRequest(); - $this->shippoApiVersion = null; + $this->connectExistingOwnAccountRequest = $connectExistingOwnAccountRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateCarrierAccountResponse.php b/src/Models/Operations/CreateCarrierAccountResponse.php deleted file mode 100644 index 6a0036e..0000000 --- a/src/Models/Operations/CreateCarrierAccountResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->carrierAccount = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateCustomsDeclarationRequest.php b/src/Models/Operations/CreateCustomsDeclarationRequest.php index 73a9f7d..9795f95 100644 --- a/src/Models/Operations/CreateCustomsDeclarationRequest.php +++ b/src/Models/Operations/CreateCustomsDeclarationRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\CustomsDeclarationCreateRequest $customsDeclarationCreateRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\CustomsDeclarationCreateRequest $customsDeclarationCreateRequest, ?string $shippoApiVersion = null) { - $this->customsDeclarationCreateRequest = new \Shippo\API\Models\Components\CustomsDeclarationCreateRequest(); - $this->shippoApiVersion = null; + $this->customsDeclarationCreateRequest = $customsDeclarationCreateRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateCustomsDeclarationResponse.php b/src/Models/Operations/CreateCustomsDeclarationResponse.php deleted file mode 100644 index be89dd6..0000000 --- a/src/Models/Operations/CreateCustomsDeclarationResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->customsDeclaration = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateCustomsItemRequest.php b/src/Models/Operations/CreateCustomsItemRequest.php index 569b10c..499370b 100644 --- a/src/Models/Operations/CreateCustomsItemRequest.php +++ b/src/Models/Operations/CreateCustomsItemRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\CustomsItemCreateRequest $customsItemCreateRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\CustomsItemCreateRequest $customsItemCreateRequest, ?string $shippoApiVersion = null) { - $this->customsItemCreateRequest = new \Shippo\API\Models\Components\CustomsItemCreateRequest(); - $this->shippoApiVersion = null; + $this->customsItemCreateRequest = $customsItemCreateRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateCustomsItemResponse.php b/src/Models/Operations/CreateCustomsItemResponse.php deleted file mode 100644 index 9bb0bac..0000000 --- a/src/Models/Operations/CreateCustomsItemResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->customsItem = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateLiveRateRequest.php b/src/Models/Operations/CreateLiveRateRequest.php index 1910ad5..8677e2d 100644 --- a/src/Models/Operations/CreateLiveRateRequest.php +++ b/src/Models/Operations/CreateLiveRateRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\LiveRateCreateRequest $liveRateCreateRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\LiveRateCreateRequest $liveRateCreateRequest, ?string $shippoApiVersion = null) { - $this->liveRateCreateRequest = new \Shippo\API\Models\Components\LiveRateCreateRequest(); - $this->shippoApiVersion = null; + $this->liveRateCreateRequest = $liveRateCreateRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateLiveRateResponse.php b/src/Models/Operations/CreateLiveRateResponse.php deleted file mode 100644 index ef05bb4..0000000 --- a/src/Models/Operations/CreateLiveRateResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->liveRatePaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateManifestRequest.php b/src/Models/Operations/CreateManifestRequest.php index 6126c8a..337dc92 100644 --- a/src/Models/Operations/CreateManifestRequest.php +++ b/src/Models/Operations/CreateManifestRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\ManifestCreateRequest $manifestCreateRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\ManifestCreateRequest $manifestCreateRequest, ?string $shippoApiVersion = null) { - $this->manifestCreateRequest = new \Shippo\API\Models\Components\ManifestCreateRequest(); - $this->shippoApiVersion = null; + $this->manifestCreateRequest = $manifestCreateRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateManifestResponse.php b/src/Models/Operations/CreateManifestResponse.php deleted file mode 100644 index bfeb329..0000000 --- a/src/Models/Operations/CreateManifestResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->manifest = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateOrderRequest.php b/src/Models/Operations/CreateOrderRequest.php index c0652a8..f959520 100644 --- a/src/Models/Operations/CreateOrderRequest.php +++ b/src/Models/Operations/CreateOrderRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\OrderCreateRequest $orderCreateRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\OrderCreateRequest $orderCreateRequest, ?string $shippoApiVersion = null) { - $this->orderCreateRequest = new \Shippo\API\Models\Components\OrderCreateRequest(); - $this->shippoApiVersion = null; + $this->orderCreateRequest = $orderCreateRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateOrderResponse.php b/src/Models/Operations/CreateOrderResponse.php deleted file mode 100644 index f361d8f..0000000 --- a/src/Models/Operations/CreateOrderResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->order = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateParcelRequest.php b/src/Models/Operations/CreateParcelRequest.php index 3421fae..bf6e22d 100644 --- a/src/Models/Operations/CreateParcelRequest.php +++ b/src/Models/Operations/CreateParcelRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\ParcelCreateRequest|Components\ParcelCreateFromTemplateRequest $requestBody + * @param ?string $shippoApiVersion + */ + public function __construct(Components\ParcelCreateRequest|Components\ParcelCreateFromTemplateRequest $requestBody, ?string $shippoApiVersion = null) { - $this->requestBody = null; - $this->shippoApiVersion = null; + $this->requestBody = $requestBody; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateParcelResponse.php b/src/Models/Operations/CreateParcelResponse.php deleted file mode 100644 index 83451c9..0000000 --- a/src/Models/Operations/CreateParcelResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->parcel = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreatePickupRequest.php b/src/Models/Operations/CreatePickupRequest.php index 50a8625..a0cda57 100644 --- a/src/Models/Operations/CreatePickupRequest.php +++ b/src/Models/Operations/CreatePickupRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\PickupBase $pickupBase + * @param ?string $shippoApiVersion + */ + public function __construct(Components\PickupBase $pickupBase, ?string $shippoApiVersion = null) { - $this->pickupBase = new \Shippo\API\Models\Components\PickupBase(); - $this->shippoApiVersion = null; + $this->pickupBase = $pickupBase; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreatePickupResponse.php b/src/Models/Operations/CreatePickupResponse.php deleted file mode 100644 index d71d061..0000000 --- a/src/Models/Operations/CreatePickupResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->pickup = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateRefundRequest.php b/src/Models/Operations/CreateRefundRequest.php index e6ba68b..4fc4e43 100644 --- a/src/Models/Operations/CreateRefundRequest.php +++ b/src/Models/Operations/CreateRefundRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\RefundRequestBody $refundRequestBody + * @param ?string $shippoApiVersion + */ + public function __construct(Components\RefundRequestBody $refundRequestBody, ?string $shippoApiVersion = null) { - $this->refundRequestBody = new \Shippo\API\Models\Components\RefundRequestBody(); - $this->shippoApiVersion = null; + $this->refundRequestBody = $refundRequestBody; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateRefundResponse.php b/src/Models/Operations/CreateRefundResponse.php deleted file mode 100644 index 61f186b..0000000 --- a/src/Models/Operations/CreateRefundResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->refund = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateServiceGroupRequest.php b/src/Models/Operations/CreateServiceGroupRequest.php index c2d2544..4610000 100644 --- a/src/Models/Operations/CreateServiceGroupRequest.php +++ b/src/Models/Operations/CreateServiceGroupRequest.php @@ -1,30 +1,39 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\ServiceGroupCreateRequest $serviceGroupCreateRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\ServiceGroupCreateRequest $serviceGroupCreateRequest, ?string $shippoApiVersion = null) { - $this->serviceGroupCreateRequest = new \Shippo\API\Models\Components\ServiceGroupCreateRequest(); - $this->shippoApiVersion = null; + $this->serviceGroupCreateRequest = $serviceGroupCreateRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateServiceGroupResponse.php b/src/Models/Operations/CreateServiceGroupResponse.php deleted file mode 100644 index 20d13a6..0000000 --- a/src/Models/Operations/CreateServiceGroupResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->serviceGroup = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateShipmentRequest.php b/src/Models/Operations/CreateShipmentRequest.php index 679e4fd..79184f2 100644 --- a/src/Models/Operations/CreateShipmentRequest.php +++ b/src/Models/Operations/CreateShipmentRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\ShipmentCreateRequest $shipmentCreateRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\ShipmentCreateRequest $shipmentCreateRequest, ?string $shippoApiVersion = null) { - $this->shipmentCreateRequest = new \Shippo\API\Models\Components\ShipmentCreateRequest(); - $this->shippoApiVersion = null; + $this->shipmentCreateRequest = $shipmentCreateRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateShipmentResponse.php b/src/Models/Operations/CreateShipmentResponse.php deleted file mode 100644 index 2a5a9f0..0000000 --- a/src/Models/Operations/CreateShipmentResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->shipment = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateShippoAccountRequest.php b/src/Models/Operations/CreateShippoAccountRequest.php index 24c4c9f..66db122 100644 --- a/src/Models/Operations/CreateShippoAccountRequest.php +++ b/src/Models/Operations/CreateShippoAccountRequest.php @@ -1,30 +1,39 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest, ?string $shippoApiVersion = null) { - $this->shippoAccountUpdateRequest = new \Shippo\API\Models\Components\ShippoAccountUpdateRequest(); - $this->shippoApiVersion = null; + $this->shippoAccountUpdateRequest = $shippoAccountUpdateRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateShippoAccountResponse.php b/src/Models/Operations/CreateShippoAccountResponse.php deleted file mode 100644 index 465951c..0000000 --- a/src/Models/Operations/CreateShippoAccountResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->shippoAccount = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateTrackRequest.php b/src/Models/Operations/CreateTrackRequest.php index 08026e6..598f069 100644 --- a/src/Models/Operations/CreateTrackRequest.php +++ b/src/Models/Operations/CreateTrackRequest.php @@ -1,30 +1,39 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\TracksRequest $tracksRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\TracksRequest $tracksRequest, ?string $shippoApiVersion = null) { - $this->tracksRequest = new \Shippo\API\Models\Components\TracksRequest(); - $this->shippoApiVersion = null; + $this->tracksRequest = $tracksRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateTrackResponse.php b/src/Models/Operations/CreateTrackResponse.php deleted file mode 100644 index cd1d7e2..0000000 --- a/src/Models/Operations/CreateTrackResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->track = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateTransactionRequest.php b/src/Models/Operations/CreateTransactionRequest.php index 51f4099..5196e28 100644 --- a/src/Models/Operations/CreateTransactionRequest.php +++ b/src/Models/Operations/CreateTransactionRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\TransactionCreateRequest|Components\InstantTransactionCreateRequest $requestBody + * @param ?string $shippoApiVersion + */ + public function __construct(Components\TransactionCreateRequest|Components\InstantTransactionCreateRequest $requestBody, ?string $shippoApiVersion = null) { - $this->requestBody = null; - $this->shippoApiVersion = null; + $this->requestBody = $requestBody; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateTransactionResponse.php b/src/Models/Operations/CreateTransactionResponse.php deleted file mode 100644 index f50983c..0000000 --- a/src/Models/Operations/CreateTransactionResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->transaction = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateUserParcelTemplateRequest.php b/src/Models/Operations/CreateUserParcelTemplateRequest.php index 151740e..8dc5ec9 100644 --- a/src/Models/Operations/CreateUserParcelTemplateRequest.php +++ b/src/Models/Operations/CreateUserParcelTemplateRequest.php @@ -1,30 +1,39 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\UserParcelTemplateWithCarrierTemplateCreateRequest|Components\UserParcelTemplateWithoutCarrierTemplateCreateRequest $userParcelTemplateCreateRequest + * @param ?string $shippoApiVersion + */ + public function __construct(Components\UserParcelTemplateWithCarrierTemplateCreateRequest|Components\UserParcelTemplateWithoutCarrierTemplateCreateRequest $userParcelTemplateCreateRequest, ?string $shippoApiVersion = null) { - $this->requestBody = null; - $this->shippoApiVersion = null; + $this->userParcelTemplateCreateRequest = $userParcelTemplateCreateRequest; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateUserParcelTemplateResponse.php b/src/Models/Operations/CreateUserParcelTemplateResponse.php deleted file mode 100644 index 82e3056..0000000 --- a/src/Models/Operations/CreateUserParcelTemplateResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->userParcelTemplate = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateWebhookResponse.php b/src/Models/Operations/CreateWebhookResponse.php deleted file mode 100644 index 041dc44..0000000 --- a/src/Models/Operations/CreateWebhookResponse.php +++ /dev/null @@ -1,44 +0,0 @@ -contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->webhook = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/DeleteDefaultParcelTemplateRequest.php b/src/Models/Operations/DeleteDefaultParcelTemplateRequest.php index 6d4eaea..378936e 100644 --- a/src/Models/Operations/DeleteDefaultParcelTemplateRequest.php +++ b/src/Models/Operations/DeleteDefaultParcelTemplateRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?string $shippoApiVersion + */ + public function __construct(?string $shippoApiVersion = null) { - $this->shippoApiVersion = null; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/DeleteDefaultParcelTemplateResponse.php b/src/Models/Operations/DeleteDefaultParcelTemplateResponse.php deleted file mode 100644 index 761945d..0000000 --- a/src/Models/Operations/DeleteDefaultParcelTemplateResponse.php +++ /dev/null @@ -1,49 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/DeleteServiceGroupRequest.php b/src/Models/Operations/DeleteServiceGroupRequest.php index 8d7b23e..aa7ae6a 100644 --- a/src/Models/Operations/DeleteServiceGroupRequest.php +++ b/src/Models/Operations/DeleteServiceGroupRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $serviceGroupId + * @param ?string $shippoApiVersion + */ + public function __construct(string $serviceGroupId, ?string $shippoApiVersion = null) { - $this->serviceGroupId = ''; - $this->shippoApiVersion = null; + $this->serviceGroupId = $serviceGroupId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/DeleteServiceGroupResponse.php b/src/Models/Operations/DeleteServiceGroupResponse.php deleted file mode 100644 index f29fdb9..0000000 --- a/src/Models/Operations/DeleteServiceGroupResponse.php +++ /dev/null @@ -1,49 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/DeleteUserParcelTemplateRequest.php b/src/Models/Operations/DeleteUserParcelTemplateRequest.php index dcd5550..082a368 100644 --- a/src/Models/Operations/DeleteUserParcelTemplateRequest.php +++ b/src/Models/Operations/DeleteUserParcelTemplateRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $userParcelTemplateObjectId + * @param ?string $shippoApiVersion + */ + public function __construct(string $userParcelTemplateObjectId, ?string $shippoApiVersion = null) { - $this->userParcelTemplateObjectId = ''; - $this->shippoApiVersion = null; + $this->userParcelTemplateObjectId = $userParcelTemplateObjectId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/DeleteUserParcelTemplateResponse.php b/src/Models/Operations/DeleteUserParcelTemplateResponse.php deleted file mode 100644 index 38f3e95..0000000 --- a/src/Models/Operations/DeleteUserParcelTemplateResponse.php +++ /dev/null @@ -1,49 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/DeleteWebhookRequest.php b/src/Models/Operations/DeleteWebhookRequest.php index eb086f0..bc25427 100644 --- a/src/Models/Operations/DeleteWebhookRequest.php +++ b/src/Models/Operations/DeleteWebhookRequest.php @@ -1,7 +1,7 @@ webhookId = ''; + $this->webhookId = $webhookId; } } \ No newline at end of file diff --git a/src/Models/Operations/DeleteWebhookResponse.php b/src/Models/Operations/DeleteWebhookResponse.php deleted file mode 100644 index 1970abb..0000000 --- a/src/Models/Operations/DeleteWebhookResponse.php +++ /dev/null @@ -1,41 +0,0 @@ -contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetAddressRequest.php b/src/Models/Operations/GetAddressRequest.php index ba4f8cd..edd43d4 100644 --- a/src/Models/Operations/GetAddressRequest.php +++ b/src/Models/Operations/GetAddressRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $addressId + * @param ?string $shippoApiVersion + */ + public function __construct(string $addressId, ?string $shippoApiVersion = null) { - $this->addressId = ''; - $this->shippoApiVersion = null; + $this->addressId = $addressId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetAddressResponse.php b/src/Models/Operations/GetAddressResponse.php deleted file mode 100644 index a39693e..0000000 --- a/src/Models/Operations/GetAddressResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->address = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetBatchRequest.php b/src/Models/Operations/GetBatchRequest.php index 106f9d0..a47daa2 100644 --- a/src/Models/Operations/GetBatchRequest.php +++ b/src/Models/Operations/GetBatchRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $batchId + * @param ?int $page + * @param ?int $results + * @param ?string $shippoApiVersion + */ + public function __construct(string $batchId, ?string $shippoApiVersion = null, ?int $page = 1, ?int $results = 5) { - $this->batchId = ''; - $this->shippoApiVersion = null; + $this->batchId = $batchId; + $this->page = $page; + $this->results = $results; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetBatchResponse.php b/src/Models/Operations/GetBatchResponse.php deleted file mode 100644 index ce14653..0000000 --- a/src/Models/Operations/GetBatchResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->batch = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetCarrierAccountRequest.php b/src/Models/Operations/GetCarrierAccountRequest.php index efe5093..980a925 100644 --- a/src/Models/Operations/GetCarrierAccountRequest.php +++ b/src/Models/Operations/GetCarrierAccountRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $carrierAccountId + * @param ?string $shippoApiVersion + */ + public function __construct(string $carrierAccountId, ?string $shippoApiVersion = null) { - $this->carrierAccountId = ''; - $this->shippoApiVersion = null; + $this->carrierAccountId = $carrierAccountId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetCarrierAccountResponse.php b/src/Models/Operations/GetCarrierAccountResponse.php deleted file mode 100644 index d61a747..0000000 --- a/src/Models/Operations/GetCarrierAccountResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->carrierAccount = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetCarrierParcelTemplateRequest.php b/src/Models/Operations/GetCarrierParcelTemplateRequest.php index eb5158b..1966d3a 100644 --- a/src/Models/Operations/GetCarrierParcelTemplateRequest.php +++ b/src/Models/Operations/GetCarrierParcelTemplateRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $carrierParcelTemplateToken + * @param ?string $shippoApiVersion + */ + public function __construct(string $carrierParcelTemplateToken, ?string $shippoApiVersion = null) { - $this->carrierParcelTemplateToken = ''; - $this->shippoApiVersion = null; + $this->carrierParcelTemplateToken = $carrierParcelTemplateToken; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetCarrierParcelTemplateResponse.php b/src/Models/Operations/GetCarrierParcelTemplateResponse.php deleted file mode 100644 index 8dcccfd..0000000 --- a/src/Models/Operations/GetCarrierParcelTemplateResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->carrierParcelTemplate = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetCarrierRegistrationStatusRequest.php b/src/Models/Operations/GetCarrierRegistrationStatusRequest.php index 7bbc6ea..fc576b9 100644 --- a/src/Models/Operations/GetCarrierRegistrationStatusRequest.php +++ b/src/Models/Operations/GetCarrierRegistrationStatusRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Carrier $carrier + * @param ?string $shippoApiVersion + */ + public function __construct(Carrier $carrier, ?string $shippoApiVersion = null) { - $this->carrier = \Shippo\API\Models\Operations\Carrier::Ups; - $this->shippoApiVersion = null; + $this->carrier = $carrier; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetCarrierRegistrationStatusResponse.php b/src/Models/Operations/GetCarrierRegistrationStatusResponse.php deleted file mode 100644 index 03db621..0000000 --- a/src/Models/Operations/GetCarrierRegistrationStatusResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->carrierAccountRegistrationStatus = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetCustomsDeclarationRequest.php b/src/Models/Operations/GetCustomsDeclarationRequest.php index 57895bd..dcaf16c 100644 --- a/src/Models/Operations/GetCustomsDeclarationRequest.php +++ b/src/Models/Operations/GetCustomsDeclarationRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $customsDeclarationId + * @param ?int $page + * @param ?string $shippoApiVersion + */ + public function __construct(string $customsDeclarationId, ?string $shippoApiVersion = null, ?int $page = 1) { - $this->customsDeclarationId = ''; - $this->page = null; - $this->shippoApiVersion = null; + $this->customsDeclarationId = $customsDeclarationId; + $this->page = $page; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetCustomsDeclarationResponse.php b/src/Models/Operations/GetCustomsDeclarationResponse.php deleted file mode 100644 index 013e5ef..0000000 --- a/src/Models/Operations/GetCustomsDeclarationResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->customsDeclaration = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetCustomsItemRequest.php b/src/Models/Operations/GetCustomsItemRequest.php index fc8ffb4..8a1f192 100644 --- a/src/Models/Operations/GetCustomsItemRequest.php +++ b/src/Models/Operations/GetCustomsItemRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $customsItemId + * @param ?int $page + * @param ?string $shippoApiVersion + */ + public function __construct(string $customsItemId, ?string $shippoApiVersion = null, ?int $page = 1) { - $this->customsItemId = ''; - $this->page = null; - $this->shippoApiVersion = null; + $this->customsItemId = $customsItemId; + $this->page = $page; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetCustomsItemResponse.php b/src/Models/Operations/GetCustomsItemResponse.php deleted file mode 100644 index c06af39..0000000 --- a/src/Models/Operations/GetCustomsItemResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->customsItem = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetDefaultParcelTemplateRequest.php b/src/Models/Operations/GetDefaultParcelTemplateRequest.php index db77cf3..2d9f096 100644 --- a/src/Models/Operations/GetDefaultParcelTemplateRequest.php +++ b/src/Models/Operations/GetDefaultParcelTemplateRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?string $shippoApiVersion + */ + public function __construct(?string $shippoApiVersion = null) { - $this->shippoApiVersion = null; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetDefaultParcelTemplateResponse.php b/src/Models/Operations/GetDefaultParcelTemplateResponse.php deleted file mode 100644 index a525f0c..0000000 --- a/src/Models/Operations/GetDefaultParcelTemplateResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->defaultParcelTemplate = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetManifestRequest.php b/src/Models/Operations/GetManifestRequest.php index 54c89c7..0dfda00 100644 --- a/src/Models/Operations/GetManifestRequest.php +++ b/src/Models/Operations/GetManifestRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $manifestId + * @param ?string $shippoApiVersion + */ + public function __construct(string $manifestId, ?string $shippoApiVersion = null) { - $this->manifestId = ''; - $this->shippoApiVersion = null; + $this->manifestId = $manifestId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetManifestResponse.php b/src/Models/Operations/GetManifestResponse.php deleted file mode 100644 index c4b0c12..0000000 --- a/src/Models/Operations/GetManifestResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->manifest = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetOrderRequest.php b/src/Models/Operations/GetOrderRequest.php index af46830..a244687 100644 --- a/src/Models/Operations/GetOrderRequest.php +++ b/src/Models/Operations/GetOrderRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $orderId + * @param ?string $shippoApiVersion + */ + public function __construct(string $orderId, ?string $shippoApiVersion = null) { - $this->orderId = ''; - $this->shippoApiVersion = null; + $this->orderId = $orderId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetOrderResponse.php b/src/Models/Operations/GetOrderResponse.php deleted file mode 100644 index a2968f5..0000000 --- a/src/Models/Operations/GetOrderResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->order = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetParcelRequest.php b/src/Models/Operations/GetParcelRequest.php index 1f7cb2f..25670d1 100644 --- a/src/Models/Operations/GetParcelRequest.php +++ b/src/Models/Operations/GetParcelRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $parcelId + * @param ?string $shippoApiVersion + */ + public function __construct(string $parcelId, ?string $shippoApiVersion = null) { - $this->parcelId = ''; - $this->shippoApiVersion = null; + $this->parcelId = $parcelId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetParcelResponse.php b/src/Models/Operations/GetParcelResponse.php deleted file mode 100644 index 351147c..0000000 --- a/src/Models/Operations/GetParcelResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->parcel = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetRateRequest.php b/src/Models/Operations/GetRateRequest.php index 794c154..dcaa5d6 100644 --- a/src/Models/Operations/GetRateRequest.php +++ b/src/Models/Operations/GetRateRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $rateId + * @param ?string $shippoApiVersion + */ + public function __construct(string $rateId, ?string $shippoApiVersion = null) { - $this->rateId = ''; - $this->shippoApiVersion = null; + $this->rateId = $rateId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetRateResponse.php b/src/Models/Operations/GetRateResponse.php deleted file mode 100644 index db44e70..0000000 --- a/src/Models/Operations/GetRateResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->rate = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetRefundRequest.php b/src/Models/Operations/GetRefundRequest.php index c212dc7..a72c643 100644 --- a/src/Models/Operations/GetRefundRequest.php +++ b/src/Models/Operations/GetRefundRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $refundId + * @param ?string $shippoApiVersion + */ + public function __construct(string $refundId, ?string $shippoApiVersion = null) { - $this->refundId = ''; - $this->shippoApiVersion = null; + $this->refundId = $refundId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetRefundResponse.php b/src/Models/Operations/GetRefundResponse.php deleted file mode 100644 index 5d44ec5..0000000 --- a/src/Models/Operations/GetRefundResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->refund = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetShipmentRequest.php b/src/Models/Operations/GetShipmentRequest.php index dbe7c2c..f53ee07 100644 --- a/src/Models/Operations/GetShipmentRequest.php +++ b/src/Models/Operations/GetShipmentRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $shipmentId + * @param ?string $shippoApiVersion + */ + public function __construct(string $shipmentId, ?string $shippoApiVersion = null) { - $this->shipmentId = ''; - $this->shippoApiVersion = null; + $this->shipmentId = $shipmentId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetShipmentResponse.php b/src/Models/Operations/GetShipmentResponse.php deleted file mode 100644 index 53f3d4d..0000000 --- a/src/Models/Operations/GetShipmentResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->shipment = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetShippoAccountRequest.php b/src/Models/Operations/GetShippoAccountRequest.php index 36a5fa3..7269d73 100644 --- a/src/Models/Operations/GetShippoAccountRequest.php +++ b/src/Models/Operations/GetShippoAccountRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $shippoAccountId + * @param ?string $shippoApiVersion + */ + public function __construct(string $shippoAccountId, ?string $shippoApiVersion = null) { - $this->shippoAccountId = ''; - $this->shippoApiVersion = null; + $this->shippoAccountId = $shippoAccountId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetShippoAccountResponse.php b/src/Models/Operations/GetShippoAccountResponse.php deleted file mode 100644 index 1662421..0000000 --- a/src/Models/Operations/GetShippoAccountResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->shippoAccount = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetTrackRequest.php b/src/Models/Operations/GetTrackRequest.php index befe698..0dec46b 100644 --- a/src/Models/Operations/GetTrackRequest.php +++ b/src/Models/Operations/GetTrackRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $trackingNumber + * @param string $carrier + * @param ?string $shippoApiVersion + */ + public function __construct(string $trackingNumber, string $carrier, ?string $shippoApiVersion = null) { - $this->trackingNumber = ''; - $this->carrier = ''; - $this->shippoApiVersion = null; + $this->trackingNumber = $trackingNumber; + $this->carrier = $carrier; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetTrackResponse.php b/src/Models/Operations/GetTrackResponse.php deleted file mode 100644 index d5accb8..0000000 --- a/src/Models/Operations/GetTrackResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->track = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetTransactionRequest.php b/src/Models/Operations/GetTransactionRequest.php index eedc5eb..2dbaa94 100644 --- a/src/Models/Operations/GetTransactionRequest.php +++ b/src/Models/Operations/GetTransactionRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $transactionId + * @param ?string $shippoApiVersion + */ + public function __construct(string $transactionId, ?string $shippoApiVersion = null) { - $this->transactionId = ''; - $this->shippoApiVersion = null; + $this->transactionId = $transactionId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetTransactionResponse.php b/src/Models/Operations/GetTransactionResponse.php deleted file mode 100644 index 5a8c550..0000000 --- a/src/Models/Operations/GetTransactionResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->transaction = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetUserParcelTemplateRequest.php b/src/Models/Operations/GetUserParcelTemplateRequest.php index f33b17f..705b3d7 100644 --- a/src/Models/Operations/GetUserParcelTemplateRequest.php +++ b/src/Models/Operations/GetUserParcelTemplateRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $userParcelTemplateObjectId + * @param ?string $shippoApiVersion + */ + public function __construct(string $userParcelTemplateObjectId, ?string $shippoApiVersion = null) { - $this->userParcelTemplateObjectId = ''; - $this->shippoApiVersion = null; + $this->userParcelTemplateObjectId = $userParcelTemplateObjectId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/GetUserParcelTemplateResponse.php b/src/Models/Operations/GetUserParcelTemplateResponse.php deleted file mode 100644 index d0315d7..0000000 --- a/src/Models/Operations/GetUserParcelTemplateResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->userParcelTemplate = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/GetWebhookRequest.php b/src/Models/Operations/GetWebhookRequest.php index 37ec5d4..e095839 100644 --- a/src/Models/Operations/GetWebhookRequest.php +++ b/src/Models/Operations/GetWebhookRequest.php @@ -1,7 +1,7 @@ webhookId = ''; + $this->webhookId = $webhookId; } } \ No newline at end of file diff --git a/src/Models/Operations/GetWebhookResponse.php b/src/Models/Operations/GetWebhookResponse.php deleted file mode 100644 index aaa5ee4..0000000 --- a/src/Models/Operations/GetWebhookResponse.php +++ /dev/null @@ -1,44 +0,0 @@ -contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->webhook = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/IncludeT.php b/src/Models/Operations/IncludeT.php index 9e768f4..a5c15c3 100644 --- a/src/Models/Operations/IncludeT.php +++ b/src/Models/Operations/IncludeT.php @@ -1,7 +1,7 @@ title = null; - $this->detail = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/InitiateOauth2SigninCarrierAccountsResponseResponseBody.php b/src/Models/Operations/InitiateOauth2SigninCarrierAccountsResponseResponseBody.php deleted file mode 100644 index 0ad3858..0000000 --- a/src/Models/Operations/InitiateOauth2SigninCarrierAccountsResponseResponseBody.php +++ /dev/null @@ -1,30 +0,0 @@ -title = null; - $this->detail = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/InitiateOauth2SigninRequest.php b/src/Models/Operations/InitiateOauth2SigninRequest.php index bf9c8fa..98290fc 100644 --- a/src/Models/Operations/InitiateOauth2SigninRequest.php +++ b/src/Models/Operations/InitiateOauth2SigninRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $carrierAccountObjectId + * @param string $redirectUri + * @param ?string $state + * @param ?string $shippoApiVersion + */ + public function __construct(string $carrierAccountObjectId, string $redirectUri, ?string $state = null, ?string $shippoApiVersion = null) { - $this->carrierAccountObjectId = ''; - $this->redirectUri = ''; - $this->state = null; - $this->shippoApiVersion = null; + $this->carrierAccountObjectId = $carrierAccountObjectId; + $this->redirectUri = $redirectUri; + $this->state = $state; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/InitiateOauth2SigninResponse.php b/src/Models/Operations/InitiateOauth2SigninResponse.php index d5bc100..4039b14 100644 --- a/src/Models/Operations/InitiateOauth2SigninResponse.php +++ b/src/Models/Operations/InitiateOauth2SigninResponse.php @@ -1,7 +1,7 @@ > $headers + */ + public function __construct(?array $headers = []) { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->fourHundredApplicationJsonObject = null; - $this->fourHundredAndOneApplicationJsonObject = null; - $this->fourHundredAndFourApplicationJsonObject = null; - $this->headers = []; + $this->headers = $headers; } } \ No newline at end of file diff --git a/src/Models/Operations/InitiateOauth2SigninResponseBody.php b/src/Models/Operations/InitiateOauth2SigninResponseBody.php deleted file mode 100644 index 2cf03cc..0000000 --- a/src/Models/Operations/InitiateOauth2SigninResponseBody.php +++ /dev/null @@ -1,30 +0,0 @@ -title = null; - $this->detail = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListAddressesRequest.php b/src/Models/Operations/ListAddressesRequest.php index fd6a4dc..2c1a154 100644 --- a/src/Models/Operations/ListAddressesRequest.php +++ b/src/Models/Operations/ListAddressesRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?int $page + * @param ?int $results + * @param ?string $shippoApiVersion + */ + public function __construct(?string $shippoApiVersion = null, ?int $page = 1, ?int $results = 5) { - $this->page = null; - $this->results = null; - $this->shippoApiVersion = null; + $this->page = $page; + $this->results = $results; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListAddressesResponse.php b/src/Models/Operations/ListAddressesResponse.php deleted file mode 100644 index e99c1d4..0000000 --- a/src/Models/Operations/ListAddressesResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->addressPaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListCarrierAccountsRequest.php b/src/Models/Operations/ListCarrierAccountsRequest.php index 973c1b1..5583861 100644 --- a/src/Models/Operations/ListCarrierAccountsRequest.php +++ b/src/Models/Operations/ListCarrierAccountsRequest.php @@ -1,13 +1,14 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?bool $serviceLevels + * @param ?Components\CarriersEnum $carrier + * @param ?string $accountId + * @param ?int $page + * @param ?int $results + * @param ?string $shippoApiVersion + */ + public function __construct(?bool $serviceLevels = null, ?Components\CarriersEnum $carrier = null, ?string $accountId = null, ?string $shippoApiVersion = null, ?int $page = 1, ?int $results = 5) { - $this->serviceLevels = null; - $this->carrier = null; - $this->accountId = null; - $this->page = null; - $this->results = null; - $this->shippoApiVersion = null; + $this->serviceLevels = $serviceLevels; + $this->carrier = $carrier; + $this->accountId = $accountId; + $this->page = $page; + $this->results = $results; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListCarrierAccountsResponse.php b/src/Models/Operations/ListCarrierAccountsResponse.php deleted file mode 100644 index 705d2e7..0000000 --- a/src/Models/Operations/ListCarrierAccountsResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->carrierAccountPaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListCarrierParcelTemplatesRequest.php b/src/Models/Operations/ListCarrierParcelTemplatesRequest.php index d534854..223cafd 100644 --- a/src/Models/Operations/ListCarrierParcelTemplatesRequest.php +++ b/src/Models/Operations/ListCarrierParcelTemplatesRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?IncludeT $include + * @param ?string $carrier + * @param ?string $shippoApiVersion + */ + public function __construct(?IncludeT $include = null, ?string $carrier = null, ?string $shippoApiVersion = null) { - $this->include = null; - $this->carrier = null; - $this->shippoApiVersion = null; + $this->include = $include; + $this->carrier = $carrier; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListCarrierParcelTemplatesResponse.php b/src/Models/Operations/ListCarrierParcelTemplatesResponse.php deleted file mode 100644 index 115458d..0000000 --- a/src/Models/Operations/ListCarrierParcelTemplatesResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->carrierParcelTemplateList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListCustomsDeclarationsRequest.php b/src/Models/Operations/ListCustomsDeclarationsRequest.php index 96ceb21..e2982a1 100644 --- a/src/Models/Operations/ListCustomsDeclarationsRequest.php +++ b/src/Models/Operations/ListCustomsDeclarationsRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?int $page + * @param ?int $results + * @param ?string $shippoApiVersion + */ + public function __construct(?string $shippoApiVersion = null, ?int $page = 1, ?int $results = 5) { - $this->page = null; - $this->results = null; - $this->shippoApiVersion = null; + $this->page = $page; + $this->results = $results; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListCustomsDeclarationsResponse.php b/src/Models/Operations/ListCustomsDeclarationsResponse.php deleted file mode 100644 index ddc234e..0000000 --- a/src/Models/Operations/ListCustomsDeclarationsResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->customsDeclarationPaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListCustomsItemsRequest.php b/src/Models/Operations/ListCustomsItemsRequest.php index 8dfc7f3..f362e57 100644 --- a/src/Models/Operations/ListCustomsItemsRequest.php +++ b/src/Models/Operations/ListCustomsItemsRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?int $page + * @param ?int $results + * @param ?string $shippoApiVersion + */ + public function __construct(?string $shippoApiVersion = null, ?int $page = 1, ?int $results = 25) { - $this->page = null; - $this->results = null; - $this->shippoApiVersion = null; + $this->page = $page; + $this->results = $results; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListCustomsItemsResponse.php b/src/Models/Operations/ListCustomsItemsResponse.php deleted file mode 100644 index 2153270..0000000 --- a/src/Models/Operations/ListCustomsItemsResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->customsItemPaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListManifestsRequest.php b/src/Models/Operations/ListManifestsRequest.php index 5cf5b94..c37bea5 100644 --- a/src/Models/Operations/ListManifestsRequest.php +++ b/src/Models/Operations/ListManifestsRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?int $page + * @param ?int $results + * @param ?string $shippoApiVersion + */ + public function __construct(?string $shippoApiVersion = null, ?int $page = 1, ?int $results = 5) { - $this->page = null; - $this->results = null; - $this->shippoApiVersion = null; + $this->page = $page; + $this->results = $results; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListManifestsResponse.php b/src/Models/Operations/ListManifestsResponse.php deleted file mode 100644 index b5f7119..0000000 --- a/src/Models/Operations/ListManifestsResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->manifestPaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListOrdersRequest.php b/src/Models/Operations/ListOrdersRequest.php index 3e33011..dad6213 100644 --- a/src/Models/Operations/ListOrdersRequest.php +++ b/src/Models/Operations/ListOrdersRequest.php @@ -1,13 +1,14 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * Filter orders by order status + * + * @var ?array $orderStatus + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=order_status[]')] + public ?array $orderStatus = null; + + /** + * Filter orders by shop app + * + * @var ?Components\OrderShopAppEnum $shopApp + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=shop_app')] + public ?Components\OrderShopAppEnum $shopApp = null; + + /** + * Filter orders created after the input date and time (ISO 8601 UTC format). This is based on the + * + * `placed_at` field, meaning when the order has been placed, not when the order object was created. + * + * @var ?string $startDate + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=start_date')] + public ?string $startDate = null; + + /** + * Filter orders created before the input date and time (ISO 8601 UTC format). This is based on the + * + * `placed_at` field, meaning when the order has been placed, not when the order object was created. + * + * @var ?string $endDate + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=end_date')] + public ?string $endDate = null; + + /** + * @param ?int $page + * @param ?int $results + * @param ?string $shippoApiVersion + * @param ?array $orderStatus + * @param ?Components\OrderShopAppEnum $shopApp + * @param ?string $startDate + * @param ?string $endDate + */ + public function __construct(?string $shippoApiVersion = null, ?array $orderStatus = null, ?Components\OrderShopAppEnum $shopApp = null, ?string $startDate = null, ?string $endDate = null, ?int $page = 1, ?int $results = 25) { - $this->page = null; - $this->results = null; - $this->shippoApiVersion = null; + $this->page = $page; + $this->results = $results; + $this->shippoApiVersion = $shippoApiVersion; + $this->orderStatus = $orderStatus; + $this->shopApp = $shopApp; + $this->startDate = $startDate; + $this->endDate = $endDate; } } \ No newline at end of file diff --git a/src/Models/Operations/ListOrdersResponse.php b/src/Models/Operations/ListOrdersResponse.php deleted file mode 100644 index 929a332..0000000 --- a/src/Models/Operations/ListOrdersResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->orderPaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListParcelsRequest.php b/src/Models/Operations/ListParcelsRequest.php index 3805c84..0acdff8 100644 --- a/src/Models/Operations/ListParcelsRequest.php +++ b/src/Models/Operations/ListParcelsRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?int $page + * @param ?int $results + * @param ?string $shippoApiVersion + */ + public function __construct(?string $shippoApiVersion = null, ?int $page = 1, ?int $results = 25) { - $this->page = null; - $this->results = null; - $this->shippoApiVersion = null; + $this->page = $page; + $this->results = $results; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListParcelsResponse.php b/src/Models/Operations/ListParcelsResponse.php deleted file mode 100644 index 796a8dd..0000000 --- a/src/Models/Operations/ListParcelsResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->parcelPaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListRefundsRequest.php b/src/Models/Operations/ListRefundsRequest.php index 2d996bc..ebb7866 100644 --- a/src/Models/Operations/ListRefundsRequest.php +++ b/src/Models/Operations/ListRefundsRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?string $shippoApiVersion + */ + public function __construct(?string $shippoApiVersion = null) { - $this->shippoApiVersion = null; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListRefundsResponse.php b/src/Models/Operations/ListRefundsResponse.php deleted file mode 100644 index be1eb0b..0000000 --- a/src/Models/Operations/ListRefundsResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->refundPaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListServiceGroupsRequest.php b/src/Models/Operations/ListServiceGroupsRequest.php index e3a8a2b..04a9ec1 100644 --- a/src/Models/Operations/ListServiceGroupsRequest.php +++ b/src/Models/Operations/ListServiceGroupsRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?string $shippoApiVersion + */ + public function __construct(?string $shippoApiVersion = null) { - $this->shippoApiVersion = null; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListServiceGroupsResponse.php b/src/Models/Operations/ListServiceGroupsResponse.php deleted file mode 100644 index bb236c0..0000000 --- a/src/Models/Operations/ListServiceGroupsResponse.php +++ /dev/null @@ -1,57 +0,0 @@ - $serviceGroupListResponse - */ - public ?array $serviceGroupListResponse = null; - - /** - * $badRequest - * - * @var ?array $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->serviceGroupListResponse = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListShipmentRatesByCurrencyCodeRequest.php b/src/Models/Operations/ListShipmentRatesByCurrencyCodeRequest.php index a9e47f7..b400bb4 100644 --- a/src/Models/Operations/ListShipmentRatesByCurrencyCodeRequest.php +++ b/src/Models/Operations/ListShipmentRatesByCurrencyCodeRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $shipmentId + * @param string $currencyCode + * @param ?int $page + * @param ?int $results + * @param ?string $shippoApiVersion + */ + public function __construct(string $shipmentId, ?string $shippoApiVersion = null, string $currencyCode = 'USD', ?int $page = 1, ?int $results = 25) { - $this->shipmentId = ''; - $this->currencyCode = ''; - $this->page = null; - $this->results = null; - $this->shippoApiVersion = null; + $this->shipmentId = $shipmentId; + $this->currencyCode = $currencyCode; + $this->page = $page; + $this->results = $results; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListShipmentRatesByCurrencyCodeResponse.php b/src/Models/Operations/ListShipmentRatesByCurrencyCodeResponse.php deleted file mode 100644 index 288406d..0000000 --- a/src/Models/Operations/ListShipmentRatesByCurrencyCodeResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->ratePaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListShipmentRatesRequest.php b/src/Models/Operations/ListShipmentRatesRequest.php index cd132df..58fd2e2 100644 --- a/src/Models/Operations/ListShipmentRatesRequest.php +++ b/src/Models/Operations/ListShipmentRatesRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $shipmentId + * @param ?int $page + * @param ?int $results + * @param ?string $shippoApiVersion + */ + public function __construct(string $shipmentId, ?string $shippoApiVersion = null, ?int $page = 1, ?int $results = 25) { - $this->shipmentId = ''; - $this->page = null; - $this->results = null; - $this->shippoApiVersion = null; + $this->shipmentId = $shipmentId; + $this->page = $page; + $this->results = $results; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListShipmentRatesResponse.php b/src/Models/Operations/ListShipmentRatesResponse.php deleted file mode 100644 index 54c3a19..0000000 --- a/src/Models/Operations/ListShipmentRatesResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->ratePaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListShipmentsRequest.php b/src/Models/Operations/ListShipmentsRequest.php index bb5b0ac..6a93cd1 100644 --- a/src/Models/Operations/ListShipmentsRequest.php +++ b/src/Models/Operations/ListShipmentsRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?string $pageToken + * @param ?int $page + * @param ?int $results + * @param ?string $objectCreatedGt + * @param ?string $objectCreatedGte + * @param ?string $objectCreatedLt + * @param ?string $objectCreatedLte + * @param ?string $shippoApiVersion + */ + public function __construct(?string $pageToken = null, ?string $objectCreatedGt = null, ?string $objectCreatedGte = null, ?string $objectCreatedLt = null, ?string $objectCreatedLte = null, ?string $shippoApiVersion = null, ?int $page = 1, ?int $results = 25) { - $this->page = null; - $this->results = null; - $this->shippoApiVersion = null; + $this->pageToken = $pageToken; + $this->page = $page; + $this->results = $results; + $this->objectCreatedGt = $objectCreatedGt; + $this->objectCreatedGte = $objectCreatedGte; + $this->objectCreatedLt = $objectCreatedLt; + $this->objectCreatedLte = $objectCreatedLte; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListShipmentsResponse.php b/src/Models/Operations/ListShipmentsResponse.php deleted file mode 100644 index 10aceaf..0000000 --- a/src/Models/Operations/ListShipmentsResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->shipmentPaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListShippoAccountsRequest.php b/src/Models/Operations/ListShippoAccountsRequest.php index 8cf3015..aa4da5f 100644 --- a/src/Models/Operations/ListShippoAccountsRequest.php +++ b/src/Models/Operations/ListShippoAccountsRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?int $page + * @param ?int $results + * @param ?string $shippoApiVersion + */ + public function __construct(?string $shippoApiVersion = null, ?int $page = 1, ?int $results = 25) { - $this->page = null; - $this->results = null; - $this->shippoApiVersion = null; + $this->page = $page; + $this->results = $results; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListShippoAccountsResponse.php b/src/Models/Operations/ListShippoAccountsResponse.php deleted file mode 100644 index f66f4d7..0000000 --- a/src/Models/Operations/ListShippoAccountsResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->shippoAccountPaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListTransactionsRequest.php b/src/Models/Operations/ListTransactionsRequest.php index 7132c79..95cb855 100644 --- a/src/Models/Operations/ListTransactionsRequest.php +++ b/src/Models/Operations/ListTransactionsRequest.php @@ -1,13 +1,14 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?string $rate + * @param ?Components\TransactionStatusEnum $objectStatus + * @param ?Components\TrackingStatusEnum $trackingStatus + * @param ?int $page + * @param ?int $results + * @param ?string $shippoApiVersion + */ + public function __construct(?string $rate = null, ?Components\TransactionStatusEnum $objectStatus = null, ?Components\TrackingStatusEnum $trackingStatus = null, ?string $shippoApiVersion = null, ?int $page = 1, ?int $results = 25) { - $this->rate = null; - $this->objectStatus = null; - $this->trackingStatus = null; - $this->page = null; - $this->results = null; - $this->shippoApiVersion = null; + $this->rate = $rate; + $this->objectStatus = $objectStatus; + $this->trackingStatus = $trackingStatus; + $this->page = $page; + $this->results = $results; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListTransactionsResponse.php b/src/Models/Operations/ListTransactionsResponse.php deleted file mode 100644 index 5c5cd8c..0000000 --- a/src/Models/Operations/ListTransactionsResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->transactionPaginatedList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListUserParcelTemplatesRequest.php b/src/Models/Operations/ListUserParcelTemplatesRequest.php index d2eb247..17221da 100644 --- a/src/Models/Operations/ListUserParcelTemplatesRequest.php +++ b/src/Models/Operations/ListUserParcelTemplatesRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param ?string $shippoApiVersion + */ + public function __construct(?string $shippoApiVersion = null) { - $this->shippoApiVersion = null; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ListUserParcelTemplatesResponse.php b/src/Models/Operations/ListUserParcelTemplatesResponse.php deleted file mode 100644 index 916b88e..0000000 --- a/src/Models/Operations/ListUserParcelTemplatesResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->userParcelTemplateList = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ListWebhooksResponse.php b/src/Models/Operations/ListWebhooksResponse.php deleted file mode 100644 index 2b8b728..0000000 --- a/src/Models/Operations/ListWebhooksResponse.php +++ /dev/null @@ -1,44 +0,0 @@ -contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->webhookPaginatedList = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/PurchaseBatchRequest.php b/src/Models/Operations/PurchaseBatchRequest.php index 51bfbcc..9bce448 100644 --- a/src/Models/Operations/PurchaseBatchRequest.php +++ b/src/Models/Operations/PurchaseBatchRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $batchId + * @param ?string $shippoApiVersion + */ + public function __construct(string $batchId, ?string $shippoApiVersion = null) { - $this->batchId = ''; - $this->shippoApiVersion = null; + $this->batchId = $batchId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/PurchaseBatchResponse.php b/src/Models/Operations/PurchaseBatchResponse.php deleted file mode 100644 index afede92..0000000 --- a/src/Models/Operations/PurchaseBatchResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->batch = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/RegisterCarrierAccountRequest.php b/src/Models/Operations/RegisterCarrierAccountRequest.php index a01ec69..be07a33 100644 --- a/src/Models/Operations/RegisterCarrierAccountRequest.php +++ b/src/Models/Operations/RegisterCarrierAccountRequest.php @@ -1,35 +1,40 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param Components\CarrierAccountCanadaPostCreateRequest|Components\CarrierAccountChronopostCreateRequest|Components\CarrierAccountColissimoCreateRequest|Components\CarrierAccountCorreosCreateRequest|Components\CarrierAccountDeutschePostCreateRequest|Components\CarrierAccountDHLExpressCreateRequest|Components\CarrierAccountDpdDeCreateRequest|Components\CarrierAccountDPDUKCreateRequest|Components\CarrierAccountFedExCreateRequest|Components\CarrierAccountHermesUKCreateRequest|Components\CarrierAccountMondialRelayCreateRequest|Components\CarrierAccountPosteItalianeCreateRequest|Components\CarrierAccountUPSCreateRequest|Components\CarrierAccountUSPSCreateRequest|Components\CarrierAccountSendleCreateRequest $requestBody + * @param ?string $shippoApiVersion + */ + public function __construct(Components\CarrierAccountCanadaPostCreateRequest|Components\CarrierAccountChronopostCreateRequest|Components\CarrierAccountColissimoCreateRequest|Components\CarrierAccountCorreosCreateRequest|Components\CarrierAccountDeutschePostCreateRequest|Components\CarrierAccountDHLExpressCreateRequest|Components\CarrierAccountDpdDeCreateRequest|Components\CarrierAccountDPDUKCreateRequest|Components\CarrierAccountFedExCreateRequest|Components\CarrierAccountHermesUKCreateRequest|Components\CarrierAccountMondialRelayCreateRequest|Components\CarrierAccountPosteItalianeCreateRequest|Components\CarrierAccountUPSCreateRequest|Components\CarrierAccountUSPSCreateRequest|Components\CarrierAccountSendleCreateRequest $requestBody, ?string $shippoApiVersion = null) { - $this->requestBody = null; - $this->shippoApiVersion = null; + $this->requestBody = $requestBody; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/RegisterCarrierAccountResponse.php b/src/Models/Operations/RegisterCarrierAccountResponse.php deleted file mode 100644 index 4693431..0000000 --- a/src/Models/Operations/RegisterCarrierAccountResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->carrierAccount = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/RemoveShipmentsFromBatchRequest.php b/src/Models/Operations/RemoveShipmentsFromBatchRequest.php index f1c5292..767d387 100644 --- a/src/Models/Operations/RemoveShipmentsFromBatchRequest.php +++ b/src/Models/Operations/RemoveShipmentsFromBatchRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $batchId + * @param array $requestBody + * @param ?string $shippoApiVersion + */ + public function __construct(string $batchId, array $requestBody, ?string $shippoApiVersion = null) { - $this->batchId = ''; - $this->requestBody = []; - $this->shippoApiVersion = null; + $this->batchId = $batchId; + $this->requestBody = $requestBody; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/RemoveShipmentsFromBatchResponse.php b/src/Models/Operations/RemoveShipmentsFromBatchResponse.php deleted file mode 100644 index 6dec23f..0000000 --- a/src/Models/Operations/RemoveShipmentsFromBatchResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->batch = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/UpdateCarrierAccountRequest.php b/src/Models/Operations/UpdateCarrierAccountRequest.php index 7b7878a..9d30398 100644 --- a/src/Models/Operations/UpdateCarrierAccountRequest.php +++ b/src/Models/Operations/UpdateCarrierAccountRequest.php @@ -1,13 +1,14 @@ API version guide. * * @var ?string $shippoApiVersion */ @@ -30,15 +31,20 @@ class UpdateCarrierAccountRequest /** * Examples. * - * @var ?\Shippo\API\Models\Components\CarrierAccountBase $carrierAccountBase + * @var ?Components\CarrierAccountBase $carrierAccountBase */ #[SpeakeasyMetadata('request:mediaType=application/json')] - public ?\Shippo\API\Models\Components\CarrierAccountBase $carrierAccountBase = null; + public ?Components\CarrierAccountBase $carrierAccountBase = null; - public function __construct() + /** + * @param string $carrierAccountId + * @param ?string $shippoApiVersion + * @param ?Components\CarrierAccountBase $carrierAccountBase + */ + public function __construct(string $carrierAccountId, ?string $shippoApiVersion = null, ?Components\CarrierAccountBase $carrierAccountBase = null) { - $this->carrierAccountId = ''; - $this->shippoApiVersion = null; - $this->carrierAccountBase = null; + $this->carrierAccountId = $carrierAccountId; + $this->shippoApiVersion = $shippoApiVersion; + $this->carrierAccountBase = $carrierAccountBase; } } \ No newline at end of file diff --git a/src/Models/Operations/UpdateCarrierAccountResponse.php b/src/Models/Operations/UpdateCarrierAccountResponse.php deleted file mode 100644 index c86a972..0000000 --- a/src/Models/Operations/UpdateCarrierAccountResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->carrierAccount = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/UpdateDefaultParcelTemplateRequest.php b/src/Models/Operations/UpdateDefaultParcelTemplateRequest.php index 27d714a..8722f00 100644 --- a/src/Models/Operations/UpdateDefaultParcelTemplateRequest.php +++ b/src/Models/Operations/UpdateDefaultParcelTemplateRequest.php @@ -1,30 +1,39 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; + /** + * + * @var ?Components\DefaultParcelTemplateUpdateRequest $defaultParcelTemplateUpdateRequest + */ #[SpeakeasyMetadata('request:mediaType=application/json')] - public ?\Shippo\API\Models\Components\DefaultParcelTemplateUpdateRequest $defaultParcelTemplateUpdateRequest = null; + public ?Components\DefaultParcelTemplateUpdateRequest $defaultParcelTemplateUpdateRequest = null; - public function __construct() + /** + * @param ?string $shippoApiVersion + * @param ?Components\DefaultParcelTemplateUpdateRequest $defaultParcelTemplateUpdateRequest + */ + public function __construct(?string $shippoApiVersion = null, ?Components\DefaultParcelTemplateUpdateRequest $defaultParcelTemplateUpdateRequest = null) { - $this->shippoApiVersion = null; - $this->defaultParcelTemplateUpdateRequest = null; + $this->shippoApiVersion = $shippoApiVersion; + $this->defaultParcelTemplateUpdateRequest = $defaultParcelTemplateUpdateRequest; } } \ No newline at end of file diff --git a/src/Models/Operations/UpdateDefaultParcelTemplateResponse.php b/src/Models/Operations/UpdateDefaultParcelTemplateResponse.php deleted file mode 100644 index c5975ac..0000000 --- a/src/Models/Operations/UpdateDefaultParcelTemplateResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->defaultParcelTemplate = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/UpdateServiceGroupRequest.php b/src/Models/Operations/UpdateServiceGroupRequest.php index f7ce69d..c565027 100644 --- a/src/Models/Operations/UpdateServiceGroupRequest.php +++ b/src/Models/Operations/UpdateServiceGroupRequest.php @@ -1,30 +1,39 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; + /** + * + * @var ?Components\ServiceGroupUpdateRequest $serviceGroupUpdateRequest + */ #[SpeakeasyMetadata('request:mediaType=application/json')] - public ?\Shippo\API\Models\Components\ServiceGroupUpdateRequest $serviceGroupUpdateRequest = null; + public ?Components\ServiceGroupUpdateRequest $serviceGroupUpdateRequest = null; - public function __construct() + /** + * @param ?string $shippoApiVersion + * @param ?Components\ServiceGroupUpdateRequest $serviceGroupUpdateRequest + */ + public function __construct(?string $shippoApiVersion = null, ?Components\ServiceGroupUpdateRequest $serviceGroupUpdateRequest = null) { - $this->shippoApiVersion = null; - $this->serviceGroupUpdateRequest = null; + $this->shippoApiVersion = $shippoApiVersion; + $this->serviceGroupUpdateRequest = $serviceGroupUpdateRequest; } } \ No newline at end of file diff --git a/src/Models/Operations/UpdateServiceGroupResponse.php b/src/Models/Operations/UpdateServiceGroupResponse.php deleted file mode 100644 index cc5d6e8..0000000 --- a/src/Models/Operations/UpdateServiceGroupResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->serviceGroup = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/UpdateShippoAccountRequest.php b/src/Models/Operations/UpdateShippoAccountRequest.php index 0b68b2e..71762a9 100644 --- a/src/Models/Operations/UpdateShippoAccountRequest.php +++ b/src/Models/Operations/UpdateShippoAccountRequest.php @@ -1,13 +1,14 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; + /** + * + * @var ?Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest + */ #[SpeakeasyMetadata('request:mediaType=application/json')] - public ?\Shippo\API\Models\Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest = null; + public ?Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest = null; - public function __construct() + /** + * @param string $shippoAccountId + * @param ?string $shippoApiVersion + * @param ?Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest + */ + public function __construct(string $shippoAccountId, ?string $shippoApiVersion = null, ?Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest = null) { - $this->shippoAccountId = ''; - $this->shippoApiVersion = null; - $this->shippoAccountUpdateRequest = null; + $this->shippoAccountId = $shippoAccountId; + $this->shippoApiVersion = $shippoApiVersion; + $this->shippoAccountUpdateRequest = $shippoAccountUpdateRequest; } } \ No newline at end of file diff --git a/src/Models/Operations/UpdateShippoAccountResponse.php b/src/Models/Operations/UpdateShippoAccountResponse.php deleted file mode 100644 index da17c72..0000000 --- a/src/Models/Operations/UpdateShippoAccountResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->shippoAccount = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/UpdateUserParcelTemplateRequest.php b/src/Models/Operations/UpdateUserParcelTemplateRequest.php index 8574527..1cd5601 100644 --- a/src/Models/Operations/UpdateUserParcelTemplateRequest.php +++ b/src/Models/Operations/UpdateUserParcelTemplateRequest.php @@ -1,13 +1,14 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; + /** + * + * @var ?Components\UserParcelTemplateUpdateRequest $userParcelTemplateUpdateRequest + */ #[SpeakeasyMetadata('request:mediaType=application/json')] - public ?\Shippo\API\Models\Components\UserParcelTemplateUpdateRequest $userParcelTemplateUpdateRequest = null; + public ?Components\UserParcelTemplateUpdateRequest $userParcelTemplateUpdateRequest = null; - public function __construct() + /** + * @param string $userParcelTemplateObjectId + * @param ?string $shippoApiVersion + * @param ?Components\UserParcelTemplateUpdateRequest $userParcelTemplateUpdateRequest + */ + public function __construct(string $userParcelTemplateObjectId, ?string $shippoApiVersion = null, ?Components\UserParcelTemplateUpdateRequest $userParcelTemplateUpdateRequest = null) { - $this->userParcelTemplateObjectId = ''; - $this->shippoApiVersion = null; - $this->userParcelTemplateUpdateRequest = null; + $this->userParcelTemplateObjectId = $userParcelTemplateObjectId; + $this->shippoApiVersion = $shippoApiVersion; + $this->userParcelTemplateUpdateRequest = $userParcelTemplateUpdateRequest; } } \ No newline at end of file diff --git a/src/Models/Operations/UpdateUserParcelTemplateResponse.php b/src/Models/Operations/UpdateUserParcelTemplateResponse.php deleted file mode 100644 index 28895c5..0000000 --- a/src/Models/Operations/UpdateUserParcelTemplateResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->userParcelTemplate = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/UpdateWebhookRequest.php b/src/Models/Operations/UpdateWebhookRequest.php index 7bf48ae..0bd3a2d 100644 --- a/src/Models/Operations/UpdateWebhookRequest.php +++ b/src/Models/Operations/UpdateWebhookRequest.php @@ -1,13 +1,14 @@ webhookId = ''; - $this->webhookUpdateRequest = new \Shippo\API\Models\Components\WebhookUpdateRequest(); + $this->webhookId = $webhookId; + $this->webhookUpdateRequest = $webhookUpdateRequest; } } \ No newline at end of file diff --git a/src/Models/Operations/UpdateWebhookResponse.php b/src/Models/Operations/UpdateWebhookResponse.php deleted file mode 100644 index e305d99..0000000 --- a/src/Models/Operations/UpdateWebhookResponse.php +++ /dev/null @@ -1,44 +0,0 @@ -contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->webhook = null; - } -} \ No newline at end of file diff --git a/src/Models/Operations/ValidateAddressRequest.php b/src/Models/Operations/ValidateAddressRequest.php index 8ebcc9a..15676d2 100644 --- a/src/Models/Operations/ValidateAddressRequest.php +++ b/src/Models/Operations/ValidateAddressRequest.php @@ -1,7 +1,7 @@ API version guide. * * @var ?string $shippoApiVersion */ #[SpeakeasyMetadata('header:style=simple,explode=false,name=SHIPPO-API-VERSION')] public ?string $shippoApiVersion = null; - public function __construct() + /** + * @param string $addressId + * @param ?string $shippoApiVersion + */ + public function __construct(string $addressId, ?string $shippoApiVersion = null) { - $this->addressId = ''; - $this->shippoApiVersion = null; + $this->addressId = $addressId; + $this->shippoApiVersion = $shippoApiVersion; } } \ No newline at end of file diff --git a/src/Models/Operations/ValidateAddressResponse.php b/src/Models/Operations/ValidateAddressResponse.php deleted file mode 100644 index a405fd3..0000000 --- a/src/Models/Operations/ValidateAddressResponse.php +++ /dev/null @@ -1,52 +0,0 @@ - $badRequest - */ - public ?array $badRequest = null; - - public function __construct() - { - $this->contentType = ''; - $this->statusCode = 0; - $this->rawResponse = null; - $this->address = null; - $this->badRequest = null; - } -} \ No newline at end of file diff --git a/src/Orders.php b/src/Orders.php index 9ab4ae7..2bc1a11 100644 --- a/src/Orders.php +++ b/src/Orders.php @@ -1,77 +1,111 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all orders * * Returns a list of all order objects. * - * @param ?int $page - * @param ?int $results - * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListOrdersResponse + * @param ?Operations\ListOrdersRequest $request + * @return Components\OrderPaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?int $page = null, - ?int $results = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListOrdersResponse { - $request = new \Shippo\API\Models\Operations\ListOrdersRequest(); - $request->page = $page; - $request->results = $results; - $request->shippoApiVersion = $shippoApiVersion; + public function list(?Operations\ListOrdersRequest $request = null): Components\OrderPaginatedList + { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/orders'); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListOrdersRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListOrdersRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListOrders', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListOrdersResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->orderPaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\OrderPaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\OrderPaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -79,19 +113,20 @@ public function list( * * Creates a new order object. * - * @param \Shippo\API\Models\Components\OrderCreateRequest $orderCreateRequest + * @param Components\OrderCreateRequest $orderCreateRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateOrderResponse + * @return Components\Order + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\OrderCreateRequest $orderCreateRequest, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateOrderResponse { - $request = new \Shippo\API\Models\Operations\CreateOrderRequest(); - $request->orderCreateRequest = $orderCreateRequest; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\OrderCreateRequest $orderCreateRequest, ?string $shippoApiVersion = null): Components\Order + { + $request = new Operations\CreateOrderRequest( + orderCreateRequest: $orderCreateRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/orders'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'orderCreateRequest', 'json'); if ($body === null) { @@ -104,29 +139,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateOrder', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateOrderResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->order = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Order', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Order', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -136,17 +186,18 @@ public function create( * * @param string $orderId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetOrderResponse + * @return Components\Order + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $orderId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetOrderResponse { - $request = new \Shippo\API\Models\Operations\GetOrderRequest(); - $request->orderId = $orderId; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $orderId, ?string $shippoApiVersion = null): Components\Order + { + $request = new Operations\GetOrderRequest( + orderId: $orderId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/orders/{OrderId}', \Shippo\API\Models\Operations\GetOrderRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/orders/{OrderId}', Operations\GetOrderRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -154,28 +205,44 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetOrder', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetOrderResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->order = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Order', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Order', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/Parcels.php b/src/Parcels.php index ec0825f..cfcaaaa 100644 --- a/src/Parcels.php +++ b/src/Parcels.php @@ -1,24 +1,48 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all parcels @@ -28,50 +52,67 @@ public function __construct(SDKConfiguration $sdkConfig) * @param ?int $page * @param ?int $results * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListParcelsResponse + * @return Components\ParcelPaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?int $page = null, - ?int $results = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListParcelsResponse { - $request = new \Shippo\API\Models\Operations\ListParcelsRequest(); - $request->page = $page; - $request->results = $results; - $request->shippoApiVersion = $shippoApiVersion; + public function list(?int $page = null, ?int $results = null, ?string $shippoApiVersion = null): Components\ParcelPaginatedList + { + $request = new Operations\ListParcelsRequest( + page: $page, + results: $results, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/parcels'); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListParcelsRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListParcelsRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListParcels', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListParcelsResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->parcelPaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\ParcelPaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\ParcelPaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -79,19 +120,20 @@ public function list( * * Creates a new parcel object. * - * @param mixed $requestBody + * @param Components\ParcelCreateRequest|Components\ParcelCreateFromTemplateRequest $requestBody * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateParcelResponse + * @return Components\Parcel + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - mixed $requestBody, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateParcelResponse { - $request = new \Shippo\API\Models\Operations\CreateParcelRequest(); - $request->requestBody = $requestBody; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\ParcelCreateRequest|Components\ParcelCreateFromTemplateRequest $requestBody, ?string $shippoApiVersion = null): Components\Parcel + { + $request = new Operations\CreateParcelRequest( + requestBody: $requestBody, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/parcels'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); if ($body === null) { @@ -104,29 +146,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateParcel', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateParcelResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->parcel = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Parcel', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Parcel', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -136,17 +193,18 @@ public function create( * * @param string $parcelId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetParcelResponse + * @return Components\Parcel + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $parcelId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetParcelResponse { - $request = new \Shippo\API\Models\Operations\GetParcelRequest(); - $request->parcelId = $parcelId; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $parcelId, ?string $shippoApiVersion = null): Components\Parcel + { + $request = new Operations\GetParcelRequest( + parcelId: $parcelId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/parcels/{ParcelId}', \Shippo\API\Models\Operations\GetParcelRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/parcels/{ParcelId}', Operations\GetParcelRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -154,28 +212,44 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetParcel', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetParcelResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->parcel = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Parcel', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Parcel', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/Pickups.php b/src/Pickups.php index bdf5e2d..f6da22e 100644 --- a/src/Pickups.php +++ b/src/Pickups.php @@ -1,43 +1,68 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * Create a pickup * * Creates a pickup object. This request is for a carrier to come to a specified location to take a package for shipping. * - * @param \Shippo\API\Models\Components\PickupBase $pickupBase + * @param Components\PickupBase $pickupBase * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreatePickupResponse + * @return Components\Pickup + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\PickupBase $pickupBase, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreatePickupResponse { - $request = new \Shippo\API\Models\Operations\CreatePickupRequest(); - $request->pickupBase = $pickupBase; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\PickupBase $pickupBase, ?string $shippoApiVersion = null): Components\Pickup + { + $request = new Operations\CreatePickupRequest( + pickupBase: $pickupBase, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/pickups'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'pickupBase', 'json'); if ($body === null) { @@ -50,28 +75,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreatePickup', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreatePickupResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->pickup = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Pickup', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Pickup', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/Rates.php b/src/Rates.php index 6052c08..caa53a3 100644 --- a/src/Rates.php +++ b/src/Rates.php @@ -1,24 +1,48 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * Retrieve a rate @@ -27,17 +51,18 @@ public function __construct(SDKConfiguration $sdkConfig) * * @param string $rateId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetRateResponse + * @return Components\Rate + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $rateId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetRateResponse { - $request = new \Shippo\API\Models\Operations\GetRateRequest(); - $request->rateId = $rateId; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $rateId, ?string $shippoApiVersion = null): Components\Rate + { + $request = new Operations\GetRateRequest( + rateId: $rateId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/rates/{RateId}', \Shippo\API\Models\Operations\GetRateRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/rates/{RateId}', Operations\GetRateRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -45,29 +70,44 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetRate', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetRateResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->rate = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Rate', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Rate', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -75,56 +115,63 @@ public function get( * * Returns a paginated list of rates associated with a shipment * - * @param string $shipmentId - * @param ?int $page - * @param ?int $results - * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListShipmentRatesResponse + * @param Operations\ListShipmentRatesRequest $request + * @return Components\RatePaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function listShipmentRates( - string $shipmentId, - ?int $page = null, - ?int $results = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListShipmentRatesResponse { - $request = new \Shippo\API\Models\Operations\ListShipmentRatesRequest(); - $request->shipmentId = $shipmentId; - $request->page = $page; - $request->results = $results; - $request->shippoApiVersion = $shippoApiVersion; + public function listShipmentRates(Operations\ListShipmentRatesRequest $request): Components\RatePaginatedList + { $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/shipments/{ShipmentId}/rates', \Shippo\API\Models\Operations\ListShipmentRatesRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/shipments/{ShipmentId}/rates', Operations\ListShipmentRatesRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListShipmentRatesRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListShipmentRatesRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListShipmentRates', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListShipmentRatesResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->ratePaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\RatePaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\RatePaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -138,44 +185,63 @@ public function listShipmentRates( * * Note: re-requesting the rates with a different currency code will re-queue the shipment (i.e. set the Shipment's `status` to `QUEUED`) and the converted currency rates will only be available when the Shipment's `status` is set to `SUCCESS`. * - * @param \Shippo\API\Models\Operations\ListShipmentRatesByCurrencyCodeRequest $request - * @return \Shippo\API\Models\Operations\ListShipmentRatesByCurrencyCodeResponse + * @param Operations\ListShipmentRatesByCurrencyCodeRequest $request + * @return Components\RatePaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function listShipmentRatesByCurrencyCode( - ?\Shippo\API\Models\Operations\ListShipmentRatesByCurrencyCodeRequest $request, - ): \Shippo\API\Models\Operations\ListShipmentRatesByCurrencyCodeResponse { + public function listShipmentRatesByCurrencyCode(Operations\ListShipmentRatesByCurrencyCodeRequest $request): Components\RatePaginatedList + { $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/shipments/{ShipmentId}/rates/{CurrencyCode}', \Shippo\API\Models\Operations\ListShipmentRatesByCurrencyCodeRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/shipments/{ShipmentId}/rates/{CurrencyCode}', Operations\ListShipmentRatesByCurrencyCodeRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListShipmentRatesByCurrencyCodeRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListShipmentRatesByCurrencyCodeRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListShipmentRatesByCurrencyCode', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListShipmentRatesByCurrencyCodeResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->ratePaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\RatePaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\RatePaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/RatesAtCheckout.php b/src/RatesAtCheckout.php index 4041004..467d24c 100644 --- a/src/RatesAtCheckout.php +++ b/src/RatesAtCheckout.php @@ -1,24 +1,48 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * Generate a live rates request @@ -28,19 +52,20 @@ public function __construct(SDKConfiguration $sdkConfig) * an address value. You can also enter the object ID of an existing user parcel * template or a fully formed user parcel template object as the parcel value. * - * @param \Shippo\API\Models\Components\LiveRateCreateRequest $liveRateCreateRequest + * @param Components\LiveRateCreateRequest $liveRateCreateRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateLiveRateResponse + * @return Components\LiveRatePaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\LiveRateCreateRequest $liveRateCreateRequest, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateLiveRateResponse { - $request = new \Shippo\API\Models\Operations\CreateLiveRateRequest(); - $request->liveRateCreateRequest = $liveRateCreateRequest; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\LiveRateCreateRequest $liveRateCreateRequest, ?string $shippoApiVersion = null): Components\LiveRatePaginatedList + { + $request = new Operations\CreateLiveRateRequest( + liveRateCreateRequest: $liveRateCreateRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/live-rates'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'liveRateCreateRequest', 'json'); if ($body === null) { @@ -53,29 +78,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateLiveRate', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateLiveRateResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->liveRatePaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\LiveRatePaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\LiveRatePaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -84,15 +124,17 @@ public function create( * Retrieve and display the currently configured default parcel template for live rates. * * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetDefaultParcelTemplateResponse + * @return Components\DefaultParcelTemplate + * @throws \Shippo\API\Models\Errors\SDKError */ - public function getDefaultParcelTemplate( - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetDefaultParcelTemplateResponse { - $request = new \Shippo\API\Models\Operations\GetDefaultParcelTemplateRequest(); - $request->shippoApiVersion = $shippoApiVersion; + public function getDefaultParcelTemplate(?string $shippoApiVersion = null): Components\DefaultParcelTemplate + { + $request = new Operations\GetDefaultParcelTemplateRequest( + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/live-rates/settings/parcel-template'); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -100,29 +142,44 @@ public function getDefaultParcelTemplate( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetDefaultParcelTemplate', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetDefaultParcelTemplateResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->defaultParcelTemplate = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\DefaultParcelTemplate', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\DefaultParcelTemplate', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -130,19 +187,20 @@ public function getDefaultParcelTemplate( * * Update the currently configured default parcel template for live rates. The object_id in the request payload should identify the user parcel template to be the new default. * + * @param ?Components\DefaultParcelTemplateUpdateRequest $defaultParcelTemplateUpdateRequest * @param ?string $shippoApiVersion - * @param ?\Shippo\API\Models\Components\DefaultParcelTemplateUpdateRequest $defaultParcelTemplateUpdateRequest - * @return \Shippo\API\Models\Operations\UpdateDefaultParcelTemplateResponse + * @return Components\DefaultParcelTemplate + * @throws \Shippo\API\Models\Errors\SDKError */ - public function updateDefaultParcelTemplate( - ?string $shippoApiVersion = null, - ?\Shippo\API\Models\Components\DefaultParcelTemplateUpdateRequest $defaultParcelTemplateUpdateRequest = null, - ): \Shippo\API\Models\Operations\UpdateDefaultParcelTemplateResponse { - $request = new \Shippo\API\Models\Operations\UpdateDefaultParcelTemplateRequest(); - $request->shippoApiVersion = $shippoApiVersion; - $request->defaultParcelTemplateUpdateRequest = $defaultParcelTemplateUpdateRequest; + public function updateDefaultParcelTemplate(?Components\DefaultParcelTemplateUpdateRequest $defaultParcelTemplateUpdateRequest = null, ?string $shippoApiVersion = null): Components\DefaultParcelTemplate + { + $request = new Operations\UpdateDefaultParcelTemplateRequest( + shippoApiVersion: $shippoApiVersion, + defaultParcelTemplateUpdateRequest: $defaultParcelTemplateUpdateRequest, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/live-rates/settings/parcel-template'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'defaultParcelTemplateUpdateRequest', 'json'); if ($body !== null) { @@ -154,29 +212,44 @@ public function updateDefaultParcelTemplate( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('PUT', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('PUT', $url); + $hookContext = new HookContext('UpdateDefaultParcelTemplate', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\UpdateDefaultParcelTemplateResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->defaultParcelTemplate = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\DefaultParcelTemplate', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\DefaultParcelTemplate', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -185,40 +258,55 @@ public function updateDefaultParcelTemplate( * Clears the currently configured default parcel template for live rates. * * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\DeleteDefaultParcelTemplateResponse + * @return void + * @throws \Shippo\API\Models\Errors\SDKError */ - public function deleteDefaultParcelTemplate( - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\DeleteDefaultParcelTemplateResponse { - $request = new \Shippo\API\Models\Operations\DeleteDefaultParcelTemplateRequest(); - $request->shippoApiVersion = $shippoApiVersion; + public function deleteDefaultParcelTemplate(?string $shippoApiVersion = null): void + { + $request = new Operations\DeleteDefaultParcelTemplateRequest( + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/live-rates/settings/parcel-template'); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } - $options['headers']['Accept'] = 'application/json'; + $options['headers']['Accept'] = '*/*'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('DELETE', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); + $hookContext = new HookContext('DeleteDefaultParcelTemplate', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\DeleteDefaultParcelTemplateResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 204) { - } elseif ($httpResponse->getStatusCode() === 400) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } } + if ($statusCode == 204) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); - return $response; + return; + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } } + } \ No newline at end of file diff --git a/src/Refunds.php b/src/Refunds.php index a17608f..8fd3874 100644 --- a/src/Refunds.php +++ b/src/Refunds.php @@ -1,43 +1,68 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * Create a refund * * Creates a new refund object. * - * @param \Shippo\API\Models\Components\RefundRequestBody $refundRequestBody + * @param Components\RefundRequestBody $refundRequestBody * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateRefundResponse + * @return Components\Refund + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\RefundRequestBody $refundRequestBody, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateRefundResponse { - $request = new \Shippo\API\Models\Operations\CreateRefundRequest(); - $request->refundRequestBody = $refundRequestBody; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\RefundRequestBody $refundRequestBody, ?string $shippoApiVersion = null): Components\Refund + { + $request = new Operations\CreateRefundRequest( + refundRequestBody: $refundRequestBody, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/refunds'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'refundRequestBody', 'json'); if ($body === null) { @@ -50,29 +75,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateRefund', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateRefundResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->refund = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Refund', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Refund', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -81,15 +121,17 @@ public function create( * Returns a list all refund objects. * * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListRefundsResponse + * @return Components\RefundPaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListRefundsResponse { - $request = new \Shippo\API\Models\Operations\ListRefundsRequest(); - $request->shippoApiVersion = $shippoApiVersion; + public function list(?string $shippoApiVersion = null): Components\RefundPaginatedList + { + $request = new Operations\ListRefundsRequest( + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/refunds/'); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -97,29 +139,44 @@ public function list( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListRefunds', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListRefundsResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->refundPaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\RefundPaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\RefundPaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -129,17 +186,18 @@ public function list( * * @param string $refundId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetRefundResponse + * @return Components\Refund + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $refundId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetRefundResponse { - $request = new \Shippo\API\Models\Operations\GetRefundRequest(); - $request->refundId = $refundId; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $refundId, ?string $shippoApiVersion = null): Components\Refund + { + $request = new Operations\GetRefundRequest( + refundId: $refundId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/refunds/{RefundId}', \Shippo\API\Models\Operations\GetRefundRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/refunds/{RefundId}', Operations\GetRefundRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -147,28 +205,44 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetRefund', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetRefundResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->refund = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Refund', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Refund', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/SDKConfiguration.php b/src/SDKConfiguration.php index a0520df..9d192db 100644 --- a/src/SDKConfiguration.php +++ b/src/SDKConfiguration.php @@ -1,23 +1,23 @@ >> */ public ?array $globals = [ 'parameters' => [], ]; + public function __construct() + { + $this->hooks = new Hooks\SDKHooks(); + } + public function getServerUrl(): string { @@ -43,7 +48,11 @@ public function getServerUrl(): string return $this->serverUrl; } - return ShippoSDK::SERVERS[$this->serverIndex]; + if (isset(Shippo::SERVERS[$this->serverIndex])) { + return Shippo::SERVERS[$this->serverIndex]; + } else { + throw new \OutOfBoundsException('Server index '.$this->serverIndex.' is out of bounds'); + } } public function hasSecurity(): bool { @@ -53,12 +62,49 @@ public function hasSecurity(): bool public function getSecurity(): ?Models\Components\Security { if ($this->securitySource !== null) { - $security = new Models\Components\Security(); - $security->apiKeyHeader = $this->securitySource->call($this); + $security = new Models\Components\Security( + apiKeyHeader: $this->securitySource->call($this) + ); return $security; } else { return $this->security; } } -} \ No newline at end of file + + /** + * @return Utils\ServerDetails + */ + public function getServerDetails(): Utils\ServerDetails + { + if ($this->serverUrl !== null && $this->serverUrl !== '') { + return new Utils\ServerDetails(rtrim($this->serverUrl, '/'), []); + } + if ($this->serverIndex === null) { + $this->serverIndex = 0; + } + + return new Utils\ServerDetails(Shippo::SERVERS[$this->serverIndex], []); + + } + + public function getTemplatedServerUrl(): string + { + if ($this->serverUrl) { + return Utils\Utils::templateUrl($this->serverUrl.trim('/'), []); + } + + return Utils\Utils::templateUrl($this->getServerUrl(), []); + } + + public function initHooks(\GuzzleHttp\ClientInterface $client): \GuzzleHttp\ClientInterface + { + $preHooksUrl = $this->getTemplatedServerUrl(); + $ret = $this->hooks->sdkInit($preHooksUrl, $client); + if ($preHooksUrl != $ret->url) { + $this->serverUrl = $ret->url; + } + + return $ret->client; + } +} diff --git a/src/ServiceGroups.php b/src/ServiceGroups.php index 091c522..1d1658e 100644 --- a/src/ServiceGroups.php +++ b/src/ServiceGroups.php @@ -1,24 +1,48 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all service groups @@ -26,15 +50,17 @@ public function __construct(SDKConfiguration $sdkConfig) * Returns a list of service group objects. * * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListServiceGroupsResponse + * @return array + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListServiceGroupsResponse { - $request = new \Shippo\API\Models\Operations\ListServiceGroupsRequest(); - $request->shippoApiVersion = $shippoApiVersion; + public function list(?string $shippoApiVersion = null): array + { + $request = new Operations\ListServiceGroupsRequest( + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/service-groups'); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -42,29 +68,44 @@ public function list( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListServiceGroups', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListServiceGroupsResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->serviceGroupListResponse = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, 'array<\Shippo\API\Models\Components\ServiceGroup>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -72,19 +113,20 @@ public function list( * * Creates a new service group. * - * @param \Shippo\API\Models\Components\ServiceGroupCreateRequest $serviceGroupCreateRequest + * @param Components\ServiceGroupCreateRequest $serviceGroupCreateRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateServiceGroupResponse + * @return Components\ServiceGroup + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\ServiceGroupCreateRequest $serviceGroupCreateRequest, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateServiceGroupResponse { - $request = new \Shippo\API\Models\Operations\CreateServiceGroupRequest(); - $request->serviceGroupCreateRequest = $serviceGroupCreateRequest; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\ServiceGroupCreateRequest $serviceGroupCreateRequest, ?string $shippoApiVersion = null): Components\ServiceGroup + { + $request = new Operations\CreateServiceGroupRequest( + serviceGroupCreateRequest: $serviceGroupCreateRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/service-groups'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'serviceGroupCreateRequest', 'json'); if ($body === null) { @@ -97,29 +139,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateServiceGroup', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateServiceGroupResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->serviceGroup = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\ServiceGroup', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\ServiceGroup', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -127,19 +184,20 @@ public function create( * * Updates an existing service group object.
The object_id cannot be updated as it is the unique identifier for the object. * + * @param ?Components\ServiceGroupUpdateRequest $serviceGroupUpdateRequest * @param ?string $shippoApiVersion - * @param ?\Shippo\API\Models\Components\ServiceGroupUpdateRequest $serviceGroupUpdateRequest - * @return \Shippo\API\Models\Operations\UpdateServiceGroupResponse + * @return Components\ServiceGroup + * @throws \Shippo\API\Models\Errors\SDKError */ - public function update( - ?string $shippoApiVersion = null, - ?\Shippo\API\Models\Components\ServiceGroupUpdateRequest $serviceGroupUpdateRequest = null, - ): \Shippo\API\Models\Operations\UpdateServiceGroupResponse { - $request = new \Shippo\API\Models\Operations\UpdateServiceGroupRequest(); - $request->shippoApiVersion = $shippoApiVersion; - $request->serviceGroupUpdateRequest = $serviceGroupUpdateRequest; + public function update(?Components\ServiceGroupUpdateRequest $serviceGroupUpdateRequest = null, ?string $shippoApiVersion = null): Components\ServiceGroup + { + $request = new Operations\UpdateServiceGroupRequest( + shippoApiVersion: $shippoApiVersion, + serviceGroupUpdateRequest: $serviceGroupUpdateRequest, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/service-groups'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'serviceGroupUpdateRequest', 'json'); if ($body !== null) { @@ -151,29 +209,44 @@ public function update( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('PUT', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('PUT', $url); + $hookContext = new HookContext('UpdateServiceGroup', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\UpdateServiceGroupResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->serviceGroup = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\ServiceGroup', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\ServiceGroup', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -183,42 +256,56 @@ public function update( * * @param string $serviceGroupId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\DeleteServiceGroupResponse + * @return void + * @throws \Shippo\API\Models\Errors\SDKError */ - public function delete( - string $serviceGroupId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\DeleteServiceGroupResponse { - $request = new \Shippo\API\Models\Operations\DeleteServiceGroupRequest(); - $request->serviceGroupId = $serviceGroupId; - $request->shippoApiVersion = $shippoApiVersion; + public function delete(string $serviceGroupId, ?string $shippoApiVersion = null): void + { + $request = new Operations\DeleteServiceGroupRequest( + serviceGroupId: $serviceGroupId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/service-groups/{ServiceGroupId}', \Shippo\API\Models\Operations\DeleteServiceGroupRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/service-groups/{ServiceGroupId}', Operations\DeleteServiceGroupRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } - $options['headers']['Accept'] = 'application/json'; + $options['headers']['Accept'] = '*/*'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('DELETE', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); + $hookContext = new HookContext('DeleteServiceGroup', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\DeleteServiceGroupResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 204) { - } elseif ($httpResponse->getStatusCode() === 400) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } } + if ($statusCode == 204) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); - return $response; + return; + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } } + } \ No newline at end of file diff --git a/src/Shipments.php b/src/Shipments.php index 86f020d..48041f4 100644 --- a/src/Shipments.php +++ b/src/Shipments.php @@ -1,24 +1,48 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all shipments @@ -42,53 +66,63 @@ public function __construct(SDKConfiguration $sdkConfig) * Example URL:
* `https://api.goshippo.com/shipments/?object_created_gte=2017-01-01T00:00:30&object_created_lt=2017-04-01T00:00:30` * - * @param ?int $page - * @param ?int $results - * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListShipmentsResponse + * @param ?Operations\ListShipmentsRequest $request + * @return Components\ShipmentPaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?int $page = null, - ?int $results = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListShipmentsResponse { - $request = new \Shippo\API\Models\Operations\ListShipmentsRequest(); - $request->page = $page; - $request->results = $results; - $request->shippoApiVersion = $shippoApiVersion; + public function list(?Operations\ListShipmentsRequest $request = null): Components\ShipmentPaginatedList + { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/shipments'); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListShipmentsRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListShipmentsRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListShipments', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListShipmentsResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->shipmentPaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\ShipmentPaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\ShipmentPaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -96,19 +130,20 @@ public function list( * * Creates a new shipment object. * - * @param \Shippo\API\Models\Components\ShipmentCreateRequest $shipmentCreateRequest + * @param Components\ShipmentCreateRequest $shipmentCreateRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateShipmentResponse + * @return Components\Shipment + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\ShipmentCreateRequest $shipmentCreateRequest, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateShipmentResponse { - $request = new \Shippo\API\Models\Operations\CreateShipmentRequest(); - $request->shipmentCreateRequest = $shipmentCreateRequest; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\ShipmentCreateRequest $shipmentCreateRequest, ?string $shippoApiVersion = null): Components\Shipment + { + $request = new Operations\CreateShipmentRequest( + shipmentCreateRequest: $shipmentCreateRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/shipments'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'shipmentCreateRequest', 'json'); if ($body === null) { @@ -121,29 +156,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateShipment', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateShipmentResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->shipment = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Shipment', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Shipment', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -153,17 +203,18 @@ public function create( * * @param string $shipmentId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetShipmentResponse + * @return Components\Shipment + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $shipmentId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetShipmentResponse { - $request = new \Shippo\API\Models\Operations\GetShipmentRequest(); - $request->shipmentId = $shipmentId; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $shipmentId, ?string $shippoApiVersion = null): Components\Shipment + { + $request = new Operations\GetShipmentRequest( + shipmentId: $shipmentId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/shipments/{ShipmentId}', \Shippo\API\Models\Operations\GetShipmentRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/shipments/{ShipmentId}', Operations\GetShipmentRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -171,28 +222,44 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetShipment', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetShipmentResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->shipment = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Shipment', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Shipment', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/ShippoSDK.php b/src/Shippo.php similarity index 94% rename from src/ShippoSDK.php rename to src/Shippo.php index 498f188..6a93a38 100644 --- a/src/ShippoSDK.php +++ b/src/Shippo.php @@ -1,15 +1,17 @@ guide for more details. * * * @var ShippoAccounts $$shippoAccounts @@ -252,6 +254,10 @@ class ShippoSDK * * * + * # Webhook Payload + * The payload is the body of the POST request Shippo sends to the URL specified at the time of webhook registration. + * + * * @var Webhooks $$webhooks */ public Webhooks $webhooks; @@ -259,18 +265,18 @@ class ShippoSDK /** * Returns a new instance of the SDK builder used to configure and create the SDK instance. * - * @return ShippoSDKBuilder + * @return ShippoBuilder */ - public static function builder(): ShippoSDKBuilder + public static function builder(): ShippoBuilder { - return new ShippoSDKBuilder(); + return new ShippoBuilder(); } /** * @param SDKConfiguration $sdkConfiguration */ public function __construct( - private SDKConfiguration $sdkConfiguration, + public SDKConfiguration $sdkConfiguration, ) { $this->addresses = new Addresses($this->sdkConfiguration); $this->batches = new Batches($this->sdkConfiguration); @@ -292,5 +298,7 @@ public function __construct( $this->userParcelTemplates = new UserParcelTemplates($this->sdkConfiguration); $this->shippoAccounts = new ShippoAccounts($this->sdkConfiguration); $this->webhooks = new Webhooks($this->sdkConfiguration); + $this->sdkConfiguration->client = $this->sdkConfiguration->initHooks($this->sdkConfiguration->client); + } } \ No newline at end of file diff --git a/src/ShippoAccounts.php b/src/ShippoAccounts.php index 78b9b35..95eda35 100644 --- a/src/ShippoAccounts.php +++ b/src/ShippoAccounts.php @@ -1,97 +1,139 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all Shippo Accounts * - * Returns a list of Shippo Accounts objects + * Returns a list of Shippo Managed Accounts objects. * * @param ?int $page * @param ?int $results * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListShippoAccountsResponse + * @return Components\ShippoAccountPaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?int $page = null, - ?int $results = null, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListShippoAccountsResponse { - $request = new \Shippo\API\Models\Operations\ListShippoAccountsRequest(); - $request->page = $page; - $request->results = $results; - $request->shippoApiVersion = $shippoApiVersion; + public function list(?int $page = null, ?int $results = null, ?string $shippoApiVersion = null): Components\ShippoAccountPaginatedList + { + $request = new Operations\ListShippoAccountsRequest( + page: $page, + results: $results, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/shippo-accounts'); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListShippoAccountsRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListShippoAccountsRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListShippoAccounts', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListShippoAccountsResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->shippoAccountPaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\ShippoAccountPaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\ShippoAccountPaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** * Create a Shippo Account * - * Creates a Shippo Account object + * Creates a new Shippo Managed Account. * - * @param \Shippo\API\Models\Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest + * @param Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateShippoAccountResponse + * @return Components\ShippoAccount + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateShippoAccountResponse { - $request = new \Shippo\API\Models\Operations\CreateShippoAccountRequest(); - $request->shippoAccountUpdateRequest = $shippoAccountUpdateRequest; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest, ?string $shippoApiVersion = null): Components\ShippoAccount + { + $request = new Operations\CreateShippoAccountRequest( + shippoAccountUpdateRequest: $shippoAccountUpdateRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/shippo-accounts'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'shippoAccountUpdateRequest', 'json'); if ($body === null) { @@ -104,49 +146,65 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateShippoAccount', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateShippoAccountResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->shippoAccount = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\ShippoAccount', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\ShippoAccount', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** * Retrieve a Shippo Account * - * Returns a Shippo Account using an object ID + * Returns a Shippo Managed Account using an object ID. * * @param string $shippoAccountId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetShippoAccountResponse + * @return Components\ShippoAccount + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $shippoAccountId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetShippoAccountResponse { - $request = new \Shippo\API\Models\Operations\GetShippoAccountRequest(); - $request->shippoAccountId = $shippoAccountId; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $shippoAccountId, ?string $shippoApiVersion = null): Components\ShippoAccount + { + $request = new Operations\GetShippoAccountRequest( + shippoAccountId: $shippoAccountId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/shippo-accounts/{ShippoAccountId}', \Shippo\API\Models\Operations\GetShippoAccountRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/shippo-accounts/{ShippoAccountId}', Operations\GetShippoAccountRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -154,52 +212,67 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetShippoAccount', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetShippoAccountResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->shippoAccount = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\ShippoAccount', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\ShippoAccount', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** * Update a Shippo Account * - * Updates a Shippo Account object + * Updates a Shippo Managed Account using an object ID. * * @param string $shippoAccountId + * @param ?Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest * @param ?string $shippoApiVersion - * @param ?\Shippo\API\Models\Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest - * @return \Shippo\API\Models\Operations\UpdateShippoAccountResponse + * @return Components\ShippoAccount + * @throws \Shippo\API\Models\Errors\SDKError */ - public function update( - string $shippoAccountId, - ?string $shippoApiVersion = null, - ?\Shippo\API\Models\Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest = null, - ): \Shippo\API\Models\Operations\UpdateShippoAccountResponse { - $request = new \Shippo\API\Models\Operations\UpdateShippoAccountRequest(); - $request->shippoAccountId = $shippoAccountId; - $request->shippoApiVersion = $shippoApiVersion; - $request->shippoAccountUpdateRequest = $shippoAccountUpdateRequest; + public function update(string $shippoAccountId, ?Components\ShippoAccountUpdateRequest $shippoAccountUpdateRequest = null, ?string $shippoApiVersion = null): Components\ShippoAccount + { + $request = new Operations\UpdateShippoAccountRequest( + shippoAccountId: $shippoAccountId, + shippoApiVersion: $shippoApiVersion, + shippoAccountUpdateRequest: $shippoAccountUpdateRequest, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/shippo-accounts/{ShippoAccountId}', \Shippo\API\Models\Operations\UpdateShippoAccountRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/shippo-accounts/{ShippoAccountId}', Operations\UpdateShippoAccountRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'shippoAccountUpdateRequest', 'json'); if ($body !== null) { @@ -211,28 +284,44 @@ public function update( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('PUT', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('PUT', $url); + $hookContext = new HookContext('UpdateShippoAccount', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\UpdateShippoAccountResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->shippoAccount = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\ShippoAccount', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\ShippoAccount', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/ShippoSDKBuilder.php b/src/ShippoBuilder.php similarity index 66% rename from src/ShippoSDKBuilder.php rename to src/ShippoBuilder.php index 6018da6..0437e46 100644 --- a/src/ShippoSDKBuilder.php +++ b/src/ShippoBuilder.php @@ -1,7 +1,7 @@ sdkConfig->defaultClient = $client; + $this->sdkConfig->client = $client; return $this; } @@ -35,12 +35,13 @@ public function setClient(\GuzzleHttp\ClientInterface $client): ShippoSDKBuilder * setSecurity is used to configure the security required for the SDK. * * @param string $apiKeyHeader - * @return ShippoSDKBuilder + * @return ShippoBuilder */ - public function setSecurity(string $apiKeyHeader): ShippoSDKBuilder + public function setSecurity(string $apiKeyHeader): ShippoBuilder { - $security = new Models\Components\Security(); - $security->apiKeyHeader = $apiKeyHeader; + $security = new Models\Components\Security( + apiKeyHeader: $apiKeyHeader + ); $this->sdkConfig->security = $security; return $this; @@ -51,9 +52,9 @@ public function setSecurity(string $apiKeyHeader): ShippoSDKBuilder * unlike setSecurity, setSecuritySource accepts a closure that will be called to retrieve the security information. * * @param pure-Closure(): string $securitySource - * @return ShippoSDKBuilder + * @return ShippoBuilder */ - public function setSecuritySource(\Closure $securitySource): ShippoSDKBuilder + public function setSecuritySource(\Closure $securitySource): ShippoBuilder { $this->sdkConfig->securitySource = $securitySource; @@ -65,9 +66,9 @@ public function setSecuritySource(\Closure $securitySource): ShippoSDKBuilder * * @param string $serverUrl * @param array $params - * @return ShippoSDKBuilder + * @return ShippoBuilder */ - public function setServerUrl(string $serverUrl, ?array $params = null): ShippoSDKBuilder + public function setServerUrl(string $serverUrl, ?array $params = null): ShippoBuilder { $this->sdkConfig->serverUrl = Utils\Utils::templateUrl($serverUrl, $params); @@ -78,9 +79,9 @@ public function setServerUrl(string $serverUrl, ?array $params = null): ShippoSD * setServer is used to configure the server for the SDK * * @param int $serverIdx - * @return ShippoSDKBuilder + * @return ShippoBuilder */ - public function setServerIndex(int $serverIdx): ShippoSDKBuilder + public function setServerIndex(int $serverIdx): ShippoBuilder { $this->sdkConfig->serverIndex = $serverIdx; @@ -90,9 +91,9 @@ public function setServerIndex(int $serverIdx): ShippoSDKBuilder * setSHIPPOAPIVERSION is used to configure the SHIPPO-API-VERSION parameter for the SDK. * * @param string $shippoApiVersion - * @return ShippoSDKBuilder + * @return ShippoBuilder */ - public function setSHIPPOAPIVERSION(string $shippoApiVersion): ShippoSDKBuilder + public function setSHIPPOAPIVERSION(string $shippoApiVersion): ShippoBuilder { if (! array_key_exists('header', $this->sdkConfig->globals['parameters'])) { $this->sdkConfig->globals['parameters']['header'] = []; @@ -106,22 +107,19 @@ public function setSHIPPOAPIVERSION(string $shippoApiVersion): ShippoSDKBuilder /** * build is used to build the SDK with any of the configured options. * - * @return ShippoSDK + * @return Shippo */ - public function build(): ShippoSDK + public function build(): Shippo { - if ($this->sdkConfig->defaultClient === null) { - $this->sdkConfig->defaultClient = new \GuzzleHttp\Client([ + if ($this->sdkConfig->client === null) { + $this->sdkConfig->client = new \GuzzleHttp\Client([ 'timeout' => 60, ]); } if ($this->sdkConfig->hasSecurity()) { - $this->sdkConfig->securityClient = Utils\Utils::configureSecurityClient($this->sdkConfig->defaultClient, $this->sdkConfig->getSecurity()); - } - if ($this->sdkConfig->securityClient === null) { - $this->sdkConfig->securityClient = $this->sdkConfig->defaultClient; + $this->sdkConfig->client = Utils\Utils::configureSecurityClient($this->sdkConfig->client, $this->sdkConfig->getSecurity()); } - return new ShippoSDK($this->sdkConfig); + return new Shippo($this->sdkConfig); } } \ No newline at end of file diff --git a/src/TrackingStatus.php b/src/TrackingStatus.php index 2e654d0..aac7ba7 100644 --- a/src/TrackingStatus.php +++ b/src/TrackingStatus.php @@ -1,43 +1,68 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * Register a tracking webhook * * Registers a webhook that will send HTTP notifications to you when the status of your tracked package changes. For more details on creating a webhook, see our guides on Webhooks and Tracking. * - * @param \Shippo\API\Models\Components\TracksRequest $tracksRequest + * @param Components\TracksRequest $tracksRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateTrackResponse + * @return Components\Track + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - \Shippo\API\Models\Components\TracksRequest $tracksRequest, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateTrackResponse { - $request = new \Shippo\API\Models\Operations\CreateTrackRequest(); - $request->tracksRequest = $tracksRequest; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\TracksRequest $tracksRequest, ?string $shippoApiVersion = null): Components\Track + { + $request = new Operations\CreateTrackRequest( + tracksRequest: $tracksRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/tracks'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'tracksRequest', 'json'); if ($body === null) { @@ -50,29 +75,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateTrack', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateTrackResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->track = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Track', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Track', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -83,19 +123,19 @@ public function create( * @param string $trackingNumber * @param string $carrier * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetTrackResponse + * @return Components\Track + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $trackingNumber, - string $carrier, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetTrackResponse { - $request = new \Shippo\API\Models\Operations\GetTrackRequest(); - $request->trackingNumber = $trackingNumber; - $request->carrier = $carrier; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $trackingNumber, string $carrier, ?string $shippoApiVersion = null): Components\Track + { + $request = new Operations\GetTrackRequest( + trackingNumber: $trackingNumber, + carrier: $carrier, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/tracks/{Carrier}/{TrackingNumber}', \Shippo\API\Models\Operations\GetTrackRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/tracks/{Carrier}/{TrackingNumber}', Operations\GetTrackRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -103,28 +143,44 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetTrack', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetTrackResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->track = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Track', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Track', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/Transactions.php b/src/Transactions.php index dd79a99..e9c04a3 100644 --- a/src/Transactions.php +++ b/src/Transactions.php @@ -1,69 +1,111 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all shipping labels * * Returns a list of all transaction objects. * - * @param \Shippo\API\Models\Operations\ListTransactionsRequest $request - * @return \Shippo\API\Models\Operations\ListTransactionsResponse + * @param ?Operations\ListTransactionsRequest $request + * @return Components\TransactionPaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?\Shippo\API\Models\Operations\ListTransactionsRequest $request, - ): \Shippo\API\Models\Operations\ListTransactionsResponse { + public function list(?Operations\ListTransactionsRequest $request = null): Components\TransactionPaginatedList + { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/transactions'); + $urlOverride = null; $options = ['http_errors' => false]; - $options = array_merge_recursive($options, Utils\Utils::getQueryParams(\Shippo\API\Models\Operations\ListTransactionsRequest::class, $request, $this->sdkConfiguration->globals)); + + $qp = Utils\Utils::getQueryParams(Operations\ListTransactionsRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListTransactions', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListTransactionsResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->transactionPaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\TransactionPaginatedList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\TransactionPaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -71,19 +113,20 @@ public function list( * * Creates a new transaction object and purchases the shipping label using a rate object that has previously been created.
OR
Creates a new transaction object and purchases the shipping label instantly using shipment details, an existing carrier account, and an existing service level token. * - * @param mixed $requestBody + * @param Components\TransactionCreateRequest|Components\InstantTransactionCreateRequest $requestBody * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateTransactionResponse + * @return Components\Transaction + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - mixed $requestBody, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateTransactionResponse { - $request = new \Shippo\API\Models\Operations\CreateTransactionRequest(); - $request->requestBody = $requestBody; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\TransactionCreateRequest|Components\InstantTransactionCreateRequest $requestBody, ?string $shippoApiVersion = null): Components\Transaction + { + $request = new Operations\CreateTransactionRequest( + requestBody: $requestBody, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/transactions'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); if ($body === null) { @@ -96,29 +139,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateTransaction', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateTransactionResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->transaction = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Transaction', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Transaction', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -128,17 +186,18 @@ public function create( * * @param string $transactionId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetTransactionResponse + * @return Components\Transaction + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $transactionId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetTransactionResponse { - $request = new \Shippo\API\Models\Operations\GetTransactionRequest(); - $request->transactionId = $transactionId; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $transactionId, ?string $shippoApiVersion = null): Components\Transaction + { + $request = new Operations\GetTransactionRequest( + transactionId: $transactionId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/transactions/{TransactionId}', \Shippo\API\Models\Operations\GetTransactionRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/transactions/{TransactionId}', Operations\GetTransactionRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -146,28 +205,44 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetTransaction', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetTransactionResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->transaction = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Transaction', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Transaction', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/UserParcelTemplates.php b/src/UserParcelTemplates.php index e42c188..bd9de20 100644 --- a/src/UserParcelTemplates.php +++ b/src/UserParcelTemplates.php @@ -1,24 +1,48 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * List all user parcel templates @@ -26,15 +50,17 @@ public function __construct(SDKConfiguration $sdkConfig) * Returns a list all of all user parcel template objects. * * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\ListUserParcelTemplatesResponse + * @return Components\UserParcelTemplateList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function list( - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\ListUserParcelTemplatesResponse { - $request = new \Shippo\API\Models\Operations\ListUserParcelTemplatesRequest(); - $request->shippoApiVersion = $shippoApiVersion; + public function list(?string $shippoApiVersion = null): Components\UserParcelTemplateList + { + $request = new Operations\ListUserParcelTemplatesRequest( + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/user-parcel-templates'); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -42,29 +68,44 @@ public function list( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('ListUserParcelTemplates', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListUserParcelTemplatesResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->userParcelTemplateList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\UserParcelTemplateList', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\UserParcelTemplateList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -78,21 +119,22 @@ public function list( * the template field and pass the other fields, for the weight, length, height, * and depth, as well as their units." * - * @param mixed $requestBody + * @param Components\UserParcelTemplateWithCarrierTemplateCreateRequest|Components\UserParcelTemplateWithoutCarrierTemplateCreateRequest $userParcelTemplateCreateRequest * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\CreateUserParcelTemplateResponse + * @return Components\UserParcelTemplate + * @throws \Shippo\API\Models\Errors\SDKError */ - public function create( - mixed $requestBody, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\CreateUserParcelTemplateResponse { - $request = new \Shippo\API\Models\Operations\CreateUserParcelTemplateRequest(); - $request->requestBody = $requestBody; - $request->shippoApiVersion = $shippoApiVersion; + public function create(Components\UserParcelTemplateWithCarrierTemplateCreateRequest|Components\UserParcelTemplateWithoutCarrierTemplateCreateRequest $userParcelTemplateCreateRequest, ?string $shippoApiVersion = null): Components\UserParcelTemplate + { + $request = new Operations\CreateUserParcelTemplateRequest( + userParcelTemplateCreateRequest: $userParcelTemplateCreateRequest, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/user-parcel-templates'); + $urlOverride = null; $options = ['http_errors' => false]; - $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); + $body = Utils\Utils::serializeRequestBody($request, 'userParcelTemplateCreateRequest', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } @@ -103,29 +145,44 @@ public function create( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('CreateUserParcelTemplate', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateUserParcelTemplateResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->userParcelTemplate = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\UserParcelTemplate', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\UserParcelTemplate', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -135,43 +192,56 @@ public function create( * * @param string $userParcelTemplateObjectId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\DeleteUserParcelTemplateResponse + * @return void + * @throws \Shippo\API\Models\Errors\SDKError */ - public function delete( - string $userParcelTemplateObjectId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\DeleteUserParcelTemplateResponse { - $request = new \Shippo\API\Models\Operations\DeleteUserParcelTemplateRequest(); - $request->userParcelTemplateObjectId = $userParcelTemplateObjectId; - $request->shippoApiVersion = $shippoApiVersion; + public function delete(string $userParcelTemplateObjectId, ?string $shippoApiVersion = null): void + { + $request = new Operations\DeleteUserParcelTemplateRequest( + userParcelTemplateObjectId: $userParcelTemplateObjectId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/user-parcel-templates/{UserParcelTemplateObjectId}', \Shippo\API\Models\Operations\DeleteUserParcelTemplateRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/user-parcel-templates/{UserParcelTemplateObjectId}', Operations\DeleteUserParcelTemplateRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { $options['headers'] = []; } - $options['headers']['Accept'] = 'application/json'; + $options['headers']['Accept'] = '*/*'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('DELETE', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); + $hookContext = new HookContext('DeleteUserParcelTemplate', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\DeleteUserParcelTemplateResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 204) { - } elseif ($httpResponse->getStatusCode() === 400) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } } + if ($statusCode == 204) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); - return $response; + return; + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } } /** @@ -182,17 +252,18 @@ public function delete( * * @param string $userParcelTemplateObjectId * @param ?string $shippoApiVersion - * @return \Shippo\API\Models\Operations\GetUserParcelTemplateResponse + * @return Components\UserParcelTemplate + * @throws \Shippo\API\Models\Errors\SDKError */ - public function get( - string $userParcelTemplateObjectId, - ?string $shippoApiVersion = null, - ): \Shippo\API\Models\Operations\GetUserParcelTemplateResponse { - $request = new \Shippo\API\Models\Operations\GetUserParcelTemplateRequest(); - $request->userParcelTemplateObjectId = $userParcelTemplateObjectId; - $request->shippoApiVersion = $shippoApiVersion; + public function get(string $userParcelTemplateObjectId, ?string $shippoApiVersion = null): Components\UserParcelTemplate + { + $request = new Operations\GetUserParcelTemplateRequest( + userParcelTemplateObjectId: $userParcelTemplateObjectId, + shippoApiVersion: $shippoApiVersion, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/user-parcel-templates/{UserParcelTemplateObjectId}', \Shippo\API\Models\Operations\GetUserParcelTemplateRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/user-parcel-templates/{UserParcelTemplateObjectId}', Operations\GetUserParcelTemplateRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options = array_merge_recursive($options, Utils\Utils::getHeaders($request, $this->sdkConfiguration->globals)); if (! array_key_exists('headers', $options)) { @@ -200,29 +271,44 @@ public function get( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('GetUserParcelTemplate', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetUserParcelTemplateResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->userParcelTemplate = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\UserParcelTemplate', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\UserParcelTemplate', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -231,21 +317,21 @@ public function get( * Updates an existing user parcel template. * * @param string $userParcelTemplateObjectId + * @param ?Components\UserParcelTemplateUpdateRequest $userParcelTemplateUpdateRequest * @param ?string $shippoApiVersion - * @param ?\Shippo\API\Models\Components\UserParcelTemplateUpdateRequest $userParcelTemplateUpdateRequest - * @return \Shippo\API\Models\Operations\UpdateUserParcelTemplateResponse + * @return Components\UserParcelTemplate + * @throws \Shippo\API\Models\Errors\SDKError */ - public function update( - string $userParcelTemplateObjectId, - ?string $shippoApiVersion = null, - ?\Shippo\API\Models\Components\UserParcelTemplateUpdateRequest $userParcelTemplateUpdateRequest = null, - ): \Shippo\API\Models\Operations\UpdateUserParcelTemplateResponse { - $request = new \Shippo\API\Models\Operations\UpdateUserParcelTemplateRequest(); - $request->userParcelTemplateObjectId = $userParcelTemplateObjectId; - $request->shippoApiVersion = $shippoApiVersion; - $request->userParcelTemplateUpdateRequest = $userParcelTemplateUpdateRequest; + public function update(string $userParcelTemplateObjectId, ?Components\UserParcelTemplateUpdateRequest $userParcelTemplateUpdateRequest = null, ?string $shippoApiVersion = null): Components\UserParcelTemplate + { + $request = new Operations\UpdateUserParcelTemplateRequest( + userParcelTemplateObjectId: $userParcelTemplateObjectId, + shippoApiVersion: $shippoApiVersion, + userParcelTemplateUpdateRequest: $userParcelTemplateUpdateRequest, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/user-parcel-templates/{UserParcelTemplateObjectId}', \Shippo\API\Models\Operations\UpdateUserParcelTemplateRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/user-parcel-templates/{UserParcelTemplateObjectId}', Operations\UpdateUserParcelTemplateRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'userParcelTemplateUpdateRequest', 'json'); if ($body !== null) { @@ -257,28 +343,44 @@ public function update( } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('PUT', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('PUT', $url); + $hookContext = new HookContext('UpdateUserParcelTemplate', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\UpdateUserParcelTemplateResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { - if (Utils\Utils::matchContentType($contentType, 'application/json')) { - $serializer = Utils\JSON::createSerializer(); - $response->userParcelTemplate = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\UserParcelTemplate', 'json'); + if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; } - } elseif ($httpResponse->getStatusCode() === 400) { + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->badRequest = $serializer->deserialize((string) $httpResponse->getBody(), 'array', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\UserParcelTemplate', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } + } \ No newline at end of file diff --git a/src/Utils/BigDecimalHandler.php b/src/Utils/BigDecimalHandler.php new file mode 100644 index 0000000..7412338 --- /dev/null +++ b/src/Utils/BigDecimalHandler.php @@ -0,0 +1,65 @@ + GraphNavigator::DIRECTION_SERIALIZATION, + 'format' => 'json', + 'type' => '\\Brick\\Math\\BigDecimal', + 'method' => 'serialize', + ], + [ + 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION, + 'format' => 'json', + 'type' => '\\Brick\\Math\\BigDecimal', + 'method' => 'deserialize', + ], + [ + 'direction' => GraphNavigator::DIRECTION_SERIALIZATION, + 'format' => 'json', + 'type' => 'Brick\\Math\\BigDecimal', + 'method' => 'serialize', + ], + [ + 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION, + 'format' => 'json', + 'type' => 'Brick\\Math\\BigDecimal', + 'method' => 'deserialize', + ], + ]; + } + + /** @phpstan-ignore-next-line */ + public function serialize(JsonSerializationVisitor $visitor, \Brick\Math\BigDecimal|string $any, array $type, Context $context): string|float + { + if (gettype($any) == 'string') { + return $any; + } + + return (float) $any->__toString(); + } + + /** @phpstan-ignore-next-line */ + public function deserialize(JsonDeserializationVisitor $visitor, string|float $data, array $type, Context $context): mixed + { + return \Brick\Math\BigDecimal::of($data); + } +} diff --git a/src/Utils/BigIntHandler.php b/src/Utils/BigIntHandler.php new file mode 100644 index 0000000..4031610 --- /dev/null +++ b/src/Utils/BigIntHandler.php @@ -0,0 +1,65 @@ + GraphNavigator::DIRECTION_SERIALIZATION, + 'format' => 'json', + 'type' => '\\Brick\\Math\\BigInteger', + 'method' => 'serialize', + ], + [ + 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION, + 'format' => 'json', + 'type' => '\\Brick\\Math\\BigInteger', + 'method' => 'deserialize', + ], + [ + 'direction' => GraphNavigator::DIRECTION_SERIALIZATION, + 'format' => 'json', + 'type' => 'Brick\\Math\\BigInteger', + 'method' => 'serialize', + ], + [ + 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION, + 'format' => 'json', + 'type' => 'Brick\\Math\\BigInteger', + 'method' => 'deserialize', + ], + ]; + } + + /** @phpstan-ignore-next-line */ + public function serialize(JsonSerializationVisitor $visitor, \Brick\Math\BigInteger|string $any, array $type, Context $context): string|int + { + if (gettype($any) == 'string') { + return $any; + } + + return (int) $any->toBase(10); + } + + /** @phpstan-ignore-next-line */ + public function deserialize(JsonDeserializationVisitor $visitor, string|int $data, array $type, Context $context): mixed + { + return \Brick\Math\BigInteger::of($data); + } +} diff --git a/src/Utils/DateHandler.php b/src/Utils/DateHandler.php new file mode 100644 index 0000000..9ad1084 --- /dev/null +++ b/src/Utils/DateHandler.php @@ -0,0 +1,61 @@ + GraphNavigator::DIRECTION_SERIALIZATION, + 'format' => 'json', + 'type' => '\\Brick\\DateTime\\LocalDate', + 'method' => 'serializeDateTimeToJson', + ], + [ + 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION, + 'format' => 'json', + 'type' => '\\Brick\\DateTime\\LocalDate', + 'method' => 'deserializeDateTimeToJson', + ], + [ + 'direction' => GraphNavigator::DIRECTION_SERIALIZATION, + 'format' => 'json', + 'type' => 'Brick\\DateTime\\LocalDate', + 'method' => 'serializeDateTimeToJson', + ], + [ + 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION, + 'format' => 'json', + 'type' => 'Brick\\DateTime\\LocalDate', + 'method' => 'deserializeDateTimeToJson', + ], + ]; + } + + /** @phpstan-ignore-next-line */ + public function serializeDateTimeToJson(JsonSerializationVisitor $visitor, \Brick\DateTime\LocalDate $any, array $type, Context $context): string + { + return $any->jsonSerialize(); + } + + /** @phpstan-ignore-next-line */ + public function deserializeDateTimeToJson(JsonDeserializationVisitor $visitor, string $data, array $type, Context $context): mixed + { + return \Brick\DateTime\LocalDate::parse($data); + } +} diff --git a/src/Utils/DateTimeHandler.php b/src/Utils/DateTimeHandler.php new file mode 100644 index 0000000..2723636 --- /dev/null +++ b/src/Utils/DateTimeHandler.php @@ -0,0 +1,61 @@ + GraphNavigator::DIRECTION_SERIALIZATION, + 'format' => 'json', + 'type' => '\DateTime', + 'method' => 'serializeDateTimeToJson', + ], + [ + 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION, + 'format' => 'json', + 'type' => '\DateTime', + 'method' => 'deserializeDateTimeToJson', + ], + [ + 'direction' => GraphNavigator::DIRECTION_SERIALIZATION, + 'format' => 'json', + 'type' => 'DateTime', + 'method' => 'serializeDateTimeToJson', + ], + [ + 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION, + 'format' => 'json', + 'type' => 'DateTime', + 'method' => 'deserializeDateTimeToJson', + ], + ]; + } + + /** @phpstan-ignore-next-line */ + public function serializeDateTimeToJson(JsonSerializationVisitor $visitor, \DateTime $any, array $type, Context $context): string + { + return $any->format('Y-m-d\TH:i:s.up'); + } + + /** @phpstan-ignore-next-line */ + public function deserializeDateTimeToJson(JsonDeserializationVisitor $visitor, string $data, array $type, Context $context): mixed + { + return new \DateTime($data); + } +} diff --git a/src/Utils/DefaultRequest.php b/src/Utils/DefaultRequest.php new file mode 100644 index 0000000..92c8c38 --- /dev/null +++ b/src/Utils/DefaultRequest.php @@ -0,0 +1,106 @@ +getMessage()); + } } } diff --git a/src/Utils/FormMetadata.php b/src/Utils/FormMetadata.php index 23dcdb7..b58a5a6 100644 --- a/src/Utils/FormMetadata.php +++ b/src/Utils/FormMetadata.php @@ -1,7 +1,7 @@ $style = $parts[1], 'explode' => $explode = $parts[1] === 'true', 'dateTimeFormat' => $dateTimeFormat = $parts[1], + 'serializeToString' => $serializeToString = $parts[1] === 'true', default => throw new \RuntimeException('Invalid part'), }; } @@ -57,6 +60,7 @@ public static function parse(string $metadata): ?FormMetadata style: $style, explode: $explode, dateTimeFormat: $dateTimeFormat, + serializeToString: $serializeToString ); } } diff --git a/src/Utils/Headers.php b/src/Utils/Headers.php index 3999334..f3bf0f3 100644 --- a/src/Utils/Headers.php +++ b/src/Utils/Headers.php @@ -1,7 +1,7 @@ >> $globals + * @param array>>|null $globals * @return array */ - public function parseHeaders(mixed $headers, array $globals): array + public function parseHeaders(mixed $headers, ?array $globals = null): array { $out = []; @@ -26,7 +26,10 @@ public function parseHeaders(mixed $headers, array $globals): array } foreach ($headers as $field => $value) { - $value = populateGlobal($value, 'header', $field, $globals); + if ($globals !== null) { + $value = populateGlobal($value, 'header', $field, $globals); + } + if ($value === null) { continue; } @@ -65,17 +68,17 @@ private function serializeHeader(ParamsMetadata $metadata, mixed $value): string } if ($metadata->explode) { - $items[] = $fieldMetadata->name.'='.valToString($fieldValue); + $items[] = $fieldMetadata->name.'='.valToString($fieldValue, ['dateTimeFormat' => $fieldMetadata->dateTimeFormat]); } else { $items[] = $fieldMetadata->name; - $items[] = valToString($fieldValue); + $items[] = valToString($fieldValue, ['dateTimeFormat' => $fieldMetadata->dateTimeFormat]); } } return implode(',', $items); case 'array': if (array_is_list($value)) { - return implode(',', array_map(fn ($v) => valToString($v), $value)); + return implode(',', array_map(fn ($v) => valToString($v, []), $value)); } else { $items = []; @@ -85,17 +88,17 @@ private function serializeHeader(ParamsMetadata $metadata, mixed $value): string } if ($metadata->explode) { - $items[] = $field.'='.valToString($fieldValue); + $items[] = $field.'='.valToString($fieldValue, []); } else { $items[] = $field; - $items[] = valToString($fieldValue); + $items[] = valToString($fieldValue, []); } } return implode(',', $items); } default: - return valToString($value); + return valToString($value, []); } } diff --git a/src/Utils/JSON.php b/src/Utils/JSON.php index 56425b5..adba52a 100644 --- a/src/Utils/JSON.php +++ b/src/Utils/JSON.php @@ -1,25 +1,43 @@ configureHandlers( static function (HandlerRegistry $registry): void { + $registry->registerSubscribingHandler(new StdClassHandler()); + $registry->registerSubscribingHandler(new ArrayCollectionHandler()); + $registry->registerSubscribingHandler(new IteratorHandler()); $registry->registerSubscribingHandler(new MixedJSONHandler()); $registry->registerSubscribingHandler(new EnumHandler()); + $registry->registerSubscribingHandler(new DateTimeHandler()); + $registry->registerSubscribingHandler(new DateHandler()); + $registry->registerSubscribingHandler(new UnionHandler()); + $registry->registerSubscribingHandler(new BigIntHandler()); + $registry->registerSubscribingHandler(new BigDecimalHandler()); }, - )->addDefaultHandlers()->build(); + )->setTypeParser(new PhpDocTypeParser() + )->setSerializationContextFactory(function () { + return SerializationContext::create() + ->setSerializeNull(true); + })->build(); } -} \ No newline at end of file +} diff --git a/src/Utils/MixedJSONHandler.php b/src/Utils/MixedJSONHandler.php index 2f311c5..552c725 100644 --- a/src/Utils/MixedJSONHandler.php +++ b/src/Utils/MixedJSONHandler.php @@ -1,18 +1,19 @@ $content = $parts[1] === 'true', 'json' => $json = $parts[1] === 'true', 'dateTimeFormat' => $dateTimeFormat = $parts[1], + 'serializeToString' => $serializeToString = $parts[1] === 'true', default => throw new \RuntimeException('Failed to parse options.'), }; } @@ -57,6 +60,7 @@ public static function parse(string $metadata): ?MultipartMetadata content: $content, json: $json, dateTimeFormat: $dateTimeFormat, + serializeToString: $serializeToString ); } } diff --git a/src/Utils/ParamsMetadata.php b/src/Utils/ParamsMetadata.php index cdd0be1..c068c70 100644 --- a/src/Utils/ParamsMetadata.php +++ b/src/Utils/ParamsMetadata.php @@ -1,7 +1,7 @@ $explode = $parts[1] === 'true', 'serialization' => $serialization = $parts[1], 'dateTimeFormat' => $dateTimeFormat = $parts[1], + 'serializeToString' => $serializeToString = $parts[1] === 'true', default => throw new \RuntimeException('Failed to parse options'), }; } @@ -77,6 +80,7 @@ public static function parse(string $metadata): ?ParamsMetadata name: $name, serialization: $serialization, dateTimeFormat: $dateTimeFormat, + serializeToString: $serializeToString ); } } diff --git a/src/Utils/PathParameters.php b/src/Utils/PathParameters.php index 9010eb2..f55e4d7 100644 --- a/src/Utils/PathParameters.php +++ b/src/Utils/PathParameters.php @@ -1,7 +1,7 @@ {$field} : null; - $value = populateGlobal($value, 'pathParam', $field, $globals); + + if ($globals !== null) { + $value = populateGlobal($value, 'pathParam', $field, $globals); + } if ($value === null) { continue; @@ -79,9 +82,9 @@ private function parseSimplePathParams(ParamsMetadata $metadata, mixed $value): } if ($metadata->explode) { - $vals[] = sprintf('%s=%s', $fieldMetadata->name, valToString($fieldValue)); + $vals[] = sprintf('%s=%s', $fieldMetadata->name, valToString($fieldValue, ['dateTimeFormat' => $fieldMetadata->dateTimeFormat])); } else { - $vals[] = sprintf('%s,%s', $fieldMetadata->name, valToString($fieldValue)); + $vals[] = sprintf('%s,%s', $fieldMetadata->name, valToString($fieldValue, ['dateTimeFormat' => $fieldMetadata->dateTimeFormat])); } } @@ -92,14 +95,14 @@ private function parseSimplePathParams(ParamsMetadata $metadata, mixed $value): if (array_is_list($value)) { foreach ($value as $val) { - $vals[] = valToString($val); + $vals[] = valToString($val, []); } } else { foreach ($value as $key => $val) { if ($metadata->explode) { - $vals[] = sprintf('%s=%s', $key, valToString($val)); + $vals[] = sprintf('%s=%s', $key, valToString($val, [])); } else { - $vals[] = sprintf('%s,%s', $key, valToString($val)); + $vals[] = sprintf('%s,%s', $key, valToString($val, [])); } } } @@ -107,7 +110,7 @@ private function parseSimplePathParams(ParamsMetadata $metadata, mixed $value): $pathParams[$metadata->name] = implode(',', $vals); break; default: - $pathParams[$metadata->name] = valToString($value); + $pathParams[$metadata->name] = valToString($value, []); break; } diff --git a/src/Utils/PhpDocTypeParser.php b/src/Utils/PhpDocTypeParser.php new file mode 100644 index 0000000..22d5eb9 --- /dev/null +++ b/src/Utils/PhpDocTypeParser.php @@ -0,0 +1,101 @@ +typeResolver = new \phpDocumentor\Reflection\TypeResolver(); + } + + /** + * @param string $typeString + * @return array + */ + public function parse(string $typeString): array + { + $type = $this->typeResolver->resolve($typeString); + + return $this->convertRecursive($type); + } + + /** + * @param Type $type + * @return array + */ + public function convertRecursive(Type $type): array + { + if (\is_a($type, \phpDocumentor\Reflection\Types\AggregatedType::class)) { + return [ + 'name' => 'union', + 'params' => \array_map(function ($type) { + return $this->convertRecursive($type); + }, iterator_to_array($type->getIterator())), + ]; + } elseif (\is_a($type, \phpDocumentor\Reflection\Types\Array_::class)) { + $params = []; + $keyType = $type->getKeyType(); + if (\is_a($keyType, \phpDocumentor\Reflection\Types\AggregatedType::class)) { + // The Default key that the phpdoc type system returns for *maps* is string|int, so if we see that, exclude it (which is the JMS/Serializer default). + if (! ($keyType->getIterator()->count() == 2 && $keyType->contains(new \phpDocumentor\Reflection\Types\String_()) && $keyType->contains(new \phpDocumentor\Reflection\Types\Integer()))) { + $params[] = $this->convertRecursive($keyType); + } + } else { + $params[] = $this->convertRecursive($keyType); + } + $valueType = $type->getValueType(); + $params[] = $this->convertRecursive($valueType); + + return [ + 'name' => 'array', + 'params' => $params, + ]; + } elseif (\is_a($type, \phpDocumentor\Reflection\Types\Object_::class)) { + $className = $type->__toString(); + if (class_exists($className)) { + $objectClass = new \ReflectionClass($className); + if ($objectClass->isEnum()) { + return [ + 'name' => 'enum', + 'params' => [ + [ + 'name' => $objectClass->getName(), + 'params' => [], + ], + ], + ]; + } + } + } elseif (\is_a($type, \phpDocumentor\Reflection\Types\Null_::class)) { + return [ + 'name' => 'NULL', + 'params' => [], + ]; + } + + + return [ + 'name' => $type->__toString(), + 'params' => [], + ]; + } +} \ No newline at end of file diff --git a/src/Utils/QueryParameters.php b/src/Utils/QueryParameters.php index 61e0130..1b3cb21 100644 --- a/src/Utils/QueryParameters.php +++ b/src/Utils/QueryParameters.php @@ -1,13 +1,14 @@ >> $globals - * @return ?string + * @param array $urlOverride + * @param array>>|null $globals + * @return array */ - public function parseQueryParams(string $type, mixed $queryParams, array $globals): ?string + public function parseQueryParams(string $type, mixed $queryParams, array $urlOverride, ?array $globals = null): array { $parts = []; @@ -26,7 +28,10 @@ public function parseQueryParams(string $type, mixed $queryParams, array $global foreach ($fields as $field) { $value = $queryParams !== null ? $queryParams->{$field} : null; - $value = populateGlobal($value, 'queryParam', $field, $globals); + + if ($globals !== null) { + $value = populateGlobal($value, 'queryParam', $field, $globals); + } if ($value === null) { continue; @@ -41,28 +46,29 @@ public function parseQueryParams(string $type, mixed $queryParams, array $global if ($metadata === null) { continue; } - if (! empty($metadata->serialization)) { - $parts[] = $this->parseSerializationParams($metadata, $value); + $parts = array_merge($parts, $this->parseSerializationParams($metadata, $value)); } else { match ($metadata->style) { - 'deepObject' => $parts[] = $this->parseDeepObjectParams($metadata, $value), - 'form' => $parts[] = $this->parseDelimitedParams($metadata, $value, ','), - 'pipeDelimited' => $parts[] = $this->parseDelimitedParams($metadata, $value, '|'), + 'deepObject' => $parts = array_merge_recursive($parts, $this->parseDeepObjectParams($metadata, $value)), + 'form' => $parts = array_merge_recursive($parts, $this->parseDelimitedParams($metadata, $value, ',')), + 'pipeDelimited' => $parts = array_merge_recursive($parts, $this->parseDelimitedParams($metadata, $value, '|')), default => throw new \RuntimeException('Unsupported style '.$metadata->style), }; } } - return empty($parts) ? null : implode('&', $parts); + $parts = array_merge($parts, $urlOverride); + + return $parts; } /** * @param ParamsMetadata $metadata * @param mixed $value - * @return string + * @return array */ - private function parseSerializationParams(ParamsMetadata $metadata, mixed $value): string + private function parseSerializationParams(ParamsMetadata $metadata, mixed $value): array { $queryParams = []; @@ -75,15 +81,15 @@ private function parseSerializationParams(ParamsMetadata $metadata, mixed $value throw new \Exception('Unsupported serialization: '.$metadata->serialization); } - return http_build_query($queryParams); + return $queryParams; } /** * @param ParamsMetadata $metadata * @param mixed $value - * @return string + * @return array|string> */ - private function parseDeepObjectParams(ParamsMetadata $metadata, mixed $value): string + private function parseDeepObjectParams(ParamsMetadata $metadata, mixed $value): array { $queryParams = []; @@ -107,10 +113,10 @@ private function parseDeepObjectParams(ParamsMetadata $metadata, mixed $value): if (is_array($val) && array_is_list($val)) { foreach ($val as $item) { - $items[] = valToString($item, $dateTimeFormat); + $items[] = valToString($item, ['dateTimeFormat' => $dateTimeFormat]); } } else { - $queryParams[$metadata->name.'['.$fieldMetaData->name.']'] = valToString($val, $dateTimeFormat); + $queryParams[$metadata->name.'['.$fieldMetaData->name.']'] = valToString($val, ['dateTimeFormat' => $dateTimeFormat]); } if (count($items) > 0) { @@ -129,10 +135,10 @@ private function parseDeepObjectParams(ParamsMetadata $metadata, mixed $value): if (is_array($val) && array_is_list($val)) { foreach ($val as $item) { - $items[] = valToString($item, $dateTimeFormat); + $items[] = valToString($item, ['dateTimeFormat' => $dateTimeFormat]); } } else { - $queryParams[$metadata->name.'['.$key.']'] = valToString($val, $dateTimeFormat); + $queryParams[$metadata->name.'['.$key.']'] = valToString($val, ['dateTimeFormat' => $dateTimeFormat]); } if (count($items) > 0) { @@ -143,16 +149,16 @@ private function parseDeepObjectParams(ParamsMetadata $metadata, mixed $value): break; } - return $this->buildQueryString($queryParams); + return $queryParams; } /** * @param ParamsMetadata $metadata * @param mixed $value * @param string $delimiter - * @return string + * @return array|string> */ - private function parseDelimitedParams(ParamsMetadata $metadata, mixed $value, string $delimiter): string + private function parseDelimitedParams(ParamsMetadata $metadata, mixed $value, string $delimiter): array { $queryParams = []; @@ -175,9 +181,9 @@ private function parseDelimitedParams(ParamsMetadata $metadata, mixed $value, st $dateTimeFormat = $fieldMetaData->dateTimeFormat; if ($metadata->explode) { - $queryParams[$fieldMetaData->name] = valToString($val, $dateTimeFormat); + $queryParams[$fieldMetaData->name] = valToString($val, ['dateTimeFormat' => $dateTimeFormat]); } else { - $items[] = $fieldMetaData->name.$delimiter.valToString($val, $dateTimeFormat); + $items[] = $fieldMetaData->name.$delimiter.valToString($val, ['dateTimeFormat' => $dateTimeFormat]); } } @@ -192,9 +198,9 @@ private function parseDelimitedParams(ParamsMetadata $metadata, mixed $value, st foreach ($value as $item) { if ($metadata->explode) { - $values[] = valToString($item, $dateTimeFormat); + $values[] = valToString($item, ['dateTimeFormat' => $dateTimeFormat]); } else { - $items[] = valToString($item, $dateTimeFormat); + $items[] = valToString($item, ['dateTimeFormat' => $dateTimeFormat]); } } @@ -212,9 +218,9 @@ private function parseDelimitedParams(ParamsMetadata $metadata, mixed $value, st } if ($metadata->explode) { - $queryParams[$key] = valToString($val, $dateTimeFormat); + $queryParams[$key] = valToString($val, ['dateTimeFormat' => $dateTimeFormat]); } else { - $items[] = $key.$delimiter.valToString($val, $dateTimeFormat); + $items[] = $key.$delimiter.valToString($val, ['dateTimeFormat' => $dateTimeFormat]); } } @@ -224,33 +230,48 @@ private function parseDelimitedParams(ParamsMetadata $metadata, mixed $value, st } break; default: - $queryParams[$metadata->name] = valToString($value, $dateTimeFormat); + $queryParams[$metadata->name] = valToString($value, ['dateTimeFormat' => $dateTimeFormat]); } - return $this->buildQueryString($queryParams); + return $queryParams; } /** - * @param array|string> $queryParams + * @param array> $queryParams + * @return string */ - private function buildQueryString(array $queryParams): string + private static function recursivelyBuildQueryString(array $queryParams): string { - ksort($queryParams); - $parts = []; + foreach ($queryParams as $key => $value) { - if (is_array($value)) { - foreach ($value as $item) { - $parts[] = urlencode($key).'='.urlencode($item); - } + if (is_array($value) && array_is_list($value)) { + $parts = array_merge($parts, array_map(fn ($v) => self::buildQueryString($key, $v), $value)); + } elseif (is_array($value)) { + $res = self::recursivelyBuildQueryString($value); + $parts[] = self::buildQueryString($key, $res); } else { - $parts[] = urlencode($key).'='.urlencode($value); + $parts[] = self::buildQueryString($key, $value); } } return implode('&', $parts); } + /** + * @param string|int $queryParamKey + * @param string $queryParamValue + * @return string + */ + private static function buildQueryString(string|int $queryParamKey, string $queryParamValue): string + { + if (is_int($queryParamKey)) { + $queryParamKey = (string) $queryParamKey; + } + + return implode('=', [urlencode($queryParamKey), urlencode($queryParamValue)]); + } + private function parseQueryParamsMetadata(ReflectionProperty $property): ?ParamsMetadata { $metadataStr = SpeakeasyMetadata::find($property->getAttributes(SpeakeasyMetadata::class), 'queryParam'); @@ -265,5 +286,21 @@ private function parseQueryParamsMetadata(ReflectionProperty $property): ?Params return $metadata; } -} + /** + * @param RequestInterface $httpRequest + * @param array $queryParams + * @return string + */ + public static function standardizeQueryParams(RequestInterface $httpRequest, array $queryParams): string + { + $uri = $httpRequest->getUri(); + $query = $uri->getQuery(); + $requestQueryParams = Utils::proper_parse_str($query); + + $allParams = array_merge($queryParams, $requestQueryParams); + $uri = $uri->withQuery(QueryParameters::recursivelyBuildQueryString($allParams)); + + return $uri->getQuery(); + } +} diff --git a/src/Utils/RequestBodies.php b/src/Utils/RequestBodies.php index f4d5aa0..f0662fd 100644 --- a/src/Utils/RequestBodies.php +++ b/src/Utils/RequestBodies.php @@ -1,7 +1,7 @@ $metadata->name.'[]', - 'contents' => valToString($item, $dateTimeFormat), + 'contents' => valToString($item, ['dateTimeFormat' => $dateTimeFormat]), ]; } } else { $options['multipart'][] = [ 'name' => $metadata->name, - 'contents' => valToString($val, $dateTimeFormat), + 'contents' => valToString($val, ['dateTimeFormat' => $dateTimeFormat]), ]; } } @@ -225,7 +225,7 @@ private function serializeFormData(string $fieldName, mixed $value): array throw new \Exception("Invalid request body type for field $fieldName"); } else { foreach ($value as $k => $v) { - $options['form_params'][$k] = valToString($v); + $options['form_params'][$k] = valToString($v, []); } } break; @@ -246,16 +246,22 @@ private function serializeForm(FormMetadata $metadata, mixed $value): array $values = []; $dateTimeFormat = $metadata->dateTimeFormat; + $serializeToString = $metadata->serializeToString; switch (gettype($value)) { case 'object': switch ($value::class) { + case 'Brick\DateTime\LocalDate': case 'DateTime': - $values[$metadata->name] = valToString($value, $dateTimeFormat); + $values[$metadata->name] = valToString($value, ['dateTimeFormat' => $dateTimeFormat]); + break; + case 'Brick\Math\BigInteger': + case 'Brick\Math\BigDecimal': + $values[$metadata->name] = valToString($value, ['serializeToString' => $serializeToString]); break; default: if (is_a($value, \BackedEnum::class, true)) { - $values[$metadata->name] = valToString($value); + $values[$metadata->name] = valToString($value, []); } else { $items = []; @@ -270,9 +276,9 @@ private function serializeForm(FormMetadata $metadata, mixed $value): array } if ($metadata->explode) { - $values[$fieldMetadata->name] = valToString($val, $fieldMetadata->dateTimeFormat); + $values[$fieldMetadata->name] = valToString($val, ['dateTimeFormat' => $fieldMetadata->dateTimeFormat]); } else { - $items[] = sprintf('%s,%s', $fieldMetadata->name, valToString($val)); + $items[] = sprintf('%s,%s', $fieldMetadata->name, valToString($val, [])); } } @@ -286,16 +292,16 @@ private function serializeForm(FormMetadata $metadata, mixed $value): array case 'array': if (array_is_list($value)) { foreach ($value as $v) { - $values[$metadata->name] = valToString($v, $dateTimeFormat); + $values[$metadata->name] = valToString($v, ['dateTimeFormat' => $dateTimeFormat]); } } else { $items = []; foreach ($value as $k => $v) { if ($metadata->explode) { - $values[$k] = valToString($v, $dateTimeFormat); + $values[$k] = valToString($v, ['dateTimeFormat' => $dateTimeFormat]); } else { - $items[] = sprintf('%s,%s', $k, valToString($v, $dateTimeFormat)); + $items[] = sprintf('%s,%s', $k, valToString($v, ['dateTimeFormat' => $dateTimeFormat])); } } @@ -305,7 +311,7 @@ private function serializeForm(FormMetadata $metadata, mixed $value): array } break; default: - $values[$metadata->name] = valToString($value, $dateTimeFormat); + $values[$metadata->name] = valToString($value, ['dateTimeFormat' => $dateTimeFormat]); break; } diff --git a/src/Utils/RequestMetadata.php b/src/Utils/RequestMetadata.php index 4364b90..4e6f33f 100644 --- a/src/Utils/RequestMetadata.php +++ b/src/Utils/RequestMetadata.php @@ -1,7 +1,7 @@ clientOptions['headers']) > 0) { - $options['headers'] = array_merge_recursive($options['headers'], $this->clientOptions['headers']); + $options['headers'] = array_merge($this->clientOptions['headers'], $options['headers']); } if (count($this->clientOptions['query']) > 0) { diff --git a/src/Utils/SecurityMetadata.php b/src/Utils/SecurityMetadata.php index 961ccdf..7673716 100644 --- a/src/Utils/SecurityMetadata.php +++ b/src/Utils/SecurityMetadata.php @@ -1,7 +1,7 @@ options + */ + public array $options; + + /** + * @param string $baseUrl + * @param array $options + */ + public function __construct(string $baseUrl, array $options) + { + $this->baseUrl = $baseUrl; + $this->options = $options; + } +} \ No newline at end of file diff --git a/src/Utils/SpeakeasyMetadata.php b/src/Utils/SpeakeasyMetadata.php index 580265a..31b3278 100644 --- a/src/Utils/SpeakeasyMetadata.php +++ b/src/Utils/SpeakeasyMetadata.php @@ -1,7 +1,7 @@ > + */ + public static function getSubscribingMethods(): array + { + $methods = []; + $formats = ['json', 'xml']; + + foreach ($formats as $format) { + $methods[] = [ + 'type' => 'union', + 'format' => $format, + 'direction' => GraphNavigatorInterface::DIRECTION_DESERIALIZATION, + 'method' => 'deserializeUnion', + ]; + $methods[] = [ + 'type' => 'union', + 'format' => $format, + 'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION, + 'method' => 'serializeUnion', + ]; + } + + return $methods; + } + + /** + * @param SerializationVisitorInterface $visitor + * @param mixed $data + * @param array $type + * @param SerializationContext $context + * @return mixed + */ + public function serializeUnion( + SerializationVisitorInterface $visitor, + mixed $data, + array $type, + SerializationContext $context + ): mixed { + if ($this->isPrimitiveType(gettype($data))) { + return $this->matchSimpleType($data, $type, $context); + } else { + if (is_array($data)) { + if (array_is_list($data) && ! empty($data)) { + $innerType = gettype($data[0]); + if ($innerType === 'object') { + $innerType = get_class($data[0]); + } + $resolvedType = [ + 'name' => 'array', + 'params' => ['name' => $innerType, 'params' => []], + ]; + } else { + $keyType = gettype(array_key_first($data)); + $valueType = gettype($data[array_key_first($data)]); + $resolvedType = [ + 'name' => 'array', + 'params' => [ + ['name' => $keyType, 'params' => []], + ['name' => $valueType, 'params' => []], + ], + ]; + } + } else { + $resolvedType = null; + foreach ($type['params'] as $possibleType) { + if ($possibleType['name'] === 'enum' && $possibleType['params'][0]['name'] === get_class($data)) { + $resolvedType = $possibleType; + break; + } + } + if ($resolvedType === null) { + $resolvedType = [ + 'name' => get_class($data), + 'params' => [], + ]; + } + } + + return $context->getNavigator()->accept($data, $resolvedType); + } + } + + /** + * @param DeserializationVisitorInterface $visitor + * @param mixed $data + * @param array $type + * @param DeserializationContext $context + * @return mixed + */ + public function deserializeUnion(DeserializationVisitorInterface $visitor, mixed $data, array $type, DeserializationContext $context): mixed + { + if ($data instanceof \SimpleXMLElement) { + throw new RuntimeException('XML deserialisation into union types is not supported yet.'); + } + + // if three params exist, it may mean that there was a union discriminator set for this type. + // It also may mean that there are three possible types. + if (count($type['params']) == 3 && $this->paramsLookLikeUnionDiscriminator($type)) { + $lookupField = $type['params'][1]; + if (empty($data[$lookupField])) { + throw new NonVisitableTypeException(sprintf('Union Discriminator Field "%s" not found in data', $lookupField)); + } + + $unionMap = $type['params'][2]; + $lookupValue = $data[$lookupField]; + if (empty($unionMap[$lookupValue])) { + throw new NonVisitableTypeException(sprintf('Union Discriminator Map does not contain key "%s"', $lookupValue)); + } + + $finalType = [ + 'name' => $unionMap[$lookupValue], + 'params' => [], + ]; + + return $context->getNavigator()->accept($data, $finalType); + } + + foreach ($this->reorderTypes($type)['params'] as $possibleType) { + + $typeToTry = $possibleType['name']; + if ($typeToTry === 'array') { + $typeNames = array_map(fn ($t) => $t['name'], $possibleType['params']); + $typeToTry = 'array<'.implode(', ', $typeNames).'>'; + } + if ($typeToTry === 'enum') { + $typeToTry = $possibleType['params'][0]['name']; + } + if ($typeToTry == 'NULL') { + if ($data == null) { + return null; + } else { + continue; + } + } + $serializer = JSON::createSerializer(); + try { + if ($this->isPrimitiveType($possibleType['name']) && (is_array($data) || ! $this->testPrimitive($data, $possibleType['name']))) { + continue; + } + + $json_encoded_data = json_encode($data); + if ($json_encoded_data === false) { + throw new RuntimeException('Failed to encode data to JSON: '.json_last_error_msg()); + } + $accept = $serializer->deserialize($json_encoded_data, $typeToTry, 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $accept; + } catch (NonVisitableTypeException $e) { + continue; + } catch (PropertyMissingException $e) { + continue; + } catch (NonStringCastableTypeException $e) { + continue; + } catch (NonIntCastableTypeException $e) { + continue; + } catch (NonFloatCastableTypeException $e) { + continue; + } catch (\Brick\Math\Exception\NumberFormatException $e) { + continue; + } catch (RuntimeException $e) { + continue; + } + } + + return null; + } + + /** + * @param array $type + * @return bool + */ + private function paramsLookLikeUnionDiscriminator(array $type): bool + { + // if the first param is null, then the second and third parameters + // will contain the discriminator details. + $first = $type['params'][0]; + + return $first === null; + } + + /** + * @param mixed $data + * @param array $type + * @param Context $context + */ + private function matchSimpleType(mixed $data, array $type, Context $context): mixed + { + foreach ($type['params'] as $possibleType) { + if ($this->isPrimitiveType($possibleType['name']) && ! $this->testPrimitive($data, $possibleType['name'])) { + continue; + } + + try { + return $context->getNavigator()->accept($data, $possibleType); + } catch (NonVisitableTypeException $e) { + continue; + } catch (PropertyMissingException $e) { + continue; + } + } + + return null; + } + + /** + * @param string $type + * @return bool + */ + private function isPrimitiveType(string $type): bool + { + return in_array($type, ['int', 'integer', 'float', 'double', 'bool', 'boolean', 'string']); + } + + /** + * @param mixed $data + * @param string $type + * @return bool + */ + private function testPrimitive(mixed $data, string $type): bool + { + switch ($type) { + case 'integer': + case 'int': + return (string) (int) $data === (string) $data; + + case 'double': + case 'float': + return (string) (float) $data === (string) $data; + + case 'bool': + case 'boolean': + return (string) (bool) $data === (string) $data; + + case 'string': + return (string) $data === (string) $data; + } + + return false; + } + + /** + * @param array $type + * @return array + */ + private function reorderTypes(array $type): array + { + if ($type['params']) { + uasort($type['params'], static function ($a, $b) { + if (\class_exists($a['name']) && \class_exists($b['name'])) { + $aClass = new \ReflectionClass($a['name']); + $bClass = new \ReflectionClass($b['name']); + $aRequiredPropertyCount = 0; + $bRequiredPropertyCount = 0; + foreach ($aClass->getProperties() as $property) { + if (! $property->getType()->allowsNull()) { + $aRequiredPropertyCount++; + } + } + + foreach ($bClass->getProperties() as $property) { + if (! $property->getType()->allowsNull()) { + $bRequiredPropertyCount++; + } + } + + return $bRequiredPropertyCount <=> $aRequiredPropertyCount; + } + + if (\class_exists($a['name'])) { + return 1; + } + + if (\class_exists($b['name'])) { + return -1; + } + + $order = ['null' => 0, 'true' => 1, 'false' => 2, 'bool' => 3, 'int' => 4, 'float' => 5, 'string' => 6]; + + return ($order[$a['name']] ?? 7) <=> ($order[$b['name']] ?? 7); + }); + } + + return $type; + } +} diff --git a/src/Utils/Utils.php b/src/Utils/Utils.php index c5d5eb4..47e7d5d 100644 --- a/src/Utils/Utils.php +++ b/src/Utils/Utils.php @@ -1,7 +1,7 @@ >>|null $globals * @return array */ - public static function getQueryParams(string $type, mixed $queryParams, ?array $globals = null): array + public static function getQueryParams(string $type, mixed $queryParams, ?string $urlOverride, ?array $globals = null): array { $qp = new QueryParameters(); $globals ??= []; - $query = $qp->parseQueryParams($type, $queryParams, $globals); + $parsedUrl = []; + if ($urlOverride != null) { + $splitUrl = explode('?', $urlOverride); + if (count($splitUrl) > 1) { + $parsedUrl = self::proper_parse_str($splitUrl[1]); + } + } + $query = $qp->parseQueryParams($type, $queryParams, $parsedUrl, $globals); if ($query === null) { return []; } - return [ - 'query' => $query, - ]; + return $query; } /** @@ -160,6 +180,182 @@ public static function getHeaders(mixed $headers, ?array $globals = null): array 'headers' => $headers, ]; } + + /** + * The builtin php parse_str function does not + * properly implement query param parsing (specifically it doesn't handle + * multiple values from the same key) This function is a bit more correct + * @param string $str + * @return array + */ + public static function proper_parse_str($str) + { + $arr = []; + + if (empty($str)) { + return $arr; + } + + $pairs = explode('&', $str); + + foreach ($pairs as $i) { + [$name,$value] = explode('=', $i, 2); + + // if name already exists + if (isset($arr[$name])) { + // stick multiple values into an array + if (is_array($arr[$name])) { + $arr[$name][] = $value; + } else { + $arr[$name] = [$arr[$name], $value]; + } + } else { + // else treat as scalar + $arr[$name] = $value; + } + } + + return $arr; + } + + /** + * convertHeadersToOptions will convert the headers from a request to options for a client. + * + * @param RequestInterface $request + * @param array $options + * @return array + */ + public static function convertHeadersToOptions(RequestInterface $request, array $options): array + { + $headers = $request->getHeaders(); + foreach ($request->getHeaders() as $name => $values) { + $options['headers'][$name] = $values; + } + + return $options; + } + + /** + * removeHeaders will remove all headers from a request + * + * @param RequestInterface $request + * @return RequestInterface + */ + public static function removeHeaders(RequestInterface $request): RequestInterface + { + $headers = $request->getHeaders(); + foreach ($request->getHeaders() as $name => $values) { + $request = $request->withoutHeader($name); + } + + return $request; + } + + /** + * urljoin joins a base URL and a relative URL. + * this is a PHP port of the Python urllib.urljoin function + * + * @param string $base + * @param string $rel + * @return string + */ + public static function urljoin(string $base, string $rel): string + { + $pbase = parse_url($base); + if ($pbase === false) { + throw new \InvalidArgumentException('Invalid base URL: '.$base); + } else { + $pbase = (array) $pbase; + } + $prel = parse_url($rel); + if ($prel === false) { + throw new \InvalidArgumentException('Invalid relative URL: '.$rel); + } else { + $prel = (array) $prel; + } + + $merged = array_merge($pbase, $prel); + if (array_key_exists('path', $pbase) && array_key_exists('path', $prel) && $prel['path'][0] != '/') { + // Relative path + $dir = preg_replace('@/[^/]*$@', '', $pbase['path']); + $merged['path'] = $dir.'/'.$prel['path']; + } elseif (array_key_exists('path', $pbase)) { + $merged['path'] = $pbase['path']; + } elseif (array_key_exists('path', $prel)) { + $merged['path'] = $prel['path']; + } else { + $merged['path'] = ''; + } + + // Get the path components, and remove the initial empty one + $pathParts = explode('/', $merged['path']); + array_shift($pathParts); + + $path = []; + $prevPart = ''; + foreach ($pathParts as $part) { + if ($part == '..' && count($path) > 0) { + // Cancel out the parent directory (if there's a parent to cancel) + $parent = array_pop($path); + // But if it was also a parent directory, leave it in + if ($parent == '..') { + array_push($path, $parent); + array_push($path, $part); + } + } elseif ($prevPart != '' || ($part != '.' && $part != '')) { + // Don't include empty or current-directory components + if ($part == '.') { + $part = ''; + } + array_push($path, $part); + } + $prevPart = $part; + } + $merged['path'] = '/'.implode('/', $path); + + $ret = ''; + if (isset($merged['scheme'])) { + $ret .= $merged['scheme'].':'; + } + + if (isset($merged['scheme']) || isset($merged['host'])) { + $ret .= '//'; + } + + if (isset($prel['host'])) { + $hostSource = $prel; + } else { + $hostSource = $pbase; + } + + // username, password, and port are associated with the hostname, not merged + if (isset($hostSource['host'])) { + if (isset($hostSource['user'])) { + $ret .= $hostSource['user']; + if (isset($hostSource['pass'])) { + $ret .= ':'.$hostSource['pass']; + } + $ret .= '@'; + } + $ret .= $hostSource['host']; + if (isset($hostSource['port'])) { + $ret .= ':'.$hostSource['port']; + } + } + + $ret .= $merged['path']; + + if (isset($prel['query'])) { + $ret .= '?'.$prel['query']; + } + + if (isset($prel['fragment'])) { + $ret .= '#'.$prel['fragment']; + } + + return $ret; + } + } function removePrefix(string $text, string $prefix): string @@ -180,8 +376,12 @@ function removeSuffix(string $text, string $suffix): string return $text; } - -function valToString(mixed $val, string $dateTimeFormat = ''): string +/** + * @param mixed $val + * @param array $extras + * @return string + */ +function valToString(mixed $val, array $extras): string { switch (gettype($val)) { case 'string': @@ -189,11 +389,26 @@ function valToString(mixed $val, string $dateTimeFormat = ''): string case 'object': switch (get_class($val)) { case 'DateTime': - if (empty($dateTimeFormat)) { - $dateTimeFormat = 'Y-m-d\TH:i:s.uP'; + $dateTimeFormat = $dateTimeFormat = 'Y-m-d\TH:i:s.up'; + if (array_key_exists('dateTimeFormat', $extras)) { + $dateTimeFormat = $extras['dateTimeFormat']; } return $val->format($dateTimeFormat); + case 'Brick\DateTime\LocalDate': + return $val->jsonSerialize(); + case 'Brick\Math\BigInteger': + if (array_key_exists('serializeToString', $extras) && $extras['serializeToString']) { + return '"'.$val->toBase(10).'"'; + } + + return $val->toBase(10); + case 'Brick\Math\BigDecimal': + if (array_key_exists('serializeToString', $extras) && $extras['serializeToString']) { + return '"'.$val->__toString().'"'; + } + + return $val->__toString(); default: if (is_a($val, \BackedEnum::class, true)) { $enumVal = $val->value; @@ -209,6 +424,7 @@ function valToString(mixed $val, string $dateTimeFormat = ''): string default: return var_export($val, true); } + } /** @@ -220,11 +436,8 @@ function valToString(mixed $val, string $dateTimeFormat = ''): string */ function populateGlobal(mixed $value, string $type, string $field, array $globals): mixed { - if ($globals !== null && $value === null && isset($globals['parameters'][$type]) && isset($globals['parameters'][$type][$field])) { - $globalVal = $globals['parameters'][$type][$field]; - if ($globalVal !== null) { - $value = $globalVal; - } + if ($value === null && ! empty($globals['parameters'][$type][$field])) { + $value = $globals['parameters'][$type][$field]; } return $value; diff --git a/src/Webhooks.php b/src/Webhooks.php index 84ad2e0..f9de817 100644 --- a/src/Webhooks.php +++ b/src/Webhooks.php @@ -1,38 +1,63 @@ sdkConfiguration = $sdkConfig; } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } /** * Create a new webhook * * Creates a new webhook to send notifications to a URL when a specific event occurs. * - * @param \Shippo\API\Models\Components\WebhookUpdateRequest $request - * @return \Shippo\API\Models\Operations\CreateWebhookResponse + * @param Components\WebhookUpdateRequest $request + * @return Components\Webhook + * @throws \Shippo\API\Models\Errors\SDKError */ - public function createWebhook( - \Shippo\API\Models\Components\WebhookUpdateRequest $request, - ): \Shippo\API\Models\Operations\CreateWebhookResponse { + public function createWebhook(Components\WebhookUpdateRequest $request): Components\Webhook + { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/webhooks'); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { @@ -41,24 +66,44 @@ public function createWebhook( $options = array_merge_recursive($options, $body); $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('POST', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('createWebhook', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\CreateWebhookResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 201) { + if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; + } + } + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->webhook = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Webhook', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Webhook', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -66,33 +111,55 @@ public function createWebhook( * * Returns a list of all webhooks you have created. * - * @return \Shippo\API\Models\Operations\ListWebhooksResponse + * @return Components\WebhookPaginatedList + * @throws \Shippo\API\Models\Errors\SDKError */ - public function listWebhooks( - ): \Shippo\API\Models\Operations\ListWebhooksResponse { + public function listWebhooks(): Components\WebhookPaginatedList + { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/webhooks'); + $urlOverride = null; $options = ['http_errors' => false]; $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('listWebhooks', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\ListWebhooksResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { + if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; + } + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->webhookPaginatedList = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\WebhookPaginatedList', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\WebhookPaginatedList', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -101,36 +168,58 @@ public function listWebhooks( * Returns the details of a specific webhook using the webhook object ID. * * @param string $webhookId - * @return \Shippo\API\Models\Operations\GetWebhookResponse + * @return Components\Webhook + * @throws \Shippo\API\Models\Errors\SDKError */ - public function getWebhook( - string $webhookId, - ): \Shippo\API\Models\Operations\GetWebhookResponse { - $request = new \Shippo\API\Models\Operations\GetWebhookRequest(); - $request->webhookId = $webhookId; + public function getWebhook(string $webhookId): Components\Webhook + { + $request = new Operations\GetWebhookRequest( + webhookId: $webhookId, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/webhooks/{webhookId}', \Shippo\API\Models\Operations\GetWebhookRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/webhooks/{webhookId}', Operations\GetWebhookRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('GET', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('getWebhook', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\GetWebhookResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { + if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; + } + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->webhook = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Webhook', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Webhook', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -138,19 +227,20 @@ public function getWebhook( * * Updates an existing webhook using the webhook object ID. * + * @param Components\WebhookUpdateRequest $webhookUpdateRequest * @param string $webhookId - * @param \Shippo\API\Models\Components\WebhookUpdateRequest $webhookUpdateRequest - * @return \Shippo\API\Models\Operations\UpdateWebhookResponse + * @return Components\Webhook + * @throws \Shippo\API\Models\Errors\SDKError */ - public function updateWebhook( - string $webhookId, - \Shippo\API\Models\Components\WebhookUpdateRequest $webhookUpdateRequest, - ): \Shippo\API\Models\Operations\UpdateWebhookResponse { - $request = new \Shippo\API\Models\Operations\UpdateWebhookRequest(); - $request->webhookId = $webhookId; - $request->webhookUpdateRequest = $webhookUpdateRequest; + public function updateWebhook(Components\WebhookUpdateRequest $webhookUpdateRequest, string $webhookId): Components\Webhook + { + $request = new Operations\UpdateWebhookRequest( + webhookId: $webhookId, + webhookUpdateRequest: $webhookUpdateRequest, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/webhooks/{webhookId}', \Shippo\API\Models\Operations\UpdateWebhookRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/webhooks/{webhookId}', Operations\UpdateWebhookRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'webhookUpdateRequest', 'json'); if ($body === null) { @@ -159,24 +249,44 @@ public function updateWebhook( $options = array_merge_recursive($options, $body); $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('PUT', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('PUT', $url); + $hookContext = new HookContext('updateWebhook', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\UpdateWebhookResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 200) { + if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; + } + } + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + $serializer = Utils\JSON::createSerializer(); - $response->webhook = $serializer->deserialize((string) $httpResponse->getBody(), 'Shippo\API\Models\Components\Webhook', 'json'); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Shippo\API\Models\Components\Webhook', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + + return $obj; } + throw new \Shippo\API\Models\Errors\SDKError('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - - return $response; } /** @@ -185,31 +295,51 @@ public function updateWebhook( * Deletes a specific webhook using the webhook object ID. * * @param string $webhookId - * @return \Shippo\API\Models\Operations\DeleteWebhookResponse + * @return void + * @throws \Shippo\API\Models\Errors\SDKError */ - public function deleteWebhook( - string $webhookId, - ): \Shippo\API\Models\Operations\DeleteWebhookResponse { - $request = new \Shippo\API\Models\Operations\DeleteWebhookRequest(); - $request->webhookId = $webhookId; + public function deleteWebhook(string $webhookId): void + { + $request = new Operations\DeleteWebhookRequest( + webhookId: $webhookId, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/webhooks/{webhookId}', \Shippo\API\Models\Operations\DeleteWebhookRequest::class, $request, $this->sdkConfiguration->globals); + $url = Utils\Utils::generateUrl($baseUrl, '/webhooks/{webhookId}', Operations\DeleteWebhookRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; $options = ['http_errors' => false]; $options['headers']['Accept'] = '*/*'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - - $httpResponse = $this->sdkConfiguration->securityClient->request('DELETE', $url, $options); + $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); + $hookContext = new HookContext('deleteWebhook', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + if ($res !== null) { + $httpResponse = $res; + } + } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - - $response = new \Shippo\API\Models\Operations\DeleteWebhookResponse(); - $response->statusCode = $statusCode; - $response->contentType = $contentType; - $response->rawResponse = $httpResponse; - if ($httpResponse->getStatusCode() === 204) { + if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + if ($res !== null) { + $httpResponse = $res; + } } + if ($statusCode == 204) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); - return $response; + return; + } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + throw new \Shippo\API\Models\Errors\SDKError('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Shippo\API\Models\Errors\SDKError('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } } + } \ No newline at end of file