diff --git a/services/preview/subscription/mgmt/2018-03-01-preview/subscription/models.go b/services/preview/subscription/mgmt/2018-03-01-preview/subscription/models.go index 84e918ed75d0..15549112f3f8 100644 --- a/services/preview/subscription/mgmt/2018-03-01-preview/subscription/models.go +++ b/services/preview/subscription/mgmt/2018-03-01-preview/subscription/models.go @@ -18,6 +18,7 @@ package subscription // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( + "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "net/http" @@ -52,6 +53,26 @@ type CreationParameters struct { Owners *[]AdPrincipal `json:"owners,omitempty"` // OfferType - The offer type of the subscription. For example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P (EnterpriseAgreement devTest) are available. Only valid when creating a subscription in a enrollment account scope. Possible values include: 'MSAZR0017P', 'MSAZR0148P' OfferType OfferType `json:"offerType,omitempty"` + // AdditionalParameters - Additional, untyped parameters to support custom subscription creation scenarios. + AdditionalParameters map[string]interface{} `json:"additionalParameters"` +} + +// MarshalJSON is the custom marshaler for CreationParameters. +func (cp CreationParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.DisplayName != nil { + objectMap["displayName"] = cp.DisplayName + } + if cp.Owners != nil { + objectMap["owners"] = cp.Owners + } + if cp.OfferType != "" { + objectMap["offerType"] = cp.OfferType + } + if cp.AdditionalParameters != nil { + objectMap["additionalParameters"] = cp.AdditionalParameters + } + return json.Marshal(objectMap) } // CreationResult the created subscription object.