Пример #1
0
        /// <summary>
        /// Serializes this instance of <see cref="RequestApprovalsDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="RequestApprovalsDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._offerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._offerId.ToString()) : null, "offerId", container.Add);
            AddIf(null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName", container.Add);
            AddIf(null != (((object)this._publisherId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._publisherId.ToString()) : null, "publisherId", container.Add);
            AddIf(null != this._messageCode ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNumber((long)this._messageCode) : null, "messageCode", container.Add);
            AddIf(null != (((object)this._icon)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._icon.ToString()) : null, "icon", container.Add);
            if (null != this._plan)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.XNodeArray();
                foreach (var __x in this._plan)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("plans", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
Пример #2
0
        /// <summary>
        /// Serializes this instance of <see cref="CollectionsSubscriptionsMappingDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode"
        /// />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="CollectionsSubscriptionsMappingDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._value)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Пример #4
0
        /// <summary>
        /// Serializes this instance of <see cref="SystemData" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SystemData" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy", container.Add);
            AddIf(null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType", container.Add);
            AddIf(null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt", container.Add);
            AddIf(null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy", container.Add);
            AddIf(null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType", container.Add);
            AddIf(null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="QueryRequestApprovalPlansDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="QueryRequestApprovalPlansDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.JsonSerializable.ToJson(((Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.IAssociativeArray <Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Models.Api20210601.IPlanDetails>) this).AdditionalProperties, container);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// <c>BeforeToJson</c> will be called before the json serialization has commenced, allowing complete customization of the
        /// object before it is serialized.
        /// If you wish to disable the default serialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter.
        /// Implement this method in a partial class to enable this behavior.
        /// </summary>
        /// <param name="container">The JSON container that the serialization result will be placed in.</param>
        /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
        /// instantly.</param>

        partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, ref bool returnNow);
        /// <summary>
        /// <c>AfterFromJson</c> will be called after the json deserialization has finished, allowing customization of the object
        /// before it is returned. Implement this method in a partial class to enable this behavior
        /// </summary>
        /// <param name="json">The JsonNode that should be deserialized into this object.</param>

        partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject json);
Пример #8
0
        /// <summary>
        /// Serializes this instance of <see cref="Any" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Any" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._recipient)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.XNodeArray();
                foreach (var __x in this._recipient)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("recipients", __w);
            }
            AddIf(null != this._sendToAllMarketplaceAdmin ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonBoolean((bool)this._sendToAllMarketplaceAdmin) : null, "sendToAllMarketplaceAdmins", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="TransferOffersDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="TransferOffersDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._targetCollection)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.XNodeArray();
                foreach (var __x in this._targetCollection)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("targetCollections", __w);
            }
            AddIf(null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation", container.Add);
            if (null != this._offerIdsList)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.XNodeArray();
                foreach (var __s in this._offerIdsList)
                {
                    AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                }
                container.Add("offerIdsList", __r);
            }
            AfterToJson(ref container);
            return(container);
        }
Пример #11
0
        /// <summary>
        /// Serializes this instance of <see cref="ErrorResponseError" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorResponseError" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._code.ToString()) : null, "code", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Пример #12
0
        /// <summary>
        /// Serializes this instance of <see cref="AcknowledgeOfferNotificationDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode"
        /// />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="AcknowledgeOfferNotificationDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._acknowledge ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonBoolean((bool)this._acknowledge) : null, "acknowledge", container.Add);
            AddIf(null != this._dismiss ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonBoolean((bool)this._dismiss) : null, "dismiss", container.Add);
            AddIf(null != this._removeOffer ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonBoolean((bool)this._removeOffer) : null, "removeOffer", container.Add);
            if (null != this._addPlan)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.XNodeArray();
                foreach (var __x in this._addPlan)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("addPlans", __w);
            }
            if (null != this._removePlan)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.XNodeArray();
                foreach (var __s in this._removePlan)
                {
                    AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add);
                }
                container.Add("removePlans", __r);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="QueryRequestApproval" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="QueryRequestApproval" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._uniqueOfferId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._uniqueOfferId.ToString()) : null, "uniqueOfferId", container.Add);
            AddIf(null != this._plansDetail ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) this._plansDetail.ToJson(null, serializationMode) : null, "plansDetails", container.Add);
            AddIf(null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag", container.Add);
            AddIf(null != this._messageCode ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNumber((long)this._messageCode) : null, "messageCode", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="OfferProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="OfferProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._uniqueOfferId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._uniqueOfferId.ToString()) : null, "uniqueOfferId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._offerDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._offerDisplayName.ToString()) : null, "offerDisplayName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._publisherDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._publisherDisplayName.ToString()) : null, "publisherDisplayName", container.Add);
            }
            AddIf(null != (((object)this._eTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._eTag.ToString()) : null, "eTag", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._privateStoreId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._privateStoreId.ToString()) : null, "privateStoreId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._createdAt)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._createdAt.ToString()) : null, "createdAt", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._modifiedAt)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._modifiedAt.ToString()) : null, "modifiedAt", container.Add);
            }
            if (null != this._specificPlanIdsLimitation)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.XNodeArray();
                foreach (var __x in this._specificPlanIdsLimitation)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("specificPlanIdsLimitation", __w);
            }
            AddIf(null != this._updateSuppressedDueIdempotence ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonBoolean((bool)this._updateSuppressedDueIdempotence) : null, "updateSuppressedDueIdempotence", container.Add);
            AddIf(null != this._iconFileUri ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) this._iconFileUri.ToJson(null, serializationMode) : null, "iconFileUris", container.Add);
            if (null != this._plan)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.XNodeArray();
                foreach (var __s in this._plan)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("plans", __r);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="WithdrawDetails" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="WithdrawDetails" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._detail)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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>
        /// <c>BeforeFromJson</c> will be called before the json deserialization has commenced, allowing complete customization of
        /// the object before it is deserialized.
        /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter.
        /// Implement this method in a partial class to enable this behavior.
        /// </summary>
        /// <param name="json">The JsonNode that should be deserialized into this object.</param>
        /// <param name="returnNow">Determines if the rest of the deserialization should be processed, or if the method should return
        /// instantly.</param>

        partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject json, ref bool returnNow);
