diff --git a/services/signalr/mgmt/2020-05-01/signalr/CHANGELOG.md b/services/signalr/mgmt/2020-05-01/signalr/CHANGELOG.md index c1bbea5cc91f..e9ef2054d06f 100644 --- a/services/signalr/mgmt/2020-05-01/signalr/CHANGELOG.md +++ b/services/signalr/mgmt/2020-05-01/signalr/CHANGELOG.md @@ -1,8 +1,8 @@ -# Change History +# Unreleased ## Additive Changes ### New Funcs -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) +1. CreateOrUpdateProperties.MarshalJSON() ([]byte, error) +1. ResourceSku.MarshalJSON() ([]byte, error) diff --git a/services/signalr/mgmt/2020-05-01/signalr/_meta.json b/services/signalr/mgmt/2020-05-01/signalr/_meta.json index 045fb37badee..78bdf5cd2163 100644 --- a/services/signalr/mgmt/2020-05-01/signalr/_meta.json +++ b/services/signalr/mgmt/2020-05-01/signalr/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a7d586879f08845a76d817fcfb00ab815b71e84a", "readme": "/_/azure-rest-api-specs/specification/signalr/resource-manager/readme.md", "tag": "package-2020-05-01", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/signalr/mgmt/2020-05-01/signalr/models.go b/services/signalr/mgmt/2020-05-01/signalr/models.go index 5083df3069fc..3232d0a53a52 100644 --- a/services/signalr/mgmt/2020-05-01/signalr/models.go +++ b/services/signalr/mgmt/2020-05-01/signalr/models.go @@ -70,7 +70,7 @@ func (future *CreateOrUpdateFuture) result(client Client) (rt ResourceType, err // CreateOrUpdateProperties settings used to provision or configure the resource. type CreateOrUpdateProperties struct { - // HostNamePrefix - Prefix for the hostName of the SignalR service. Retained for future use. + // HostNamePrefix - READ-ONLY; Prefix for the hostName of the SignalR service. Retained for future use. // The hostname will be of format: <hostNamePrefix>.service.signalr.net. HostNamePrefix *string `json:"hostNamePrefix,omitempty"` // Features - List of SignalR featureFlags. e.g. ServiceMode. @@ -88,6 +88,24 @@ type CreateOrUpdateProperties struct { NetworkACLs *NetworkACLs `json:"networkACLs,omitempty"` } +// MarshalJSON is the custom marshaler for CreateOrUpdateProperties. +func (coup CreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if coup.Features != nil { + objectMap["features"] = coup.Features + } + if coup.Cors != nil { + objectMap["cors"] = coup.Cors + } + if coup.Upstream != nil { + objectMap["upstream"] = coup.Upstream + } + if coup.NetworkACLs != nil { + objectMap["networkACLs"] = coup.NetworkACLs + } + return json.Marshal(objectMap) +} + // DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type DeleteFuture struct { azure.FutureAPI @@ -873,7 +891,7 @@ type Properties struct { Version *string `json:"version,omitempty"` // PrivateEndpointConnections - READ-ONLY; Private endpoint connections to the SignalR resource. PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - // HostNamePrefix - Prefix for the hostName of the SignalR service. Retained for future use. + // HostNamePrefix - READ-ONLY; Prefix for the hostName of the SignalR service. Retained for future use. // The hostname will be of format: <hostNamePrefix>.service.signalr.net. HostNamePrefix *string `json:"hostNamePrefix,omitempty"` // Features - List of SignalR featureFlags. e.g. ServiceMode. @@ -894,9 +912,6 @@ type Properties struct { // MarshalJSON is the custom marshaler for Properties. func (p Properties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if p.HostNamePrefix != nil { - objectMap["hostNamePrefix"] = p.HostNamePrefix - } if p.Features != nil { objectMap["features"] = p.Features } @@ -1164,9 +1179,9 @@ type ResourceSku struct { // // `Basic` is deprecated, use `Standard` instead. Possible values include: 'Free', 'Basic', 'Standard', 'Premium' Tier SkuTier `json:"tier,omitempty"` - // Size - Optional string. For future use. + // Size - READ-ONLY; Not used. Retained for future use. Size *string `json:"size,omitempty"` - // Family - Optional string. For future use. + // Family - READ-ONLY; Not used. Retained for future use. Family *string `json:"family,omitempty"` // Capacity - Optional, integer. The unit count of SignalR resource. 1 by default. // @@ -1176,6 +1191,21 @@ type ResourceSku struct { Capacity *int32 `json:"capacity,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceSku. +func (rs ResourceSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rs.Name != nil { + objectMap["name"] = rs.Name + } + if rs.Tier != "" { + objectMap["tier"] = rs.Tier + } + if rs.Capacity != nil { + objectMap["capacity"] = rs.Capacity + } + return json.Marshal(objectMap) +} + // ResourceType a class represent a SignalR service resource. type ResourceType struct { autorest.Response `json:"-"`