using NetLibrary.WebReference; using System; using System.Collections.Generic; using System.Linq; using System.Web; using TradeManageNew.RateWebReference; namespace TradeManageNew { public class UPSModel { } #region UPSTokenModel public class UPSTokenModel { public string token_type { get; set; } public string issued_at { get; set; } public string client_id { get; set; } public string access_token { get; set; } public string scope { get; set; } public string expires_in { get; set; } public string refresh_count { get; set; } public string status { get; set; } } #endregion #region UPS RatingRequestModel public class RateRequestModel { public RateRequestNew RateRequest { get; set; } } public class RateRequestNew { public Request Request { get; set; } public PickupType PickupType { get; set; } public CustomerClassification CustomerClassification { get; set; } public Shipment Shipment { get; set; } } public class Request { public string RequestOption { get; set; } public string SubVersion { get; set; } public TransactionReference TransactionReference { get; set; } } public class TransactionReference { public string CustomerContext { get; set; } } public class PickupType { public string Code { get; set; } public string Description { get; set; } } public class CustomerClassification { public string Code { get; set; } public string Description { get; set; } } public class Shipment { public string OriginRecordTransactionTimestamp { get; set; } public Shipper Shipper { get; set; } public ShipTo ShipTo { get; set; } public ShipFrom ShipFrom { get; set; } public AlternateDeliveryAddress AlternateDeliveryAddress { get; set; } public List ShipmentIndicationType { get; set; } public PaymentDetails PaymentDetails { get; set; } public FRSPaymentInformation FRSPaymentInformation { get; set; } public FreightShipmentInformation FreightShipmentInformation { get; set; } public string GoodsNotInFreeCirculationIndicator { get; set; } public Service Service { get; set; } public string NumOfPieces { get; set; } public ShipmentTotalWeight ShipmentTotalWeight { get; set; } public string DocumentsOnlyIndicator { get; set; } public List Package { get; set; } public ShipmentServiceOptions ShipmentServiceOptions { get; set; } public ShipmentRatingOptions ShipmentRatingOptions { get; set; } public CodeAndValue InvoiceLineTotal { get; set; } public string RatingMethodRequestedIndicator { get; set; } public string TaxInformationIndicator { get; set; } public PromotionalDiscountInformation PromotionalDiscountInformation { get; set; } public DeliveryTimeInformation DeliveryTimeInformation { get; set; } public string MasterCartonIndicator { get; set; } public string WWEShipmentIndicator { get; set; } //public RateInformation RateInformation { get; set; } } public class Shipper { public string Name { get; set; } /// /// 发件人姓名 /// public string AttentionName { get; set; } /// /// 发货人编号 /// public string ShipperNumber { get; set; } public AddressFrom Address { get; set; } } public class AddressFrom { public List AddressLine { get; set; } public string City { get; set; } /// /// 省自治区编码 /// public string StateProvinceCode { get; set; } /// /// 邮政编码 /// public string PostalCode { get; set; } /// /// 国家代码 /// public string CountryCode { get; set; } } public class ShipTo { public string Name { get; set; } /// /// 发件人姓名 /// public string AttentionName { get; set; } public AddressTo Address { get; set; } } public class AddressTo { public List AddressLine { get; set; } public string City { get; set; } /// /// 省自治区编码 /// public string StateProvinceCode { get; set; } /// /// 邮政编码 /// public string PostalCode { get; set; } /// /// 国家代码 /// public string CountryCode { get; set; } public string ResidentialAddressIndicator { get; set; } } public class ShipFrom { public string Name { get; set; } /// /// 发件人姓名 /// public string AttentionName { get; set; } public AddressFrom Address { get; set; } } public class AlternateDeliveryAddress { public string Name { get; set; } public AddressAlternate Address { get; set; } } public class AddressAlternate { public string AddressLine { get; set; } public string City { get; set; } /// /// 省自治区编码 /// public string StateProvinceCode { get; set; } /// /// 邮政编码 /// public string PostalCode { get; set; } /// /// 国家代码 /// public string CountryCode { get; set; } public string ResidentialAddressIndicator { get; set; } public string POBoxIndicator { get; set; } } public class TypeModel { public string Code { get; set; } public string Description { get; set; } } public class PaymentDetails { public List ShipmentCharge { get; set; } public string SplitDutyVATIndicator { get; set; } } public class ShipmentCharge { public string Type { get; set; } public BillShipper BillShipper { get; set; } public BillReceiver BillReceiver { get; set; } public BillThirdParty BillThirdParty { get; set; } public string ConsigneeBilledIndicator { get; set; } } public class BillShipper { public string AccountNumber { get; set; } } public class BillReceiver { public string AccountNumber { get; set; } public AddressBillReceiver Address { get; set; } } public class AddressBillReceiver { public string PostalCode { get; set; } } public class BillThirdParty { public string AccountNumber { get; set; } public AddressFrom Address { get; set; } } public class FRSPaymentInformation { public FRSPaymentInformationType Type { get; set; } public string AccountNumber { get; set; } public AddressFRSPaymentInformation Address { get; set; } } public class FRSPaymentInformationType { public string Code { get; set; } public string Description { get; set; } } public class AddressFRSPaymentInformation { public string PostalCode { get; set; } public string CountryCode { get; set; } } public class FreightShipmentInformation { public FreightDensityInfo FreightDensityInfo { get; set; } public string DensityEligibleIndicator { get; set; } } public class FreightDensityInfo { public string AdjustedHeightIndicator { get; set; } public ValueAndUnitOfMeasurement AdjustedHeight { get; set; } public List HandlingUnits { get; set; } } public class ValueAndUnitOfMeasurement { public string Value { get; set; } public UnitOfMeasurement UnitOfMeasurement { get; set; } } public class UnitOfMeasurement { public string Code { get; set; } public string Description { get; set; } } public class HandlingUnits { public string Quantity { get; set; } public TypeModel Type { get; set; } public DimensionsNew Dimensions { get; set; } } public class DimensionsNew { public UnitOfMeasurement UnitOfMeasurement { get; set; } public string Length { get; set; } public string Width { get; set; } public string Height { get; set; } } public class Service { public string Code { get; set; } public string Description { get; set; } } public class ShipmentTotalWeight { public UnitOfMeasurement UnitOfMeasurement { get; set; } public string Weight { get; set; } } public class Package { public TypeModel PackagingType { get; set; } public DimensionsNew Dimensions { get; set; } public ShipmentTotalWeight DimWeight { get; set; } public ShipmentTotalWeight PackageWeight { get; set; } public Commodity Commodity { get; set; } public string LargePackageIndicator { get; set; } public PackageServiceOptions PackageServiceOptions { get; set; } public string AdditionalHandlingIndicator { get; set; } public CodeAndDescription SimpleRate { get; set; } public UPSPremier UPSPremier { get; set; } public string OversizeIndicator { get; set; } public string MinimumBillableWeightIndicator { get; set; } } public class Commodity { public string FreightClass { get; set; } public NMFC NMFC { get; set; } } public class NMFC { public string PrimeCode { get; set; } public string SubCode { get; set; } } public class PackageServiceOptions { public DeliveryConfirmation DeliveryConfirmation { get; set; } public CodeAndValue AccessPointCOD { get; set; } public COD COD { get; set; } public CodeAndValue DeclaredValue { get; set; } public CodeAndValue ShipperDeclaredValue { get; set; } public string ShipperReleaseIndicator { get; set; } public string ProactiveIndicator { get; set; } public string RefrigerationIndicator { get; set; } public string UPSPremiumCareIndicator { get; set; } public HazMat HazMat { get; set; } public DryIce DryIce { get; set; } } public class DeliveryConfirmation { public string DCISType { get; set; } } public class CodeAndValue { public string CurrencyCode { get; set; } public string MonetaryValue { get; set; } } public class COD { public string CODFundsCode { get; set; } public CodeAndValue CODAmount { get; set; } } public class HazMat { public string PackageIdentifier { get; set; } public string QValue { get; set; } public string OverPackedIndicator { get; set; } public string AllPackedInOneIndicator { get; set; } public List HazMatChemicalRecord { get; set; } } public class HazMatChemicalRecord { public string ChemicalRecordIdentifier { get; set; } public string ClassDivisionNumber { get; set; } public string IDNumber { get; set; } public string TransportationMode { get; set; } public string RegulationSet { get; set; } public string EmergencyPhone { get; set; } public string EmergencyContact { get; set; } public string ReportableQuantity { get; set; } public string SubRiskClass { get; set; } public string PackagingGroupType { get; set; } public string Quantity { get; set; } public string UOM { get; set; } public string PackagingInstructionCode { get; set; } public string ProperShippingName { get; set; } public string TechnicalName { get; set; } public string AdditionalDescription { get; set; } public string PackagingType { get; set; } public string HazardLabelRequired { get; set; } public string PackagingTypeQuantity { get; set; } public string CommodityRegulatedLevelCode { get; set; } public string TransportCategory { get; set; } public string TunnelRestrictionCode { get; set; } } public class DryIce { public string RegulationSet { get; set; } public ValueAndUnitOfMeasurement DryIceWeight { get; set; } public string MedicalUseIndicator { get; set; } public string AuditRequired { get; set; } } public class UPSPremier { public string Category { get; set; } } public class ShipmentServiceOptions { public string SaturdayPickupIndicator { get; set; } public string SaturdayDeliveryIndicator { get; set; } public string SundayDeliveryIndicator { get; set; } public string AvailableServicesOption { get; set; } public CodeAndValue AccessPointCOD { get; set; } public string DeliverToAddresseeOnlyIndicator { get; set; } public string DirectDeliveryOnlyIndicator { get; set; } public COD COD { get; set; } public DeliveryConfirmation DeliveryConfirmation { get; set; } public string ReturnOfDocumentIndicator { get; set; } public string UPScarbonneutralIndicator { get; set; } public string CertificateOfOriginIndicator { get; set; } public PickupOptions PickupOptions { get; set; } public DeliveryOptions DeliveryOptions { get; set; } public RestrictedArticles RestrictedArticles { get; set; } public string ShipperExportDeclarationIndicator { get; set; } public string CommercialInvoiceRemovalIndicator { get; set; } public CodeAndDescription ImportControl { get; set; } public CodeAndDescription ReturnService { get; set; } public string SDLShipmentIndicator { get; set; } public string EPRAIndicator { get; set; } public string InsideDelivery { get; set; } public string ItemDisposalIndicator { get; set; } } public class PickupOptions { public string LiftGateAtPickupIndicator { get; set; } public string HoldForPickupIndicator { get; set; } } public class DeliveryOptions { public string LiftGateAtDeliveryIndicator { get; set; } public string DropOffAtUPSFacilityIndicator { get; set; } } public class RestrictedArticles { public string AlcoholicBeveragesIndicator { get; set; } public string DiagnosticSpecimensIndicator { get; set; } public string PerishablesIndicator { get; set; } public string PlantsIndicator { get; set; } public string SeedsIndicator { get; set; } public string SpecialExceptionsIndicator { get; set; } public string TobaccoIndicator { get; set; } public string ECigarettesIndicator { get; set; } public string HempCBDIndicator { get; set; } } public class CodeAndDescription { public string Code { get; set; } public string Description { get; set; } } public class ShipmentRatingOptions { public string NegotiatedRatesIndicator { get; set; } public string FRSShipmentIndicator { get; set; } public string RateChartIndicator { get; set; } public string UserLevelDiscountIndicator { get; set; } public string TPFCNegotiatedRatesIndicator { get; set; } } public class PromotionalDiscountInformation { public string PromoCode { get; set; } public string PromoAliasCode { get; set; } } public class DeliveryTimeInformation { public string PackageBillType { get; set; } public Pickup Pickup { get; set; } public List ReturnContractServices { get; set; } } public class Pickup { public string Date { get; set; } public string Time { get; set; } } #endregion #region Rating Response Model public class RateResponseModel { public RateResponseNew RateResponse { get; set; } } public class RateResponseNew { public Response Response { get; set; } //public RatedShipment RatedShipment { get; set; } private dynamic _RatedShipment; public dynamic RatedShipment { get=> _RatedShipment; set { if(value is RatedShipment) { _RatedShipment = new List { value }; } else { _RatedShipment= value; } } } } public class Response { public CodeAndDescription ResponseStatus { get; set; } public List Alert { get; set; } public List AlertDetail { get; set; } public TransactionReference TransactionReference { get; set; } } public class AlertDetail { public string Code { get; set; } public string Description { get; set; } public ElementLevelInformation ElementLevelInformation { get; set; } } public class ElementLevelInformation { public string Level { get; set; } public List ElementIdentifier { get; set; } } public class RatedShipment { public List Disclaimer { get; set; } public CodeAndDescription Service { get; set; } public string RateChart { get; set; } //public CodeAndDescription RatedShipmentAlert { get; set; } private dynamic _RatedShipmentAlert; public dynamic RatedShipmentAlert { get => _RatedShipmentAlert; set { if (value is CodeAndDescription) { _RatedShipmentAlert = new List { value }; } else { _RatedShipmentAlert = value; } } } public string BillableWeightCalculationMethod { get; set; } public string RatingMethod { get; set; } public BillingWeight BillingWeight { get; set; } public CodeAndValue TransportationCharges { get; set; } public CodeAndValue BaseServiceCharge { get; set; } //public ItemizedCharges ItemizedCharges { get; set; } private dynamic _ItemizedCharges; public dynamic ItemizedCharges { get => _ItemizedCharges; set { if (value is ItemizedCharges) { _ItemizedCharges = new List { value }; } else { _ItemizedCharges = value; } } } public FRSShipmentData FRSShipmentData { get; set; } public CodeAndValue ServiceOptionsCharges { get; set; } public List TaxCharges { get; set; } public CodeAndValue TotalCharges { get; set; } public CodeAndValue TotalChargesWithTaxes { get; set; } public NegotiatedRateCharges NegotiatedRateCharges { get; set; } public RatedPackage RatedPackage { get; set; } public TimeInTransit TimeInTransit { get; set; } public string ScheduledDeliveryDate { get; set; } public string RoarRatedIndicator { get; set; } } public class BillingWeight { public string Weight { get; set; } public UnitOfMeasurement UnitOfMeasurement { get; set; } } public class ItemizedCharges { public string Code { get; set; } public string Description { get; set; } public string CurrencyCode { get; set; } public string MonetaryValue { get; set; } public string SubType { get; set; } } public class FRSShipmentData { public TransportationCharges TransportationCharges { get; set; } public FreightDensityRate FreightDensityRate { get; set; } public List HandlingUnits { get; set; } } public class TransportationCharges { public CodeAndValue GrossCharge { get; set; } public CodeAndValue DiscountAmount { get; set; } public string DiscountPercentage { get; set; } public CodeAndValue NetCharge { get; set; } } public class FreightDensityRate { public string Density { get; set; } public string TotalCubicFeet { get; set; } } public class HandlingUnitsForResponse { public string Quantity { get; set; } public CodeAndDescription Type { get; set; } public DimensionsNew Dimensions { get; set; } public ValueAndUnitOfMeasurement AdjustedHeight { get; set; } } public class TypeAndValue { public string Type { get; set; } public string MonetaryValue { get; set; } } public class NegotiatedRateCharges { //public List ItemizedCharges { get; set; } //public List TaxCharges { get; set; } public CodeAndValue BaseServiceCharge { get; set; } //public ItemizedCharges ItemizedCharges { get; set; } private dynamic _ItemizedCharges; public dynamic ItemizedCharges { get => _ItemizedCharges; set { if (value is ItemizedCharges) { _ItemizedCharges = new List { value }; } else { _ItemizedCharges = value; } } } public CodeAndValue TotalCharge { get; set; } public CodeAndValue TotalChargesWithTaxes { get; set; } } public class RatedPackage { public CodeAndValue BaseServiceCharge { get; set; } public CodeAndValue TransportationCharges { get; set; } public CodeAndValue ServiceOptionsCharges { get; set; } public CodeAndValue TotalCharges { get; set; } public string Weight { get; set; } public BillingWeight BillingWeight { get; set; } public List Accessorial { get; set; } private dynamic _ItemizedCharges; public dynamic ItemizedCharges { get => _ItemizedCharges; set { if(value is ItemizedCharges) { _ItemizedCharges = new List { value }; } else { _ItemizedCharges = value; } } } public NegotiatedCharges NegotiatedCharges { get; set; } public SimpleRate SimpleRate { get; set; } public List RateModifier { get; set; } } public class NegotiatedCharges { public CodeAndValue BaseServiceCharge { get; set; } public CodeAndValue TransportationCharges { get; set; } public CodeAndValue ServiceOptionsCharges { get; set; } public CodeAndValue TotalCharge { get; set; } //public ItemizedCharges ItemizedCharges { get; set; } private dynamic _ItemizedCharges; public dynamic ItemizedCharges { get => _ItemizedCharges; set { if (value is ItemizedCharges) { _ItemizedCharges = new List { value }; } else { _ItemizedCharges = value; } } } } public class SimpleRate { public string Code { get; set; } } public class RateModifier { public string ModifierType { get; set; } public string ModifierDesc { get; set; } public string Amount { get; set; } } public class TimeInTransit { public string PickupDate { get; set; } public string DocumentsOnlyIndicator { get; set; } public string PackageBillType { get; set; } public ServiceSummary ServiceSummary { get; set; } public string AutoDutyCode { get; set; } public string Disclaimer { get; set; } } public class ServiceSummary { public ServiceForResponse Service { get; set; } public string GuaranteedIndicator { get; set; } public string Disclaimer { get; set; } public EstimatedArrival EstimatedArrival { get; set; } public string SaturdayDelivery { get; set; } public string SaturdayDeliveryDisclaimer { get; set; } public string SundayDelivery { get; set; } public string SundayDeliveryDisclaimer { get; set; } } public class ServiceForResponse { public string Description { get; set; } } public class EstimatedArrival { public DateAndTime Arrival { get; set; } public string BusinessDaysInTransit { get; set; } public DateAndTime Pickup { get; set; } public string DayOfWeek { get; set; } public string CustomerCenterCutoff { get; set; } public string DelayCount { get; set; } public string HolidayCount { get; set; } public string RestDays { get; set; } public string TotalTransitDays { get; set; } } public class DateAndTime { public string Date { get; set; } public string Time { get; set; } } #endregion #region UPS Shipping RequestModel public class ShippingRequestModel { public ShipmentRequestNew ShipmentRequest { get; set; } } public class ShipmentRequestNew { public Request Request { get; set; } public ShippingShipment Shipment { get; set; } public Ship_ShipmentRequest_LabelSpecification LabelSpecification { get; set; } } public class ShippingShipment { public string Description { get; set; } public Ship_Shipment_Shipper Shipper { get; set; } public Ship_Shipment_ShipTo ShipTo { get;set; } public Ship_Shipment_ShipFrom ShipFrom { get; set; } public PaymentInformation PaymentInformation { get; set; } public Service Service { get;set; } public List Package { get; set; } public Ship_ShipmentRequest_LabelSpecification LabelSpecification { get; set; } } public class Ship_Shipment_Shipper { public string Name { get; set; } public string AttentionName { get; set; } public string CompanyDisplayableName { get; set; } public string TaxIdentificationNumber { get; set; } public Ship_Shipper_Phone Phone { get; set; } public string ShipperNumber { get; set; } public string FaxNumber { get; set; } public string EMailAddress { get; set; } public AddressFrom Address { get; set; } } public class Ship_Shipper_Phone { public string Number { get; set; } public string Extension { get; set; } } public class Ship_Shipment_ShipTo { public string Name { get; set; } public string AttentionName { get; set; } public string CompanyDisplayableName { get; set; } public string TaxIdentificationNumber { get; set; } public Ship_Shipper_Phone Phone { get;set; } public string FaxNumber { get; set;} public string EMailAddress { get; set; } public AddressTo Address { get; set; } public string LocationID { get; set; } } public class Ship_Shipment_ShipFrom { public string Name { get; set; } public string AttentionName { get; set; } public string CompanyDisplayableName { get; set; } public string TaxIdentificationNumber { get; set; } public Ship_Shipper_Phone Phone { get; set; } public string FaxNumber { get; set; } public AddressFrom Address { get; set; } } public class PaymentInformation { public List ShipmentCharge { get; set; } public string SplitDutyVATIndicator { get; set; } } //public class Ship_PaymentInformation_ShipmentCharge //{ // public ShipmentCharge ShipmentCharge { get; set; } //} public class Ship_Shipment_Package { public string Description { get; set; } public CodeAndDescription Packaging { get; set; } public DimensionsNew Dimensions { get; set; } public PackageWeight PackageWeight { get; set; } } public class PackageWeight { public UnitOfMeasurement UnitOfMeasurement { get; set; } public string Weight { get; set; } } public class Ship_ShipmentRequest_LabelSpecification { public CodeAndDescription LabelImageFormat { get; set; } public string HTTPUserAgent { get; set; } public LabelStockSize LabelStockSize { get; set; } } public class LabelStockSize { public string Height { get; set; } public string Width { get; set; } } #endregion #region UPS Shipping ResponseModel public class ShippingResponseModel { public ShipmentResponseNew ShipmentResponse { get; set; } public Ship_ShipmentResponse_ShipmentResults ShipmentResults { get; set; } } public class ShipmentResponseNew { public Ship_ShipmentResponse_Response Response { get; set; } public Ship_ShipmentResponse_ShipmentResults ShipmentResults { get; set; } } public class Ship_ShipmentResponse_Response { public CodeAndDescription ResponseStatus { get; set; } public CodeAndDescription Alert { get; set; } public TransactionReference TransactionReference { get; set; } } public class Ship_ShipmentResponse_ShipmentResults { public List Disclaimer { get; set; } public string ShipmentIdentificationNumber { get; set; } public Ship_ShipmentResponse_PackageResults PackageResults { get; set; } } public class Ship_ShipmentResponse_PackageResults { public string TrackingNumber { get; set; } public ShippingLabel ShippingLabel { get; set; } } public class ShippingLabel { public CodeAndDescription ImageFormat { get; set; } public string GraphicImage { get; set; } public string HTMLImage { get; set; } } #endregion }