From 4405f7043c934adc820bc1a681a25b13f53ade3b Mon Sep 17 00:00:00 2001 From: Bastian Winkler Date: Mon, 27 Sep 2021 10:58:19 +0200 Subject: [PATCH] json: Use segmentio/encoding/json for unmarshaling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For maximum compatibility it's used only for unmarshaling at the moment. The existing unit tests look good, benchmarks are promising. name \ time/op bench_encoding_json.txt bench_go_json.txt bench_jsoniter.txt bench_segmentio.txt UnmarshalOrders-8 185ms ± 0% 89ms ± 0% 116ms ± 0% 97ms ± 0% name \ alloc/op bench_encoding_json.txt bench_go_json.txt bench_jsoniter.txt bench_segmentio.txt UnmarshalOrders-8 19.1MB ± 0% 30.7MB ± 0% 27.2MB ± 0% 28.3MB ± 0% name \ allocs/op bench_encoding_json.txt bench_go_json.txt bench_jsoniter.txt bench_segmentio.txt UnmarshalOrders-8 388k ± 0% 335k ± 0% 686k ± 0% 332k ± 0% Using this library for marshaling produces different results from encoding/json due tue the handling of embedded pointers. See https://github.com/segmentio/encoding/issues/63 --- code-generate/generate_types.go | 2 +- commercetools/client.go | 2 +- commercetools/client_graphql.go | 2 +- commercetools/client_test.go | 2 +- commercetools/date.go | 3 +- commercetools/types_cart.go | 136 +++++++++--------- commercetools/types_cart_discount.go | 64 +++++---- commercetools/types_category.go | 4 +- commercetools/types_channel.go | 32 +++-- commercetools/types_common.go | 8 +- commercetools/types_customer.go | 4 +- commercetools/types_customer_group.go | 4 +- commercetools/types_discount_code.go | 34 ++--- commercetools/types_error.go | 8 +- commercetools/types_extension.go | 20 +-- commercetools/types_inventory.go | 4 +- commercetools/types_me.go | 148 +++++++++---------- commercetools/types_message.go | 16 ++- commercetools/types_order.go | 8 +- commercetools/types_order_edit.go | 184 ++++++++++++------------ commercetools/types_payment.go | 52 +++---- commercetools/types_product.go | 8 +- commercetools/types_product_discount.go | 40 +++--- commercetools/types_product_type.go | 10 +- commercetools/types_project.go | 8 +- commercetools/types_review.go | 30 ++-- commercetools/types_shipping_method.go | 8 +- commercetools/types_shopping_list.go | 4 +- commercetools/types_state.go | 4 +- commercetools/types_store.go | 4 +- commercetools/types_subscription.go | 10 +- commercetools/types_tax_category.go | 4 +- commercetools/types_type.go | 8 +- commercetools/types_zone.go | 4 +- go.mod | 1 + go.sum | 6 + 36 files changed, 476 insertions(+), 410 deletions(-) diff --git a/code-generate/generate_types.go b/code-generate/generate_types.go index 9a3d6ac3..0257ad4d 100644 --- a/code-generate/generate_types.go +++ b/code-generate/generate_types.go @@ -271,7 +271,7 @@ func generateStructUnmarshalJSON(object *RamlType, discriminatedAttributes []*Ra c = c.Block( jen.Type().Id("Alias").Id(object.CodeName), jen.If( - jen.Err().Op(":=").Qual("encoding/json", "Unmarshal").Call( + jen.Err().Op(":=").Qual("github.com/segmentio/encoding/json", "Unmarshal").Call( jen.Id("data"), jen.Parens(jen.Op("*").Id("Alias")).Parens(jen.Id("obj")), ), diff --git a/commercetools/client.go b/commercetools/client.go index 9cf2d6ce..e26c1127 100644 --- a/commercetools/client.go +++ b/commercetools/client.go @@ -3,7 +3,6 @@ package commercetools import ( "bytes" "context" - "encoding/json" "fmt" "io" "io/ioutil" @@ -15,6 +14,7 @@ import ( "github.com/opentracing-contrib/go-stdlib/nethttp" "github.com/opentracing/opentracing-go" "github.com/pkg/errors" + "github.com/segmentio/encoding/json" "golang.org/x/oauth2" "golang.org/x/oauth2/clientcredentials" ) diff --git a/commercetools/client_graphql.go b/commercetools/client_graphql.go index ef8e5920..0fe7f348 100644 --- a/commercetools/client_graphql.go +++ b/commercetools/client_graphql.go @@ -3,13 +3,13 @@ package commercetools import ( "bytes" "context" - "encoding/json" "fmt" "io/ioutil" "net/http" mapstructure "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/segmentio/encoding/json" ) type GraphQLQuery struct { diff --git a/commercetools/client_test.go b/commercetools/client_test.go index 693ca7d5..77c733de 100644 --- a/commercetools/client_test.go +++ b/commercetools/client_test.go @@ -26,7 +26,7 @@ func TestClientGetBadRequestJson(t *testing.T) { defer server.Close() _, err := client.ProductGetWithID(context.TODO(), "fake-id") - assert.Equal(t, "invalid character ',' looking for beginning of value", err.Error()) + assert.Equal(t, "json: invalid character ',' looking for beginning of value: ,", err.Error()) assert.IsType(t, commercetools.ErrorResponse{}, err) } diff --git a/commercetools/date.go b/commercetools/date.go index 9c40a099..29fbd707 100644 --- a/commercetools/date.go +++ b/commercetools/date.go @@ -1,10 +1,11 @@ package commercetools import ( - "encoding/json" "fmt" "strconv" "time" + + "github.com/segmentio/encoding/json" ) // Date holds date information for Commercetools API format diff --git a/commercetools/types_cart.go b/commercetools/types_cart.go index 925895bc..1828374f 100644 --- a/commercetools/types_cart.go +++ b/commercetools/types_cart.go @@ -3,9 +3,11 @@ package commercetools import ( - "encoding/json" + json1 "encoding/json" "errors" "time" + + json "github.com/segmentio/encoding/json" ) // CartOrigin is an enum type @@ -702,7 +704,7 @@ type CartAddCustomLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj CartAddCustomLineItemAction) MarshalJSON() ([]byte, error) { type Alias CartAddCustomLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addCustomLineItem", Alias: (*Alias)(&obj)}) @@ -716,7 +718,7 @@ type CartAddDiscountCodeAction struct { // MarshalJSON override to set the discriminator value func (obj CartAddDiscountCodeAction) MarshalJSON() ([]byte, error) { type Alias CartAddDiscountCodeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addDiscountCode", Alias: (*Alias)(&obj)}) @@ -730,7 +732,7 @@ type CartAddItemShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj CartAddItemShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias CartAddItemShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addItemShippingAddress", Alias: (*Alias)(&obj)}) @@ -754,7 +756,7 @@ type CartAddLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj CartAddLineItemAction) MarshalJSON() ([]byte, error) { type Alias CartAddLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addLineItem", Alias: (*Alias)(&obj)}) @@ -768,7 +770,7 @@ type CartAddPaymentAction struct { // MarshalJSON override to set the discriminator value func (obj CartAddPaymentAction) MarshalJSON() ([]byte, error) { type Alias CartAddPaymentAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addPayment", Alias: (*Alias)(&obj)}) @@ -784,7 +786,7 @@ type CartAddShoppingListAction struct { // MarshalJSON override to set the discriminator value func (obj CartAddShoppingListAction) MarshalJSON() ([]byte, error) { type Alias CartAddShoppingListAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addShoppingList", Alias: (*Alias)(&obj)}) @@ -799,7 +801,7 @@ type CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction struct { // MarshalJSON override to set the discriminator value func (obj CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction) MarshalJSON() ([]byte, error) { type Alias CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "applyDeltaToCustomLineItemShippingDetailsTargets", Alias: (*Alias)(&obj)}) @@ -814,7 +816,7 @@ type CartApplyDeltaToLineItemShippingDetailsTargetsAction struct { // MarshalJSON override to set the discriminator value func (obj CartApplyDeltaToLineItemShippingDetailsTargetsAction) MarshalJSON() ([]byte, error) { type Alias CartApplyDeltaToLineItemShippingDetailsTargetsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "applyDeltaToLineItemShippingDetailsTargets", Alias: (*Alias)(&obj)}) @@ -829,7 +831,7 @@ type CartChangeCustomLineItemMoneyAction struct { // MarshalJSON override to set the discriminator value func (obj CartChangeCustomLineItemMoneyAction) MarshalJSON() ([]byte, error) { type Alias CartChangeCustomLineItemMoneyAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeCustomLineItemMoney", Alias: (*Alias)(&obj)}) @@ -844,7 +846,7 @@ type CartChangeCustomLineItemQuantityAction struct { // MarshalJSON override to set the discriminator value func (obj CartChangeCustomLineItemQuantityAction) MarshalJSON() ([]byte, error) { type Alias CartChangeCustomLineItemQuantityAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeCustomLineItemQuantity", Alias: (*Alias)(&obj)}) @@ -861,7 +863,7 @@ type CartChangeLineItemQuantityAction struct { // MarshalJSON override to set the discriminator value func (obj CartChangeLineItemQuantityAction) MarshalJSON() ([]byte, error) { type Alias CartChangeLineItemQuantityAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeLineItemQuantity", Alias: (*Alias)(&obj)}) @@ -875,7 +877,7 @@ type CartChangeTaxCalculationModeAction struct { // MarshalJSON override to set the discriminator value func (obj CartChangeTaxCalculationModeAction) MarshalJSON() ([]byte, error) { type Alias CartChangeTaxCalculationModeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTaxCalculationMode", Alias: (*Alias)(&obj)}) @@ -889,7 +891,7 @@ type CartChangeTaxModeAction struct { // MarshalJSON override to set the discriminator value func (obj CartChangeTaxModeAction) MarshalJSON() ([]byte, error) { type Alias CartChangeTaxModeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTaxMode", Alias: (*Alias)(&obj)}) @@ -903,7 +905,7 @@ type CartChangeTaxRoundingModeAction struct { // MarshalJSON override to set the discriminator value func (obj CartChangeTaxRoundingModeAction) MarshalJSON() ([]byte, error) { type Alias CartChangeTaxRoundingModeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTaxRoundingMode", Alias: (*Alias)(&obj)}) @@ -973,7 +975,7 @@ type CartRecalculateAction struct { // MarshalJSON override to set the discriminator value func (obj CartRecalculateAction) MarshalJSON() ([]byte, error) { type Alias CartRecalculateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "recalculate", Alias: (*Alias)(&obj)}) @@ -988,7 +990,7 @@ type CartReference struct { // MarshalJSON override to set the discriminator value func (obj CartReference) MarshalJSON() ([]byte, error) { type Alias CartReference - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "cart", Alias: (*Alias)(&obj)}) @@ -1002,7 +1004,7 @@ type CartRemoveCustomLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj CartRemoveCustomLineItemAction) MarshalJSON() ([]byte, error) { type Alias CartRemoveCustomLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeCustomLineItem", Alias: (*Alias)(&obj)}) @@ -1016,7 +1018,7 @@ type CartRemoveDiscountCodeAction struct { // MarshalJSON override to set the discriminator value func (obj CartRemoveDiscountCodeAction) MarshalJSON() ([]byte, error) { type Alias CartRemoveDiscountCodeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeDiscountCode", Alias: (*Alias)(&obj)}) @@ -1030,7 +1032,7 @@ type CartRemoveItemShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj CartRemoveItemShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias CartRemoveItemShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeItemShippingAddress", Alias: (*Alias)(&obj)}) @@ -1048,7 +1050,7 @@ type CartRemoveLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj CartRemoveLineItemAction) MarshalJSON() ([]byte, error) { type Alias CartRemoveLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeLineItem", Alias: (*Alias)(&obj)}) @@ -1062,7 +1064,7 @@ type CartRemovePaymentAction struct { // MarshalJSON override to set the discriminator value func (obj CartRemovePaymentAction) MarshalJSON() ([]byte, error) { type Alias CartRemovePaymentAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removePayment", Alias: (*Alias)(&obj)}) @@ -1077,7 +1079,7 @@ type CartResourceIdentifier struct { // MarshalJSON override to set the discriminator value func (obj CartResourceIdentifier) MarshalJSON() ([]byte, error) { type Alias CartResourceIdentifier - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "cart", Alias: (*Alias)(&obj)}) @@ -1091,7 +1093,7 @@ type CartSetAnonymousIDAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetAnonymousIDAction) MarshalJSON() ([]byte, error) { type Alias CartSetAnonymousIDAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setAnonymousId", Alias: (*Alias)(&obj)}) @@ -1105,7 +1107,7 @@ type CartSetBillingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetBillingAddressAction) MarshalJSON() ([]byte, error) { type Alias CartSetBillingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setBillingAddress", Alias: (*Alias)(&obj)}) @@ -1120,7 +1122,7 @@ type CartSetBillingAddressCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetBillingAddressCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias CartSetBillingAddressCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setBillingAddressCustomField", Alias: (*Alias)(&obj)}) @@ -1135,7 +1137,7 @@ type CartSetBillingAddressCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetBillingAddressCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias CartSetBillingAddressCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setBillingAddressCustomType", Alias: (*Alias)(&obj)}) @@ -1150,7 +1152,7 @@ type CartSetCartTotalTaxAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCartTotalTaxAction) MarshalJSON() ([]byte, error) { type Alias CartSetCartTotalTaxAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCartTotalTax", Alias: (*Alias)(&obj)}) @@ -1164,7 +1166,7 @@ type CartSetCountryAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCountryAction) MarshalJSON() ([]byte, error) { type Alias CartSetCountryAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCountry", Alias: (*Alias)(&obj)}) @@ -1179,7 +1181,7 @@ type CartSetCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias CartSetCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomField", Alias: (*Alias)(&obj)}) @@ -1195,7 +1197,7 @@ type CartSetCustomLineItemCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCustomLineItemCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias CartSetCustomLineItemCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomLineItemCustomField", Alias: (*Alias)(&obj)}) @@ -1211,7 +1213,7 @@ type CartSetCustomLineItemCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCustomLineItemCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias CartSetCustomLineItemCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomLineItemCustomType", Alias: (*Alias)(&obj)}) @@ -1226,7 +1228,7 @@ type CartSetCustomLineItemShippingDetailsAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCustomLineItemShippingDetailsAction) MarshalJSON() ([]byte, error) { type Alias CartSetCustomLineItemShippingDetailsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomLineItemShippingDetails", Alias: (*Alias)(&obj)}) @@ -1241,7 +1243,7 @@ type CartSetCustomLineItemTaxAmountAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCustomLineItemTaxAmountAction) MarshalJSON() ([]byte, error) { type Alias CartSetCustomLineItemTaxAmountAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomLineItemTaxAmount", Alias: (*Alias)(&obj)}) @@ -1256,7 +1258,7 @@ type CartSetCustomLineItemTaxRateAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCustomLineItemTaxRateAction) MarshalJSON() ([]byte, error) { type Alias CartSetCustomLineItemTaxRateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomLineItemTaxRate", Alias: (*Alias)(&obj)}) @@ -1273,7 +1275,7 @@ type CartSetCustomShippingMethodAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCustomShippingMethodAction) MarshalJSON() ([]byte, error) { type Alias CartSetCustomShippingMethodAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomShippingMethod", Alias: (*Alias)(&obj)}) @@ -1288,7 +1290,7 @@ type CartSetCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias CartSetCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomType", Alias: (*Alias)(&obj)}) @@ -1302,7 +1304,7 @@ type CartSetCustomerEmailAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCustomerEmailAction) MarshalJSON() ([]byte, error) { type Alias CartSetCustomerEmailAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomerEmail", Alias: (*Alias)(&obj)}) @@ -1316,7 +1318,7 @@ type CartSetCustomerGroupAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCustomerGroupAction) MarshalJSON() ([]byte, error) { type Alias CartSetCustomerGroupAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomerGroup", Alias: (*Alias)(&obj)}) @@ -1330,7 +1332,7 @@ type CartSetCustomerIDAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetCustomerIDAction) MarshalJSON() ([]byte, error) { type Alias CartSetCustomerIDAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomerId", Alias: (*Alias)(&obj)}) @@ -1344,7 +1346,7 @@ type CartSetDeleteDaysAfterLastModificationAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetDeleteDaysAfterLastModificationAction) MarshalJSON() ([]byte, error) { type Alias CartSetDeleteDaysAfterLastModificationAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDeleteDaysAfterLastModification", Alias: (*Alias)(&obj)}) @@ -1360,7 +1362,7 @@ type CartSetDeliveryAddressCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetDeliveryAddressCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias CartSetDeliveryAddressCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDeliveryAddressCustomField", Alias: (*Alias)(&obj)}) @@ -1376,7 +1378,7 @@ type CartSetDeliveryAddressCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetDeliveryAddressCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias CartSetDeliveryAddressCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDeliveryAddressCustomType", Alias: (*Alias)(&obj)}) @@ -1392,7 +1394,7 @@ type CartSetItemShippingAddressCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetItemShippingAddressCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias CartSetItemShippingAddressCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setItemShippingAddressCustomField", Alias: (*Alias)(&obj)}) @@ -1408,7 +1410,7 @@ type CartSetItemShippingAddressCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetItemShippingAddressCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias CartSetItemShippingAddressCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setItemShippingAddressCustomType", Alias: (*Alias)(&obj)}) @@ -1422,7 +1424,7 @@ type CartSetKeyAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetKeyAction) MarshalJSON() ([]byte, error) { type Alias CartSetKeyAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setKey", Alias: (*Alias)(&obj)}) @@ -1438,7 +1440,7 @@ type CartSetLineItemCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetLineItemCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias CartSetLineItemCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemCustomField", Alias: (*Alias)(&obj)}) @@ -1454,7 +1456,7 @@ type CartSetLineItemCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetLineItemCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias CartSetLineItemCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemCustomType", Alias: (*Alias)(&obj)}) @@ -1469,7 +1471,7 @@ type CartSetLineItemDistributionChannelAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetLineItemDistributionChannelAction) MarshalJSON() ([]byte, error) { type Alias CartSetLineItemDistributionChannelAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemDistributionChannel", Alias: (*Alias)(&obj)}) @@ -1484,7 +1486,7 @@ type CartSetLineItemPriceAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetLineItemPriceAction) MarshalJSON() ([]byte, error) { type Alias CartSetLineItemPriceAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemPrice", Alias: (*Alias)(&obj)}) @@ -1499,7 +1501,7 @@ type CartSetLineItemShippingDetailsAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetLineItemShippingDetailsAction) MarshalJSON() ([]byte, error) { type Alias CartSetLineItemShippingDetailsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemShippingDetails", Alias: (*Alias)(&obj)}) @@ -1514,7 +1516,7 @@ type CartSetLineItemTaxAmountAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetLineItemTaxAmountAction) MarshalJSON() ([]byte, error) { type Alias CartSetLineItemTaxAmountAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemTaxAmount", Alias: (*Alias)(&obj)}) @@ -1529,7 +1531,7 @@ type CartSetLineItemTaxRateAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetLineItemTaxRateAction) MarshalJSON() ([]byte, error) { type Alias CartSetLineItemTaxRateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemTaxRate", Alias: (*Alias)(&obj)}) @@ -1544,7 +1546,7 @@ type CartSetLineItemTotalPriceAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetLineItemTotalPriceAction) MarshalJSON() ([]byte, error) { type Alias CartSetLineItemTotalPriceAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemTotalPrice", Alias: (*Alias)(&obj)}) @@ -1558,7 +1560,7 @@ type CartSetLocaleAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetLocaleAction) MarshalJSON() ([]byte, error) { type Alias CartSetLocaleAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLocale", Alias: (*Alias)(&obj)}) @@ -1572,7 +1574,7 @@ type CartSetShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias CartSetShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingAddress", Alias: (*Alias)(&obj)}) @@ -1587,7 +1589,7 @@ type CartSetShippingAddressCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetShippingAddressCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias CartSetShippingAddressCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingAddressCustomField", Alias: (*Alias)(&obj)}) @@ -1602,7 +1604,7 @@ type CartSetShippingAddressCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetShippingAddressCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias CartSetShippingAddressCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingAddressCustomType", Alias: (*Alias)(&obj)}) @@ -1617,7 +1619,7 @@ type CartSetShippingMethodAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetShippingMethodAction) MarshalJSON() ([]byte, error) { type Alias CartSetShippingMethodAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingMethod", Alias: (*Alias)(&obj)}) @@ -1631,7 +1633,7 @@ type CartSetShippingMethodTaxAmountAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetShippingMethodTaxAmountAction) MarshalJSON() ([]byte, error) { type Alias CartSetShippingMethodTaxAmountAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingMethodTaxAmount", Alias: (*Alias)(&obj)}) @@ -1645,7 +1647,7 @@ type CartSetShippingMethodTaxRateAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetShippingMethodTaxRateAction) MarshalJSON() ([]byte, error) { type Alias CartSetShippingMethodTaxRateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingMethodTaxRate", Alias: (*Alias)(&obj)}) @@ -1659,7 +1661,7 @@ type CartSetShippingRateInputAction struct { // MarshalJSON override to set the discriminator value func (obj CartSetShippingRateInputAction) MarshalJSON() ([]byte, error) { type Alias CartSetShippingRateInputAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingRateInput", Alias: (*Alias)(&obj)}) @@ -1715,7 +1717,7 @@ type CartUpdateItemShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj CartUpdateItemShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias CartUpdateItemShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "updateItemShippingAddress", Alias: (*Alias)(&obj)}) @@ -1730,7 +1732,7 @@ type ClassificationShippingRateInput struct { // MarshalJSON override to set the discriminator value func (obj ClassificationShippingRateInput) MarshalJSON() ([]byte, error) { type Alias ClassificationShippingRateInput - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "Classification", Alias: (*Alias)(&obj)}) @@ -1744,7 +1746,7 @@ type ClassificationShippingRateInputDraft struct { // MarshalJSON override to set the discriminator value func (obj ClassificationShippingRateInputDraft) MarshalJSON() ([]byte, error) { type Alias ClassificationShippingRateInputDraft - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "Classification", Alias: (*Alias)(&obj)}) @@ -2007,7 +2009,7 @@ type ScoreShippingRateInput struct { // MarshalJSON override to set the discriminator value func (obj ScoreShippingRateInput) MarshalJSON() ([]byte, error) { type Alias ScoreShippingRateInput - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "Score", Alias: (*Alias)(&obj)}) @@ -2021,7 +2023,7 @@ type ScoreShippingRateInputDraft struct { // MarshalJSON override to set the discriminator value func (obj ScoreShippingRateInputDraft) MarshalJSON() ([]byte, error) { type Alias ScoreShippingRateInputDraft - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "Score", Alias: (*Alias)(&obj)}) diff --git a/commercetools/types_cart_discount.go b/commercetools/types_cart_discount.go index deb8c745..dd265717 100644 --- a/commercetools/types_cart_discount.go +++ b/commercetools/types_cart_discount.go @@ -3,9 +3,11 @@ package commercetools import ( - "encoding/json" + json1 "encoding/json" "errors" "time" + + json "github.com/segmentio/encoding/json" ) // SelectionMode is an enum type @@ -376,7 +378,7 @@ type CartDiscountChangeCartPredicateAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountChangeCartPredicateAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountChangeCartPredicateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeCartPredicate", Alias: (*Alias)(&obj)}) @@ -390,7 +392,7 @@ type CartDiscountChangeIsActiveAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountChangeIsActiveAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountChangeIsActiveAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeIsActive", Alias: (*Alias)(&obj)}) @@ -404,7 +406,7 @@ type CartDiscountChangeNameAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountChangeNameAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountChangeNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeName", Alias: (*Alias)(&obj)}) @@ -418,7 +420,7 @@ type CartDiscountChangeRequiresDiscountCodeAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountChangeRequiresDiscountCodeAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountChangeRequiresDiscountCodeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeRequiresDiscountCode", Alias: (*Alias)(&obj)}) @@ -432,7 +434,7 @@ type CartDiscountChangeSortOrderAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountChangeSortOrderAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountChangeSortOrderAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeSortOrder", Alias: (*Alias)(&obj)}) @@ -446,7 +448,7 @@ type CartDiscountChangeStackingModeAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountChangeStackingModeAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountChangeStackingModeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeStackingMode", Alias: (*Alias)(&obj)}) @@ -460,7 +462,7 @@ type CartDiscountChangeTargetAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountChangeTargetAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountChangeTargetAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTarget", Alias: (*Alias)(&obj)}) @@ -492,7 +494,7 @@ type CartDiscountChangeValueAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountChangeValueAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountChangeValueAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeValue", Alias: (*Alias)(&obj)}) @@ -524,7 +526,7 @@ type CartDiscountCustomLineItemsTarget struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountCustomLineItemsTarget) MarshalJSON() ([]byte, error) { type Alias CartDiscountCustomLineItemsTarget - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "customLineItems", Alias: (*Alias)(&obj)}) @@ -580,7 +582,7 @@ type CartDiscountLineItemsTarget struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountLineItemsTarget) MarshalJSON() ([]byte, error) { type Alias CartDiscountLineItemsTarget - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "lineItems", Alias: (*Alias)(&obj)}) @@ -604,7 +606,7 @@ type CartDiscountReference struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountReference) MarshalJSON() ([]byte, error) { type Alias CartDiscountReference - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "cart-discount", Alias: (*Alias)(&obj)}) @@ -619,7 +621,7 @@ type CartDiscountResourceIdentifier struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountResourceIdentifier) MarshalJSON() ([]byte, error) { type Alias CartDiscountResourceIdentifier - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "cart-discount", Alias: (*Alias)(&obj)}) @@ -634,7 +636,7 @@ type CartDiscountSetCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountSetCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountSetCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomField", Alias: (*Alias)(&obj)}) @@ -649,7 +651,7 @@ type CartDiscountSetCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountSetCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountSetCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomType", Alias: (*Alias)(&obj)}) @@ -663,7 +665,7 @@ type CartDiscountSetDescriptionAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountSetDescriptionAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountSetDescriptionAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDescription", Alias: (*Alias)(&obj)}) @@ -677,7 +679,7 @@ type CartDiscountSetKeyAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountSetKeyAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountSetKeyAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setKey", Alias: (*Alias)(&obj)}) @@ -691,7 +693,7 @@ type CartDiscountSetValidFromAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountSetValidFromAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountSetValidFromAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setValidFrom", Alias: (*Alias)(&obj)}) @@ -706,7 +708,7 @@ type CartDiscountSetValidFromAndUntilAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountSetValidFromAndUntilAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountSetValidFromAndUntilAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setValidFromAndUntil", Alias: (*Alias)(&obj)}) @@ -720,7 +722,7 @@ type CartDiscountSetValidUntilAction struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountSetValidUntilAction) MarshalJSON() ([]byte, error) { type Alias CartDiscountSetValidUntilAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setValidUntil", Alias: (*Alias)(&obj)}) @@ -732,7 +734,7 @@ type CartDiscountShippingCostTarget struct{} // MarshalJSON override to set the discriminator value func (obj CartDiscountShippingCostTarget) MarshalJSON() ([]byte, error) { type Alias CartDiscountShippingCostTarget - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "shipping", Alias: (*Alias)(&obj)}) @@ -770,7 +772,7 @@ type CartDiscountValueAbsolute struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountValueAbsolute) MarshalJSON() ([]byte, error) { type Alias CartDiscountValueAbsolute - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "absolute", Alias: (*Alias)(&obj)}) @@ -802,7 +804,7 @@ type CartDiscountValueAbsoluteDraft struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountValueAbsoluteDraft) MarshalJSON() ([]byte, error) { type Alias CartDiscountValueAbsoluteDraft - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "absolute", Alias: (*Alias)(&obj)}) @@ -816,7 +818,7 @@ type CartDiscountValueFixed struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountValueFixed) MarshalJSON() ([]byte, error) { type Alias CartDiscountValueFixed - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "fixed", Alias: (*Alias)(&obj)}) @@ -848,7 +850,7 @@ type CartDiscountValueFixedDraft struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountValueFixedDraft) MarshalJSON() ([]byte, error) { type Alias CartDiscountValueFixedDraft - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "fixed", Alias: (*Alias)(&obj)}) @@ -865,7 +867,7 @@ type CartDiscountValueGiftLineItem struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountValueGiftLineItem) MarshalJSON() ([]byte, error) { type Alias CartDiscountValueGiftLineItem - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "giftLineItem", Alias: (*Alias)(&obj)}) @@ -882,7 +884,7 @@ type CartDiscountValueGiftLineItemDraft struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountValueGiftLineItemDraft) MarshalJSON() ([]byte, error) { type Alias CartDiscountValueGiftLineItemDraft - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "giftLineItem", Alias: (*Alias)(&obj)}) @@ -896,7 +898,7 @@ type CartDiscountValueRelative struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountValueRelative) MarshalJSON() ([]byte, error) { type Alias CartDiscountValueRelative - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "relative", Alias: (*Alias)(&obj)}) @@ -910,7 +912,7 @@ type CartDiscountValueRelativeDraft struct { // MarshalJSON override to set the discriminator value func (obj CartDiscountValueRelativeDraft) MarshalJSON() ([]byte, error) { type Alias CartDiscountValueRelativeDraft - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "relative", Alias: (*Alias)(&obj)}) @@ -928,7 +930,7 @@ type MultiBuyCustomLineItemsTarget struct { // MarshalJSON override to set the discriminator value func (obj MultiBuyCustomLineItemsTarget) MarshalJSON() ([]byte, error) { type Alias MultiBuyCustomLineItemsTarget - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "multiBuyCustomLineItems", Alias: (*Alias)(&obj)}) @@ -946,7 +948,7 @@ type MultiBuyLineItemsTarget struct { // MarshalJSON override to set the discriminator value func (obj MultiBuyLineItemsTarget) MarshalJSON() ([]byte, error) { type Alias MultiBuyLineItemsTarget - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "multiBuyLineItems", Alias: (*Alias)(&obj)}) diff --git a/commercetools/types_category.go b/commercetools/types_category.go index a192b00b..d370678a 100644 --- a/commercetools/types_category.go +++ b/commercetools/types_category.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // CategoryUpdateAction uses action as discriminator attribute @@ -595,7 +597,7 @@ type CategoryUpdate struct { // on the discriminator value func (obj *CategoryUpdate) UnmarshalJSON(data []byte) error { type Alias CategoryUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/commercetools/types_channel.go b/commercetools/types_channel.go index 2c8ffb1e..377d671d 100644 --- a/commercetools/types_channel.go +++ b/commercetools/types_channel.go @@ -3,9 +3,11 @@ package commercetools import ( - "encoding/json" + json1 "encoding/json" "errors" "time" + + json "github.com/segmentio/encoding/json" ) // ChannelRoleEnum is an enum type @@ -172,7 +174,7 @@ type ChannelAddRolesAction struct { // MarshalJSON override to set the discriminator value func (obj ChannelAddRolesAction) MarshalJSON() ([]byte, error) { type Alias ChannelAddRolesAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addRoles", Alias: (*Alias)(&obj)}) @@ -186,7 +188,7 @@ type ChannelChangeDescriptionAction struct { // MarshalJSON override to set the discriminator value func (obj ChannelChangeDescriptionAction) MarshalJSON() ([]byte, error) { type Alias ChannelChangeDescriptionAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeDescription", Alias: (*Alias)(&obj)}) @@ -200,7 +202,7 @@ type ChannelChangeKeyAction struct { // MarshalJSON override to set the discriminator value func (obj ChannelChangeKeyAction) MarshalJSON() ([]byte, error) { type Alias ChannelChangeKeyAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeKey", Alias: (*Alias)(&obj)}) @@ -214,7 +216,7 @@ type ChannelChangeNameAction struct { // MarshalJSON override to set the discriminator value func (obj ChannelChangeNameAction) MarshalJSON() ([]byte, error) { type Alias ChannelChangeNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeName", Alias: (*Alias)(&obj)}) @@ -267,7 +269,7 @@ type ChannelReference struct { // MarshalJSON override to set the discriminator value func (obj ChannelReference) MarshalJSON() ([]byte, error) { type Alias ChannelReference - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "channel", Alias: (*Alias)(&obj)}) @@ -281,7 +283,7 @@ type ChannelRemoveRolesAction struct { // MarshalJSON override to set the discriminator value func (obj ChannelRemoveRolesAction) MarshalJSON() ([]byte, error) { type Alias ChannelRemoveRolesAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeRoles", Alias: (*Alias)(&obj)}) @@ -296,7 +298,7 @@ type ChannelResourceIdentifier struct { // MarshalJSON override to set the discriminator value func (obj ChannelResourceIdentifier) MarshalJSON() ([]byte, error) { type Alias ChannelResourceIdentifier - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "channel", Alias: (*Alias)(&obj)}) @@ -310,7 +312,7 @@ type ChannelSetAddressAction struct { // MarshalJSON override to set the discriminator value func (obj ChannelSetAddressAction) MarshalJSON() ([]byte, error) { type Alias ChannelSetAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setAddress", Alias: (*Alias)(&obj)}) @@ -325,7 +327,7 @@ type ChannelSetAddressCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj ChannelSetAddressCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias ChannelSetAddressCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setAddressCustomField", Alias: (*Alias)(&obj)}) @@ -340,7 +342,7 @@ type ChannelSetAddressCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj ChannelSetAddressCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias ChannelSetAddressCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setAddressCustomType", Alias: (*Alias)(&obj)}) @@ -355,7 +357,7 @@ type ChannelSetCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj ChannelSetCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias ChannelSetCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomField", Alias: (*Alias)(&obj)}) @@ -370,7 +372,7 @@ type ChannelSetCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj ChannelSetCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias ChannelSetCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomType", Alias: (*Alias)(&obj)}) @@ -384,7 +386,7 @@ type ChannelSetGeoLocationAction struct { // MarshalJSON override to set the discriminator value func (obj ChannelSetGeoLocationAction) MarshalJSON() ([]byte, error) { type Alias ChannelSetGeoLocationAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setGeoLocation", Alias: (*Alias)(&obj)}) @@ -416,7 +418,7 @@ type ChannelSetRolesAction struct { // MarshalJSON override to set the discriminator value func (obj ChannelSetRolesAction) MarshalJSON() ([]byte, error) { type Alias ChannelSetRolesAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setRoles", Alias: (*Alias)(&obj)}) diff --git a/commercetools/types_common.go b/commercetools/types_common.go index b407cdb3..7cf86a4e 100644 --- a/commercetools/types_common.go +++ b/commercetools/types_common.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // MoneyType is an enum type @@ -758,7 +760,7 @@ type Price struct { // on the discriminator value func (obj *Price) UnmarshalJSON(data []byte) error { type Alias Price - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.Value != nil { @@ -795,7 +797,7 @@ type PriceTier struct { // on the discriminator value func (obj *PriceTier) UnmarshalJSON(data []byte) error { type Alias PriceTier - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.Value != nil { @@ -847,7 +849,7 @@ type ScopedPrice struct { // on the discriminator value func (obj *ScopedPrice) UnmarshalJSON(data []byte) error { type Alias ScopedPrice - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.CurrentValue != nil { diff --git a/commercetools/types_customer.go b/commercetools/types_customer.go index e150710a..4b4c8212 100644 --- a/commercetools/types_customer.go +++ b/commercetools/types_customer.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // AnonymousCartSignInMode is an enum type @@ -853,7 +855,7 @@ type CustomerUpdate struct { // on the discriminator value func (obj *CustomerUpdate) UnmarshalJSON(data []byte) error { type Alias CustomerUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/commercetools/types_customer_group.go b/commercetools/types_customer_group.go index 47d628d1..ed8c7cba 100644 --- a/commercetools/types_customer_group.go +++ b/commercetools/types_customer_group.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // CustomerGroupUpdateAction uses action as discriminator attribute @@ -181,7 +183,7 @@ type CustomerGroupUpdate struct { // on the discriminator value func (obj *CustomerGroupUpdate) UnmarshalJSON(data []byte) error { type Alias CustomerGroupUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/commercetools/types_discount_code.go b/commercetools/types_discount_code.go index cfa08e85..f733f732 100644 --- a/commercetools/types_discount_code.go +++ b/commercetools/types_discount_code.go @@ -3,9 +3,11 @@ package commercetools import ( - "encoding/json" + json1 "encoding/json" "errors" "time" + + json "github.com/segmentio/encoding/json" ) // DiscountCodeUpdateAction uses action as discriminator attribute @@ -166,7 +168,7 @@ type DiscountCodeChangeCartDiscountsAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeChangeCartDiscountsAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeChangeCartDiscountsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeCartDiscounts", Alias: (*Alias)(&obj)}) @@ -180,7 +182,7 @@ type DiscountCodeChangeGroupsAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeChangeGroupsAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeChangeGroupsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeGroups", Alias: (*Alias)(&obj)}) @@ -194,7 +196,7 @@ type DiscountCodeChangeIsActiveAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeChangeIsActiveAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeChangeIsActiveAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeIsActive", Alias: (*Alias)(&obj)}) @@ -234,7 +236,7 @@ type DiscountCodeReference struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeReference) MarshalJSON() ([]byte, error) { type Alias DiscountCodeReference - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "discount-code", Alias: (*Alias)(&obj)}) @@ -249,7 +251,7 @@ type DiscountCodeResourceIdentifier struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeResourceIdentifier) MarshalJSON() ([]byte, error) { type Alias DiscountCodeResourceIdentifier - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "discount-code", Alias: (*Alias)(&obj)}) @@ -263,7 +265,7 @@ type DiscountCodeSetCartPredicateAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeSetCartPredicateAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeSetCartPredicateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCartPredicate", Alias: (*Alias)(&obj)}) @@ -278,7 +280,7 @@ type DiscountCodeSetCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeSetCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeSetCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomField", Alias: (*Alias)(&obj)}) @@ -293,7 +295,7 @@ type DiscountCodeSetCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeSetCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeSetCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomType", Alias: (*Alias)(&obj)}) @@ -307,7 +309,7 @@ type DiscountCodeSetDescriptionAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeSetDescriptionAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeSetDescriptionAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDescription", Alias: (*Alias)(&obj)}) @@ -321,7 +323,7 @@ type DiscountCodeSetMaxApplicationsAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeSetMaxApplicationsAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeSetMaxApplicationsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setMaxApplications", Alias: (*Alias)(&obj)}) @@ -335,7 +337,7 @@ type DiscountCodeSetMaxApplicationsPerCustomerAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeSetMaxApplicationsPerCustomerAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeSetMaxApplicationsPerCustomerAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setMaxApplicationsPerCustomer", Alias: (*Alias)(&obj)}) @@ -349,7 +351,7 @@ type DiscountCodeSetNameAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeSetNameAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeSetNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setName", Alias: (*Alias)(&obj)}) @@ -363,7 +365,7 @@ type DiscountCodeSetValidFromAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeSetValidFromAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeSetValidFromAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setValidFrom", Alias: (*Alias)(&obj)}) @@ -378,7 +380,7 @@ type DiscountCodeSetValidFromAndUntilAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeSetValidFromAndUntilAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeSetValidFromAndUntilAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setValidFromAndUntil", Alias: (*Alias)(&obj)}) @@ -392,7 +394,7 @@ type DiscountCodeSetValidUntilAction struct { // MarshalJSON override to set the discriminator value func (obj DiscountCodeSetValidUntilAction) MarshalJSON() ([]byte, error) { type Alias DiscountCodeSetValidUntilAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setValidUntil", Alias: (*Alias)(&obj)}) diff --git a/commercetools/types_error.go b/commercetools/types_error.go index 6469793d..d6320b68 100644 --- a/commercetools/types_error.go +++ b/commercetools/types_error.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // ErrorObject uses code as discriminator attribute @@ -704,7 +706,7 @@ func (obj DuplicateFieldError) MarshalJSON() ([]byte, error) { // on the discriminator value func (obj *DuplicateFieldError) UnmarshalJSON(data []byte) error { type Alias DuplicateFieldError - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.ConflictingResource != nil { @@ -743,7 +745,7 @@ func (obj DuplicateFieldWithConflictingResourceError) MarshalJSON() ([]byte, err // on the discriminator value func (obj *DuplicateFieldWithConflictingResourceError) UnmarshalJSON(data []byte) error { type Alias DuplicateFieldWithConflictingResourceError - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.ConflictingResource != nil { @@ -913,7 +915,7 @@ type ErrorResponse struct { // on the discriminator value func (obj *ErrorResponse) UnmarshalJSON(data []byte) error { type Alias ErrorResponse - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Errors { diff --git a/commercetools/types_extension.go b/commercetools/types_extension.go index ec05ea45..a32e261c 100644 --- a/commercetools/types_extension.go +++ b/commercetools/types_extension.go @@ -3,9 +3,11 @@ package commercetools import ( - "encoding/json" + json1 "encoding/json" "errors" "time" + + json "github.com/segmentio/encoding/json" ) // ExtensionAction is an enum type @@ -192,7 +194,7 @@ type ExtensionAWSLambdaDestination struct { // MarshalJSON override to set the discriminator value func (obj ExtensionAWSLambdaDestination) MarshalJSON() ([]byte, error) { type Alias ExtensionAWSLambdaDestination - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "AWSLambda", Alias: (*Alias)(&obj)}) @@ -206,7 +208,7 @@ type ExtensionAuthorizationHeaderAuthentication struct { // MarshalJSON override to set the discriminator value func (obj ExtensionAuthorizationHeaderAuthentication) MarshalJSON() ([]byte, error) { type Alias ExtensionAuthorizationHeaderAuthentication - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "AuthorizationHeader", Alias: (*Alias)(&obj)}) @@ -220,7 +222,7 @@ type ExtensionAzureFunctionsAuthentication struct { // MarshalJSON override to set the discriminator value func (obj ExtensionAzureFunctionsAuthentication) MarshalJSON() ([]byte, error) { type Alias ExtensionAzureFunctionsAuthentication - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "AzureFunctions", Alias: (*Alias)(&obj)}) @@ -234,7 +236,7 @@ type ExtensionChangeDestinationAction struct { // MarshalJSON override to set the discriminator value func (obj ExtensionChangeDestinationAction) MarshalJSON() ([]byte, error) { type Alias ExtensionChangeDestinationAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeDestination", Alias: (*Alias)(&obj)}) @@ -266,7 +268,7 @@ type ExtensionChangeTriggersAction struct { // MarshalJSON override to set the discriminator value func (obj ExtensionChangeTriggersAction) MarshalJSON() ([]byte, error) { type Alias ExtensionChangeTriggersAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTriggers", Alias: (*Alias)(&obj)}) @@ -307,7 +309,7 @@ type ExtensionHTTPDestination struct { // MarshalJSON override to set the discriminator value func (obj ExtensionHTTPDestination) MarshalJSON() ([]byte, error) { type Alias ExtensionHTTPDestination - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "HTTP", Alias: (*Alias)(&obj)}) @@ -372,7 +374,7 @@ type ExtensionSetKeyAction struct { // MarshalJSON override to set the discriminator value func (obj ExtensionSetKeyAction) MarshalJSON() ([]byte, error) { type Alias ExtensionSetKeyAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setKey", Alias: (*Alias)(&obj)}) @@ -386,7 +388,7 @@ type ExtensionSetTimeoutInMsAction struct { // MarshalJSON override to set the discriminator value func (obj ExtensionSetTimeoutInMsAction) MarshalJSON() ([]byte, error) { type Alias ExtensionSetTimeoutInMsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setTimeoutInMs", Alias: (*Alias)(&obj)}) diff --git a/commercetools/types_inventory.go b/commercetools/types_inventory.go index db9459aa..a42380f8 100644 --- a/commercetools/types_inventory.go +++ b/commercetools/types_inventory.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // InventoryEntryUpdateAction uses action as discriminator attribute @@ -263,7 +265,7 @@ type InventoryEntryUpdate struct { // on the discriminator value func (obj *InventoryEntryUpdate) UnmarshalJSON(data []byte) error { type Alias InventoryEntryUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/commercetools/types_me.go b/commercetools/types_me.go index 7624e4ac..1b99e748 100644 --- a/commercetools/types_me.go +++ b/commercetools/types_me.go @@ -3,9 +3,11 @@ package commercetools import ( - "encoding/json" + json1 "encoding/json" "errors" "time" + + json "github.com/segmentio/encoding/json" ) // MyCartUpdateAction uses action as discriminator attribute @@ -655,7 +657,7 @@ type MyCartAddDiscountCodeAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartAddDiscountCodeAction) MarshalJSON() ([]byte, error) { type Alias MyCartAddDiscountCodeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addDiscountCode", Alias: (*Alias)(&obj)}) @@ -669,7 +671,7 @@ type MyCartAddItemShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartAddItemShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias MyCartAddItemShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addItemShippingAddress", Alias: (*Alias)(&obj)}) @@ -694,7 +696,7 @@ type MyCartAddLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartAddLineItemAction) MarshalJSON() ([]byte, error) { type Alias MyCartAddLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addLineItem", Alias: (*Alias)(&obj)}) @@ -708,7 +710,7 @@ type MyCartAddPaymentAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartAddPaymentAction) MarshalJSON() ([]byte, error) { type Alias MyCartAddPaymentAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addPayment", Alias: (*Alias)(&obj)}) @@ -723,7 +725,7 @@ type MyCartApplyDeltaToLineItemShippingDetailsTargetsAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartApplyDeltaToLineItemShippingDetailsTargetsAction) MarshalJSON() ([]byte, error) { type Alias MyCartApplyDeltaToLineItemShippingDetailsTargetsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "applyDeltaToLineItemShippingDetailsTargets", Alias: (*Alias)(&obj)}) @@ -740,7 +742,7 @@ type MyCartChangeLineItemQuantityAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartChangeLineItemQuantityAction) MarshalJSON() ([]byte, error) { type Alias MyCartChangeLineItemQuantityAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeLineItemQuantity", Alias: (*Alias)(&obj)}) @@ -754,7 +756,7 @@ type MyCartChangeTaxModeAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartChangeTaxModeAction) MarshalJSON() ([]byte, error) { type Alias MyCartChangeTaxModeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTaxMode", Alias: (*Alias)(&obj)}) @@ -787,7 +789,7 @@ type MyCartRecalculateAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartRecalculateAction) MarshalJSON() ([]byte, error) { type Alias MyCartRecalculateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "recalculate", Alias: (*Alias)(&obj)}) @@ -801,7 +803,7 @@ type MyCartRemoveDiscountCodeAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartRemoveDiscountCodeAction) MarshalJSON() ([]byte, error) { type Alias MyCartRemoveDiscountCodeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeDiscountCode", Alias: (*Alias)(&obj)}) @@ -815,7 +817,7 @@ type MyCartRemoveItemShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartRemoveItemShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias MyCartRemoveItemShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeItemShippingAddress", Alias: (*Alias)(&obj)}) @@ -833,7 +835,7 @@ type MyCartRemoveLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartRemoveLineItemAction) MarshalJSON() ([]byte, error) { type Alias MyCartRemoveLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeLineItem", Alias: (*Alias)(&obj)}) @@ -847,7 +849,7 @@ type MyCartRemovePaymentAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartRemovePaymentAction) MarshalJSON() ([]byte, error) { type Alias MyCartRemovePaymentAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removePayment", Alias: (*Alias)(&obj)}) @@ -861,7 +863,7 @@ type MyCartSetBillingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetBillingAddressAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetBillingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setBillingAddress", Alias: (*Alias)(&obj)}) @@ -875,7 +877,7 @@ type MyCartSetCountryAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetCountryAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetCountryAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCountry", Alias: (*Alias)(&obj)}) @@ -890,7 +892,7 @@ type MyCartSetCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomField", Alias: (*Alias)(&obj)}) @@ -907,7 +909,7 @@ type MyCartSetCustomShippingMethodAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetCustomShippingMethodAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetCustomShippingMethodAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomShippingMethod", Alias: (*Alias)(&obj)}) @@ -922,7 +924,7 @@ type MyCartSetCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomType", Alias: (*Alias)(&obj)}) @@ -936,7 +938,7 @@ type MyCartSetDeleteDaysAfterLastModificationAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetDeleteDaysAfterLastModificationAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetDeleteDaysAfterLastModificationAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDeleteDaysAfterLastModification", Alias: (*Alias)(&obj)}) @@ -952,7 +954,7 @@ type MyCartSetLineItemCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetLineItemCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetLineItemCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemCustomField", Alias: (*Alias)(&obj)}) @@ -968,7 +970,7 @@ type MyCartSetLineItemCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetLineItemCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetLineItemCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemCustomType", Alias: (*Alias)(&obj)}) @@ -983,7 +985,7 @@ type MyCartSetLineItemDistributionChannelAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetLineItemDistributionChannelAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetLineItemDistributionChannelAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemDistributionChannel", Alias: (*Alias)(&obj)}) @@ -998,7 +1000,7 @@ type MyCartSetLineItemShippingDetailsAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetLineItemShippingDetailsAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetLineItemShippingDetailsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemShippingDetails", Alias: (*Alias)(&obj)}) @@ -1012,7 +1014,7 @@ type MyCartSetLocaleAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetLocaleAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetLocaleAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLocale", Alias: (*Alias)(&obj)}) @@ -1026,7 +1028,7 @@ type MyCartSetShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingAddress", Alias: (*Alias)(&obj)}) @@ -1041,7 +1043,7 @@ type MyCartSetShippingMethodAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartSetShippingMethodAction) MarshalJSON() ([]byte, error) { type Alias MyCartSetShippingMethodAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingMethod", Alias: (*Alias)(&obj)}) @@ -1079,7 +1081,7 @@ type MyCartUpdateItemShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj MyCartUpdateItemShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias MyCartUpdateItemShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "updateItemShippingAddress", Alias: (*Alias)(&obj)}) @@ -1126,7 +1128,7 @@ type MyCustomerAddAddressAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerAddAddressAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerAddAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addAddress", Alias: (*Alias)(&obj)}) @@ -1141,7 +1143,7 @@ type MyCustomerAddBillingAddressIDAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerAddBillingAddressIDAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerAddBillingAddressIDAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addBillingAddressId", Alias: (*Alias)(&obj)}) @@ -1156,7 +1158,7 @@ type MyCustomerAddShippingAddressIDAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerAddShippingAddressIDAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerAddShippingAddressIDAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addShippingAddressId", Alias: (*Alias)(&obj)}) @@ -1172,7 +1174,7 @@ type MyCustomerChangeAddressAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerChangeAddressAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerChangeAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeAddress", Alias: (*Alias)(&obj)}) @@ -1186,7 +1188,7 @@ type MyCustomerChangeEmailAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerChangeEmailAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerChangeEmailAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeEmail", Alias: (*Alias)(&obj)}) @@ -1220,7 +1222,7 @@ type MyCustomerRemoveAddressAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerRemoveAddressAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerRemoveAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeAddress", Alias: (*Alias)(&obj)}) @@ -1235,7 +1237,7 @@ type MyCustomerRemoveBillingAddressIDAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerRemoveBillingAddressIDAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerRemoveBillingAddressIDAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeBillingAddressId", Alias: (*Alias)(&obj)}) @@ -1250,7 +1252,7 @@ type MyCustomerRemoveShippingAddressIDAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerRemoveShippingAddressIDAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerRemoveShippingAddressIDAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeShippingAddressId", Alias: (*Alias)(&obj)}) @@ -1264,7 +1266,7 @@ type MyCustomerSetCompanyNameAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetCompanyNameAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetCompanyNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCompanyName", Alias: (*Alias)(&obj)}) @@ -1279,7 +1281,7 @@ type MyCustomerSetCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomField", Alias: (*Alias)(&obj)}) @@ -1294,7 +1296,7 @@ type MyCustomerSetCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomType", Alias: (*Alias)(&obj)}) @@ -1308,7 +1310,7 @@ type MyCustomerSetDateOfBirthAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetDateOfBirthAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetDateOfBirthAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDateOfBirth", Alias: (*Alias)(&obj)}) @@ -1323,7 +1325,7 @@ type MyCustomerSetDefaultBillingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetDefaultBillingAddressAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetDefaultBillingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDefaultBillingAddress", Alias: (*Alias)(&obj)}) @@ -1338,7 +1340,7 @@ type MyCustomerSetDefaultShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetDefaultShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetDefaultShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDefaultShippingAddress", Alias: (*Alias)(&obj)}) @@ -1352,7 +1354,7 @@ type MyCustomerSetFirstNameAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetFirstNameAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetFirstNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setFirstName", Alias: (*Alias)(&obj)}) @@ -1366,7 +1368,7 @@ type MyCustomerSetLastNameAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetLastNameAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetLastNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLastName", Alias: (*Alias)(&obj)}) @@ -1380,7 +1382,7 @@ type MyCustomerSetLocaleAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetLocaleAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetLocaleAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLocale", Alias: (*Alias)(&obj)}) @@ -1394,7 +1396,7 @@ type MyCustomerSetMiddleNameAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetMiddleNameAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetMiddleNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setMiddleName", Alias: (*Alias)(&obj)}) @@ -1408,7 +1410,7 @@ type MyCustomerSetSalutationAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetSalutationAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetSalutationAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setSalutation", Alias: (*Alias)(&obj)}) @@ -1422,7 +1424,7 @@ type MyCustomerSetTitleAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetTitleAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetTitleAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setTitle", Alias: (*Alias)(&obj)}) @@ -1436,7 +1438,7 @@ type MyCustomerSetVatIDAction struct { // MarshalJSON override to set the discriminator value func (obj MyCustomerSetVatIDAction) MarshalJSON() ([]byte, error) { type Alias MyCustomerSetVatIDAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setVatId", Alias: (*Alias)(&obj)}) @@ -1593,7 +1595,7 @@ type MyPaymentAddTransactionAction struct { // MarshalJSON override to set the discriminator value func (obj MyPaymentAddTransactionAction) MarshalJSON() ([]byte, error) { type Alias MyPaymentAddTransactionAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addTransaction", Alias: (*Alias)(&obj)}) @@ -1607,7 +1609,7 @@ type MyPaymentChangeAmountPlannedAction struct { // MarshalJSON override to set the discriminator value func (obj MyPaymentChangeAmountPlannedAction) MarshalJSON() ([]byte, error) { type Alias MyPaymentChangeAmountPlannedAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeAmountPlanned", Alias: (*Alias)(&obj)}) @@ -1639,7 +1641,7 @@ type MyPaymentSetCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj MyPaymentSetCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias MyPaymentSetCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomField", Alias: (*Alias)(&obj)}) @@ -1653,7 +1655,7 @@ type MyPaymentSetMethodInfoInterfaceAction struct { // MarshalJSON override to set the discriminator value func (obj MyPaymentSetMethodInfoInterfaceAction) MarshalJSON() ([]byte, error) { type Alias MyPaymentSetMethodInfoInterfaceAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setMethodInfoInterface", Alias: (*Alias)(&obj)}) @@ -1667,7 +1669,7 @@ type MyPaymentSetMethodInfoMethodAction struct { // MarshalJSON override to set the discriminator value func (obj MyPaymentSetMethodInfoMethodAction) MarshalJSON() ([]byte, error) { type Alias MyPaymentSetMethodInfoMethodAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setMethodInfoMethod", Alias: (*Alias)(&obj)}) @@ -1681,7 +1683,7 @@ type MyPaymentSetMethodInfoNameAction struct { // MarshalJSON override to set the discriminator value func (obj MyPaymentSetMethodInfoNameAction) MarshalJSON() ([]byte, error) { type Alias MyPaymentSetMethodInfoNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setMethodInfoName", Alias: (*Alias)(&obj)}) @@ -1724,7 +1726,7 @@ type MyShoppingListAddLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListAddLineItemAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListAddLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addLineItem", Alias: (*Alias)(&obj)}) @@ -1742,7 +1744,7 @@ type MyShoppingListAddTextLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListAddTextLineItemAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListAddTextLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addTextLineItem", Alias: (*Alias)(&obj)}) @@ -1757,7 +1759,7 @@ type MyShoppingListChangeLineItemQuantityAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListChangeLineItemQuantityAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListChangeLineItemQuantityAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeLineItemQuantity", Alias: (*Alias)(&obj)}) @@ -1771,7 +1773,7 @@ type MyShoppingListChangeLineItemsOrderAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListChangeLineItemsOrderAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListChangeLineItemsOrderAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeLineItemsOrder", Alias: (*Alias)(&obj)}) @@ -1785,7 +1787,7 @@ type MyShoppingListChangeNameAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListChangeNameAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListChangeNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeName", Alias: (*Alias)(&obj)}) @@ -1800,7 +1802,7 @@ type MyShoppingListChangeTextLineItemNameAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListChangeTextLineItemNameAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListChangeTextLineItemNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTextLineItemName", Alias: (*Alias)(&obj)}) @@ -1815,7 +1817,7 @@ type MyShoppingListChangeTextLineItemQuantityAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListChangeTextLineItemQuantityAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListChangeTextLineItemQuantityAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTextLineItemQuantity", Alias: (*Alias)(&obj)}) @@ -1829,7 +1831,7 @@ type MyShoppingListChangeTextLineItemsOrderAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListChangeTextLineItemsOrderAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListChangeTextLineItemsOrderAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTextLineItemsOrder", Alias: (*Alias)(&obj)}) @@ -1854,7 +1856,7 @@ type MyShoppingListRemoveLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListRemoveLineItemAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListRemoveLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeLineItem", Alias: (*Alias)(&obj)}) @@ -1869,7 +1871,7 @@ type MyShoppingListRemoveTextLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListRemoveTextLineItemAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListRemoveTextLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeTextLineItem", Alias: (*Alias)(&obj)}) @@ -1884,7 +1886,7 @@ type MyShoppingListSetCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListSetCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListSetCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomField", Alias: (*Alias)(&obj)}) @@ -1899,7 +1901,7 @@ type MyShoppingListSetCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListSetCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListSetCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomType", Alias: (*Alias)(&obj)}) @@ -1913,7 +1915,7 @@ type MyShoppingListSetDeleteDaysAfterLastModificationAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListSetDeleteDaysAfterLastModificationAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListSetDeleteDaysAfterLastModificationAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDeleteDaysAfterLastModification", Alias: (*Alias)(&obj)}) @@ -1927,7 +1929,7 @@ type MyShoppingListSetDescriptionAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListSetDescriptionAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListSetDescriptionAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDescription", Alias: (*Alias)(&obj)}) @@ -1943,7 +1945,7 @@ type MyShoppingListSetLineItemCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListSetLineItemCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListSetLineItemCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemCustomField", Alias: (*Alias)(&obj)}) @@ -1959,7 +1961,7 @@ type MyShoppingListSetLineItemCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListSetLineItemCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListSetLineItemCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemCustomType", Alias: (*Alias)(&obj)}) @@ -1975,7 +1977,7 @@ type MyShoppingListSetTextLineItemCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListSetTextLineItemCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListSetTextLineItemCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setTextLineItemCustomField", Alias: (*Alias)(&obj)}) @@ -1991,7 +1993,7 @@ type MyShoppingListSetTextLineItemCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListSetTextLineItemCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListSetTextLineItemCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setTextLineItemCustomType", Alias: (*Alias)(&obj)}) @@ -2006,7 +2008,7 @@ type MyShoppingListSetTextLineItemDescriptionAction struct { // MarshalJSON override to set the discriminator value func (obj MyShoppingListSetTextLineItemDescriptionAction) MarshalJSON() ([]byte, error) { type Alias MyShoppingListSetTextLineItemDescriptionAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setTextLineItemDescription", Alias: (*Alias)(&obj)}) diff --git a/commercetools/types_message.go b/commercetools/types_message.go index 217ae8d5..0e8d8a53 100644 --- a/commercetools/types_message.go +++ b/commercetools/types_message.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // Message uses type as discriminator attribute @@ -1982,7 +1984,7 @@ type MessagePagedQueryResponse struct { // on the discriminator value func (obj *MessagePagedQueryResponse) UnmarshalJSON(data []byte) error { type Alias MessagePagedQueryResponse - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Results { @@ -2825,7 +2827,7 @@ func (obj OrderShippingRateInputSetMessage) MarshalJSON() ([]byte, error) { // on the discriminator value func (obj *OrderShippingRateInputSetMessage) UnmarshalJSON(data []byte) error { type Alias OrderShippingRateInputSetMessage - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.OldShippingRateInput != nil { @@ -2865,7 +2867,7 @@ func (obj OrderShippingRateInputSetMessagePayload) MarshalJSON() ([]byte, error) // on the discriminator value func (obj *OrderShippingRateInputSetMessagePayload) UnmarshalJSON(data []byte) error { type Alias OrderShippingRateInputSetMessagePayload - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.OldShippingRateInput != nil { @@ -4086,7 +4088,7 @@ func (obj ReviewRatingSetMessage) MarshalJSON() ([]byte, error) { // on the discriminator value func (obj *ReviewRatingSetMessage) UnmarshalJSON(data []byte) error { type Alias ReviewRatingSetMessage - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.Target != nil { @@ -4121,7 +4123,7 @@ func (obj ReviewRatingSetMessagePayload) MarshalJSON() ([]byte, error) { // on the discriminator value func (obj *ReviewRatingSetMessagePayload) UnmarshalJSON(data []byte) error { type Alias ReviewRatingSetMessagePayload - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.Target != nil { @@ -4168,7 +4170,7 @@ func (obj ReviewStateTransitionMessage) MarshalJSON() ([]byte, error) { // on the discriminator value func (obj *ReviewStateTransitionMessage) UnmarshalJSON(data []byte) error { type Alias ReviewStateTransitionMessage - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.Target != nil { @@ -4205,7 +4207,7 @@ func (obj ReviewStateTransitionMessagePayload) MarshalJSON() ([]byte, error) { // on the discriminator value func (obj *ReviewStateTransitionMessagePayload) UnmarshalJSON(data []byte) error { type Alias ReviewStateTransitionMessagePayload - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.Target != nil { diff --git a/commercetools/types_order.go b/commercetools/types_order.go index e9df581a..fe5df104 100644 --- a/commercetools/types_order.go +++ b/commercetools/types_order.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // OrderState is an enum type @@ -1106,7 +1108,7 @@ type Order struct { // on the discriminator value func (obj *Order) UnmarshalJSON(data []byte) error { type Alias Order - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.ShippingRateInput != nil { @@ -1921,7 +1923,7 @@ type OrderUpdate struct { // on the discriminator value func (obj *OrderUpdate) UnmarshalJSON(data []byte) error { type Alias OrderUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { @@ -2014,7 +2016,7 @@ type ReturnInfo struct { // on the discriminator value func (obj *ReturnInfo) UnmarshalJSON(data []byte) error { type Alias ReturnInfo - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Items { diff --git a/commercetools/types_order_edit.go b/commercetools/types_order_edit.go index a8fb7a81..596bdcb7 100644 --- a/commercetools/types_order_edit.go +++ b/commercetools/types_order_edit.go @@ -3,9 +3,11 @@ package commercetools import ( - "encoding/json" + json1 "encoding/json" "errors" "time" + + json "github.com/segmentio/encoding/json" ) // OrderEditResult uses type as discriminator attribute @@ -234,7 +236,7 @@ type OrderEditAddStagedActionAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditAddStagedActionAction) MarshalJSON() ([]byte, error) { type Alias OrderEditAddStagedActionAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addStagedAction", Alias: (*Alias)(&obj)}) @@ -268,7 +270,7 @@ type OrderEditApplied struct { // MarshalJSON override to set the discriminator value func (obj OrderEditApplied) MarshalJSON() ([]byte, error) { type Alias OrderEditApplied - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "Applied", Alias: (*Alias)(&obj)}) @@ -314,7 +316,7 @@ type OrderEditNotProcessed struct{} // MarshalJSON override to set the discriminator value func (obj OrderEditNotProcessed) MarshalJSON() ([]byte, error) { type Alias OrderEditNotProcessed - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "NotProcessed", Alias: (*Alias)(&obj)}) @@ -337,7 +339,7 @@ type OrderEditPreviewFailure struct { // MarshalJSON override to set the discriminator value func (obj OrderEditPreviewFailure) MarshalJSON() ([]byte, error) { type Alias OrderEditPreviewFailure - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "PreviewFailure", Alias: (*Alias)(&obj)}) @@ -370,7 +372,7 @@ type OrderEditPreviewSuccess struct { // MarshalJSON override to set the discriminator value func (obj OrderEditPreviewSuccess) MarshalJSON() ([]byte, error) { type Alias OrderEditPreviewSuccess - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "PreviewSuccess", Alias: (*Alias)(&obj)}) @@ -403,7 +405,7 @@ type OrderEditReference struct { // MarshalJSON override to set the discriminator value func (obj OrderEditReference) MarshalJSON() ([]byte, error) { type Alias OrderEditReference - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "order-edit", Alias: (*Alias)(&obj)}) @@ -418,7 +420,7 @@ type OrderEditResourceIdentifier struct { // MarshalJSON override to set the discriminator value func (obj OrderEditResourceIdentifier) MarshalJSON() ([]byte, error) { type Alias OrderEditResourceIdentifier - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "order-edit", Alias: (*Alias)(&obj)}) @@ -433,7 +435,7 @@ type OrderEditSetBillingAddressCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetBillingAddressCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetBillingAddressCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setBillingAddressCustomField", Alias: (*Alias)(&obj)}) @@ -448,7 +450,7 @@ type OrderEditSetBillingAddressCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetBillingAddressCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetBillingAddressCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setBillingAddressCustomType", Alias: (*Alias)(&obj)}) @@ -462,7 +464,7 @@ type OrderEditSetCommentAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetCommentAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetCommentAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setComment", Alias: (*Alias)(&obj)}) @@ -477,7 +479,7 @@ type OrderEditSetCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomField", Alias: (*Alias)(&obj)}) @@ -492,7 +494,7 @@ type OrderEditSetCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomType", Alias: (*Alias)(&obj)}) @@ -508,7 +510,7 @@ type OrderEditSetDeliveryAddressCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetDeliveryAddressCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetDeliveryAddressCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDeliveryAddressCustomField", Alias: (*Alias)(&obj)}) @@ -524,7 +526,7 @@ type OrderEditSetDeliveryAddressCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetDeliveryAddressCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetDeliveryAddressCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDeliveryAddressCustomType", Alias: (*Alias)(&obj)}) @@ -540,7 +542,7 @@ type OrderEditSetItemShippingAddressCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetItemShippingAddressCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetItemShippingAddressCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setItemShippingAddressCustomField", Alias: (*Alias)(&obj)}) @@ -556,7 +558,7 @@ type OrderEditSetItemShippingAddressCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetItemShippingAddressCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetItemShippingAddressCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setItemShippingAddressCustomType", Alias: (*Alias)(&obj)}) @@ -570,7 +572,7 @@ type OrderEditSetKeyAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetKeyAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetKeyAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setKey", Alias: (*Alias)(&obj)}) @@ -585,7 +587,7 @@ type OrderEditSetShippingAddressCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetShippingAddressCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetShippingAddressCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingAddressCustomField", Alias: (*Alias)(&obj)}) @@ -600,7 +602,7 @@ type OrderEditSetShippingAddressCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetShippingAddressCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetShippingAddressCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingAddressCustomType", Alias: (*Alias)(&obj)}) @@ -614,7 +616,7 @@ type OrderEditSetStagedActionsAction struct { // MarshalJSON override to set the discriminator value func (obj OrderEditSetStagedActionsAction) MarshalJSON() ([]byte, error) { type Alias OrderEditSetStagedActionsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setStagedActions", Alias: (*Alias)(&obj)}) @@ -747,7 +749,7 @@ type StagedOrderAddCustomLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderAddCustomLineItemAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderAddCustomLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addCustomLineItem", Alias: (*Alias)(&obj)}) @@ -763,7 +765,7 @@ type StagedOrderAddDeliveryAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderAddDeliveryAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderAddDeliveryAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addDelivery", Alias: (*Alias)(&obj)}) @@ -777,7 +779,7 @@ type StagedOrderAddDiscountCodeAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderAddDiscountCodeAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderAddDiscountCodeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addDiscountCode", Alias: (*Alias)(&obj)}) @@ -791,7 +793,7 @@ type StagedOrderAddItemShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderAddItemShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderAddItemShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addItemShippingAddress", Alias: (*Alias)(&obj)}) @@ -816,7 +818,7 @@ type StagedOrderAddLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderAddLineItemAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderAddLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addLineItem", Alias: (*Alias)(&obj)}) @@ -833,7 +835,7 @@ type StagedOrderAddParcelToDeliveryAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderAddParcelToDeliveryAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderAddParcelToDeliveryAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addParcelToDelivery", Alias: (*Alias)(&obj)}) @@ -847,7 +849,7 @@ type StagedOrderAddPaymentAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderAddPaymentAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderAddPaymentAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addPayment", Alias: (*Alias)(&obj)}) @@ -863,7 +865,7 @@ type StagedOrderAddReturnInfoAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderAddReturnInfoAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderAddReturnInfoAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addReturnInfo", Alias: (*Alias)(&obj)}) @@ -879,7 +881,7 @@ type StagedOrderAddShoppingListAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderAddShoppingListAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderAddShoppingListAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addShoppingList", Alias: (*Alias)(&obj)}) @@ -894,7 +896,7 @@ type StagedOrderChangeCustomLineItemMoneyAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderChangeCustomLineItemMoneyAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderChangeCustomLineItemMoneyAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeCustomLineItemMoney", Alias: (*Alias)(&obj)}) @@ -909,7 +911,7 @@ type StagedOrderChangeCustomLineItemQuantityAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderChangeCustomLineItemQuantityAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderChangeCustomLineItemQuantityAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeCustomLineItemQuantity", Alias: (*Alias)(&obj)}) @@ -926,7 +928,7 @@ type StagedOrderChangeLineItemQuantityAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderChangeLineItemQuantityAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderChangeLineItemQuantityAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeLineItemQuantity", Alias: (*Alias)(&obj)}) @@ -940,7 +942,7 @@ type StagedOrderChangeOrderStateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderChangeOrderStateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderChangeOrderStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeOrderState", Alias: (*Alias)(&obj)}) @@ -954,7 +956,7 @@ type StagedOrderChangePaymentStateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderChangePaymentStateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderChangePaymentStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changePaymentState", Alias: (*Alias)(&obj)}) @@ -968,7 +970,7 @@ type StagedOrderChangeShipmentStateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderChangeShipmentStateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderChangeShipmentStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeShipmentState", Alias: (*Alias)(&obj)}) @@ -982,7 +984,7 @@ type StagedOrderChangeTaxCalculationModeAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderChangeTaxCalculationModeAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderChangeTaxCalculationModeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTaxCalculationMode", Alias: (*Alias)(&obj)}) @@ -996,7 +998,7 @@ type StagedOrderChangeTaxModeAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderChangeTaxModeAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderChangeTaxModeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTaxMode", Alias: (*Alias)(&obj)}) @@ -1010,7 +1012,7 @@ type StagedOrderChangeTaxRoundingModeAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderChangeTaxRoundingModeAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderChangeTaxRoundingModeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTaxRoundingMode", Alias: (*Alias)(&obj)}) @@ -1025,7 +1027,7 @@ type StagedOrderImportCustomLineItemStateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderImportCustomLineItemStateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderImportCustomLineItemStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "importCustomLineItemState", Alias: (*Alias)(&obj)}) @@ -1040,7 +1042,7 @@ type StagedOrderImportLineItemStateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderImportLineItemStateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderImportLineItemStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "importLineItemState", Alias: (*Alias)(&obj)}) @@ -1054,7 +1056,7 @@ type StagedOrderRemoveCustomLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderRemoveCustomLineItemAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderRemoveCustomLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeCustomLineItem", Alias: (*Alias)(&obj)}) @@ -1068,7 +1070,7 @@ type StagedOrderRemoveDeliveryAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderRemoveDeliveryAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderRemoveDeliveryAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeDelivery", Alias: (*Alias)(&obj)}) @@ -1082,7 +1084,7 @@ type StagedOrderRemoveDiscountCodeAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderRemoveDiscountCodeAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderRemoveDiscountCodeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeDiscountCode", Alias: (*Alias)(&obj)}) @@ -1096,7 +1098,7 @@ type StagedOrderRemoveItemShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderRemoveItemShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderRemoveItemShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeItemShippingAddress", Alias: (*Alias)(&obj)}) @@ -1114,7 +1116,7 @@ type StagedOrderRemoveLineItemAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderRemoveLineItemAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderRemoveLineItemAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeLineItem", Alias: (*Alias)(&obj)}) @@ -1128,7 +1130,7 @@ type StagedOrderRemoveParcelFromDeliveryAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderRemoveParcelFromDeliveryAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderRemoveParcelFromDeliveryAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removeParcelFromDelivery", Alias: (*Alias)(&obj)}) @@ -1142,7 +1144,7 @@ type StagedOrderRemovePaymentAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderRemovePaymentAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderRemovePaymentAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "removePayment", Alias: (*Alias)(&obj)}) @@ -1156,7 +1158,7 @@ type StagedOrderSetBillingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetBillingAddressAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetBillingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setBillingAddress", Alias: (*Alias)(&obj)}) @@ -1170,7 +1172,7 @@ type StagedOrderSetCountryAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetCountryAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetCountryAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCountry", Alias: (*Alias)(&obj)}) @@ -1185,7 +1187,7 @@ type StagedOrderSetCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomField", Alias: (*Alias)(&obj)}) @@ -1201,7 +1203,7 @@ type StagedOrderSetCustomLineItemCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetCustomLineItemCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetCustomLineItemCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomLineItemCustomField", Alias: (*Alias)(&obj)}) @@ -1217,7 +1219,7 @@ type StagedOrderSetCustomLineItemCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetCustomLineItemCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetCustomLineItemCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomLineItemCustomType", Alias: (*Alias)(&obj)}) @@ -1232,7 +1234,7 @@ type StagedOrderSetCustomLineItemShippingDetailsAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetCustomLineItemShippingDetailsAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetCustomLineItemShippingDetailsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomLineItemShippingDetails", Alias: (*Alias)(&obj)}) @@ -1247,7 +1249,7 @@ type StagedOrderSetCustomLineItemTaxAmountAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetCustomLineItemTaxAmountAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetCustomLineItemTaxAmountAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomLineItemTaxAmount", Alias: (*Alias)(&obj)}) @@ -1262,7 +1264,7 @@ type StagedOrderSetCustomLineItemTaxRateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetCustomLineItemTaxRateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetCustomLineItemTaxRateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomLineItemTaxRate", Alias: (*Alias)(&obj)}) @@ -1279,7 +1281,7 @@ type StagedOrderSetCustomShippingMethodAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetCustomShippingMethodAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetCustomShippingMethodAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomShippingMethod", Alias: (*Alias)(&obj)}) @@ -1294,7 +1296,7 @@ type StagedOrderSetCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomType", Alias: (*Alias)(&obj)}) @@ -1308,7 +1310,7 @@ type StagedOrderSetCustomerEmailAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetCustomerEmailAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetCustomerEmailAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomerEmail", Alias: (*Alias)(&obj)}) @@ -1322,7 +1324,7 @@ type StagedOrderSetCustomerGroupAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetCustomerGroupAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetCustomerGroupAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomerGroup", Alias: (*Alias)(&obj)}) @@ -1336,7 +1338,7 @@ type StagedOrderSetCustomerIDAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetCustomerIDAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetCustomerIDAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomerId", Alias: (*Alias)(&obj)}) @@ -1351,7 +1353,7 @@ type StagedOrderSetDeliveryAddressAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetDeliveryAddressAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetDeliveryAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDeliveryAddress", Alias: (*Alias)(&obj)}) @@ -1366,7 +1368,7 @@ type StagedOrderSetDeliveryItemsAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetDeliveryItemsAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetDeliveryItemsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDeliveryItems", Alias: (*Alias)(&obj)}) @@ -1382,7 +1384,7 @@ type StagedOrderSetLineItemCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetLineItemCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetLineItemCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemCustomField", Alias: (*Alias)(&obj)}) @@ -1398,7 +1400,7 @@ type StagedOrderSetLineItemCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetLineItemCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetLineItemCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemCustomType", Alias: (*Alias)(&obj)}) @@ -1413,7 +1415,7 @@ type StagedOrderSetLineItemDistributionChannelAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetLineItemDistributionChannelAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetLineItemDistributionChannelAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemDistributionChannel", Alias: (*Alias)(&obj)}) @@ -1428,7 +1430,7 @@ type StagedOrderSetLineItemPriceAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetLineItemPriceAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetLineItemPriceAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemPrice", Alias: (*Alias)(&obj)}) @@ -1443,7 +1445,7 @@ type StagedOrderSetLineItemShippingDetailsAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetLineItemShippingDetailsAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetLineItemShippingDetailsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemShippingDetails", Alias: (*Alias)(&obj)}) @@ -1458,7 +1460,7 @@ type StagedOrderSetLineItemTaxAmountAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetLineItemTaxAmountAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetLineItemTaxAmountAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemTaxAmount", Alias: (*Alias)(&obj)}) @@ -1473,7 +1475,7 @@ type StagedOrderSetLineItemTaxRateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetLineItemTaxRateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetLineItemTaxRateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemTaxRate", Alias: (*Alias)(&obj)}) @@ -1488,7 +1490,7 @@ type StagedOrderSetLineItemTotalPriceAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetLineItemTotalPriceAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetLineItemTotalPriceAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLineItemTotalPrice", Alias: (*Alias)(&obj)}) @@ -1502,7 +1504,7 @@ type StagedOrderSetLocaleAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetLocaleAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetLocaleAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLocale", Alias: (*Alias)(&obj)}) @@ -1516,7 +1518,7 @@ type StagedOrderSetOrderNumberAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetOrderNumberAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetOrderNumberAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setOrderNumber", Alias: (*Alias)(&obj)}) @@ -1531,7 +1533,7 @@ type StagedOrderSetOrderTotalTaxAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetOrderTotalTaxAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetOrderTotalTaxAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setOrderTotalTax", Alias: (*Alias)(&obj)}) @@ -1546,7 +1548,7 @@ type StagedOrderSetParcelItemsAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetParcelItemsAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetParcelItemsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setParcelItems", Alias: (*Alias)(&obj)}) @@ -1561,7 +1563,7 @@ type StagedOrderSetParcelMeasurementsAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetParcelMeasurementsAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetParcelMeasurementsAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setParcelMeasurements", Alias: (*Alias)(&obj)}) @@ -1576,7 +1578,7 @@ type StagedOrderSetParcelTrackingDataAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetParcelTrackingDataAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetParcelTrackingDataAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setParcelTrackingData", Alias: (*Alias)(&obj)}) @@ -1591,7 +1593,7 @@ type StagedOrderSetReturnPaymentStateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetReturnPaymentStateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetReturnPaymentStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setReturnPaymentState", Alias: (*Alias)(&obj)}) @@ -1606,7 +1608,7 @@ type StagedOrderSetReturnShipmentStateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetReturnShipmentStateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetReturnShipmentStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setReturnShipmentState", Alias: (*Alias)(&obj)}) @@ -1620,7 +1622,7 @@ type StagedOrderSetShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingAddress", Alias: (*Alias)(&obj)}) @@ -1638,7 +1640,7 @@ type StagedOrderSetShippingAddressAndCustomShippingMethodAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetShippingAddressAndCustomShippingMethodAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetShippingAddressAndCustomShippingMethodAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingAddressAndCustomShippingMethod", Alias: (*Alias)(&obj)}) @@ -1654,7 +1656,7 @@ type StagedOrderSetShippingAddressAndShippingMethodAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetShippingAddressAndShippingMethodAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetShippingAddressAndShippingMethodAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingAddressAndShippingMethod", Alias: (*Alias)(&obj)}) @@ -1669,7 +1671,7 @@ type StagedOrderSetShippingMethodAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetShippingMethodAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetShippingMethodAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingMethod", Alias: (*Alias)(&obj)}) @@ -1683,7 +1685,7 @@ type StagedOrderSetShippingMethodTaxAmountAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetShippingMethodTaxAmountAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetShippingMethodTaxAmountAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingMethodTaxAmount", Alias: (*Alias)(&obj)}) @@ -1697,7 +1699,7 @@ type StagedOrderSetShippingMethodTaxRateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetShippingMethodTaxRateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetShippingMethodTaxRateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingMethodTaxRate", Alias: (*Alias)(&obj)}) @@ -1711,7 +1713,7 @@ type StagedOrderSetShippingRateInputAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderSetShippingRateInputAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderSetShippingRateInputAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setShippingRateInput", Alias: (*Alias)(&obj)}) @@ -1747,7 +1749,7 @@ type StagedOrderTransitionCustomLineItemStateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderTransitionCustomLineItemStateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderTransitionCustomLineItemStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "transitionCustomLineItemState", Alias: (*Alias)(&obj)}) @@ -1765,7 +1767,7 @@ type StagedOrderTransitionLineItemStateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderTransitionLineItemStateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderTransitionLineItemStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "transitionLineItemState", Alias: (*Alias)(&obj)}) @@ -1780,7 +1782,7 @@ type StagedOrderTransitionStateAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderTransitionStateAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderTransitionStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "transitionState", Alias: (*Alias)(&obj)}) @@ -1794,7 +1796,7 @@ type StagedOrderUpdateItemShippingAddressAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderUpdateItemShippingAddressAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderUpdateItemShippingAddressAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "updateItemShippingAddress", Alias: (*Alias)(&obj)}) @@ -1810,7 +1812,7 @@ type StagedOrderUpdateSyncInfoAction struct { // MarshalJSON override to set the discriminator value func (obj StagedOrderUpdateSyncInfoAction) MarshalJSON() ([]byte, error) { type Alias StagedOrderUpdateSyncInfoAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "updateSyncInfo", Alias: (*Alias)(&obj)}) diff --git a/commercetools/types_payment.go b/commercetools/types_payment.go index ec41afaf..cb5ae261 100644 --- a/commercetools/types_payment.go +++ b/commercetools/types_payment.go @@ -3,9 +3,11 @@ package commercetools import ( - "encoding/json" + json1 "encoding/json" "errors" "time" + + json "github.com/segmentio/encoding/json" ) // TransactionState is an enum type @@ -276,7 +278,7 @@ type PaymentAddInterfaceInteractionAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentAddInterfaceInteractionAction) MarshalJSON() ([]byte, error) { type Alias PaymentAddInterfaceInteractionAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addInterfaceInteraction", Alias: (*Alias)(&obj)}) @@ -290,7 +292,7 @@ type PaymentAddTransactionAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentAddTransactionAction) MarshalJSON() ([]byte, error) { type Alias PaymentAddTransactionAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "addTransaction", Alias: (*Alias)(&obj)}) @@ -304,7 +306,7 @@ type PaymentChangeAmountPlannedAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentChangeAmountPlannedAction) MarshalJSON() ([]byte, error) { type Alias PaymentChangeAmountPlannedAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeAmountPlanned", Alias: (*Alias)(&obj)}) @@ -319,7 +321,7 @@ type PaymentChangeTransactionInteractionIDAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentChangeTransactionInteractionIDAction) MarshalJSON() ([]byte, error) { type Alias PaymentChangeTransactionInteractionIDAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTransactionInteractionId", Alias: (*Alias)(&obj)}) @@ -334,7 +336,7 @@ type PaymentChangeTransactionStateAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentChangeTransactionStateAction) MarshalJSON() ([]byte, error) { type Alias PaymentChangeTransactionStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTransactionState", Alias: (*Alias)(&obj)}) @@ -349,7 +351,7 @@ type PaymentChangeTransactionTimestampAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentChangeTransactionTimestampAction) MarshalJSON() ([]byte, error) { type Alias PaymentChangeTransactionTimestampAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeTransactionTimestamp", Alias: (*Alias)(&obj)}) @@ -399,7 +401,7 @@ type PaymentReference struct { // MarshalJSON override to set the discriminator value func (obj PaymentReference) MarshalJSON() ([]byte, error) { type Alias PaymentReference - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "payment", Alias: (*Alias)(&obj)}) @@ -414,7 +416,7 @@ type PaymentResourceIdentifier struct { // MarshalJSON override to set the discriminator value func (obj PaymentResourceIdentifier) MarshalJSON() ([]byte, error) { type Alias PaymentResourceIdentifier - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "payment", Alias: (*Alias)(&obj)}) @@ -428,7 +430,7 @@ type PaymentSetAmountPaidAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetAmountPaidAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetAmountPaidAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setAmountPaid", Alias: (*Alias)(&obj)}) @@ -442,7 +444,7 @@ type PaymentSetAmountRefundedAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetAmountRefundedAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetAmountRefundedAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setAmountRefunded", Alias: (*Alias)(&obj)}) @@ -456,7 +458,7 @@ type PaymentSetAnonymousIDAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetAnonymousIDAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetAnonymousIDAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setAnonymousId", Alias: (*Alias)(&obj)}) @@ -471,7 +473,7 @@ type PaymentSetAuthorizationAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetAuthorizationAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetAuthorizationAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setAuthorization", Alias: (*Alias)(&obj)}) @@ -486,7 +488,7 @@ type PaymentSetCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomField", Alias: (*Alias)(&obj)}) @@ -501,7 +503,7 @@ type PaymentSetCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomType", Alias: (*Alias)(&obj)}) @@ -515,7 +517,7 @@ type PaymentSetCustomerAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetCustomerAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetCustomerAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomer", Alias: (*Alias)(&obj)}) @@ -529,7 +531,7 @@ type PaymentSetExternalIDAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetExternalIDAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetExternalIDAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setExternalId", Alias: (*Alias)(&obj)}) @@ -543,7 +545,7 @@ type PaymentSetInterfaceIDAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetInterfaceIDAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetInterfaceIDAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setInterfaceId", Alias: (*Alias)(&obj)}) @@ -557,7 +559,7 @@ type PaymentSetKeyAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetKeyAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetKeyAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setKey", Alias: (*Alias)(&obj)}) @@ -571,7 +573,7 @@ type PaymentSetMethodInfoInterfaceAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetMethodInfoInterfaceAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetMethodInfoInterfaceAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setMethodInfoInterface", Alias: (*Alias)(&obj)}) @@ -585,7 +587,7 @@ type PaymentSetMethodInfoMethodAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetMethodInfoMethodAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetMethodInfoMethodAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setMethodInfoMethod", Alias: (*Alias)(&obj)}) @@ -599,7 +601,7 @@ type PaymentSetMethodInfoNameAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetMethodInfoNameAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetMethodInfoNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setMethodInfoName", Alias: (*Alias)(&obj)}) @@ -613,7 +615,7 @@ type PaymentSetStatusInterfaceCodeAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetStatusInterfaceCodeAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetStatusInterfaceCodeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setStatusInterfaceCode", Alias: (*Alias)(&obj)}) @@ -627,7 +629,7 @@ type PaymentSetStatusInterfaceTextAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentSetStatusInterfaceTextAction) MarshalJSON() ([]byte, error) { type Alias PaymentSetStatusInterfaceTextAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setStatusInterfaceText", Alias: (*Alias)(&obj)}) @@ -656,7 +658,7 @@ type PaymentTransitionStateAction struct { // MarshalJSON override to set the discriminator value func (obj PaymentTransitionStateAction) MarshalJSON() ([]byte, error) { type Alias PaymentTransitionStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "transitionState", Alias: (*Alias)(&obj)}) diff --git a/commercetools/types_product.go b/commercetools/types_product.go index 7f1930db..07c22fc5 100644 --- a/commercetools/types_product.go +++ b/commercetools/types_product.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // FacetTypes is an enum type @@ -500,7 +502,7 @@ type FacetResults struct { // on the discriminator value func (obj *FacetResults) UnmarshalJSON(data []byte) error { type Alias FacetResults - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } return nil @@ -1427,7 +1429,7 @@ type ProductUpdate struct { // on the discriminator value func (obj *ProductUpdate) UnmarshalJSON(data []byte) error { type Alias ProductUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { @@ -1506,7 +1508,7 @@ type SearchKeyword struct { // on the discriminator value func (obj *SearchKeyword) UnmarshalJSON(data []byte) error { type Alias SearchKeyword - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.SuggestTokenizer != nil { diff --git a/commercetools/types_product_discount.go b/commercetools/types_product_discount.go index 0b768587..3bcaae47 100644 --- a/commercetools/types_product_discount.go +++ b/commercetools/types_product_discount.go @@ -3,9 +3,11 @@ package commercetools import ( - "encoding/json" + json1 "encoding/json" "errors" "time" + + json "github.com/segmentio/encoding/json" ) // ProductDiscountUpdateAction uses action as discriminator attribute @@ -236,7 +238,7 @@ type ProductDiscountChangeIsActiveAction struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountChangeIsActiveAction) MarshalJSON() ([]byte, error) { type Alias ProductDiscountChangeIsActiveAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeIsActive", Alias: (*Alias)(&obj)}) @@ -250,7 +252,7 @@ type ProductDiscountChangeNameAction struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountChangeNameAction) MarshalJSON() ([]byte, error) { type Alias ProductDiscountChangeNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeName", Alias: (*Alias)(&obj)}) @@ -264,7 +266,7 @@ type ProductDiscountChangePredicateAction struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountChangePredicateAction) MarshalJSON() ([]byte, error) { type Alias ProductDiscountChangePredicateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changePredicate", Alias: (*Alias)(&obj)}) @@ -278,7 +280,7 @@ type ProductDiscountChangeSortOrderAction struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountChangeSortOrderAction) MarshalJSON() ([]byte, error) { type Alias ProductDiscountChangeSortOrderAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeSortOrder", Alias: (*Alias)(&obj)}) @@ -292,7 +294,7 @@ type ProductDiscountChangeValueAction struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountChangeValueAction) MarshalJSON() ([]byte, error) { type Alias ProductDiscountChangeValueAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "changeValue", Alias: (*Alias)(&obj)}) @@ -373,7 +375,7 @@ type ProductDiscountReference struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountReference) MarshalJSON() ([]byte, error) { type Alias ProductDiscountReference - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "product-discount", Alias: (*Alias)(&obj)}) @@ -388,7 +390,7 @@ type ProductDiscountResourceIdentifier struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountResourceIdentifier) MarshalJSON() ([]byte, error) { type Alias ProductDiscountResourceIdentifier - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "product-discount", Alias: (*Alias)(&obj)}) @@ -402,7 +404,7 @@ type ProductDiscountSetDescriptionAction struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountSetDescriptionAction) MarshalJSON() ([]byte, error) { type Alias ProductDiscountSetDescriptionAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setDescription", Alias: (*Alias)(&obj)}) @@ -416,7 +418,7 @@ type ProductDiscountSetKeyAction struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountSetKeyAction) MarshalJSON() ([]byte, error) { type Alias ProductDiscountSetKeyAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setKey", Alias: (*Alias)(&obj)}) @@ -430,7 +432,7 @@ type ProductDiscountSetValidFromAction struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountSetValidFromAction) MarshalJSON() ([]byte, error) { type Alias ProductDiscountSetValidFromAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setValidFrom", Alias: (*Alias)(&obj)}) @@ -445,7 +447,7 @@ type ProductDiscountSetValidFromAndUntilAction struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountSetValidFromAndUntilAction) MarshalJSON() ([]byte, error) { type Alias ProductDiscountSetValidFromAndUntilAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setValidFromAndUntil", Alias: (*Alias)(&obj)}) @@ -459,7 +461,7 @@ type ProductDiscountSetValidUntilAction struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountSetValidUntilAction) MarshalJSON() ([]byte, error) { type Alias ProductDiscountSetValidUntilAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setValidUntil", Alias: (*Alias)(&obj)}) @@ -497,7 +499,7 @@ type ProductDiscountValueAbsolute struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountValueAbsolute) MarshalJSON() ([]byte, error) { type Alias ProductDiscountValueAbsolute - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "absolute", Alias: (*Alias)(&obj)}) @@ -529,7 +531,7 @@ type ProductDiscountValueAbsoluteDraft struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountValueAbsoluteDraft) MarshalJSON() ([]byte, error) { type Alias ProductDiscountValueAbsoluteDraft - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "absolute", Alias: (*Alias)(&obj)}) @@ -541,7 +543,7 @@ type ProductDiscountValueExternal struct{} // MarshalJSON override to set the discriminator value func (obj ProductDiscountValueExternal) MarshalJSON() ([]byte, error) { type Alias ProductDiscountValueExternal - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "external", Alias: (*Alias)(&obj)}) @@ -553,7 +555,7 @@ type ProductDiscountValueExternalDraft struct{} // MarshalJSON override to set the discriminator value func (obj ProductDiscountValueExternalDraft) MarshalJSON() ([]byte, error) { type Alias ProductDiscountValueExternalDraft - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "external", Alias: (*Alias)(&obj)}) @@ -567,7 +569,7 @@ type ProductDiscountValueRelative struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountValueRelative) MarshalJSON() ([]byte, error) { type Alias ProductDiscountValueRelative - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "relative", Alias: (*Alias)(&obj)}) @@ -581,7 +583,7 @@ type ProductDiscountValueRelativeDraft struct { // MarshalJSON override to set the discriminator value func (obj ProductDiscountValueRelativeDraft) MarshalJSON() ([]byte, error) { type Alias ProductDiscountValueRelativeDraft - return json.Marshal(struct { + return json1.Marshal(struct { Type string `json:"type"` *Alias }{Type: "relative", Alias: (*Alias)(&obj)}) diff --git a/commercetools/types_product_type.go b/commercetools/types_product_type.go index c6c843ea..247690be 100644 --- a/commercetools/types_product_type.go +++ b/commercetools/types_product_type.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // AttributeConstraintEnum is an enum type @@ -368,7 +370,7 @@ type AttributeDefinition struct { // on the discriminator value func (obj *AttributeDefinition) UnmarshalJSON(data []byte) error { type Alias AttributeDefinition - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.Type != nil { @@ -398,7 +400,7 @@ type AttributeDefinitionDraft struct { // on the discriminator value func (obj *AttributeDefinitionDraft) UnmarshalJSON(data []byte) error { type Alias AttributeDefinitionDraft - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.Type != nil { @@ -534,7 +536,7 @@ func (obj AttributeSetType) MarshalJSON() ([]byte, error) { // on the discriminator value func (obj *AttributeSetType) UnmarshalJSON(data []byte) error { type Alias AttributeSetType - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.ElementType != nil { @@ -952,7 +954,7 @@ type ProductTypeUpdate struct { // on the discriminator value func (obj *ProductTypeUpdate) UnmarshalJSON(data []byte) error { type Alias ProductTypeUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/commercetools/types_project.go b/commercetools/types_project.go index eb245720..327e7a37 100644 --- a/commercetools/types_project.go +++ b/commercetools/types_project.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // SearchIndexingConfigurationStatus is an enum type @@ -229,7 +231,7 @@ type Project struct { // on the discriminator value func (obj *Project) UnmarshalJSON(data []byte) error { type Alias Project - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.ShippingRateInputType != nil { @@ -401,7 +403,7 @@ func (obj ProjectSetShippingRateInputTypeAction) MarshalJSON() ([]byte, error) { // on the discriminator value func (obj *ProjectSetShippingRateInputTypeAction) UnmarshalJSON(data []byte) error { type Alias ProjectSetShippingRateInputTypeAction - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.ShippingRateInputType != nil { @@ -425,7 +427,7 @@ type ProjectUpdate struct { // on the discriminator value func (obj *ProjectUpdate) UnmarshalJSON(data []byte) error { type Alias ProjectUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/commercetools/types_review.go b/commercetools/types_review.go index 79fa5dc8..ba46dcee 100644 --- a/commercetools/types_review.go +++ b/commercetools/types_review.go @@ -3,9 +3,11 @@ package commercetools import ( - "encoding/json" + json1 "encoding/json" "errors" "time" + + json "github.com/segmentio/encoding/json" ) // ReviewUpdateAction uses action as discriminator attribute @@ -209,7 +211,7 @@ type ReviewReference struct { // MarshalJSON override to set the discriminator value func (obj ReviewReference) MarshalJSON() ([]byte, error) { type Alias ReviewReference - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "review", Alias: (*Alias)(&obj)}) @@ -224,7 +226,7 @@ type ReviewResourceIdentifier struct { // MarshalJSON override to set the discriminator value func (obj ReviewResourceIdentifier) MarshalJSON() ([]byte, error) { type Alias ReviewResourceIdentifier - return json.Marshal(struct { + return json1.Marshal(struct { TypeID string `json:"typeId"` *Alias }{TypeID: "review", Alias: (*Alias)(&obj)}) @@ -238,7 +240,7 @@ type ReviewSetAuthorNameAction struct { // MarshalJSON override to set the discriminator value func (obj ReviewSetAuthorNameAction) MarshalJSON() ([]byte, error) { type Alias ReviewSetAuthorNameAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setAuthorName", Alias: (*Alias)(&obj)}) @@ -253,7 +255,7 @@ type ReviewSetCustomFieldAction struct { // MarshalJSON override to set the discriminator value func (obj ReviewSetCustomFieldAction) MarshalJSON() ([]byte, error) { type Alias ReviewSetCustomFieldAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomField", Alias: (*Alias)(&obj)}) @@ -268,7 +270,7 @@ type ReviewSetCustomTypeAction struct { // MarshalJSON override to set the discriminator value func (obj ReviewSetCustomTypeAction) MarshalJSON() ([]byte, error) { type Alias ReviewSetCustomTypeAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomType", Alias: (*Alias)(&obj)}) @@ -282,7 +284,7 @@ type ReviewSetCustomerAction struct { // MarshalJSON override to set the discriminator value func (obj ReviewSetCustomerAction) MarshalJSON() ([]byte, error) { type Alias ReviewSetCustomerAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setCustomer", Alias: (*Alias)(&obj)}) @@ -296,7 +298,7 @@ type ReviewSetKeyAction struct { // MarshalJSON override to set the discriminator value func (obj ReviewSetKeyAction) MarshalJSON() ([]byte, error) { type Alias ReviewSetKeyAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setKey", Alias: (*Alias)(&obj)}) @@ -310,7 +312,7 @@ type ReviewSetLocaleAction struct { // MarshalJSON override to set the discriminator value func (obj ReviewSetLocaleAction) MarshalJSON() ([]byte, error) { type Alias ReviewSetLocaleAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setLocale", Alias: (*Alias)(&obj)}) @@ -324,7 +326,7 @@ type ReviewSetRatingAction struct { // MarshalJSON override to set the discriminator value func (obj ReviewSetRatingAction) MarshalJSON() ([]byte, error) { type Alias ReviewSetRatingAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setRating", Alias: (*Alias)(&obj)}) @@ -338,7 +340,7 @@ type ReviewSetTargetAction struct { // MarshalJSON override to set the discriminator value func (obj ReviewSetTargetAction) MarshalJSON() ([]byte, error) { type Alias ReviewSetTargetAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setTarget", Alias: (*Alias)(&obj)}) @@ -370,7 +372,7 @@ type ReviewSetTextAction struct { // MarshalJSON override to set the discriminator value func (obj ReviewSetTextAction) MarshalJSON() ([]byte, error) { type Alias ReviewSetTextAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setText", Alias: (*Alias)(&obj)}) @@ -384,7 +386,7 @@ type ReviewSetTitleAction struct { // MarshalJSON override to set the discriminator value func (obj ReviewSetTitleAction) MarshalJSON() ([]byte, error) { type Alias ReviewSetTitleAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "setTitle", Alias: (*Alias)(&obj)}) @@ -399,7 +401,7 @@ type ReviewTransitionStateAction struct { // MarshalJSON override to set the discriminator value func (obj ReviewTransitionStateAction) MarshalJSON() ([]byte, error) { type Alias ReviewTransitionStateAction - return json.Marshal(struct { + return json1.Marshal(struct { Action string `json:"action"` *Alias }{Action: "transitionState", Alias: (*Alias)(&obj)}) diff --git a/commercetools/types_shipping_method.go b/commercetools/types_shipping_method.go index 5b9eeb54..6985d7cf 100644 --- a/commercetools/types_shipping_method.go +++ b/commercetools/types_shipping_method.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // ShippingRateTierType is an enum type @@ -488,7 +490,7 @@ type ShippingMethodUpdate struct { // on the discriminator value func (obj *ShippingMethodUpdate) UnmarshalJSON(data []byte) error { type Alias ShippingMethodUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { @@ -514,7 +516,7 @@ type ShippingRate struct { // on the discriminator value func (obj *ShippingRate) UnmarshalJSON(data []byte) error { type Alias ShippingRate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.FreeAbove != nil { @@ -553,7 +555,7 @@ type ShippingRateDraft struct { // on the discriminator value func (obj *ShippingRateDraft) UnmarshalJSON(data []byte) error { type Alias ShippingRateDraft - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Tiers { diff --git a/commercetools/types_shopping_list.go b/commercetools/types_shopping_list.go index 9f9b6d49..bb566bfd 100644 --- a/commercetools/types_shopping_list.go +++ b/commercetools/types_shopping_list.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // ShoppingListUpdateAction uses action as discriminator attribute @@ -683,7 +685,7 @@ type ShoppingListUpdate struct { // on the discriminator value func (obj *ShoppingListUpdate) UnmarshalJSON(data []byte) error { type Alias ShoppingListUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/commercetools/types_state.go b/commercetools/types_state.go index 76b9b816..66a413ab 100644 --- a/commercetools/types_state.go +++ b/commercetools/types_state.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // StateRoleEnum is an enum type @@ -314,7 +316,7 @@ type StateUpdate struct { // on the discriminator value func (obj *StateUpdate) UnmarshalJSON(data []byte) error { type Alias StateUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/commercetools/types_store.go b/commercetools/types_store.go index 055e95de..be86e774 100644 --- a/commercetools/types_store.go +++ b/commercetools/types_store.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // StoreUpdateAction uses action as discriminator attribute @@ -327,7 +329,7 @@ type StoreUpdate struct { // on the discriminator value func (obj *StoreUpdate) UnmarshalJSON(data []byte) error { type Alias StoreUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/commercetools/types_subscription.go b/commercetools/types_subscription.go index bc791f36..4f77ff07 100644 --- a/commercetools/types_subscription.go +++ b/commercetools/types_subscription.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // SubscriptionHealthStatus is an enum type @@ -442,7 +444,7 @@ type Subscription struct { // on the discriminator value func (obj *Subscription) UnmarshalJSON(data []byte) error { type Alias Subscription - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.Destination != nil { @@ -481,7 +483,7 @@ func (obj SubscriptionChangeDestinationAction) MarshalJSON() ([]byte, error) { // on the discriminator value func (obj *SubscriptionChangeDestinationAction) UnmarshalJSON(data []byte) error { type Alias SubscriptionChangeDestinationAction - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.Destination != nil { @@ -508,7 +510,7 @@ type SubscriptionDraft struct { // on the discriminator value func (obj *SubscriptionDraft) UnmarshalJSON(data []byte) error { type Alias SubscriptionDraft - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.Destination != nil { @@ -590,7 +592,7 @@ type SubscriptionUpdate struct { // on the discriminator value func (obj *SubscriptionUpdate) UnmarshalJSON(data []byte) error { type Alias SubscriptionUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/commercetools/types_tax_category.go b/commercetools/types_tax_category.go index 690ffcee..8edf5424 100644 --- a/commercetools/types_tax_category.go +++ b/commercetools/types_tax_category.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // TaxCategoryUpdateAction uses action as discriminator attribute @@ -230,7 +232,7 @@ type TaxCategoryUpdate struct { // on the discriminator value func (obj *TaxCategoryUpdate) UnmarshalJSON(data []byte) error { type Alias TaxCategoryUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/commercetools/types_type.go b/commercetools/types_type.go index d3c6fc39..630b0c5f 100644 --- a/commercetools/types_type.go +++ b/commercetools/types_type.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // ResourceTypeID is an enum type @@ -422,7 +424,7 @@ func (obj CustomFieldSetType) MarshalJSON() ([]byte, error) { // on the discriminator value func (obj *CustomFieldSetType) UnmarshalJSON(data []byte) error { type Alias CustomFieldSetType - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.ElementType != nil { @@ -485,7 +487,7 @@ type FieldDefinition struct { // on the discriminator value func (obj *FieldDefinition) UnmarshalJSON(data []byte) error { type Alias FieldDefinition - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } if obj.Type != nil { @@ -791,7 +793,7 @@ type TypeUpdate struct { // on the discriminator value func (obj *TypeUpdate) UnmarshalJSON(data []byte) error { type Alias TypeUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/commercetools/types_zone.go b/commercetools/types_zone.go index 9dbaa6fe..29b32bb5 100644 --- a/commercetools/types_zone.go +++ b/commercetools/types_zone.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "time" + + json1 "github.com/segmentio/encoding/json" ) // ZoneUpdateAction uses action as discriminator attribute @@ -208,7 +210,7 @@ type ZoneUpdate struct { // on the discriminator value func (obj *ZoneUpdate) UnmarshalJSON(data []byte) error { type Alias ZoneUpdate - if err := json.Unmarshal(data, (*Alias)(obj)); err != nil { + if err := json1.Unmarshal(data, (*Alias)(obj)); err != nil { return err } for i := range obj.Actions { diff --git a/go.mod b/go.mod index 9a4c4867..5908f250 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( github.com/opentracing-contrib/go-stdlib v1.0.0 github.com/opentracing/opentracing-go v1.2.0 github.com/pkg/errors v0.9.1 + github.com/segmentio/encoding v0.2.21 // indirect github.com/stretchr/testify v1.6.1 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d gopkg.in/yaml.v2 v2.3.0 diff --git a/go.sum b/go.sum index 86cdb502..51734d91 100644 --- a/go.sum +++ b/go.sum @@ -9,6 +9,8 @@ github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 h1:VHgatEHNcBFEB7inlalqfNqw65aNkM1lGX2yt3NmbS8= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= +github.com/klauspost/cpuid/v2 v2.0.6 h1:dQ5ueTiftKxp0gyjKSx5+8BtPWkyQbd95m8Gys/RarI= +github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg= github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/opentracing-contrib/go-stdlib v1.0.0 h1:TBS7YuVotp8myLon4Pv7BtCBzOTo1DeZCld0Z63mW2w= @@ -20,6 +22,10 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/segmentio/asm v1.0.1 h1:g9VK62hXylgXI4yJV+dLTu/1j7kTxG9bkUSYBxL9dpg= +github.com/segmentio/asm v1.0.1/go.mod h1:4EUJGaKsB8ImLUwOGORVsNd9vTRDeh44JGsY4aKp5I4= +github.com/segmentio/encoding v0.2.21 h1:hlRQz3Pv+/mBj+jqr46TVqqv6AuTwvP5aAxQ0Usd4gY= +github.com/segmentio/encoding v0.2.21/go.mod h1:kF1db1oBuYxMvLR3RXrZJchRdBKrS+1J/hL63p5hekI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=