
com.azure.resourcemanager.network.fluent.models.VpnGatewayInner Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.network.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SubResource;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.network.models.BgpSettings;
import com.azure.resourcemanager.network.models.ProvisioningState;
import com.azure.resourcemanager.network.models.VpnGatewayIpConfiguration;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* VpnGateway Resource.
*/
@Fluent
public final class VpnGatewayInner extends Resource {
/*
* Properties of the VPN gateway.
*/
private VpnGatewayProperties innerProperties;
/*
* A unique read-only string that changes whenever the resource is updated.
*/
private String etag;
/*
* Resource ID.
*/
private String id;
/*
* The type of the resource.
*/
private String type;
/*
* The name of the resource.
*/
private String name;
/**
* Creates an instance of VpnGatewayInner class.
*/
public VpnGatewayInner() {
}
/**
* Get the innerProperties property: Properties of the VPN gateway.
*
* @return the innerProperties value.
*/
private VpnGatewayProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the etag property: A unique read-only string that changes whenever the resource is updated.
*
* @return the etag value.
*/
public String etag() {
return this.etag;
}
/**
* Get the id property: Resource ID.
*
* @return the id value.
*/
public String id() {
return this.id;
}
/**
* Set the id property: Resource ID.
*
* @param id the id value to set.
* @return the VpnGatewayInner object itself.
*/
public VpnGatewayInner withId(String id) {
this.id = id;
return this;
}
/**
* Get the type property: The type of the resource.
*
* @return the type value.
*/
@Override
public String type() {
return this.type;
}
/**
* Get the name property: The name of the resource.
*
* @return the name value.
*/
@Override
public String name() {
return this.name;
}
/**
* {@inheritDoc}
*/
@Override
public VpnGatewayInner withLocation(String location) {
super.withLocation(location);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public VpnGatewayInner withTags(Map tags) {
super.withTags(tags);
return this;
}
/**
* Get the virtualHub property: The VirtualHub to which the gateway belongs.
*
* @return the virtualHub value.
*/
public SubResource virtualHub() {
return this.innerProperties() == null ? null : this.innerProperties().virtualHub();
}
/**
* Set the virtualHub property: The VirtualHub to which the gateway belongs.
*
* @param virtualHub the virtualHub value to set.
* @return the VpnGatewayInner object itself.
*/
public VpnGatewayInner withVirtualHub(SubResource virtualHub) {
if (this.innerProperties() == null) {
this.innerProperties = new VpnGatewayProperties();
}
this.innerProperties().withVirtualHub(virtualHub);
return this;
}
/**
* Get the connections property: List of all vpn connections to the gateway.
*
* @return the connections value.
*/
public List connections() {
return this.innerProperties() == null ? null : this.innerProperties().connections();
}
/**
* Set the connections property: List of all vpn connections to the gateway.
*
* @param connections the connections value to set.
* @return the VpnGatewayInner object itself.
*/
public VpnGatewayInner withConnections(List connections) {
if (this.innerProperties() == null) {
this.innerProperties = new VpnGatewayProperties();
}
this.innerProperties().withConnections(connections);
return this;
}
/**
* Get the bgpSettings property: Local network gateway's BGP speaker settings.
*
* @return the bgpSettings value.
*/
public BgpSettings bgpSettings() {
return this.innerProperties() == null ? null : this.innerProperties().bgpSettings();
}
/**
* Set the bgpSettings property: Local network gateway's BGP speaker settings.
*
* @param bgpSettings the bgpSettings value to set.
* @return the VpnGatewayInner object itself.
*/
public VpnGatewayInner withBgpSettings(BgpSettings bgpSettings) {
if (this.innerProperties() == null) {
this.innerProperties = new VpnGatewayProperties();
}
this.innerProperties().withBgpSettings(bgpSettings);
return this;
}
/**
* Get the provisioningState property: The provisioning state of the VPN gateway resource.
*
* @return the provisioningState value.
*/
public ProvisioningState provisioningState() {
return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
}
/**
* Get the vpnGatewayScaleUnit property: The scale unit for this vpn gateway.
*
* @return the vpnGatewayScaleUnit value.
*/
public Integer vpnGatewayScaleUnit() {
return this.innerProperties() == null ? null : this.innerProperties().vpnGatewayScaleUnit();
}
/**
* Set the vpnGatewayScaleUnit property: The scale unit for this vpn gateway.
*
* @param vpnGatewayScaleUnit the vpnGatewayScaleUnit value to set.
* @return the VpnGatewayInner object itself.
*/
public VpnGatewayInner withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) {
if (this.innerProperties() == null) {
this.innerProperties = new VpnGatewayProperties();
}
this.innerProperties().withVpnGatewayScaleUnit(vpnGatewayScaleUnit);
return this;
}
/**
* Get the ipConfigurations property: List of all IPs configured on the gateway.
*
* @return the ipConfigurations value.
*/
public List ipConfigurations() {
return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations();
}
/**
* Get the enableBgpRouteTranslationForNat property: Enable BGP routes translation for NAT on this VpnGateway.
*
* @return the enableBgpRouteTranslationForNat value.
*/
public Boolean enableBgpRouteTranslationForNat() {
return this.innerProperties() == null ? null : this.innerProperties().enableBgpRouteTranslationForNat();
}
/**
* Set the enableBgpRouteTranslationForNat property: Enable BGP routes translation for NAT on this VpnGateway.
*
* @param enableBgpRouteTranslationForNat the enableBgpRouteTranslationForNat value to set.
* @return the VpnGatewayInner object itself.
*/
public VpnGatewayInner withEnableBgpRouteTranslationForNat(Boolean enableBgpRouteTranslationForNat) {
if (this.innerProperties() == null) {
this.innerProperties = new VpnGatewayProperties();
}
this.innerProperties().withEnableBgpRouteTranslationForNat(enableBgpRouteTranslationForNat);
return this;
}
/**
* Get the isRoutingPreferenceInternet property: Enable Routing Preference property for the Public IP Interface of
* the VpnGateway.
*
* @return the isRoutingPreferenceInternet value.
*/
public Boolean isRoutingPreferenceInternet() {
return this.innerProperties() == null ? null : this.innerProperties().isRoutingPreferenceInternet();
}
/**
* Set the isRoutingPreferenceInternet property: Enable Routing Preference property for the Public IP Interface of
* the VpnGateway.
*
* @param isRoutingPreferenceInternet the isRoutingPreferenceInternet value to set.
* @return the VpnGatewayInner object itself.
*/
public VpnGatewayInner withIsRoutingPreferenceInternet(Boolean isRoutingPreferenceInternet) {
if (this.innerProperties() == null) {
this.innerProperties = new VpnGatewayProperties();
}
this.innerProperties().withIsRoutingPreferenceInternet(isRoutingPreferenceInternet);
return this;
}
/**
* Get the natRules property: List of all the nat Rules associated with the gateway.
*
* @return the natRules value.
*/
public List natRules() {
return this.innerProperties() == null ? null : this.innerProperties().natRules();
}
/**
* Set the natRules property: List of all the nat Rules associated with the gateway.
*
* @param natRules the natRules value to set.
* @return the VpnGatewayInner object itself.
*/
public VpnGatewayInner withNatRules(List natRules) {
if (this.innerProperties() == null) {
this.innerProperties = new VpnGatewayProperties();
}
this.innerProperties().withNatRules(natRules);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() != null) {
innerProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("location", location());
jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
jsonWriter.writeJsonField("properties", this.innerProperties);
jsonWriter.writeStringField("id", this.id);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of VpnGatewayInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of VpnGatewayInner if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the VpnGatewayInner.
*/
public static VpnGatewayInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
VpnGatewayInner deserializedVpnGatewayInner = new VpnGatewayInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("name".equals(fieldName)) {
deserializedVpnGatewayInner.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedVpnGatewayInner.type = reader.getString();
} else if ("location".equals(fieldName)) {
deserializedVpnGatewayInner.withLocation(reader.getString());
} else if ("tags".equals(fieldName)) {
Map tags = reader.readMap(reader1 -> reader1.getString());
deserializedVpnGatewayInner.withTags(tags);
} else if ("properties".equals(fieldName)) {
deserializedVpnGatewayInner.innerProperties = VpnGatewayProperties.fromJson(reader);
} else if ("etag".equals(fieldName)) {
deserializedVpnGatewayInner.etag = reader.getString();
} else if ("id".equals(fieldName)) {
deserializedVpnGatewayInner.id = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedVpnGatewayInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy