/// <summary>
        /// Serializes this instance of <see cref="ResourceProviderOperation" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.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.CustomProviders.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ResourceProviderOperation" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) this._display.ToJson(null, serializationMode) : null, "display", container.Add);
            AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ResourceProviderOperationDisplay" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.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.CustomProviders.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ResourceProviderOperationDisplay" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._description.ToString()) : null, "description", container.Add);
            AddIf(null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation", container.Add);
            AddIf(null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider", container.Add);
            AddIf(null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 3
0
        /// <summary>
        /// Serializes this instance of <see cref="ListByCustomRpManifest" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.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.CustomProviders.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ListByCustomRpManifest" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add);
            if (null != this._value)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.XNodeArray();
                foreach (var __x in this._value)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("value", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 4
0
        /// <summary>
        /// Serializes this instance of <see cref="Resource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.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.CustomProviders.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Resource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._type.ToString()) : null, "type", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            }
            AddIf(null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._location.ToString()) : null, "location", container.Add);
            AddIf(null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) this._tag.ToJson(null, serializationMode) : null, "tags", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 5
0
        /// <summary>
        /// Serializes this instance of <see cref="ErrorDefinition" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.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.CustomProviders.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorDefinition" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._code.ToString()) : null, "code", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._detail)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.XNodeArray();
                    foreach (var __x in this._detail)
                    {
                        AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                    }
                    container.Add("details", __w);
                }
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="CustomRpManifestProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.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.CustomProviders.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="CustomRpManifestProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._action)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.XNodeArray();
                foreach (var __x in this._action)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("actions", __w);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            if (null != this._resourceType)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.XNodeArray();
                foreach (var __s in this._resourceType)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("resourceTypes", __r);
            }
            if (null != this._validation)
            {
                var __m = new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.XNodeArray();
                foreach (var __n in this._validation)
                {
                    AddIf(__n?.ToJson(null, serializationMode), __m.Add);
                }
                container.Add("validations", __m);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ResourceProvidersUpdateTags" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.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.CustomProviders.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ResourceProvidersUpdateTags" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.JsonSerializable.ToJson(((Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.IAssociativeArray <string>) this).AdditionalProperties, container);
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 8
0
        /// <summary>
        /// Serializes this instance of <see cref="CustomRpActionRouteDefinition" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.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.CustomProviders.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="CustomRpActionRouteDefinition" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            __customRpRouteDefinition?.ToJson(container, serializationMode);
            AddIf(null != (((object)this._routingType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._routingType.ToString()) : null, "routingType", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 9
0
        /// <summary>
        /// Serializes this instance of <see cref="ResourceProvidersUpdate" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.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.CustomProviders.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ResourceProvidersUpdate" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) this._tag.ToJson(null, serializationMode) : null, "tags", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Esempio n. 10
0
        /// <summary>
        /// Serializes this instance of <see cref="CustomProvidersIdentity" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.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.CustomProviders.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="CustomProvidersIdentity" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._associationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._associationName.ToString()) : null, "associationName", container.Add);
            AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            AddIf(null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName", container.Add);
            AddIf(null != (((object)this._resourceProviderName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._resourceProviderName.ToString()) : null, "resourceProviderName", container.Add);
            AddIf(null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope", container.Add);
            AddIf(null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="AssociationProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.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.CustomProviders.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="AssociationProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            AddIf(null != (((object)this._targetResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomProviders.Runtime.Json.JsonString(this._targetResourceId.ToString()) : null, "targetResourceId", container.Add);
            AfterToJson(ref container);
            return(container);
        }