Class NetworkPeering.Builder (1.33.0)

public static final class NetworkPeering.Builder extends GeneratedMessageV3.Builder<NetworkPeering.Builder> implements NetworkPeeringOrBuilder

A network peering attached to a network resource. The message includes the peering name, peer network, peering state, and a flag indicating whether Google Compute Engine should automatically create routes for the peering.

Protobuf type google.cloud.compute.v1.NetworkPeering

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public NetworkPeering.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
NetworkPeering.Builder
Overrides

build()

public NetworkPeering build()
Returns
TypeDescription
NetworkPeering

buildPartial()

public NetworkPeering buildPartial()
Returns
TypeDescription
NetworkPeering

clear()

public NetworkPeering.Builder clear()
Returns
TypeDescription
NetworkPeering.Builder
Overrides

clearAutoCreateRoutes()

public NetworkPeering.Builder clearAutoCreateRoutes()

This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.

optional bool auto_create_routes = 57454941;

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

clearExchangeSubnetRoutes()

public NetworkPeering.Builder clearExchangeSubnetRoutes()

Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.

optional bool exchange_subnet_routes = 26322256;

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

clearExportCustomRoutes()

public NetworkPeering.Builder clearExportCustomRoutes()

Whether to export the custom routes to peer network. The default value is false.

optional bool export_custom_routes = 60281485;

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

clearExportSubnetRoutesWithPublicIp()

public NetworkPeering.Builder clearExportSubnetRoutesWithPublicIp()

Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. IPv4 special-use ranges are always exported to peers and are not controlled by this field.

optional bool export_subnet_routes_with_public_ip = 97940834;

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public NetworkPeering.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
NetworkPeering.Builder
Overrides

clearImportCustomRoutes()

public NetworkPeering.Builder clearImportCustomRoutes()

Whether to import the custom routes from peer network. The default value is false.

optional bool import_custom_routes = 197982398;

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

clearImportSubnetRoutesWithPublicIp()

public NetworkPeering.Builder clearImportSubnetRoutesWithPublicIp()

Whether subnet routes with public IP range are imported. The default value is false. IPv4 special-use ranges are always imported from peers and are not controlled by this field.

optional bool import_subnet_routes_with_public_ip = 14419729;

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

clearName()

public NetworkPeering.Builder clearName()

Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression a-z?. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

optional string name = 3373707;

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

clearNetwork()

public NetworkPeering.Builder clearNetwork()

The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network.

optional string network = 232872494;

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public NetworkPeering.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
NetworkPeering.Builder
Overrides

clearPeerMtu()

public NetworkPeering.Builder clearPeerMtu()

Maximum Transmission Unit in bytes.

optional int32 peer_mtu = 69584721;

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

clearStackType()

public NetworkPeering.Builder clearStackType()

Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Check the StackType enum for the list of possible values.

optional string stack_type = 425908881;

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

clearState()

public NetworkPeering.Builder clearState()

[Output Only] State for the peering, either ACTIVE or INACTIVE. The peering is ACTIVE when there's a matching configuration in the peer network. Check the State enum for the list of possible values.

optional string state = 109757585;

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

clearStateDetails()

public NetworkPeering.Builder clearStateDetails()

[Output Only] Details about the current state of the peering.

optional string state_details = 95566996;

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

clone()

public NetworkPeering.Builder clone()
Returns
TypeDescription
NetworkPeering.Builder
Overrides

getAutoCreateRoutes()

public boolean getAutoCreateRoutes()

This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.

optional bool auto_create_routes = 57454941;

Returns
TypeDescription
boolean

The autoCreateRoutes.

getDefaultInstanceForType()

public NetworkPeering getDefaultInstanceForType()
Returns
TypeDescription
NetworkPeering

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getExchangeSubnetRoutes()

public boolean getExchangeSubnetRoutes()

Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.

optional bool exchange_subnet_routes = 26322256;

Returns
TypeDescription
boolean

The exchangeSubnetRoutes.

getExportCustomRoutes()

public boolean getExportCustomRoutes()

Whether to export the custom routes to peer network. The default value is false.

optional bool export_custom_routes = 60281485;

Returns
TypeDescription
boolean

The exportCustomRoutes.

getExportSubnetRoutesWithPublicIp()

public boolean getExportSubnetRoutesWithPublicIp()

Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. IPv4 special-use ranges are always exported to peers and are not controlled by this field.

optional bool export_subnet_routes_with_public_ip = 97940834;

Returns
TypeDescription
boolean

The exportSubnetRoutesWithPublicIp.

getImportCustomRoutes()

public boolean getImportCustomRoutes()

Whether to import the custom routes from peer network. The default value is false.

optional bool import_custom_routes = 197982398;

Returns
TypeDescription
boolean

The importCustomRoutes.

getImportSubnetRoutesWithPublicIp()

public boolean getImportSubnetRoutesWithPublicIp()

Whether subnet routes with public IP range are imported. The default value is false. IPv4 special-use ranges are always imported from peers and are not controlled by this field.

optional bool import_subnet_routes_with_public_ip = 14419729;

