package emailmarkup /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.1-dev * User agent: apibuilder app.apibuilder.io/sullis/email-markup/0.0.1-dev/go_1_5_client */ import ( "bytes" "encoding/json" "io" "strings" ) const UserAgent = "apibuilder app.apibuilder.io/sullis/email-markup/0.0.1-dev/go_1_5_client" const Version = "0.0.1-dev" const VersionMajor = 0 type ActionTypes string const ( ActionTypesConfirmAction ActionTypes = "ConfirmAction" ActionTypesSaveAction = "SaveAction" ActionTypesTrackAction = "TrackAction" ActionTypesViewAction = "ViewAction" ActionTypesUNDEFINED = "UNDEFINED" ) func ActionTypesFromString(value string) ActionTypes { switch strings.TrimSpace(strings.ToLower(value)) { case "confirmaction": return ActionTypesConfirmAction case "saveaction": return ActionTypesSaveAction case "trackaction": return ActionTypesTrackAction case "viewaction": return ActionTypesViewAction default: return ActionTypesUNDEFINED } } type ActionHandler struct { AtType string `json:"at_type"` Url string `json:"url"` } func ActionHandlerFromMap(data interface{}) ActionHandler { b, err := json.Marshal(data) if err == nil { return ActionHandlerFromJson(bytes.NewReader(b)) } else { panic(err) } } func ActionHandlerFromJson(bytes io.Reader) ActionHandler { var actionHandler ActionHandler json.NewDecoder(bytes).Decode(&actionHandler) return actionHandler } type Address struct { AddressCountry string `json:"addressCountry"` AddressLocality string `json:"addressLocality"` AddressRegion string `json:"addressRegion"` PostalCode string `json:"postalCode"` PostOfficeBoxNumber string `json:"postOfficeBoxNumber"` StreetAddress string `json:"streetAddress"` } func AddressFromMap(data interface{}) Address { b, err := json.Marshal(data) if err == nil { return AddressFromJson(bytes.NewReader(b)) } else { panic(err) } } func AddressFromJson(bytes io.Reader) Address { var address Address json.NewDecoder(bytes).Decode(&address) return address } type Customer struct { Name string `json:"name"` } func CustomerFromMap(data interface{}) Customer { b, err := json.Marshal(data) if err == nil { return CustomerFromJson(bytes.NewReader(b)) } else { panic(err) } } func CustomerFromJson(bytes io.Reader) Customer { var customer Customer json.NewDecoder(bytes).Decode(&customer) return customer } type GotoAction struct { AtContext string `json:"at_context"` AtType string `json:"at_type"` PotentialAction PotentialAction `json:"potentialAction"` Description string `json:"description"` } func GotoActionFromMap(data interface{}) GotoAction { b, err := json.Marshal(data) if err == nil { return GotoActionFromJson(bytes.NewReader(b)) } else { panic(err) } } func GotoActionFromJson(bytes io.Reader) GotoAction { var gotoAction GotoAction json.NewDecoder(bytes).Decode(&gotoAction) return gotoAction } type Merchant struct { Name string `json:"name"` } func MerchantFromMap(data interface{}) Merchant { b, err := json.Marshal(data) if err == nil { return MerchantFromJson(bytes.NewReader(b)) } else { panic(err) } } func MerchantFromJson(bytes io.Reader) Merchant { var merchant Merchant json.NewDecoder(bytes).Decode(&merchant) return merchant } type Offer struct { AcceptedPaymentMethod PaymentMethod `json:"acceptedPaymentMethod,omitempty"` AddOn Offer `json:"addOn,omitempty"` AdvanceBookingRequirement string `json:"advanceBookingRequirement,omitempty"` AggregateRating string `json:"aggregateRating,omitempty"` Availability string `json:"availability,omitempty"` AvailabilityEnds string `json:"availabilityEnds,omitempty"` AvailabilityStarts string `json:"availabilityStarts,omitempty"` AvailableAtOrFrom Place `json:"availableAtOrFrom,omitempty"` AvailableDeliveryMethod string `json:"availableDeliveryMethod,omitempty"` BusinessFunction string `json:"businessFunction,omitempty"` Category string `json:"category,omitempty"` DeliveryLeadTime string `json:"deliveryLeadTime,omitempty"` EligibleCustomerType string `json:"eligibleCustomerType,omitempty"` EligibleDuration string `json:"eligibleDuration,omitempty"` EligibleQuantity string `json:"eligibleQuantity,omitempty"` EligibleRegion string `json:"eligibleRegion,omitempty"` EligibleTransactionVolume string `json:"eligibleTransactionVolume,omitempty"` Gtin13 string `json:"gtin13,omitempty"` Gtin14 string `json:"gtin14,omitempty"` Gtin8 string `json:"gtin8,omitempty"` IncludesObject string `json:"includesObject,omitempty"` IneligibleRegion string `json:"ineligibleRegion,omitempty"` InventoryLevel string `json:"inventoryLevel,omitempty"` ItemCondition string `json:"itemCondition,omitempty"` ItemOffered Product `json:"itemOffered"` Mpn string `json:"mpn,omitempty"` Name string `json:"name"` Price float64 `json:"price"` PriceCurrency string `json:"priceCurrency"` PriceSpecification PriceSpecification `json:"priceSpecification,omitempty"` PriceValidUntil string `json:"priceValidUntil,omitempty"` Seller Organization `json:"seller,omitempty"` SerialNumber string `json:"serialNumber,omitempty"` Sku string `json:"sku,omitempty"` ValidFrom string `json:"validFrom,omitempty"` ValidThrough string `json:"validThrough,omitempty"` } func OfferFromMap(data interface{}) Offer { b, err := json.Marshal(data) if err == nil { return OfferFromJson(bytes.NewReader(b)) } else { panic(err) } } func OfferFromJson(bytes io.Reader) Offer { var offer Offer json.NewDecoder(bytes).Decode(&offer) return offer } type OneClickAction struct { AtContext string `json:"at_context"` AtType string `json:"at_type"` PotentialAction PotentialAction `json:"potentialAction"` Description string `json:"description"` } func OneClickActionFromMap(data interface{}) OneClickAction { b, err := json.Marshal(data) if err == nil { return OneClickActionFromJson(bytes.NewReader(b)) } else { panic(err) } } func OneClickActionFromJson(bytes io.Reader) OneClickAction { var oneClickAction OneClickAction json.NewDecoder(bytes).Decode(&oneClickAction) return oneClickAction } type Order struct { BillingAddress Address `json:"billingAddress,omitempty"` Customer Customer `json:"customer"` Discount float64 `json:"discount,omitempty"` DiscountCurrency string `json:"discountCurrency,omitempty"` IsGift string `json:"isGift"` Merchant Merchant `json:"merchant"` OrderNumber string `json:"orderNumber"` PriceCurrency string `json:"priceCurrency"` PriceSpecification PriceSpecification `json:"priceSpecification,omitempty"` Price float64 `json:"price"` AcceptedOffer []Offer `json:"acceptedOffer"` Url string `json:"url"` OrderStatus string `json:"orderStatus"` PaymentMethod PaymentMethod `json:"paymentMethod"` PaymentMethodId string `json:"paymentMethodId"` OrderDate string `json:"orderDate"` } func OrderFromMap(data interface{}) Order { b, err := json.Marshal(data) if err == nil { return OrderFromJson(bytes.NewReader(b)) } else { panic(err) } } func OrderFromJson(bytes io.Reader) Order { var order Order json.NewDecoder(bytes).Decode(&order) return order } type Organization struct { Address Address `json:"address"` LegalName string `json:"legal_name"` } func OrganizationFromMap(data interface{}) Organization { b, err := json.Marshal(data) if err == nil { return OrganizationFromJson(bytes.NewReader(b)) } else { panic(err) } } func OrganizationFromJson(bytes io.Reader) Organization { var organization Organization json.NewDecoder(bytes).Decode(&organization) return organization } type PaymentMethod struct { Name string `json:"name"` } func PaymentMethodFromMap(data interface{}) PaymentMethod { b, err := json.Marshal(data) if err == nil { return PaymentMethodFromJson(bytes.NewReader(b)) } else { panic(err) } } func PaymentMethodFromJson(bytes io.Reader) PaymentMethod { var paymentMethod PaymentMethod json.NewDecoder(bytes).Decode(&paymentMethod) return paymentMethod } type Place struct { Address Address `json:"address"` Logo string `json:"logo"` Map string `json:"map"` Telephone string `json:"telephone"` } func PlaceFromMap(data interface{}) Place { b, err := json.Marshal(data) if err == nil { return PlaceFromJson(bytes.NewReader(b)) } else { panic(err) } } func PlaceFromJson(bytes io.Reader) Place { var place Place json.NewDecoder(bytes).Decode(&place) return place } type PotentialAction struct { AtType ActionTypes `json:"at_type"` Handler ActionHandler `json:"handler,omitempty"` Name string `json:"name"` Target string `json:"target"` } func PotentialActionFromMap(data interface{}) PotentialAction { b, err := json.Marshal(data) if err == nil { return PotentialActionFromJson(bytes.NewReader(b)) } else { panic(err) } } func PotentialActionFromJson(bytes io.Reader) PotentialAction { var potentialAction PotentialAction json.NewDecoder(bytes).Decode(&potentialAction) return potentialAction } type PriceSpecification struct { EligibleQuantity string `json:"eligibleQuantity"` EligibleTransactionVolume string `json:"eligibleTransactionVolume"` MaxPrice float64 `json:"maxPrice"` MinPrice float64 `json:"minPrice"` Price float64 `json:"price"` PriceCurrency string `json:"priceCurrency"` ValidFrom string `json:"validFrom"` ValidThrough string `json:"validThrough"` ValueAddedTaxIncluded string `json:"valueAddedTaxIncluded"` } func PriceSpecificationFromMap(data interface{}) PriceSpecification { b, err := json.Marshal(data) if err == nil { return PriceSpecificationFromJson(bytes.NewReader(b)) } else { panic(err) } } func PriceSpecificationFromJson(bytes io.Reader) PriceSpecification { var priceSpecification PriceSpecification json.NewDecoder(bytes).Decode(&priceSpecification) return priceSpecification } type Product struct { ProductID string `json:"productID"` Sku string `json:"sku"` Brand Organization `json:"brand,omitempty"` Manufacturer Organization `json:"manufacturer,omitempty"` Color string `json:"color,omitempty"` } func ProductFromMap(data interface{}) Product { b, err := json.Marshal(data) if err == nil { return ProductFromJson(bytes.NewReader(b)) } else { panic(err) } } func ProductFromJson(bytes io.Reader) Product { var product Product json.NewDecoder(bytes).Decode(&product) return product }