/// <summary> /// Serializes this instance of <see cref="SkuSetting" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.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.Blockchain.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="SkuSetting" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add); if (null != this._location) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.XNodeArray(); foreach (var __x in this._location) { AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add); } container.Add("locations", __w); } if (null != this._requiredFeature) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.XNodeArray(); foreach (var __s in this._requiredFeature) { AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add); } container.Add("requiredFeatures", __r); } AddIf(null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="BlockchainMemberProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.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.Blockchain.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="BlockchainMemberProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._validatorNodesSku ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) this._validatorNodesSku.ToJson(null, serializationMode) : null, "validatorNodesSku", container.Add); AddIf(null != (((object)this._consortium)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._consortium.ToString()) : null, "consortium", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._consortiumManagementAccountAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._consortiumManagementAccountAddress.ToString()) : null, "consortiumManagementAccountAddress", container.Add); } AddIf(null != (((object)this._consortiumManagementAccountPassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._consortiumManagementAccountPassword.ToString()) : null, "consortiumManagementAccountPassword", container.Add); AddIf(null != (((object)this._consortiumMemberDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._consortiumMemberDisplayName.ToString()) : null, "consortiumMemberDisplayName", container.Add); AddIf(null != (((object)this._consortiumRole)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._consortiumRole.ToString()) : null, "consortiumRole", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._dns)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._dns.ToString()) : null, "dns", container.Add); } if (null != this._firewallRule) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.XNodeArray(); foreach (var __x in this._firewallRule) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("firewallRules", __w); } AddIf(null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._password.ToString()) : null, "password", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._publicKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._publicKey.ToString()) : null, "publicKey", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._rootContractAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._rootContractAddress.ToString()) : null, "rootContractAddress", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._userName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._userName.ToString()) : null, "userName", container.Add); } AddIf(null != (((object)this._protocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._protocol.ToString()) : null, "protocol", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="TransactionNodeProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.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.Blockchain.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="TransactionNodeProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._dns)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._dns.ToString()) : null, "dns", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._publicKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._publicKey.ToString()) : null, "publicKey", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._userName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._userName.ToString()) : null, "userName", container.Add); } AddIf(null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._password))) : null, "password", container.Add); if (null != this._firewallRule) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.XNodeArray(); foreach (var __x in this._firewallRule) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("firewallRules", __w); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ConsortiumCollection" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.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.Blockchain.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="ConsortiumCollection" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.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.Blockchain.Runtime.Json.XNodeArray(); foreach (var __x in this._value) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("value", __w); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ResourceTypeSku" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.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.Blockchain.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="ResourceTypeSku" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType", container.Add); if (null != this._sku) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.Blockchain.Runtime.Json.XNodeArray(); foreach (var __x in this._sku) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("skus", __w); } AfterToJson(ref container); return(container); }