Returns
TypeDescription
boolean

The importSubnetRoutesWithPublicIp.

getName()

public String getName()

Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression a-z?. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

optional string name = 3373707;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression a-z?. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

optional string name = 3373707;

Returns
TypeDescription
ByteString

The bytes for name.

getNetwork()

public String getNetwork()

The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network.

optional string network = 232872494;

Returns
TypeDescription
String

The network.

getNetworkBytes()

public ByteString getNetworkBytes()

The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network.

optional string network = 232872494;

Returns
TypeDescription
ByteString

The bytes for network.

getPeerMtu()

public int getPeerMtu()

Maximum Transmission Unit in bytes.

optional int32 peer_mtu = 69584721;

Returns
TypeDescription
int

The peerMtu.

getStackType()

public String getStackType()

Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Check the StackType enum for the list of possible values.

optional string stack_type = 425908881;

Returns
TypeDescription
String

The stackType.

getStackTypeBytes()

public ByteString getStackTypeBytes()

Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Check the StackType enum for the list of possible values.

optional string stack_type = 425908881;

Returns
TypeDescription
ByteString

The bytes for stackType.

getState()

public String getState()

[Output Only] State for the peering, either ACTIVE or INACTIVE. The peering is ACTIVE when there's a matching configuration in the peer network. Check the State enum for the list of possible values.

optional string state = 109757585;

Returns
TypeDescription
String

The state.

getStateBytes()

public ByteString getStateBytes()

[Output Only] State for the peering, either ACTIVE or INACTIVE. The peering is ACTIVE when there's a matching configuration in the peer network. Check the State enum for the list of possible values.

optional string state = 109757585;

Returns
TypeDescription
ByteString

The bytes for state.

getStateDetails()

public String getStateDetails()

[Output Only] Details about the current state of the peering.

optional string state_details = 95566996;

Returns
TypeDescription
String

The stateDetails.

getStateDetailsBytes()

public ByteString getStateDetailsBytes()

[Output Only] Details about the current state of the peering.

optional string state_details = 95566996;

Returns
TypeDescription
ByteString

The bytes for stateDetails.

hasAutoCreateRoutes()

public boolean hasAutoCreateRoutes()

This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.

optional bool auto_create_routes = 57454941;

Returns
TypeDescription
boolean

Whether the autoCreateRoutes field is set.

hasExchangeSubnetRoutes()

public boolean hasExchangeSubnetRoutes()

Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.

optional bool exchange_subnet_routes = 26322256;

Returns
TypeDescription
boolean

Whether the exchangeSubnetRoutes field is set.

hasExportCustomRoutes()

public boolean hasExportCustomRoutes()

Whether to export the custom routes to peer network. The default value is false.

optional bool export_custom_routes = 60281485;

Returns
TypeDescription
boolean

Whether the exportCustomRoutes field is set.

hasExportSubnetRoutesWithPublicIp()

public boolean hasExportSubnetRoutesWithPublicIp()

Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. IPv4 special-use ranges are always exported to peers and are not controlled by this field.

optional bool export_subnet_routes_with_public_ip = 97940834;

Returns
TypeDescription
boolean

Whether the exportSubnetRoutesWithPublicIp field is set.

hasImportCustomRoutes()

public boolean hasImportCustomRoutes()

Whether to import the custom routes from peer network. The default value is false.

optional bool import_custom_routes = 197982398;

Returns
TypeDescription
boolean

Whether the importCustomRoutes field is set.

hasImportSubnetRoutesWithPublicIp()

public boolean hasImportSubnetRoutesWithPublicIp()

Whether subnet routes with public IP range are imported. The default value is false. IPv4 special-use ranges are always imported from peers and are not controlled by this field.

optional bool import_subnet_routes_with_public_ip = 14419729;

Returns
TypeDescription
boolean

Whether the importSubnetRoutesWithPublicIp field is set.

hasName()

public boolean hasName()

Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression a-z?. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

optional string name = 3373707;

Returns
TypeDescription
boolean

Whether the name field is set.

hasNetwork()

public boolean hasNetwork()

The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network.

optional string network = 232872494;

Returns
TypeDescription
boolean

Whether the network field is set.

hasPeerMtu()

public boolean hasPeerMtu()

Maximum Transmission Unit in bytes.

optional int32 peer_mtu = 69584721;

Returns
TypeDescription
boolean

Whether the peerMtu field is set.

hasStackType()

public boolean hasStackType()

Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Check the StackType enum for the list of possible values.

optional string stack_type = 425908881;

Returns
TypeDescription
boolean

Whether the stackType field is set.

hasState()

public boolean hasState()

[Output Only] State for the peering, either ACTIVE or INACTIVE. The peering is ACTIVE when there's a matching configuration in the peer network. Check the State enum for the list of possible values.

optional string state = 109757585;

Returns
TypeDescription
boolean

Whether the state field is set.

hasStateDetails()

public boolean hasStateDetails()

[Output Only] Details about the current state of the peering.

optional string state_details = 95566996;

Returns
TypeDescription
boolean

Whether the stateDetails field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(NetworkPeering other)

public NetworkPeering.Builder mergeFrom(NetworkPeering other)
Parameter
NameDescription
otherNetworkPeering
Returns
TypeDescription
NetworkPeering.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public NetworkPeering.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
NetworkPeering.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public NetworkPeering.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
NetworkPeering.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final NetworkPeering.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
NetworkPeering.Builder
Overrides

setAutoCreateRoutes(boolean value)

public NetworkPeering.Builder setAutoCreateRoutes(boolean value)

This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.

optional bool auto_create_routes = 57454941;

Parameter
NameDescription
valueboolean

The autoCreateRoutes to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setExchangeSubnetRoutes(boolean value)

public NetworkPeering.Builder setExchangeSubnetRoutes(boolean value)

Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.

optional bool exchange_subnet_routes = 26322256;

Parameter
NameDescription
valueboolean

The exchangeSubnetRoutes to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setExportCustomRoutes(boolean value)

public NetworkPeering.Builder setExportCustomRoutes(boolean value)

Whether to export the custom routes to peer network. The default value is false.

optional bool export_custom_routes = 60281485;

Parameter
NameDescription
valueboolean

The exportCustomRoutes to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setExportSubnetRoutesWithPublicIp(boolean value)

public NetworkPeering.Builder setExportSubnetRoutesWithPublicIp(boolean value)

Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. IPv4 special-use ranges are always exported to peers and are not controlled by this field.

optional bool export_subnet_routes_with_public_ip = 97940834;

Parameter
NameDescription
valueboolean

The exportSubnetRoutesWithPublicIp to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public NetworkPeering.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
NetworkPeering.Builder
Overrides

setImportCustomRoutes(boolean value)

public NetworkPeering.Builder setImportCustomRoutes(boolean value)

Whether to import the custom routes from peer network. The default value is false.

optional bool import_custom_routes = 197982398;

Parameter
NameDescription
valueboolean

The importCustomRoutes to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setImportSubnetRoutesWithPublicIp(boolean value)

public NetworkPeering.Builder setImportSubnetRoutesWithPublicIp(boolean value)

Whether subnet routes with public IP range are imported. The default value is false. IPv4 special-use ranges are always imported from peers and are not controlled by this field.

optional bool import_subnet_routes_with_public_ip = 14419729;

Parameter
NameDescription
valueboolean

The importSubnetRoutesWithPublicIp to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setName(String value)

public NetworkPeering.Builder setName(String value)

Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression a-z?. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

optional string name = 3373707;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setNameBytes(ByteString value)

public NetworkPeering.Builder setNameBytes(ByteString value)

Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression a-z?. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

optional string name = 3373707;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setNetwork(String value)

public NetworkPeering.Builder setNetwork(String value)

The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network.

optional string network = 232872494;

Parameter
NameDescription
valueString

The network to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setNetworkBytes(ByteString value)

public NetworkPeering.Builder setNetworkBytes(ByteString value)

The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network.

optional string network = 232872494;

Parameter
NameDescription
valueByteString

The bytes for network to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setPeerMtu(int value)

public NetworkPeering.Builder setPeerMtu(int value)

Maximum Transmission Unit in bytes.

optional int32 peer_mtu = 69584721;

Parameter
NameDescription
valueint

The peerMtu to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public NetworkPeering.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
NetworkPeering.Builder
Overrides

setStackType(String value)

public NetworkPeering.Builder setStackType(String value)

Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Check the StackType enum for the list of possible values.

optional string stack_type = 425908881;

Parameter
NameDescription
valueString

The stackType to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setStackTypeBytes(ByteString value)

public NetworkPeering.Builder setStackTypeBytes(ByteString value)

Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Check the StackType enum for the list of possible values.

optional string stack_type = 425908881;

Parameter
NameDescription
valueByteString

The bytes for stackType to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setState(String value)

public NetworkPeering.Builder setState(String value)

[Output Only] State for the peering, either ACTIVE or INACTIVE. The peering is ACTIVE when there's a matching configuration in the peer network. Check the State enum for the list of possible values.

optional string state = 109757585;

Parameter
NameDescription
valueString

The state to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setStateBytes(ByteString value)

public NetworkPeering.Builder setStateBytes(ByteString value)

[Output Only] State for the peering, either ACTIVE or INACTIVE. The peering is ACTIVE when there's a matching configuration in the peer network. Check the State enum for the list of possible values.

optional string state = 109757585;

Parameter
NameDescription
valueByteString

The bytes for state to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setStateDetails(String value)

public NetworkPeering.Builder setStateDetails(String value)

[Output Only] Details about the current state of the peering.

optional string state_details = 95566996;

Parameter
NameDescription
valueString

The stateDetails to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setStateDetailsBytes(ByteString value)

public NetworkPeering.Builder setStateDetailsBytes(ByteString value)

[Output Only] Details about the current state of the peering.

optional string state_details = 95566996;

Parameter
NameDescription
valueByteString

The bytes for stateDetails to set.

Returns
TypeDescription
NetworkPeering.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final NetworkPeering.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
NetworkPeering.Builder
Overrides