/// <summary>
        /// Serializes this instance of <see cref="ListOperations" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ListOperations" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._value)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                    foreach (var __x in this._value)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("value", __w);
                }
            }
            AddIf(null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ServiceAcrConfigurationInfo" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ServiceAcrConfigurationInfo" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._loginServer)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                foreach (var __x in this._loginServer)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("loginServers", __w);
            }
            if (null != this._ociArtifact)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                foreach (var __s in this._ociArtifact)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("ociArtifacts", __r);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="WorkspaceProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="WorkspaceProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._privateEndpointConnection)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                    foreach (var __x in this._privateEndpointConnection)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("privateEndpointConnections", __w);
                }
            }
            AddIf(null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ServiceSpecification" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ServiceSpecification" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._logSpecification)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                foreach (var __x in this._logSpecification)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("logSpecifications", __w);
            }
            if (null != this._metricSpecification)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                foreach (var __s in this._metricSpecification)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("metricSpecifications", __r);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="FhirServiceProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="FhirServiceProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._acrConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._acrConfiguration.ToJson(null, serializationMode) : null, "acrConfiguration", container.Add);
            AddIf(null != this._authenticationConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._authenticationConfiguration.ToJson(null, serializationMode) : null, "authenticationConfiguration", container.Add);
            AddIf(null != this._corsConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._corsConfiguration.ToJson(null, serializationMode) : null, "corsConfiguration", container.Add);
            AddIf(null != this._exportConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._exportConfiguration.ToJson(null, serializationMode) : null, "exportConfiguration", container.Add);
            AddIf(null != this._resourceVersionPolicyConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) this._resourceVersionPolicyConfiguration.ToJson(null, serializationMode) : null, "resourceVersionPolicyConfiguration", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            if (null != this._accessPolicy)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                foreach (var __x in this._accessPolicy)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("accessPolicies", __w);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._privateEndpointConnection)
                {
                    var __r = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                    foreach (var __s in this._privateEndpointConnection)
                    {
                        AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                    }
                    container.Add("privateEndpointConnections", __r);
                }
            }
            AddIf(null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._eventState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._eventState.ToString()) : null, "eventState", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="MetricSpecification" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="MetricSpecification" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            AddIf(null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName", container.Add);
            AddIf(null != (((object)this._displayDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._displayDescription.ToString()) : null, "displayDescription", container.Add);
            AddIf(null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit", container.Add);
            AddIf(null != (((object)this._category)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._category.ToString()) : null, "category", container.Add);
            AddIf(null != (((object)this._aggregationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._aggregationType.ToString()) : null, "aggregationType", container.Add);
            if (null != this._supportedAggregationType)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                foreach (var __x in this._supportedAggregationType)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("supportedAggregationTypes", __w);
            }
            if (null != this._supportedTimeGrainType)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                foreach (var __s in this._supportedTimeGrainType)
                {
                    AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                }
                container.Add("supportedTimeGrainTypes", __r);
            }
            AddIf(null != this._fillGapWithZero ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonBoolean((bool)this._fillGapWithZero) : null, "fillGapWithZero", container.Add);
            if (null != this._dimension)
            {
                var __m = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                foreach (var __n in this._dimension)
                {
                    AddIf(__n?.ToJson(null, serializationMode), __m.Add);
                }
                container.Add("dimensions", __m);
            }
            AddIf(null != (((object)this._sourceMdmNamespace)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._sourceMdmNamespace.ToString()) : null, "sourceMdmNamespace", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="FhirServiceCorsConfiguration" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="FhirServiceCorsConfiguration" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._origin)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                foreach (var __x in this._origin)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("origins", __w);
            }
            if (null != this._header)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                foreach (var __s in this._header)
                {
                    AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                }
                container.Add("headers", __r);
            }
            if (null != this._method)
            {
                var __m = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                foreach (var __n in this._method)
                {
                    AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(__n.ToString()) : null, __m.Add);
                }
                container.Add("methods", __m);
            }
            AddIf(null != this._maxAge ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNumber((int)this._maxAge) : null, "maxAge", container.Add);
            AddIf(null != this._allowCredentials ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonBoolean((bool)this._allowCredentials) : null, "allowCredentials", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Пример #8
0
        /// <summary>
        /// Serializes this instance of <see cref="PrivateLinkResourceProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="PrivateLinkResourceProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._groupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(this._groupId.ToString()) : null, "groupId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._requiredMember)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                    foreach (var __x in this._requiredMember)
                    {
                        AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                    }
                    container.Add("requiredMembers", __w);
                }
            }
            if (null != this._requiredZoneName)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.XNodeArray();
                foreach (var __s in this._requiredZoneName)
                {
                    AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.HealthcareApis.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                }
                container.Add("requiredZoneNames", __r);
            }
            AfterToJson(ref container);
            return(container);
        }