internal static InboundNatPool DeserializeInboundNatPool(JsonElement element) { string name = default; string etag = default; string type = default; string id = default; SubResource frontendIPConfiguration = default; TransportProtocol?protocol = default; int? frontendPortRangeStart = default; int? frontendPortRangeEnd = default; int? backendPort = default; int? idleTimeoutInMinutes = default; bool?enableFloatingIP = default; bool?enableTcpReset = default; ProvisioningState?provisioningState = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } name = property.Value.GetString(); continue; } if (property.NameEquals("etag")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } etag = property.Value.GetString(); continue; } if (property.NameEquals("type")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } type = property.Value.GetString(); continue; } if (property.NameEquals("id")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } id = property.Value.GetString(); continue; } if (property.NameEquals("properties")) { foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("frontendIPConfiguration")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } frontendIPConfiguration = DeserializeSubResource(property0.Value); continue; } if (property0.NameEquals("protocol")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } protocol = new TransportProtocol(property0.Value.GetString()); continue; } if (property0.NameEquals("frontendPortRangeStart")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } frontendPortRangeStart = property0.Value.GetInt32(); continue; } if (property0.NameEquals("frontendPortRangeEnd")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } frontendPortRangeEnd = property0.Value.GetInt32(); continue; } if (property0.NameEquals("backendPort")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } backendPort = property0.Value.GetInt32(); continue; } if (property0.NameEquals("idleTimeoutInMinutes")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } idleTimeoutInMinutes = property0.Value.GetInt32(); continue; } if (property0.NameEquals("enableFloatingIP")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } enableFloatingIP = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("enableTcpReset")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } enableTcpReset = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } provisioningState = new ProvisioningState(property0.Value.GetString()); continue; } } continue; } } return(new InboundNatPool(id, name, etag, type, frontendIPConfiguration, protocol, frontendPortRangeStart, frontendPortRangeEnd, backendPort, idleTimeoutInMinutes, enableFloatingIP, enableTcpReset, provisioningState)); }
internal static LoadBalancingRule DeserializeLoadBalancingRule(JsonElement element) { string name = default; string etag = default; string type = default; string id = default; SubResource frontendIPConfiguration = default; SubResource backendAddressPool = default; SubResource probe = default; TransportProtocol?protocol = default; LoadDistribution? loadDistribution = default; int? frontendPort = default; int? backendPort = default; int? idleTimeoutInMinutes = default; bool?enableFloatingIP = default; bool?enableTcpReset = default; bool?disableOutboundSnat = default; ProvisioningState?provisioningState = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } name = property.Value.GetString(); continue; } if (property.NameEquals("etag")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } etag = property.Value.GetString(); continue; } if (property.NameEquals("type")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } type = property.Value.GetString(); continue; } if (property.NameEquals("id")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } id = property.Value.GetString(); continue; } if (property.NameEquals("properties")) { foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("frontendIPConfiguration")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } frontendIPConfiguration = DeserializeSubResource(property0.Value); continue; } if (property0.NameEquals("backendAddressPool")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } backendAddressPool = DeserializeSubResource(property0.Value); continue; } if (property0.NameEquals("probe")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } probe = DeserializeSubResource(property0.Value); continue; } if (property0.NameEquals("protocol")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } protocol = new TransportProtocol(property0.Value.GetString()); continue; } if (property0.NameEquals("loadDistribution")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } loadDistribution = new LoadDistribution(property0.Value.GetString()); continue; } if (property0.NameEquals("frontendPort")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } frontendPort = property0.Value.GetInt32(); continue; } if (property0.NameEquals("backendPort")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } backendPort = property0.Value.GetInt32(); continue; } if (property0.NameEquals("idleTimeoutInMinutes")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } idleTimeoutInMinutes = property0.Value.GetInt32(); continue; } if (property0.NameEquals("enableFloatingIP")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } enableFloatingIP = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("enableTcpReset")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } enableTcpReset = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("disableOutboundSnat")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } disableOutboundSnat = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } provisioningState = new ProvisioningState(property0.Value.GetString()); continue; } } continue; } } return(new LoadBalancingRule(id, name, etag, type, frontendIPConfiguration, backendAddressPool, probe, protocol, loadDistribution, frontendPort, backendPort, idleTimeoutInMinutes, enableFloatingIP, enableTcpReset, disableOutboundSnat, provisioningState)); }