Пример #18
0
        /// <summary>
        /// Serializes this instance of <see cref="Plan" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Plan" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._skuId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._skuId.ToString()) : null, "skuId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._id.ToString()) : null, "planId", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._displayName.ToString()) : null, "planDisplayName", container.Add);
            }
            AddIf(null != (((object)this._accessibility)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._accessibility.ToString()) : null, "accessibility", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._altStackReference)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._altStackReference.ToString()) : null, "altStackReference", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._stackType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._stackType.ToString()) : null, "stackType", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="AdminRequestApprovalsResource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.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.Marketplace.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="AdminRequestApprovalsResource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._notificationsSetting ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) this._notificationsSetting.ToJson(null, serializationMode) : null, "notificationsSettings", container.Add);
            AddIf(null != (((object)this._availability)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._availability.ToString()) : null, "availability", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._privateStoreId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._privateStoreId.ToString()) : null, "privateStoreId", container.Add);
            }
            AddIf(null != (((object)this._eTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._eTag.ToString()) : null, "eTag", container.Add);
            AddIf(null != (((object)this._privateStoreName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._privateStoreName.ToString()) : null, "privateStoreName", container.Add);
            AddIf(null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId", container.Add);
            AddIf(null != this._isGov ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonBoolean((bool)this._isGov) : null, "isGov", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                if (null != this._collectionId)
                {
                    var __w = new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.XNodeArray();
                    foreach (var __x in this._collectionId)
                    {
                        AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                    }
                    container.Add("collectionIds", __w);
                }
            }
            AddIf(null != this._branding ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) this._branding.ToJson(null, serializationMode) : null, "branding", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// <c>AfterToJson</c> will be called after the json erialization has finished, allowing customization of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonObject"
        /// /> before it is returned. Implement this method in a partial class to enable this behavior
        /// </summary>
        /// <param name="container">The JSON container that the serialization result will be placed in.</param>

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._collectionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._collectionId.ToString()) : null, "collectionId", container.Add);
            }
            AddIf(null != (((object)this._collectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._collectionName.ToString()) : null, "collectionName", container.Add);
            AddIf(null != (((object)this._claim)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(this._claim.ToString()) : null, "claim", container.Add);
            AddIf(null != this._allSubscription ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonBoolean((bool)this._allSubscription) : null, "allSubscriptions", container.Add);
            if (null != this._subscriptionsList)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.XNodeArray();
                foreach (var __x in this._subscriptionsList)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("subscriptionsList", __w);
            }
            AddIf(null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._numberOfOffer ? (Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Marketplace.Runtime.Json.JsonNumber((long)this._numberOfOffer) : null, "numberOfOffers", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }