From 4b021e027bbcfcb7afe538c1c001b9bb9f60608b Mon Sep 17 00:00:00 2001 From: Azure SDK Bot Date: Fri, 20 Sep 2019 12:02:46 +0800 Subject: [PATCH] Generated from 239e696db0a17997d3bc2a77c9670180e527fcfc (#5797) Update location in ManagedNetwork --- .../managednetwork/models.go | 97 +++++++++++++++---- 1 file changed, 76 insertions(+), 21 deletions(-) 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..c3a952335c4c 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 @@ -107,6 +107,8 @@ type Group struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` } // MarshalJSON is the custom marshaler for Group. @@ -118,6 +120,9 @@ func (g Group) MarshalJSON() ([]byte, error) { if g.Kind != "" { objectMap["kind"] = g.Kind } + if g.Location != nil { + objectMap["location"] = g.Location + } return json.Marshal(objectMap) } @@ -175,6 +180,15 @@ func (g *Group) UnmarshalJSON(body []byte) error { } g.Type = &typeVar } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + g.Location = &location + } } } @@ -563,16 +577,16 @@ type ManagedNetwork struct { autorest.Response `json:"-"` // Properties - The MNC properties *Properties `json:"properties,omitempty"` - // Tags - Resource tags. - Tags *[]string `json:"tags,omitempty"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` // 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 Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` } // MarshalJSON is the custom marshaler for ManagedNetwork. @@ -610,21 +624,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 - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - mn.Location = &location + mn.Tags = tags } case "id": if v != nil { @@ -653,6 +658,15 @@ func (mn *ManagedNetwork) UnmarshalJSON(body []byte) error { } mn.Type = &typeVar } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mn.Location = &location + } } } @@ -955,6 +969,8 @@ type PeeringPolicy struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` } // PeeringPolicyListResult result of the request to list Managed Network Peering Policies. It contains a @@ -1141,6 +1157,8 @@ type ProxyResource struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` } // Resource the general resource model definition @@ -1151,6 +1169,8 @@ type Resource struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` } // ResourceID generic pointer to a resource @@ -1190,6 +1210,8 @@ type ScopeAssignment struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` } // MarshalJSON is the custom marshaler for ScopeAssignment. @@ -1198,6 +1220,9 @@ func (sa ScopeAssignment) MarshalJSON() ([]byte, error) { if sa.ScopeAssignmentProperties != nil { objectMap["properties"] = sa.ScopeAssignmentProperties } + if sa.Location != nil { + objectMap["location"] = sa.Location + } return json.Marshal(objectMap) } @@ -1246,6 +1271,15 @@ func (sa *ScopeAssignment) UnmarshalJSON(body []byte) error { } sa.Type = &typeVar } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sa.Location = &location + } } } @@ -1411,20 +1445,41 @@ 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"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` // 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 Name *string `json:"name,omitempty"` // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` + // Location - The geo-location where the resource lives + Location *string `json:"location,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 - Resource tags + 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) }