/// <summary> /// Serializes this instance of <see cref="NatGatewayPropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="NatGatewayPropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._idleTimeoutInMinute ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNumber((int)this._idleTimeoutInMinute) : null, "idleTimeoutInMinutes", container.Add); if (null != this._publicIPAddress) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._publicIPAddress) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("publicIpAddresses", __w); } if (null != this._publicIPPrefix) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._publicIPPrefix) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("publicIpPrefixes", __r); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._subnet) { var __m = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __n in this._subnet) { AddIf(__n?.ToJson(null, serializationMode), __m.Add); } container.Add("subnets", __m); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._resourceGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._resourceGuid.ToString()) : null, "resourceGuid", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ServiceEndpointPolicyPropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="ServiceEndpointPolicyPropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (null != this._serviceEndpointPolicyDefinition) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._serviceEndpointPolicyDefinition) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("serviceEndpointPolicyDefinitions", __w); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._subnet) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._subnet) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("subnets", __r); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._resourceGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._resourceGuid.ToString()) : null, "resourceGuid", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AddIf(null != (((object)this._serviceAlias)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._serviceAlias.ToString()) : null, "serviceAlias", container.Add); if (null != this._contextualServiceEndpointPolicy) { var __m = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __n in this._contextualServiceEndpointPolicy) { AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__n.ToString()) : null, __m.Add); } container.Add("contextualServiceEndpointPolicies", __m); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties" /> into a <see /// cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._groupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._groupId.ToString()) : null, "groupId", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._requiredMemberName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._requiredMemberName.ToString()) : null, "requiredMemberName", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._fqdn) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._fqdn) { AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add); } container.Add("fqdns", __w); } } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="CloudServiceExtensionProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="CloudServiceExtensionProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._protectedSettingsFromKeyVault ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._protectedSettingsFromKeyVault.ToJson(null, serializationMode) : null, "protectedSettingsFromKeyVault", container.Add); AddIf(null != (((object)this._publisher)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._publisher.ToString()) : null, "publisher", container.Add); AddIf(null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._type.ToString()) : null, "type", container.Add); AddIf(null != (((object)this._typeHandlerVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._typeHandlerVersion.ToString()) : null, "typeHandlerVersion", container.Add); AddIf(null != this._autoUpgradeMinorVersion ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonBoolean((bool)this._autoUpgradeMinorVersion) : null, "autoUpgradeMinorVersion", container.Add); AddIf(null != (((object)this._setting)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._setting.ToString()) : null, "settings", container.Add); AddIf(null != (((object)this._protectedSetting)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._protectedSetting.ToString()) : null, "protectedSettings", container.Add); AddIf(null != (((object)this._forceUpdateTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._forceUpdateTag.ToString()) : null, "forceUpdateTag", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } if (null != this._rolesAppliedTo) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._rolesAppliedTo) { AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add); } container.Add("rolesAppliedTo", __w); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ServiceAssociationLinkPropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="ServiceAssociationLinkPropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._linkedResourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._linkedResourceType.ToString()) : null, "linkedResourceType", container.Add); AddIf(null != (((object)this._link)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._link.ToString()) : null, "link", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AddIf(null != this._allowDelete ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonBoolean((bool)this._allowDelete) : null, "allowDelete", container.Add); if (null != this._location) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._location) { AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add); } container.Add("locations", __w); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ApiError" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="ApiError" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._innererror ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._innererror.ToJson(null, serializationMode) : null, "innererror", container.Add); if (null != this._detail) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._detail) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("details", __w); } AddIf(null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._code.ToString()) : null, "code", container.Add); AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add); AddIf(null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._target.ToString()) : null, "target", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="InstanceViewStatusesSummary" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="InstanceViewStatusesSummary" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._statusesSummary) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._statusesSummary) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("statusesSummary", __w); } } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="PublicIPAddress" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="PublicIPAddress" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } __resource?.ToJson(container, serializationMode); AddIf(null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null, serializationMode) : null, "extendedLocation", container.Add); AddIf(null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._sku.ToJson(null, serializationMode) : null, "sku", container.Add); AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag", container.Add); } if (null != this._zone) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._zone) { AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add); } container.Add("zones", __w); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="PrivateLinkServiceConnectionProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="PrivateLinkServiceConnectionProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._privateLinkServiceConnectionState ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._privateLinkServiceConnectionState.ToJson(null, serializationMode) : null, "privateLinkServiceConnectionState", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AddIf(null != (((object)this._privateLinkServiceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._privateLinkServiceId.ToString()) : null, "privateLinkServiceId", container.Add); if (null != this._groupId) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._groupId) { AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add); } container.Add("groupIds", __w); } AddIf(null != (((object)this._requestMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._requestMessage.ToString()) : null, "requestMessage", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="OSFamilyProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="OSFamilyProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._label)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._label.ToString()) : null, "label", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._version) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._version) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("versions", __w); } } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="NetworkInterfaceDnsSettings" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="NetworkInterfaceDnsSettings" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (null != this._dnsServer) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._dnsServer) { AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add); } container.Add("dnsServers", __w); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._appliedDnsServer) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._appliedDnsServer) { AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__s.ToString()) : null, __r.Add); } container.Add("appliedDnsServers", __r); } } AddIf(null != (((object)this._internalDnsNameLabel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._internalDnsNameLabel.ToString()) : null, "internalDnsNameLabel", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._internalFqdn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._internalFqdn.ToString()) : null, "internalFqdn", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._internalDomainNameSuffix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._internalDomainNameSuffix.ToString()) : null, "internalDomainNameSuffix", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="RouteTablePropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="RouteTablePropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (null != this._route) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._route) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("routes", __w); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._subnet) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._subnet) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("subnets", __r); } } AddIf(null != this._disableBgpRoutePropagation ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonBoolean((bool)this._disableBgpRoutePropagation) : null, "disableBgpRoutePropagation", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._resourceGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._resourceGuid.ToString()) : null, "resourceGuid", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="CloudServiceInstanceView" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="CloudServiceInstanceView" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._roleInstance ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._roleInstance.ToJson(null, serializationMode) : null, "roleInstance", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._sdkVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._sdkVersion.ToString()) : null, "sdkVersion", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._privateId) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._privateId) { AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add); } container.Add("privateIds", __w); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._statuses) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._statuses) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("statuses", __r); } } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ApplicationGatewayBackendAddressPoolPropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="ApplicationGatewayBackendAddressPoolPropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._backendIPConfiguration) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._backendIPConfiguration) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("backendIPConfigurations", __w); } } if (null != this._backendAddress) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._backendAddress) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("backendAddresses", __r); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="PublicIPAddressPropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="PublicIPAddressPropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._publicIPAllocationMethod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._publicIPAllocationMethod.ToString()) : null, "publicIPAllocationMethod", container.Add); AddIf(null != (((object)this._publicIPAddressVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._publicIPAddressVersion.ToString()) : null, "publicIPAddressVersion", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != this._iPConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._iPConfiguration.ToJson(null, serializationMode) : null, "ipConfiguration", container.Add); } AddIf(null != this._dnsSetting ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._dnsSetting.ToJson(null, serializationMode) : null, "dnsSettings", container.Add); AddIf(null != this._ddosSetting ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._ddosSetting.ToJson(null, serializationMode) : null, "ddosSettings", container.Add); if (null != this._iPTag) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._iPTag) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("ipTags", __w); } AddIf(null != (((object)this._iPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._iPAddress.ToString()) : null, "ipAddress", container.Add); AddIf(null != this._publicIPPrefix ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._publicIPPrefix.ToJson(null, serializationMode) : null, "publicIPPrefix", container.Add); AddIf(null != this._idleTimeoutInMinute ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNumber((int)this._idleTimeoutInMinute) : null, "idleTimeoutInMinutes", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._resourceGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._resourceGuid.ToString()) : null, "resourceGuid", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AddIf(null != this._servicePublicIPAddress ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._servicePublicIPAddress.ToJson(null, serializationMode) : null, "servicePublicIPAddress", container.Add); AddIf(null != this._natGateway ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._natGateway.ToJson(null, serializationMode) : null, "natGateway", container.Add); AddIf(null != (((object)this._migrationPhase)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._migrationPhase.ToString()) : null, "migrationPhase", container.Add); AddIf(null != this._linkedPublicIPAddress ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._linkedPublicIPAddress.ToJson(null, serializationMode) : null, "linkedPublicIPAddress", container.Add); AddIf(null != (((object)this._deleteOption)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._deleteOption.ToString()) : null, "deleteOption", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="RoleInstanceView" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="RoleInstanceView" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != this._platformUpdateDomain ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNumber((int)this._platformUpdateDomain) : null, "platformUpdateDomain", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != this._platformFaultDomain ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNumber((int)this._platformFaultDomain) : null, "platformFaultDomain", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._privateId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._privateId.ToString()) : null, "privateId", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._statuses) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._statuses) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("statuses", __w); } } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="RoleInstances" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="RoleInstances" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (null != this._roleInstance) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._roleInstance) { AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add); } container.Add("roleInstances", __w); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="LoadBalancerConfigurationProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="LoadBalancerConfigurationProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (null != this._frontendIPConfiguration) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._frontendIPConfiguration) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("frontendIPConfigurations", __w); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="VirtualNetworkTapPropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="VirtualNetworkTapPropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._destinationNetworkInterfaceIPConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._destinationNetworkInterfaceIPConfiguration.ToJson(null, serializationMode) : null, "destinationNetworkInterfaceIPConfiguration", container.Add); AddIf(null != this._destinationLoadBalancerFrontEndIPConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._destinationLoadBalancerFrontEndIPConfiguration.ToJson(null, serializationMode) : null, "destinationLoadBalancerFrontEndIPConfiguration", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._networkInterfaceTapConfiguration) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._networkInterfaceTapConfiguration) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("networkInterfaceTapConfigurations", __w); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._resourceGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._resourceGuid.ToString()) : null, "resourceGuid", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AddIf(null != this._destinationPort ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNumber((int)this._destinationPort) : null, "destinationPort", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="CloudServiceVaultSecretGroup" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="CloudServiceVaultSecretGroup" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._sourceVault ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._sourceVault.ToJson(null, serializationMode) : null, "sourceVault", container.Add); if (null != this._vaultCertificate) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._vaultCertificate) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("vaultCertificates", __w); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="NetworkInterfacePropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="NetworkInterfacePropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != this._virtualMachine ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._virtualMachine.ToJson(null, serializationMode) : null, "virtualMachine", container.Add); } AddIf(null != this._networkSecurityGroup ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._networkSecurityGroup.ToJson(null, serializationMode) : null, "networkSecurityGroup", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != this._privateEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._privateEndpoint.ToJson(null, serializationMode) : null, "privateEndpoint", container.Add); } AddIf(null != this._dnsSetting ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._dnsSetting.ToJson(null, serializationMode) : null, "dnsSettings", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != this._dscpConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._dscpConfiguration.ToJson(null, serializationMode) : null, "dscpConfiguration", container.Add); } AddIf(null != this._privateLinkService ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._privateLinkService.ToJson(null, serializationMode) : null, "privateLinkService", container.Add); if (null != this._iPConfiguration) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._iPConfiguration) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("ipConfigurations", __w); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._tapConfiguration) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._tapConfiguration) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("tapConfigurations", __r); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._macAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._macAddress.ToString()) : null, "macAddress", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != this._primary ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonBoolean((bool)this._primary) : null, "primary", container.Add); } AddIf(null != this._enableAcceleratedNetworking ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonBoolean((bool)this._enableAcceleratedNetworking) : null, "enableAcceleratedNetworking", container.Add); AddIf(null != this._enableIPForwarding ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonBoolean((bool)this._enableIPForwarding) : null, "enableIPForwarding", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._hostedWorkload) { var __m = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __n in this._hostedWorkload) { AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__n.ToString()) : null, __m.Add); } container.Add("hostedWorkloads", __m); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._resourceGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._resourceGuid.ToString()) : null, "resourceGuid", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AddIf(null != (((object)this._workloadType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._workloadType.ToString()) : null, "workloadType", container.Add); AddIf(null != (((object)this._nicType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._nicType.ToString()) : null, "nicType", container.Add); AddIf(null != (((object)this._migrationPhase)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._migrationPhase.ToString()) : null, "migrationPhase", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="PrivateEndpointProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="PrivateEndpointProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._networkInterface) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._networkInterface) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("networkInterfaces", __w); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } if (null != this._privateLinkServiceConnection) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._privateLinkServiceConnection) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("privateLinkServiceConnections", __r); } if (null != this._manualPrivateLinkServiceConnection) { var __m = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __n in this._manualPrivateLinkServiceConnection) { AddIf(__n?.ToJson(null, serializationMode), __m.Add); } container.Add("manualPrivateLinkServiceConnections", __m); } if (null != this._customDnsConfig) { var __h = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __i in this._customDnsConfig) { AddIf(__i?.ToJson(null, serializationMode), __h.Add); } container.Add("customDnsConfigs", __h); } if (null != this._applicationSecurityGroup) { var __c = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __d in this._applicationSecurityGroup) { AddIf(__d?.ToJson(null, serializationMode), __c.Add); } container.Add("applicationSecurityGroups", __c); } if (null != this._iPConfiguration) { var ___x = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var ___y in this._iPConfiguration) { AddIf(___y?.ToJson(null, serializationMode), ___x.Add); } container.Add("ipConfigurations", ___x); } AddIf(null != (((object)this._customNetworkInterfaceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._customNetworkInterfaceName.ToString()) : null, "customNetworkInterfaceName", container.Add); AddIf(null != this._subnet ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._subnet.ToJson(null, serializationMode) : null, "subnet", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="SecurityRulePropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="SecurityRulePropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._description.ToString()) : null, "description", container.Add); AddIf(null != (((object)this._protocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._protocol.ToString()) : null, "protocol", container.Add); AddIf(null != (((object)this._sourcePortRange)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._sourcePortRange.ToString()) : null, "sourcePortRange", container.Add); AddIf(null != (((object)this._destinationPortRange)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._destinationPortRange.ToString()) : null, "destinationPortRange", container.Add); AddIf(null != (((object)this._sourceAddressPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._sourceAddressPrefix.ToString()) : null, "sourceAddressPrefix", container.Add); if (null != this._sourceAddressPrefixes) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._sourceAddressPrefixes) { AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add); } container.Add("sourceAddressPrefixes", __w); } if (null != this._sourceApplicationSecurityGroup) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._sourceApplicationSecurityGroup) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("sourceApplicationSecurityGroups", __r); } AddIf(null != (((object)this._destinationAddressPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._destinationAddressPrefix.ToString()) : null, "destinationAddressPrefix", container.Add); if (null != this._destinationAddressPrefixes) { var __m = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __n in this._destinationAddressPrefixes) { AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__n.ToString()) : null, __m.Add); } container.Add("destinationAddressPrefixes", __m); } if (null != this._destinationApplicationSecurityGroup) { var __h = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __i in this._destinationApplicationSecurityGroup) { AddIf(__i?.ToJson(null, serializationMode), __h.Add); } container.Add("destinationApplicationSecurityGroups", __h); } if (null != this._sourcePortRanges) { var __c = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __d in this._sourcePortRanges) { AddIf(null != (((object)__d)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__d.ToString()) : null, __c.Add); } container.Add("sourcePortRanges", __c); } if (null != this._destinationPortRanges) { var ___x = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var ___y in this._destinationPortRanges) { AddIf(null != (((object)___y)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(___y.ToString()) : null, ___x.Add); } container.Add("destinationPortRanges", ___x); } AddIf(null != (((object)this._access)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._access.ToString()) : null, "access", container.Add); AddIf(null != this._priority ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNumber((int)this._priority) : null, "priority", container.Add); AddIf(null != (((object)this._direction)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._direction.ToString()) : null, "direction", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="SubnetPropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="SubnetPropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._networkSecurityGroup ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._networkSecurityGroup.ToJson(null, serializationMode) : null, "networkSecurityGroup", container.Add); AddIf(null != this._routeTable ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._routeTable.ToJson(null, serializationMode) : null, "routeTable", container.Add); AddIf(null != this._natGateway ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._natGateway.ToJson(null, serializationMode) : null, "natGateway", container.Add); AddIf(null != (((object)this._addressPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._addressPrefix.ToString()) : null, "addressPrefix", container.Add); if (null != this._addressPrefixes) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._addressPrefixes) { AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add); } container.Add("addressPrefixes", __w); } if (null != this._serviceEndpoint) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._serviceEndpoint) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("serviceEndpoints", __r); } if (null != this._serviceEndpointPolicy) { var __m = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __n in this._serviceEndpointPolicy) { AddIf(__n?.ToJson(null, serializationMode), __m.Add); } container.Add("serviceEndpointPolicies", __m); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._privateEndpoint) { var __h = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __i in this._privateEndpoint) { AddIf(__i?.ToJson(null, serializationMode), __h.Add); } container.Add("privateEndpoints", __h); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._iPConfiguration) { var __c = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __d in this._iPConfiguration) { AddIf(__d?.ToJson(null, serializationMode), __c.Add); } container.Add("ipConfigurations", __c); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._iPConfigurationProfile) { var ___x = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var ___y in this._iPConfigurationProfile) { AddIf(___y?.ToJson(null, serializationMode), ___x.Add); } container.Add("ipConfigurationProfiles", ___x); } } if (null != this._iPAllocation) { var ___s = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var ___t in this._iPAllocation) { AddIf(___t?.ToJson(null, serializationMode), ___s.Add); } container.Add("ipAllocations", ___s); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._resourceNavigationLink) { var ___n = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var ___o in this._resourceNavigationLink) { AddIf(___o?.ToJson(null, serializationMode), ___n.Add); } container.Add("resourceNavigationLinks", ___n); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._serviceAssociationLink) { var ___i = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var ___j in this._serviceAssociationLink) { AddIf(___j?.ToJson(null, serializationMode), ___i.Add); } container.Add("serviceAssociationLinks", ___i); } } if (null != this._delegation) { var ___d = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var ___e in this._delegation) { AddIf(___e?.ToJson(null, serializationMode), ___d.Add); } container.Add("delegations", ___d); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._purpose)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._purpose.ToString()) : null, "purpose", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AddIf(null != (((object)this._privateEndpointNetworkPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._privateEndpointNetworkPolicy.ToString()) : null, "privateEndpointNetworkPolicies", container.Add); AddIf(null != (((object)this._privateLinkServiceNetworkPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._privateLinkServiceNetworkPolicy.ToString()) : null, "privateLinkServiceNetworkPolicies", container.Add); if (null != this._applicationGatewayIPConfiguration) { var ____y = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var ____z in this._applicationGatewayIPConfiguration) { AddIf(____z?.ToJson(null, serializationMode), ____y.Add); } container.Add("applicationGatewayIpConfigurations", ____y); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="FrontendIPConfigurationPropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="FrontendIPConfigurationPropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._publicIPPrefix ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._publicIPPrefix.ToJson(null, serializationMode) : null, "publicIPPrefix", container.Add); AddIf(null != this._gatewayLoadBalancer ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._gatewayLoadBalancer.ToJson(null, serializationMode) : null, "gatewayLoadBalancer", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._inboundNatRule) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._inboundNatRule) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("inboundNatRules", __w); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._inboundNatPool) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._inboundNatPool) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("inboundNatPools", __r); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._outboundRule) { var __m = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __n in this._outboundRule) { AddIf(__n?.ToJson(null, serializationMode), __m.Add); } container.Add("outboundRules", __m); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._loadBalancingRule) { var __h = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __i in this._loadBalancingRule) { AddIf(__i?.ToJson(null, serializationMode), __h.Add); } container.Add("loadBalancingRules", __h); } } AddIf(null != (((object)this._privateIPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._privateIPAddress.ToString()) : null, "privateIPAddress", container.Add); AddIf(null != (((object)this._privateIPAllocationMethod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._privateIPAllocationMethod.ToString()) : null, "privateIPAllocationMethod", container.Add); AddIf(null != (((object)this._privateIPAddressVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._privateIPAddressVersion.ToString()) : null, "privateIPAddressVersion", container.Add); AddIf(null != this._publicIPAddress ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._publicIPAddress.ToJson(null, serializationMode) : null, "publicIPAddress", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AddIf(null != this._subnet ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._subnet.ToJson(null, serializationMode) : null, "subnet", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="PrivateLinkServiceProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="PrivateLinkServiceProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._visibility ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._visibility.ToJson(null, serializationMode) : null, "visibility", container.Add); AddIf(null != this._autoApproval ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._autoApproval.ToJson(null, serializationMode) : null, "autoApproval", container.Add); if (null != this._loadBalancerFrontendIPConfiguration) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._loadBalancerFrontendIPConfiguration) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("loadBalancerFrontendIpConfigurations", __w); } if (null != this._iPConfiguration) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._iPConfiguration) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("ipConfigurations", __r); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._networkInterface) { var __m = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __n in this._networkInterface) { AddIf(__n?.ToJson(null, serializationMode), __m.Add); } container.Add("networkInterfaces", __m); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._privateEndpointConnection) { var __h = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __i in this._privateEndpointConnection) { AddIf(__i?.ToJson(null, serializationMode), __h.Add); } container.Add("privateEndpointConnections", __h); } } if (null != this._fqdn) { var __c = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __d in this._fqdn) { AddIf(null != (((object)__d)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(__d.ToString()) : null, __c.Add); } container.Add("fqdns", __c); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._alias)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._alias.ToString()) : null, "alias", container.Add); } AddIf(null != this._enableProxyProtocol ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonBoolean((bool)this._enableProxyProtocol) : null, "enableProxyProtocol", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="NetworkInterfaceIPConfigurationPropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="NetworkInterfaceIPConfigurationPropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._gatewayLoadBalancer ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._gatewayLoadBalancer.ToJson(null, serializationMode) : null, "gatewayLoadBalancer", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != this._privateLinkConnectionProperty ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._privateLinkConnectionProperty.ToJson(null, serializationMode) : null, "privateLinkConnectionProperties", container.Add); } if (null != this._virtualNetworkTap) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._virtualNetworkTap) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("virtualNetworkTaps", __w); } if (null != this._applicationGatewayBackendAddressPool) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._applicationGatewayBackendAddressPool) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("applicationGatewayBackendAddressPools", __r); } if (null != this._loadBalancerBackendAddressPool) { var __m = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __n in this._loadBalancerBackendAddressPool) { AddIf(__n?.ToJson(null, serializationMode), __m.Add); } container.Add("loadBalancerBackendAddressPools", __m); } if (null != this._loadBalancerInboundNatRule) { var __h = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __i in this._loadBalancerInboundNatRule) { AddIf(__i?.ToJson(null, serializationMode), __h.Add); } container.Add("loadBalancerInboundNatRules", __h); } AddIf(null != (((object)this._privateIPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._privateIPAddress.ToString()) : null, "privateIPAddress", container.Add); AddIf(null != (((object)this._privateIPAllocationMethod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._privateIPAllocationMethod.ToString()) : null, "privateIPAllocationMethod", container.Add); AddIf(null != (((object)this._privateIPAddressVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._privateIPAddressVersion.ToString()) : null, "privateIPAddressVersion", container.Add); AddIf(null != this._primary ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonBoolean((bool)this._primary) : null, "primary", container.Add); AddIf(null != this._publicIPAddress ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._publicIPAddress.ToJson(null, serializationMode) : null, "publicIPAddress", container.Add); if (null != this._applicationSecurityGroup) { var __c = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __d in this._applicationSecurityGroup) { AddIf(__d?.ToJson(null, serializationMode), __c.Add); } container.Add("applicationSecurityGroups", __c); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AddIf(null != this._subnet ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._subnet.ToJson(null, serializationMode) : null, "subnet", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="NetworkSecurityGroupPropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="NetworkSecurityGroupPropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (null != this._securityRule) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._securityRule) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("securityRules", __w); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._defaultSecurityRule) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._defaultSecurityRule) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("defaultSecurityRules", __r); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._networkInterface) { var __m = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __n in this._networkInterface) { AddIf(__n?.ToJson(null, serializationMode), __m.Add); } container.Add("networkInterfaces", __m); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._subnet) { var __h = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __i in this._subnet) { AddIf(__i?.ToJson(null, serializationMode), __h.Add); } container.Add("subnets", __h); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._flowLog) { var __c = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __d in this._flowLog) { AddIf(__d?.ToJson(null, serializationMode), __c.Add); } container.Add("flowLogs", __c); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._resourceGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._resourceGuid.ToString()) : null, "resourceGuid", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="BackendAddressPoolPropertiesFormat" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.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.CloudService.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="BackendAddressPoolPropertiesFormat" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != this._outboundRule ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) this._outboundRule.ToJson(null, serializationMode) : null, "outboundRule", container.Add); } AddIf(null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._location.ToString()) : null, "location", container.Add); if (null != this._tunnelInterface) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __x in this._tunnelInterface) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("tunnelInterfaces", __w); } if (null != this._loadBalancerBackendAddress) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __s in this._loadBalancerBackendAddress) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("loadBalancerBackendAddresses", __r); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._backendIPConfiguration) { var __m = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __n in this._backendIPConfiguration) { AddIf(__n?.ToJson(null, serializationMode), __m.Add); } container.Add("backendIPConfigurations", __m); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._loadBalancingRule) { var __h = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __i in this._loadBalancingRule) { AddIf(__i?.ToJson(null, serializationMode), __h.Add); } container.Add("loadBalancingRules", __h); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._outboundRules) { var __c = new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.XNodeArray(); foreach (var __d in this._outboundRules) { AddIf(__d?.ToJson(null, serializationMode), __c.Add); } container.Add("outboundRules", __c); } } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CloudService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AfterToJson(ref container); return(container); }