/// <summary> /// Serializes this instance of <see cref="ForwardingRuleProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="ForwardingRuleProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._domainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._domainName.ToString()) : null, "domainName", container.Add); if (null != this._targetDnsServer) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.XNodeArray(); foreach (var __x in this._targetDnsServer) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("targetDnsServers", __w); } AddIf(null != this._metadata ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) this._metadata.ToJson(null, serializationMode) : null, "metadata", container.Add); AddIf(null != (((object)this._forwardingRuleState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._forwardingRuleState.ToString()) : null, "forwardingRuleState", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="InboundEndpointPatchTags" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="InboundEndpointPatchTags" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.JsonSerializable.ToJson(((Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.IAssociativeArray <string>) this).AdditionalProperties, container); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="InboundEndpointPatch" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="InboundEndpointPatch" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) this._tag.ToJson(null, serializationMode) : null, "tags", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="SystemData" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="SystemData" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy", container.Add); AddIf(null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType", container.Add); AddIf(null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy", container.Add); AddIf(null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType", container.Add); AddIf(null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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="DnsForwardingRuleset" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="DnsForwardingRuleset" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } __trackedResource?.ToJson(container, serializationMode); AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) this._systemData.ToJson(null, serializationMode) : null, "systemData", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="DnsResolverListResult" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="DnsResolverListResult" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.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.DnsResolver.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="DnsForwardingRulesetProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="DnsForwardingRulesetProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (null != this._dnsResolverOutboundEndpoint) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.XNodeArray(); foreach (var __x in this._dnsResolverOutboundEndpoint) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("dnsResolverOutboundEndpoints", __w); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._resourceGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._resourceGuid.ToString()) : null, "resourceGuid", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="VirtualNetworkDnsForwardingRuleset" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="VirtualNetworkDnsForwardingRuleset" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add); AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="DnsResolverIdentity" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="DnsResolverIdentity" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId", container.Add); AddIf(null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName", container.Add); AddIf(null != (((object)this._dnsResolverName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._dnsResolverName.ToString()) : null, "dnsResolverName", container.Add); AddIf(null != (((object)this._virtualNetworkName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._virtualNetworkName.ToString()) : null, "virtualNetworkName", container.Add); AddIf(null != (((object)this._inboundEndpointName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._inboundEndpointName.ToString()) : null, "inboundEndpointName", container.Add); AddIf(null != (((object)this._outboundEndpointName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._outboundEndpointName.ToString()) : null, "outboundEndpointName", container.Add); AddIf(null != (((object)this._dnsForwardingRulesetName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._dnsForwardingRulesetName.ToString()) : null, "dnsForwardingRulesetName", container.Add); AddIf(null != (((object)this._forwardingRuleName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._forwardingRuleName.ToString()) : null, "forwardingRuleName", container.Add); AddIf(null != (((object)this._virtualNetworkLinkName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._virtualNetworkLinkName.ToString()) : null, "virtualNetworkLinkName", container.Add); AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="CloudErrorBody" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="CloudErrorBody" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._code.ToString()) : null, "code", container.Add); AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add); AddIf(null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._target.ToString()) : null, "target", container.Add); if (null != this._detail) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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="VirtualNetworkLinkProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="VirtualNetworkLinkProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._virtualNetwork ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) this._virtualNetwork.ToJson(null, serializationMode) : null, "virtualNetwork", container.Add); AddIf(null != this._metadata ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) this._metadata.ToJson(null, serializationMode) : null, "metadata", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="TargetDnsServer" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="TargetDnsServer" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._iPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._iPAddress.ToString()) : null, "ipAddress", container.Add); AddIf(null != this._port ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNumber((int)this._port) : null, "port", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="IPConfiguration" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="IPConfiguration" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return container; } AddIf( null != this._subnet ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) this._subnet.ToJson(null,serializationMode) : null, "subnet" ,container.Add ); AddIf( null != (((object)this._privateIPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._privateIPAddress.ToString()) : null, "privateIpAddress" ,container.Add ); AddIf( null != (((object)this._privateIPAllocationMethod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._privateIPAllocationMethod.ToString()) : null, "privateIpAllocationMethod" ,container.Add ); AfterToJson(ref container); return container; }
/// <summary> /// Serializes this instance of <see cref="Resource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="Resource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonString(this._type.ToString()) : null, "type", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ProxyResource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.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.DnsResolver.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="ProxyResource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } __resource?.ToJson(container, serializationMode); AfterToJson(ref container); return(container); }