diff --git a/profiles/preview/preview/frontdoor/mgmt/frontdoor/models.go b/profiles/preview/preview/frontdoor/mgmt/frontdoor/models.go index 38aa56ec23bf..07f791e21278 100644 --- a/profiles/preview/preview/frontdoor/mgmt/frontdoor/models.go +++ b/profiles/preview/preview/frontdoor/mgmt/frontdoor/models.go @@ -168,6 +168,13 @@ const ( OneFullStopZero MinimumTLSVersion = original.OneFullStopZero ) +type MinimumTLSVersion = original.MinimumTLSVersion + +const ( + OneFullStopTwo MinimumTLSVersion = original.OneFullStopTwo + OneFullStopZero MinimumTLSVersion = original.OneFullStopZero +) + type NetworkOperationStatus = original.NetworkOperationStatus const ( diff --git a/profiles/preview/preview/managednetwork/mgmt/managednetwork/models.go b/profiles/preview/preview/managednetwork/mgmt/managednetwork/models.go index d2b5de3e5177..579ee5b72acb 100644 --- a/profiles/preview/preview/managednetwork/mgmt/managednetwork/models.go +++ b/profiles/preview/preview/managednetwork/mgmt/managednetwork/models.go @@ -35,6 +35,14 @@ const ( Connectivity Kind = original.Connectivity ) +type PeeringPolicyType = original.PeeringPolicyType + +const ( + PeeringPolicyTypeHubAndSpokeTopology PeeringPolicyType = original.PeeringPolicyTypeHubAndSpokeTopology + PeeringPolicyTypeManagedNetworkPeeringPolicyProperties PeeringPolicyType = original.PeeringPolicyTypeManagedNetworkPeeringPolicyProperties + PeeringPolicyTypeMeshTopology PeeringPolicyType = original.PeeringPolicyTypeMeshTopology +) + type ProvisioningState = original.ProvisioningState const ( @@ -44,14 +52,8 @@ const ( Updating ProvisioningState = original.Updating ) -type Type = original.Type - -const ( - HubAndSpokeTopology Type = original.HubAndSpokeTopology - MeshTopology Type = original.MeshTopology -) - type BaseClient = original.BaseClient +type BasicPeeringPolicyProperties = original.BasicPeeringPolicyProperties type ConnectivityCollection = original.ConnectivityCollection type ErrorResponse = original.ErrorResponse type Group = original.Group @@ -169,12 +171,12 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { func PossibleKindValues() []Kind { return original.PossibleKindValues() } +func PossiblePeeringPolicyTypeValues() []PeeringPolicyType { + return original.PossiblePeeringPolicyTypeValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } -func PossibleTypeValues() []Type { - return original.PossibleTypeValues() -} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/models.go b/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/models.go index ab92d8309169..b7801231ebc4 100644 --- a/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/models.go +++ b/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/models.go @@ -302,13 +302,11 @@ const ( RequestMethod MatchVariable = "RequestMethod" // RequestURI ... RequestURI MatchVariable = "RequestUri" - // SocketAddr ... - SocketAddr MatchVariable = "SocketAddr" ) // PossibleMatchVariableValues returns an array of possible values for the MatchVariable const type. func PossibleMatchVariableValues() []MatchVariable { - return []MatchVariable{Cookies, PostArgs, QueryString, RemoteAddr, RequestBody, RequestHeader, RequestMethod, RequestURI, SocketAddr} + return []MatchVariable{Cookies, PostArgs, QueryString, RemoteAddr, RequestBody, RequestHeader, RequestMethod, RequestURI} } // MinimumTLSVersion enumerates the values for minimum tls version. @@ -2829,7 +2827,7 @@ type ManagedRuleSetList struct { // MatchCondition define a match condition. type MatchCondition struct { - // MatchVariable - Request variable to compare with. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestURI', 'RequestHeader', 'RequestBody', 'Cookies', 'SocketAddr' + // MatchVariable - Request variable to compare with. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestURI', 'RequestHeader', 'RequestBody', 'Cookies' MatchVariable MatchVariable `json:"matchVariable,omitempty"` // Selector - Match against a specific key from the QueryString, PostArgs, RequestHeader or Cookies variables. Default is null. Selector *string `json:"selector,omitempty"` diff --git a/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/models.go b/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/models.go index 5b1fc536f0d2..92c5c90ee3aa 100644 --- a/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/models.go +++ b/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/models.go @@ -43,6 +43,23 @@ func PossibleKindValues() []Kind { return []Kind{Connectivity} } +// PeeringPolicyType enumerates the values for peering policy type. +type PeeringPolicyType string + +const ( + // PeeringPolicyTypeHubAndSpokeTopology ... + PeeringPolicyTypeHubAndSpokeTopology PeeringPolicyType = "HubAndSpokeTopology" + // PeeringPolicyTypeManagedNetworkPeeringPolicyProperties ... + PeeringPolicyTypeManagedNetworkPeeringPolicyProperties PeeringPolicyType = "ManagedNetworkPeeringPolicyProperties" + // PeeringPolicyTypeMeshTopology ... + PeeringPolicyTypeMeshTopology PeeringPolicyType = "MeshTopology" +) + +// PossiblePeeringPolicyTypeValues returns an array of possible values for the PeeringPolicyType const type. +func PossiblePeeringPolicyTypeValues() []PeeringPolicyType { + return []PeeringPolicyType{PeeringPolicyTypeHubAndSpokeTopology, PeeringPolicyTypeManagedNetworkPeeringPolicyProperties, PeeringPolicyTypeMeshTopology} +} + // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -62,21 +79,6 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{Deleting, Failed, Succeeded, Updating} } -// Type enumerates the values for type. -type Type string - -const ( - // HubAndSpokeTopology ... - HubAndSpokeTopology Type = "HubAndSpokeTopology" - // MeshTopology ... - MeshTopology Type = "MeshTopology" -) - -// PossibleTypeValues returns an array of possible values for the Type const type. -func PossibleTypeValues() []Type { - return []Type{HubAndSpokeTopology, MeshTopology} -} - // ConnectivityCollection the collection of Connectivity related groups and policies within the Managed // Network type ConnectivityCollection struct { @@ -397,8 +399,6 @@ func (future *GroupsDeleteFuture) Result(client GroupsClient) (ar autorest.Respo // HubAndSpokePeeringPolicyProperties properties of a Hub and Spoke Peering Policy type HubAndSpokePeeringPolicyProperties struct { - // Type - Gets or sets the connectivity type of a network structure policy. Possible values include: 'HubAndSpokeTopology', 'MeshTopology' - Type Type `json:"type,omitempty"` // Hub - Gets or sets the hub virtual network ID Hub *ResourceID `json:"hub,omitempty"` // Spokes - Gets or sets the spokes group IDs @@ -409,6 +409,47 @@ type HubAndSpokePeeringPolicyProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // PeeringPolicyType - Possible values include: 'PeeringPolicyTypeManagedNetworkPeeringPolicyProperties', 'PeeringPolicyTypeHubAndSpokeTopology', 'PeeringPolicyTypeMeshTopology' + PeeringPolicyType PeeringPolicyType `json:"peeringPolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HubAndSpokePeeringPolicyProperties. +func (hasppp HubAndSpokePeeringPolicyProperties) MarshalJSON() ([]byte, error) { + hasppp.PeeringPolicyType = PeeringPolicyTypeHubAndSpokeTopology + objectMap := make(map[string]interface{}) + if hasppp.Hub != nil { + objectMap["hub"] = hasppp.Hub + } + if hasppp.Spokes != nil { + objectMap["spokes"] = hasppp.Spokes + } + if hasppp.Mesh != nil { + objectMap["mesh"] = hasppp.Mesh + } + if hasppp.PeeringPolicyType != "" { + objectMap["peeringPolicyType"] = hasppp.PeeringPolicyType + } + return json.Marshal(objectMap) +} + +// AsHubAndSpokePeeringPolicyProperties is the BasicPeeringPolicyProperties implementation for HubAndSpokePeeringPolicyProperties. +func (hasppp HubAndSpokePeeringPolicyProperties) AsHubAndSpokePeeringPolicyProperties() (*HubAndSpokePeeringPolicyProperties, bool) { + return &hasppp, true +} + +// AsMeshPeeringPolicyProperties is the BasicPeeringPolicyProperties implementation for HubAndSpokePeeringPolicyProperties. +func (hasppp HubAndSpokePeeringPolicyProperties) AsMeshPeeringPolicyProperties() (*MeshPeeringPolicyProperties, bool) { + return nil, false +} + +// AsPeeringPolicyProperties is the BasicPeeringPolicyProperties implementation for HubAndSpokePeeringPolicyProperties. +func (hasppp HubAndSpokePeeringPolicyProperties) AsPeeringPolicyProperties() (*PeeringPolicyProperties, bool) { + return nil, false +} + +// AsBasicPeeringPolicyProperties is the BasicPeeringPolicyProperties implementation for HubAndSpokePeeringPolicyProperties. +func (hasppp HubAndSpokePeeringPolicyProperties) AsBasicPeeringPolicyProperties() (BasicPeeringPolicyProperties, bool) { + return &hasppp, true } // ListResult result of the request to list Managed Network. It contains a list of Managed Networks and a @@ -564,7 +605,7 @@ type ManagedNetwork struct { // Properties - The MNC properties *Properties `json:"properties,omitempty"` // Tags - Resource tags. - Tags *[]string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -610,12 +651,12 @@ func (mn *ManagedNetwork) UnmarshalJSON(body []byte) error { } case "tags": if v != nil { - var tags []string + var tags map[string]*string err = json.Unmarshal(*v, &tags) if err != nil { return err } - mn.Tags = &tags + mn.Tags = tags } case "location": if v != nil { @@ -713,20 +754,59 @@ func (future *ManagedNetworksUpdateFutureType) Result(client ManagedNetworksClie // MeshPeeringPolicyProperties properties of a Mesh Peering Policy type MeshPeeringPolicyProperties struct { - // Type - Gets or sets the connectivity type of a network structure policy. Possible values include: 'HubAndSpokeTopology', 'MeshTopology' - Type Type `json:"type,omitempty"` // Hub - Gets or sets the hub virtual network ID Hub *ResourceID `json:"hub,omitempty"` // Spokes - Gets or sets the spokes group IDs Spokes *[]ResourceID `json:"spokes,omitempty"` // Mesh - Gets or sets the mesh group IDs Mesh *[]ResourceID `json:"mesh,omitempty"` + // PeeringPolicyType - Possible values include: 'PeeringPolicyTypeManagedNetworkPeeringPolicyProperties', 'PeeringPolicyTypeHubAndSpokeTopology', 'PeeringPolicyTypeMeshTopology' + PeeringPolicyType PeeringPolicyType `json:"peeringPolicyType,omitempty"` // ProvisioningState - READ-ONLY; Provisioning state of the ManagedNetwork resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. Possible values include: 'Updating', 'Deleting', 'Failed', 'Succeeded' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` } +// MarshalJSON is the custom marshaler for MeshPeeringPolicyProperties. +func (mppp MeshPeeringPolicyProperties) MarshalJSON() ([]byte, error) { + mppp.PeeringPolicyType = PeeringPolicyTypeMeshTopology + objectMap := make(map[string]interface{}) + if mppp.Hub != nil { + objectMap["hub"] = mppp.Hub + } + if mppp.Spokes != nil { + objectMap["spokes"] = mppp.Spokes + } + if mppp.Mesh != nil { + objectMap["mesh"] = mppp.Mesh + } + if mppp.PeeringPolicyType != "" { + objectMap["peeringPolicyType"] = mppp.PeeringPolicyType + } + return json.Marshal(objectMap) +} + +// AsHubAndSpokePeeringPolicyProperties is the BasicPeeringPolicyProperties implementation for MeshPeeringPolicyProperties. +func (mppp MeshPeeringPolicyProperties) AsHubAndSpokePeeringPolicyProperties() (*HubAndSpokePeeringPolicyProperties, bool) { + return nil, false +} + +// AsMeshPeeringPolicyProperties is the BasicPeeringPolicyProperties implementation for MeshPeeringPolicyProperties. +func (mppp MeshPeeringPolicyProperties) AsMeshPeeringPolicyProperties() (*MeshPeeringPolicyProperties, bool) { + return &mppp, true +} + +// AsPeeringPolicyProperties is the BasicPeeringPolicyProperties implementation for MeshPeeringPolicyProperties. +func (mppp MeshPeeringPolicyProperties) AsPeeringPolicyProperties() (*PeeringPolicyProperties, bool) { + return nil, false +} + +// AsBasicPeeringPolicyProperties is the BasicPeeringPolicyProperties implementation for MeshPeeringPolicyProperties. +func (mppp MeshPeeringPolicyProperties) AsBasicPeeringPolicyProperties() (BasicPeeringPolicyProperties, bool) { + return &mppp, true +} + // Operation REST API operation type Operation struct { // Name - Operation name: {provider}/{resource}/{operation} @@ -948,7 +1028,7 @@ func (future *PeeringPoliciesDeleteFuture) Result(client PeeringPoliciesClient) type PeeringPolicy struct { autorest.Response `json:"-"` // Properties - Gets or sets the properties of a Managed Network Policy - Properties *PeeringPolicyProperties `json:"properties,omitempty"` + Properties BasicPeeringPolicyProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource @@ -957,6 +1037,56 @@ type PeeringPolicy struct { Type *string `json:"type,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for PeeringPolicy struct. +func (pp *PeeringPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicPeeringPolicyProperties(*v) + if err != nil { + return err + } + pp.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pp.Type = &typeVar + } + } + } + + return nil +} + // PeeringPolicyListResult result of the request to list Managed Network Peering Policies. It contains a // list of policies and a URL link to get the next set of results. type PeeringPolicyListResult struct { @@ -1104,25 +1234,112 @@ func NewPeeringPolicyListResultPage(getNextPage func(context.Context, PeeringPol return PeeringPolicyListResultPage{fn: getNextPage} } +// BasicPeeringPolicyProperties properties of a Managed Network Peering Policy +type BasicPeeringPolicyProperties interface { + AsHubAndSpokePeeringPolicyProperties() (*HubAndSpokePeeringPolicyProperties, bool) + AsMeshPeeringPolicyProperties() (*MeshPeeringPolicyProperties, bool) + AsPeeringPolicyProperties() (*PeeringPolicyProperties, bool) +} + // PeeringPolicyProperties properties of a Managed Network Peering Policy type PeeringPolicyProperties struct { - // Type - Gets or sets the connectivity type of a network structure policy. Possible values include: 'HubAndSpokeTopology', 'MeshTopology' - Type Type `json:"type,omitempty"` // Hub - Gets or sets the hub virtual network ID Hub *ResourceID `json:"hub,omitempty"` // Spokes - Gets or sets the spokes group IDs Spokes *[]ResourceID `json:"spokes,omitempty"` // Mesh - Gets or sets the mesh group IDs Mesh *[]ResourceID `json:"mesh,omitempty"` + // PeeringPolicyType - Possible values include: 'PeeringPolicyTypeManagedNetworkPeeringPolicyProperties', 'PeeringPolicyTypeHubAndSpokeTopology', 'PeeringPolicyTypeMeshTopology' + PeeringPolicyType PeeringPolicyType `json:"peeringPolicyType,omitempty"` // ProvisioningState - READ-ONLY; Provisioning state of the ManagedNetwork resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. Possible values include: 'Updating', 'Deleting', 'Failed', 'Succeeded' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` } +func unmarshalBasicPeeringPolicyProperties(body []byte) (BasicPeeringPolicyProperties, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["peeringPolicyType"] { + case string(PeeringPolicyTypeHubAndSpokeTopology): + var hasppp HubAndSpokePeeringPolicyProperties + err := json.Unmarshal(body, &hasppp) + return hasppp, err + case string(PeeringPolicyTypeMeshTopology): + var mppp MeshPeeringPolicyProperties + err := json.Unmarshal(body, &mppp) + return mppp, err + default: + var ppp PeeringPolicyProperties + err := json.Unmarshal(body, &ppp) + return ppp, err + } +} +func unmarshalBasicPeeringPolicyPropertiesArray(body []byte) ([]BasicPeeringPolicyProperties, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pppArray := make([]BasicPeeringPolicyProperties, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ppp, err := unmarshalBasicPeeringPolicyProperties(*rawMessage) + if err != nil { + return nil, err + } + pppArray[index] = ppp + } + return pppArray, nil +} + +// MarshalJSON is the custom marshaler for PeeringPolicyProperties. +func (ppp PeeringPolicyProperties) MarshalJSON() ([]byte, error) { + ppp.PeeringPolicyType = PeeringPolicyTypeManagedNetworkPeeringPolicyProperties + objectMap := make(map[string]interface{}) + if ppp.Hub != nil { + objectMap["hub"] = ppp.Hub + } + if ppp.Spokes != nil { + objectMap["spokes"] = ppp.Spokes + } + if ppp.Mesh != nil { + objectMap["mesh"] = ppp.Mesh + } + if ppp.PeeringPolicyType != "" { + objectMap["peeringPolicyType"] = ppp.PeeringPolicyType + } + return json.Marshal(objectMap) +} + +// AsHubAndSpokePeeringPolicyProperties is the BasicPeeringPolicyProperties implementation for PeeringPolicyProperties. +func (ppp PeeringPolicyProperties) AsHubAndSpokePeeringPolicyProperties() (*HubAndSpokePeeringPolicyProperties, bool) { + return nil, false +} + +// AsMeshPeeringPolicyProperties is the BasicPeeringPolicyProperties implementation for PeeringPolicyProperties. +func (ppp PeeringPolicyProperties) AsMeshPeeringPolicyProperties() (*MeshPeeringPolicyProperties, bool) { + return nil, false +} + +// AsPeeringPolicyProperties is the BasicPeeringPolicyProperties implementation for PeeringPolicyProperties. +func (ppp PeeringPolicyProperties) AsPeeringPolicyProperties() (*PeeringPolicyProperties, bool) { + return &ppp, true +} + +// AsBasicPeeringPolicyProperties is the BasicPeeringPolicyProperties implementation for PeeringPolicyProperties. +func (ppp PeeringPolicyProperties) AsBasicPeeringPolicyProperties() (BasicPeeringPolicyProperties, bool) { + return &ppp, true +} + // Properties properties of Managed Network type Properties struct { - // Scope - The collection of management groups, subscriptions, virtual networks, and subnets by the Managed Network. This is a read-only property that is reflective of all ScopeAssignments for this Managed Network + // Scope - READ-ONLY; The collection of management groups, subscriptions, virtual networks, and subnets by the Managed Network. This is a read-only property that is reflective of all ScopeAssignments for this Managed Network Scope *Scope `json:"scope,omitempty"` // Connectivity - READ-ONLY; The collection of groups and policies concerned with connectivity Connectivity *ConnectivityCollection `json:"connectivity,omitempty"` @@ -1412,7 +1629,7 @@ type ScopeAssignmentProperties struct { // TrackedResource the resource model definition for a ARM tracked top level resource type TrackedResource struct { // Tags - Resource tags. - Tags *[]string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -1423,8 +1640,29 @@ type TrackedResource struct { Type *string `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + // Update update Tags of Managed Network type Update struct { // Tags - Updates the tags property of the Managed Network - Tags *[]string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Update. +func (u Update) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.Tags != nil { + objectMap["tags"] = u.Tags + } + return json.Marshal(objectMap) } diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index 572898ac481a..0f5af7fd539c 100644 --- a/swagger_to_sdk_config.json +++ b/swagger_to_sdk_config.json @@ -1,5 +1,5 @@ { - "$schema": "https://openapistorageprod.blob.core.windows.net/sdkautomation/prod/schemas/swagger_to_sdk_config.schema.json", + "$schema": "https://openapistoragetest.blob.core.windows.net/sdkautomation/test/schemas/swagger_to_sdk_config.schema.json", "meta": { "after_scripts": [ "dep ensure",