internal static ApplicationSecurityGroupListResult DeserializeApplicationSecurityGroupListResult(JsonElement element) { Optional <IReadOnlyList <ApplicationSecurityGroup> > value = default; Optional <string> nextLink = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value")) { List <ApplicationSecurityGroup> array = new List <ApplicationSecurityGroup>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(item)); } value = array; continue; } if (property.NameEquals("nextLink")) { nextLink = property.Value.GetString(); continue; } } return(new ApplicationSecurityGroupListResult(Optional.ToList(value), nextLink.Value)); }
internal static ApplicationSecurityGroupListResult DeserializeApplicationSecurityGroupListResult(JsonElement element) { IReadOnlyList <ApplicationSecurityGroup> value = default; string nextLink = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <ApplicationSecurityGroup> array = new List <ApplicationSecurityGroup>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(item)); } } value = array; continue; } if (property.NameEquals("nextLink")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } nextLink = property.Value.GetString(); continue; } } return(new ApplicationSecurityGroupListResult(value, nextLink)); }
internal static NetworkInterfaceIPConfiguration DeserializeNetworkInterfaceIPConfiguration(JsonElement element) { string name = default; string etag = default; string id = default; IList <VirtualNetworkTap> virtualNetworkTaps = default; IList <ApplicationGatewayBackendAddressPool> applicationGatewayBackendAddressPools = default; IList <BackendAddressPool> loadBalancerBackendAddressPools = default; IList <InboundNatRule> loadBalancerInboundNatRules = default; string privateIPAddress = default; IPAllocationMethod?privateIPAllocationMethod = default; IPVersion? privateIPAddressVersion = default; Subnet subnet = default; bool? primary = default; PublicIPAddress publicIPAddress = default; IList <ApplicationSecurityGroup> applicationSecurityGroups = default; ProvisioningState?provisioningState = default; NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties = 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("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("virtualNetworkTaps")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <VirtualNetworkTap> array = new List <VirtualNetworkTap>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(VirtualNetworkTap.DeserializeVirtualNetworkTap(item)); } } virtualNetworkTaps = array; continue; } if (property0.NameEquals("applicationGatewayBackendAddressPools")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <ApplicationGatewayBackendAddressPool> array = new List <ApplicationGatewayBackendAddressPool>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(ApplicationGatewayBackendAddressPool.DeserializeApplicationGatewayBackendAddressPool(item)); } } applicationGatewayBackendAddressPools = array; continue; } if (property0.NameEquals("loadBalancerBackendAddressPools")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <BackendAddressPool> array = new List <BackendAddressPool>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(BackendAddressPool.DeserializeBackendAddressPool(item)); } } loadBalancerBackendAddressPools = array; continue; } if (property0.NameEquals("loadBalancerInboundNatRules")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <InboundNatRule> array = new List <InboundNatRule>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(InboundNatRule.DeserializeInboundNatRule(item)); } } loadBalancerInboundNatRules = array; continue; } if (property0.NameEquals("privateIPAddress")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } privateIPAddress = property0.Value.GetString(); continue; } if (property0.NameEquals("privateIPAllocationMethod")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } privateIPAllocationMethod = new IPAllocationMethod(property0.Value.GetString()); continue; } if (property0.NameEquals("privateIPAddressVersion")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } privateIPAddressVersion = new IPVersion(property0.Value.GetString()); continue; } if (property0.NameEquals("subnet")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } subnet = Subnet.DeserializeSubnet(property0.Value); continue; } if (property0.NameEquals("primary")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } primary = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("publicIPAddress")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } publicIPAddress = PublicIPAddress.DeserializePublicIPAddress(property0.Value); continue; } if (property0.NameEquals("applicationSecurityGroups")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <ApplicationSecurityGroup> array = new List <ApplicationSecurityGroup>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(item)); } } applicationSecurityGroups = array; continue; } if (property0.NameEquals("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } provisioningState = new ProvisioningState(property0.Value.GetString()); continue; } if (property0.NameEquals("privateLinkConnectionProperties")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } privateLinkConnectionProperties = NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties.DeserializeNetworkInterfaceIPConfigurationPrivateLinkConnectionProperties(property0.Value); continue; } } continue; } } return(new NetworkInterfaceIPConfiguration(id, name, etag, virtualNetworkTaps, applicationGatewayBackendAddressPools, loadBalancerBackendAddressPools, loadBalancerInboundNatRules, privateIPAddress, privateIPAllocationMethod, privateIPAddressVersion, subnet, primary, publicIPAddress, applicationSecurityGroups, provisioningState, privateLinkConnectionProperties)); }
internal static SecurityRule DeserializeSecurityRule(JsonElement element) { Optional <string> name = default; Optional <string> etag = default; Optional <string> id = default; Optional <string> description = default; Optional <SecurityRuleProtocol> protocol = default; Optional <string> sourcePortRange = default; Optional <string> destinationPortRange = default; Optional <string> sourceAddressPrefix = default; Optional <IList <string> > sourceAddressPrefixes = default; Optional <IList <ApplicationSecurityGroup> > sourceApplicationSecurityGroups = default; Optional <string> destinationAddressPrefix = default; Optional <IList <string> > destinationAddressPrefixes = default; Optional <IList <ApplicationSecurityGroup> > destinationApplicationSecurityGroups = default; Optional <IList <string> > sourcePortRanges = default; Optional <IList <string> > destinationPortRanges = default; Optional <SecurityRuleAccess> access = default; Optional <int> priority = default; Optional <SecurityRuleDirection> direction = default; Optional <ProvisioningState> provisioningState = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("etag")) { etag = property.Value.GetString(); continue; } if (property.NameEquals("id")) { id = property.Value.GetString(); continue; } if (property.NameEquals("properties")) { foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("description")) { description = property0.Value.GetString(); continue; } if (property0.NameEquals("protocol")) { protocol = new SecurityRuleProtocol(property0.Value.GetString()); continue; } if (property0.NameEquals("sourcePortRange")) { sourcePortRange = property0.Value.GetString(); continue; } if (property0.NameEquals("destinationPortRange")) { destinationPortRange = property0.Value.GetString(); continue; } if (property0.NameEquals("sourceAddressPrefix")) { sourceAddressPrefix = property0.Value.GetString(); continue; } if (property0.NameEquals("sourceAddressPrefixes")) { List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(item.GetString()); } sourceAddressPrefixes = array; continue; } if (property0.NameEquals("sourceApplicationSecurityGroups")) { List <ApplicationSecurityGroup> array = new List <ApplicationSecurityGroup>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(item)); } sourceApplicationSecurityGroups = array; continue; } if (property0.NameEquals("destinationAddressPrefix")) { destinationAddressPrefix = property0.Value.GetString(); continue; } if (property0.NameEquals("destinationAddressPrefixes")) { List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(item.GetString()); } destinationAddressPrefixes = array; continue; } if (property0.NameEquals("destinationApplicationSecurityGroups")) { List <ApplicationSecurityGroup> array = new List <ApplicationSecurityGroup>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(item)); } destinationApplicationSecurityGroups = array; continue; } if (property0.NameEquals("sourcePortRanges")) { List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(item.GetString()); } sourcePortRanges = array; continue; } if (property0.NameEquals("destinationPortRanges")) { List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(item.GetString()); } destinationPortRanges = array; continue; } if (property0.NameEquals("access")) { access = new SecurityRuleAccess(property0.Value.GetString()); continue; } if (property0.NameEquals("priority")) { priority = property0.Value.GetInt32(); continue; } if (property0.NameEquals("direction")) { direction = new SecurityRuleDirection(property0.Value.GetString()); continue; } if (property0.NameEquals("provisioningState")) { provisioningState = new ProvisioningState(property0.Value.GetString()); continue; } } continue; } } return(new SecurityRule(id.Value, name.Value, etag.Value, description.Value, Optional.ToNullable(protocol), sourcePortRange.Value, destinationPortRange.Value, sourceAddressPrefix.Value, Optional.ToList(sourceAddressPrefixes), Optional.ToList(sourceApplicationSecurityGroups), destinationAddressPrefix.Value, Optional.ToList(destinationAddressPrefixes), Optional.ToList(destinationApplicationSecurityGroups), Optional.ToList(sourcePortRanges), Optional.ToList(destinationPortRanges), Optional.ToNullable(access), Optional.ToNullable(priority), Optional.ToNullable(direction), Optional.ToNullable(provisioningState))); }
internal static SecurityRule DeserializeSecurityRule(JsonElement element) { string name = default; string etag = default; string id = default; string description = default; SecurityRuleProtocol?protocol = default; string sourcePortRange = default; string destinationPortRange = default; string sourceAddressPrefix = default; IList <string> sourceAddressPrefixes = default; IList <ApplicationSecurityGroup> sourceApplicationSecurityGroups = default; string destinationAddressPrefix = default; IList <string> destinationAddressPrefixes = default; IList <ApplicationSecurityGroup> destinationApplicationSecurityGroups = default; IList <string> sourcePortRanges = default; IList <string> destinationPortRanges = default; SecurityRuleAccess?access = default; int?priority = default; SecurityRuleDirection?direction = 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("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("description")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } description = property0.Value.GetString(); continue; } if (property0.NameEquals("protocol")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } protocol = new SecurityRuleProtocol(property0.Value.GetString()); continue; } if (property0.NameEquals("sourcePortRange")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } sourcePortRange = property0.Value.GetString(); continue; } if (property0.NameEquals("destinationPortRange")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } destinationPortRange = property0.Value.GetString(); continue; } if (property0.NameEquals("sourceAddressPrefix")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } sourceAddressPrefix = property0.Value.GetString(); continue; } if (property0.NameEquals("sourceAddressPrefixes")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(item.GetString()); } } sourceAddressPrefixes = array; continue; } if (property0.NameEquals("sourceApplicationSecurityGroups")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <ApplicationSecurityGroup> array = new List <ApplicationSecurityGroup>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(item)); } } sourceApplicationSecurityGroups = array; continue; } if (property0.NameEquals("destinationAddressPrefix")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } destinationAddressPrefix = property0.Value.GetString(); continue; } if (property0.NameEquals("destinationAddressPrefixes")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(item.GetString()); } } destinationAddressPrefixes = array; continue; } if (property0.NameEquals("destinationApplicationSecurityGroups")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <ApplicationSecurityGroup> array = new List <ApplicationSecurityGroup>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(item)); } } destinationApplicationSecurityGroups = array; continue; } if (property0.NameEquals("sourcePortRanges")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(item.GetString()); } } sourcePortRanges = array; continue; } if (property0.NameEquals("destinationPortRanges")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(item.GetString()); } } destinationPortRanges = array; continue; } if (property0.NameEquals("access")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } access = new SecurityRuleAccess(property0.Value.GetString()); continue; } if (property0.NameEquals("priority")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } priority = property0.Value.GetInt32(); continue; } if (property0.NameEquals("direction")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } direction = new SecurityRuleDirection(property0.Value.GetString()); continue; } if (property0.NameEquals("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } provisioningState = new ProvisioningState(property0.Value.GetString()); continue; } } continue; } } return(new SecurityRule(id, name, etag, description, protocol, sourcePortRange, destinationPortRange, sourceAddressPrefix, sourceAddressPrefixes, sourceApplicationSecurityGroups, destinationAddressPrefix, destinationAddressPrefixes, destinationApplicationSecurityGroups, sourcePortRanges, destinationPortRanges, access, priority, direction, provisioningState)); }
internal static NetworkInterfaceIPConfiguration DeserializeNetworkInterfaceIPConfiguration(JsonElement element) { Optional <string> name = default; Optional <string> etag = default; Optional <string> id = default; Optional <IList <VirtualNetworkTap> > virtualNetworkTaps = default; Optional <IList <ApplicationGatewayBackendAddressPool> > applicationGatewayBackendAddressPools = default; Optional <IList <BackendAddressPool> > loadBalancerBackendAddressPools = default; Optional <IList <InboundNatRule> > loadBalancerInboundNatRules = default; Optional <string> privateIPAddress = default; Optional <IPAllocationMethod> privateIPAllocationMethod = default; Optional <IPVersion> privateIPAddressVersion = default; Optional <Subnet> subnet = default; Optional <bool> primary = default; Optional <PublicIPAddress> publicIPAddress = default; Optional <IList <ApplicationSecurityGroup> > applicationSecurityGroups = default; Optional <ProvisioningState> provisioningState = default; Optional <NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties> privateLinkConnectionProperties = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("etag")) { etag = property.Value.GetString(); continue; } if (property.NameEquals("id")) { id = property.Value.GetString(); continue; } if (property.NameEquals("properties")) { foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("virtualNetworkTaps")) { List <VirtualNetworkTap> array = new List <VirtualNetworkTap>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(VirtualNetworkTap.DeserializeVirtualNetworkTap(item)); } virtualNetworkTaps = array; continue; } if (property0.NameEquals("applicationGatewayBackendAddressPools")) { List <ApplicationGatewayBackendAddressPool> array = new List <ApplicationGatewayBackendAddressPool>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(ApplicationGatewayBackendAddressPool.DeserializeApplicationGatewayBackendAddressPool(item)); } applicationGatewayBackendAddressPools = array; continue; } if (property0.NameEquals("loadBalancerBackendAddressPools")) { List <BackendAddressPool> array = new List <BackendAddressPool>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(BackendAddressPool.DeserializeBackendAddressPool(item)); } loadBalancerBackendAddressPools = array; continue; } if (property0.NameEquals("loadBalancerInboundNatRules")) { List <InboundNatRule> array = new List <InboundNatRule>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(InboundNatRule.DeserializeInboundNatRule(item)); } loadBalancerInboundNatRules = array; continue; } if (property0.NameEquals("privateIPAddress")) { privateIPAddress = property0.Value.GetString(); continue; } if (property0.NameEquals("privateIPAllocationMethod")) { privateIPAllocationMethod = new IPAllocationMethod(property0.Value.GetString()); continue; } if (property0.NameEquals("privateIPAddressVersion")) { privateIPAddressVersion = new IPVersion(property0.Value.GetString()); continue; } if (property0.NameEquals("subnet")) { subnet = Subnet.DeserializeSubnet(property0.Value); continue; } if (property0.NameEquals("primary")) { primary = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("publicIPAddress")) { publicIPAddress = PublicIPAddress.DeserializePublicIPAddress(property0.Value); continue; } if (property0.NameEquals("applicationSecurityGroups")) { List <ApplicationSecurityGroup> array = new List <ApplicationSecurityGroup>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(item)); } applicationSecurityGroups = array; continue; } if (property0.NameEquals("provisioningState")) { provisioningState = new ProvisioningState(property0.Value.GetString()); continue; } if (property0.NameEquals("privateLinkConnectionProperties")) { privateLinkConnectionProperties = NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties.DeserializeNetworkInterfaceIPConfigurationPrivateLinkConnectionProperties(property0.Value); continue; } } continue; } } return(new NetworkInterfaceIPConfiguration(id.Value, name.Value, etag.Value, Optional.ToList(virtualNetworkTaps), Optional.ToList(applicationGatewayBackendAddressPools), Optional.ToList(loadBalancerBackendAddressPools), Optional.ToList(loadBalancerInboundNatRules), privateIPAddress.Value, Optional.ToNullable(privateIPAllocationMethod), Optional.ToNullable(privateIPAddressVersion), subnet.Value, Optional.ToNullable(primary), publicIPAddress.Value, Optional.ToList(applicationSecurityGroups), Optional.ToNullable(provisioningState), privateLinkConnectionProperties.Value)); }