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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._cert)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonString(this._cert.ToString()) : null, "cert", container.Add);
            AddIf(null != (((object)this._ledgerRoleName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonString(this._ledgerRoleName.ToString()) : null, "ledgerRoleName", container.Add);
            AfterToJson(ref container);
            return(container);
        }
예제 #4
0
        /// <summary>
        /// Serializes this instance of <see cref="ResourceProviderOperationList" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.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.ConfidentialLedger.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ResourceProviderOperationList" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AfterToJson(ref container);
            return(container);
        }
예제 #8
0
        /// <summary>
        /// Serializes this instance of <see cref="SystemData" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.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.ConfidentialLedger.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SystemData" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.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.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy", container.Add);
            AddIf(null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType", container.Add);
            AddIf(null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.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.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy", container.Add);
            AddIf(null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType", container.Add);
            AddIf(null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.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);
        }
예제 #9
0
        /// <summary>
        /// Serializes this instance of <see cref="Tags" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.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.ConfidentialLedger.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Tags" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonObject();

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

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

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._ledgerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonString(this._ledgerName.ToString()) : null, "ledgerName", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._ledgerUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonString(this._ledgerUri.ToString()) : null, "ledgerUri", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._identityServiceUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonString(this._identityServiceUri.ToString()) : null, "identityServiceUri", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._ledgerInternalNamespace)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonString(this._ledgerInternalNamespace.ToString()) : null, "ledgerInternalNamespace", container.Add);
            }
            AddIf(null != (((object)this._ledgerType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonString(this._ledgerType.ToString()) : null, "ledgerType", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            if (null != this._aadBasedSecurityPrincipal)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.XNodeArray();
                foreach (var __x in this._aadBasedSecurityPrincipal)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("aadBasedSecurityPrincipals", __w);
            }
            if (null != this._certBasedSecurityPrincipal)
            {
                var __r = new Microsoft.Azure.PowerShell.Cmdlets.ConfidentialLedger.Runtime.Json.XNodeArray();
                foreach (var __s in this._certBasedSecurityPrincipal)
                {
                    AddIf(__s?.ToJson(null, serializationMode), __r.Add);
                }
                container.Add("certBasedSecurityPrincipals", __r);
            }
            AfterToJson(ref container);
            return(container);
        }