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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope", container.Add);
            AddIf(null != (((object)this._registrationDefinitionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._registrationDefinitionId.ToString()) : null, "registrationDefinitionId", container.Add);
            AddIf(null != (((object)this._registrationAssignmentId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._registrationAssignmentId.ToString()) : null, "registrationAssignmentId", container.Add);
            AddIf(null != (((object)this._marketplaceIdentifier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._marketplaceIdentifier.ToString()) : null, "marketplaceIdentifier", container.Add);
            AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="RegistrationAssignment" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.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.ManagedServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="RegistrationAssignment" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._registrationDefinition ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) this._registrationDefinition.ToJson(null, serializationMode) : null, "registrationDefinition", container.Add);
            }
            AddIf(null != (((object)this._registrationDefinitionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._registrationDefinitionId.ToString()) : null, "registrationDefinitionId", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Beispiel #6
0
        /// <summary>
        /// Serializes this instance of <see cref="ErrorDefinition" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.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.ManagedServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorDefinition" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._multiFactorAuthProvider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._multiFactorAuthProvider.ToString()) : null, "multiFactorAuthProvider", container.Add);
            AddIf((Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode)(null != this._maximumActivationDuration ? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan) this._maximumActivationDuration)): null), "maximumActivationDuration", container.Add);
            if (null != this._managedByTenantApprover)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                foreach (var __x in this._managedByTenantApprover)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("managedByTenantApprovers", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
Beispiel #9
0
        /// <summary>
        /// Serializes this instance of <see cref="ErrorResponse" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.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.ManagedServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorResponse" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._managedByTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._managedByTenantId.ToString()) : null, "managedByTenantId", container.Add);
            if (null != this._authorization)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                foreach (var __x in this._authorization)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("authorizations", __w);
            }
            if (null != this._eligibleAuthorization)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                foreach (var __s in this._eligibleAuthorization)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("eligibleAuthorizations", __r);
            }
            AddIf(null != (((object)this._offerDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._offerDisplayName.ToString()) : null, "offerDisplayName", container.Add);
            AddIf(null != (((object)this._publisherDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._publisherDisplayName.ToString()) : null, "publisherDisplayName", container.Add);
            AddIf(null != (((object)this._planDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._planDisplayName.ToString()) : null, "planDisplayName", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Beispiel #11
0
        /// <summary>
        /// Serializes this instance of <see cref="RegistrationDefinitionProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.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.ManagedServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="RegistrationDefinitionProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.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.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._description.ToString()) : null, "description", container.Add);
            if (null != this._authorization)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                foreach (var __x in this._authorization)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("authorizations", __w);
            }
            if (null != this._eligibleAuthorization)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray();
                foreach (var __s in this._eligibleAuthorization)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("eligibleAuthorizations", __r);
            }
            AddIf(null != (((object)this._registrationDefinitionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._registrationDefinitionName.ToString()) : null, "registrationDefinitionName", container.Add);
            AddIf(null != (((object)this._managedByTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._managedByTenantId.ToString()) : null, "managedByTenantId", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._managedByTenantName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._managedByTenantName.ToString()) : null, "managedByTenantName", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Beispiel #12
0
        /// <summary>
        /// Serializes this instance of <see cref="OperationDisplay" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.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.ManagedServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="OperationDisplay" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider", container.Add);
            AddIf(null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource", container.Add);
            AddIf(null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation", container.Add);
            AddIf(null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._description.ToString()) : null, "description", container.Add);
            AfterToJson(ref container);
            return(container);
        }