![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.compute.fluent.models.VirtualMachineNetworkInterfaceIpConfigurationProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-compute Show documentation
Show all versions of azure-resourcemanager-compute Show documentation
This package contains Microsoft Azure Compute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.compute.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.management.SubResource;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.compute.models.IpVersions;
import com.azure.resourcemanager.compute.models.VirtualMachinePublicIpAddressConfiguration;
import java.io.IOException;
import java.util.List;
/**
* Describes a virtual machine network interface IP configuration properties.
*/
@Fluent
public final class VirtualMachineNetworkInterfaceIpConfigurationProperties
implements JsonSerializable {
/*
* Specifies the identifier of the subnet.
*/
private SubResource subnet;
/*
* Specifies the primary network interface in case the virtual machine has more than 1 network interface.
*/
private Boolean primary;
/*
* The publicIPAddressConfiguration.
*/
private VirtualMachinePublicIpAddressConfiguration publicIpAddressConfiguration;
/*
* Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or
* IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.
*/
private IpVersions privateIpAddressVersion;
/*
* Specifies an array of references to application security group.
*/
private List applicationSecurityGroups;
/*
* Specifies an array of references to backend address pools of application gateways. A virtual machine can
* reference backend address pools of multiple application gateways. Multiple virtual machines cannot use the same
* application gateway.
*/
private List applicationGatewayBackendAddressPools;
/*
* Specifies an array of references to backend address pools of load balancers. A virtual machine can reference
* backend address pools of one public and one internal load balancer. [Multiple virtual machines cannot use the
* same basic sku load balancer].
*/
private List loadBalancerBackendAddressPools;
/**
* Creates an instance of VirtualMachineNetworkInterfaceIpConfigurationProperties class.
*/
public VirtualMachineNetworkInterfaceIpConfigurationProperties() {
}
/**
* Get the subnet property: Specifies the identifier of the subnet.
*
* @return the subnet value.
*/
public SubResource subnet() {
return this.subnet;
}
/**
* Set the subnet property: Specifies the identifier of the subnet.
*
* @param subnet the subnet value to set.
* @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself.
*/
public VirtualMachineNetworkInterfaceIpConfigurationProperties withSubnet(SubResource subnet) {
this.subnet = subnet;
return this;
}
/**
* Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1
* network interface.
*
* @return the primary value.
*/
public Boolean primary() {
return this.primary;
}
/**
* Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1
* network interface.
*
* @param primary the primary value to set.
* @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself.
*/
public VirtualMachineNetworkInterfaceIpConfigurationProperties withPrimary(Boolean primary) {
this.primary = primary;
return this;
}
/**
* Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration.
*
* @return the publicIpAddressConfiguration value.
*/
public VirtualMachinePublicIpAddressConfiguration publicIpAddressConfiguration() {
return this.publicIpAddressConfiguration;
}
/**
* Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration.
*
* @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set.
* @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself.
*/
public VirtualMachineNetworkInterfaceIpConfigurationProperties
withPublicIpAddressConfiguration(VirtualMachinePublicIpAddressConfiguration publicIpAddressConfiguration) {
this.publicIpAddressConfiguration = publicIpAddressConfiguration;
return this;
}
/**
* Get the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether
* the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.
*
* @return the privateIpAddressVersion value.
*/
public IpVersions privateIpAddressVersion() {
return this.privateIpAddressVersion;
}
/**
* Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether
* the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.
*
* @param privateIpAddressVersion the privateIpAddressVersion value to set.
* @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself.
*/
public VirtualMachineNetworkInterfaceIpConfigurationProperties
withPrivateIpAddressVersion(IpVersions privateIpAddressVersion) {
this.privateIpAddressVersion = privateIpAddressVersion;
return this;
}
/**
* Get the applicationSecurityGroups property: Specifies an array of references to application security group.
*
* @return the applicationSecurityGroups value.
*/
public List applicationSecurityGroups() {
return this.applicationSecurityGroups;
}
/**
* Set the applicationSecurityGroups property: Specifies an array of references to application security group.
*
* @param applicationSecurityGroups the applicationSecurityGroups value to set.
* @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself.
*/
public VirtualMachineNetworkInterfaceIpConfigurationProperties
withApplicationSecurityGroups(List applicationSecurityGroups) {
this.applicationSecurityGroups = applicationSecurityGroups;
return this;
}
/**
* Get the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools
* of application gateways. A virtual machine can reference backend address pools of multiple application gateways.
* Multiple virtual machines cannot use the same application gateway.
*
* @return the applicationGatewayBackendAddressPools value.
*/
public List applicationGatewayBackendAddressPools() {
return this.applicationGatewayBackendAddressPools;
}
/**
* Set the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools
* of application gateways. A virtual machine can reference backend address pools of multiple application gateways.
* Multiple virtual machines cannot use the same application gateway.
*
* @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set.
* @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself.
*/
public VirtualMachineNetworkInterfaceIpConfigurationProperties
withApplicationGatewayBackendAddressPools(List applicationGatewayBackendAddressPools) {
this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools;
return this;
}
/**
* Get the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of
* load balancers. A virtual machine can reference backend address pools of one public and one internal load
* balancer. [Multiple virtual machines cannot use the same basic sku load balancer].
*
* @return the loadBalancerBackendAddressPools value.
*/
public List loadBalancerBackendAddressPools() {
return this.loadBalancerBackendAddressPools;
}
/**
* Set the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of
* load balancers. A virtual machine can reference backend address pools of one public and one internal load
* balancer. [Multiple virtual machines cannot use the same basic sku load balancer].
*
* @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set.
* @return the VirtualMachineNetworkInterfaceIpConfigurationProperties object itself.
*/
public VirtualMachineNetworkInterfaceIpConfigurationProperties
withLoadBalancerBackendAddressPools(List loadBalancerBackendAddressPools) {
this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (publicIpAddressConfiguration() != null) {
publicIpAddressConfiguration().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("subnet", this.subnet);
jsonWriter.writeBooleanField("primary", this.primary);
jsonWriter.writeJsonField("publicIPAddressConfiguration", this.publicIpAddressConfiguration);
jsonWriter.writeStringField("privateIPAddressVersion",
this.privateIpAddressVersion == null ? null : this.privateIpAddressVersion.toString());
jsonWriter.writeArrayField("applicationSecurityGroups", this.applicationSecurityGroups,
(writer, element) -> writer.writeJson(element));
jsonWriter.writeArrayField("applicationGatewayBackendAddressPools", this.applicationGatewayBackendAddressPools,
(writer, element) -> writer.writeJson(element));
jsonWriter.writeArrayField("loadBalancerBackendAddressPools", this.loadBalancerBackendAddressPools,
(writer, element) -> writer.writeJson(element));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of VirtualMachineNetworkInterfaceIpConfigurationProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of VirtualMachineNetworkInterfaceIpConfigurationProperties if the JsonReader was pointing to
* an instance of it, or null if it was pointing to JSON null.
* @throws IOException If an error occurs while reading the VirtualMachineNetworkInterfaceIpConfigurationProperties.
*/
public static VirtualMachineNetworkInterfaceIpConfigurationProperties fromJson(JsonReader jsonReader)
throws IOException {
return jsonReader.readObject(reader -> {
VirtualMachineNetworkInterfaceIpConfigurationProperties deserializedVirtualMachineNetworkInterfaceIpConfigurationProperties
= new VirtualMachineNetworkInterfaceIpConfigurationProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("subnet".equals(fieldName)) {
deserializedVirtualMachineNetworkInterfaceIpConfigurationProperties.subnet
= SubResource.fromJson(reader);
} else if ("primary".equals(fieldName)) {
deserializedVirtualMachineNetworkInterfaceIpConfigurationProperties.primary
= reader.getNullable(JsonReader::getBoolean);
} else if ("publicIPAddressConfiguration".equals(fieldName)) {
deserializedVirtualMachineNetworkInterfaceIpConfigurationProperties.publicIpAddressConfiguration
= VirtualMachinePublicIpAddressConfiguration.fromJson(reader);
} else if ("privateIPAddressVersion".equals(fieldName)) {
deserializedVirtualMachineNetworkInterfaceIpConfigurationProperties.privateIpAddressVersion
= IpVersions.fromString(reader.getString());
} else if ("applicationSecurityGroups".equals(fieldName)) {
List applicationSecurityGroups
= reader.readArray(reader1 -> SubResource.fromJson(reader1));
deserializedVirtualMachineNetworkInterfaceIpConfigurationProperties.applicationSecurityGroups
= applicationSecurityGroups;
} else if ("applicationGatewayBackendAddressPools".equals(fieldName)) {
List applicationGatewayBackendAddressPools
= reader.readArray(reader1 -> SubResource.fromJson(reader1));
deserializedVirtualMachineNetworkInterfaceIpConfigurationProperties.applicationGatewayBackendAddressPools
= applicationGatewayBackendAddressPools;
} else if ("loadBalancerBackendAddressPools".equals(fieldName)) {
List loadBalancerBackendAddressPools
= reader.readArray(reader1 -> SubResource.fromJson(reader1));
deserializedVirtualMachineNetworkInterfaceIpConfigurationProperties.loadBalancerBackendAddressPools
= loadBalancerBackendAddressPools;
} else {
reader.skipChildren();
}
}
return deserializedVirtualMachineNetworkInterfaceIpConfigurationProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy