
com.google.api.services.compute.model.Firewall Maven / Gradle / Ivy
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://code.google.com/p/google-apis-client-generator/
* (build: 2016-05-27 16:00:31 UTC)
* on 2016-07-07 at 07:34:17 UTC
* Modify at your own risk.
*/
package com.google.api.services.compute.model;
/**
* Represents a Firewall resource.
*
* This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Compute Engine API. For a detailed explanation see:
* http://code.google.com/p/google-http-java-client/wiki/JSON
*
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class Firewall extends com.google.api.client.json.GenericJson {
/**
* The list of rules specified by this firewall. Each rule specifies a protocol and port-range
* tuple that describes a permitted connection.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.List allowed;
static {
// hack to force ProGuard to consider Allowed used, since otherwise it would be stripped out
// see http://code.google.com/p/google-api-java-client/issues/detail?id=528
com.google.api.client.util.Data.nullOf(Allowed.class);
}
/**
* [Output Only] Creation timestamp in RFC3339 text format.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String creationTimestamp;
/**
* An optional description of this resource. Provide this property when you create the resource.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String description;
/**
* [Output Only] The unique identifier for the resource. This identifier is defined by the server.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key @com.google.api.client.json.JsonString
private java.math.BigInteger id;
/**
* [Output Ony] Type of the resource. Always compute#firewall for firewall rules.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String kind;
/**
* Name of the resource; provided by the client when the resource is created. The name must be
* 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters
* long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first
* character must be a lowercase letter, and all following characters must be a dash, lowercase
* letter, or digit, except the last character, which cannot be a dash.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/**
* URL of the network resource for this firewall rule. If not specified when creating a firewall
* rule, the default network is used: global/networks/default If you choose to specify this
* property, you can specify the network as a full or partial URL. For example, the following are
* all valid URLs: - https://www.googleapis.com/compute/v1/projects/myproject/global/networks
* /my-network - projects/myproject/global/networks/my-network - global/networks/default
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String network;
/**
* [Output Only] Server-defined URL for the resource.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String selfLink;
/**
* The IP address blocks that this rule applies to, expressed in CIDR format. One or both of
* sourceRanges and sourceTags may be set.
*
* If both properties are set, an inbound connection is allowed if the range matches the
* sourceRanges OR the tag of the source matches the sourceTags property. The connection does not
* need to match both properties.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.List sourceRanges;
/**
* A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags
* may be set.
*
* If both properties are set, an inbound connection is allowed if the range matches the
* sourceRanges OR the tag of the source matches the sourceTags property. The connection does not
* need to match both properties.
*
* Source tags cannot be used to allow access to an instance's external IP address. Because tags
* are associated with an instance, not an IP address, source tags can only be used to control
* traffic traveling from an instance inside the same network as the firewall.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.List sourceTags;
/**
* A list of instance tags indicating sets of instances located in the network that may make
* network connections as specified in allowed[]. If no targetTags are specified, the firewall
* rule applies to all instances on the specified network.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.List targetTags;
/**
* The list of rules specified by this firewall. Each rule specifies a protocol and port-range
* tuple that describes a permitted connection.
* @return value or {@code null} for none
*/
public java.util.List getAllowed() {
return allowed;
}
/**
* The list of rules specified by this firewall. Each rule specifies a protocol and port-range
* tuple that describes a permitted connection.
* @param allowed allowed or {@code null} for none
*/
public Firewall setAllowed(java.util.List allowed) {
this.allowed = allowed;
return this;
}
/**
* [Output Only] Creation timestamp in RFC3339 text format.
* @return value or {@code null} for none
*/
public java.lang.String getCreationTimestamp() {
return creationTimestamp;
}
/**
* [Output Only] Creation timestamp in RFC3339 text format.
* @param creationTimestamp creationTimestamp or {@code null} for none
*/
public Firewall setCreationTimestamp(java.lang.String creationTimestamp) {
this.creationTimestamp = creationTimestamp;
return this;
}
/**
* An optional description of this resource. Provide this property when you create the resource.
* @return value or {@code null} for none
*/
public java.lang.String getDescription() {
return description;
}
/**
* An optional description of this resource. Provide this property when you create the resource.
* @param description description or {@code null} for none
*/
public Firewall setDescription(java.lang.String description) {
this.description = description;
return this;
}
/**
* [Output Only] The unique identifier for the resource. This identifier is defined by the server.
* @return value or {@code null} for none
*/
public java.math.BigInteger getId() {
return id;
}
/**
* [Output Only] The unique identifier for the resource. This identifier is defined by the server.
* @param id id or {@code null} for none
*/
public Firewall setId(java.math.BigInteger id) {
this.id = id;
return this;
}
/**
* [Output Ony] Type of the resource. Always compute#firewall for firewall rules.
* @return value or {@code null} for none
*/
public java.lang.String getKind() {
return kind;
}
/**
* [Output Ony] Type of the resource. Always compute#firewall for firewall rules.
* @param kind kind or {@code null} for none
*/
public Firewall setKind(java.lang.String kind) {
this.kind = kind;
return this;
}
/**
* Name of the resource; provided by the client when the resource is created. The name must be
* 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters
* long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first
* character must be a lowercase letter, and all following characters must be a dash, lowercase
* letter, or digit, except the last character, which cannot be a dash.
* @return value or {@code null} for none
*/
public java.lang.String getName() {
return name;
}
/**
* Name of the resource; provided by the client when the resource is created. The name must be
* 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters
* long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first
* character must be a lowercase letter, and all following characters must be a dash, lowercase
* letter, or digit, except the last character, which cannot be a dash.
* @param name name or {@code null} for none
*/
public Firewall setName(java.lang.String name) {
this.name = name;
return this;
}
/**
* URL of the network resource for this firewall rule. If not specified when creating a firewall
* rule, the default network is used: global/networks/default If you choose to specify this
* property, you can specify the network as a full or partial URL. For example, the following are
* all valid URLs: - https://www.googleapis.com/compute/v1/projects/myproject/global/networks
* /my-network - projects/myproject/global/networks/my-network - global/networks/default
* @return value or {@code null} for none
*/
public java.lang.String getNetwork() {
return network;
}
/**
* URL of the network resource for this firewall rule. If not specified when creating a firewall
* rule, the default network is used: global/networks/default If you choose to specify this
* property, you can specify the network as a full or partial URL. For example, the following are
* all valid URLs: - https://www.googleapis.com/compute/v1/projects/myproject/global/networks
* /my-network - projects/myproject/global/networks/my-network - global/networks/default
* @param network network or {@code null} for none
*/
public Firewall setNetwork(java.lang.String network) {
this.network = network;
return this;
}
/**
* [Output Only] Server-defined URL for the resource.
* @return value or {@code null} for none
*/
public java.lang.String getSelfLink() {
return selfLink;
}
/**
* [Output Only] Server-defined URL for the resource.
* @param selfLink selfLink or {@code null} for none
*/
public Firewall setSelfLink(java.lang.String selfLink) {
this.selfLink = selfLink;
return this;
}
/**
* The IP address blocks that this rule applies to, expressed in CIDR format. One or both of
* sourceRanges and sourceTags may be set.
*
* If both properties are set, an inbound connection is allowed if the range matches the
* sourceRanges OR the tag of the source matches the sourceTags property. The connection does not
* need to match both properties.
* @return value or {@code null} for none
*/
public java.util.List getSourceRanges() {
return sourceRanges;
}
/**
* The IP address blocks that this rule applies to, expressed in CIDR format. One or both of
* sourceRanges and sourceTags may be set.
*
* If both properties are set, an inbound connection is allowed if the range matches the
* sourceRanges OR the tag of the source matches the sourceTags property. The connection does not
* need to match both properties.
* @param sourceRanges sourceRanges or {@code null} for none
*/
public Firewall setSourceRanges(java.util.List sourceRanges) {
this.sourceRanges = sourceRanges;
return this;
}
/**
* A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags
* may be set.
*
* If both properties are set, an inbound connection is allowed if the range matches the
* sourceRanges OR the tag of the source matches the sourceTags property. The connection does not
* need to match both properties.
*
* Source tags cannot be used to allow access to an instance's external IP address. Because tags
* are associated with an instance, not an IP address, source tags can only be used to control
* traffic traveling from an instance inside the same network as the firewall.
* @return value or {@code null} for none
*/
public java.util.List getSourceTags() {
return sourceTags;
}
/**
* A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags
* may be set.
*
* If both properties are set, an inbound connection is allowed if the range matches the
* sourceRanges OR the tag of the source matches the sourceTags property. The connection does not
* need to match both properties.
*
* Source tags cannot be used to allow access to an instance's external IP address. Because tags
* are associated with an instance, not an IP address, source tags can only be used to control
* traffic traveling from an instance inside the same network as the firewall.
* @param sourceTags sourceTags or {@code null} for none
*/
public Firewall setSourceTags(java.util.List sourceTags) {
this.sourceTags = sourceTags;
return this;
}
/**
* A list of instance tags indicating sets of instances located in the network that may make
* network connections as specified in allowed[]. If no targetTags are specified, the firewall
* rule applies to all instances on the specified network.
* @return value or {@code null} for none
*/
public java.util.List getTargetTags() {
return targetTags;
}
/**
* A list of instance tags indicating sets of instances located in the network that may make
* network connections as specified in allowed[]. If no targetTags are specified, the firewall
* rule applies to all instances on the specified network.
* @param targetTags targetTags or {@code null} for none
*/
public Firewall setTargetTags(java.util.List targetTags) {
this.targetTags = targetTags;
return this;
}
@Override
public Firewall set(String fieldName, Object value) {
return (Firewall) super.set(fieldName, value);
}
@Override
public Firewall clone() {
return (Firewall) super.clone();
}
/**
* Model definition for FirewallAllowed.
*/
public static final class Allowed extends com.google.api.client.json.GenericJson {
/**
* The IP protocol that is allowed for this rule. The protocol type is required when creating a
* firewall rule. This value can either be one of the following well known protocol strings (tcp,
* udp, icmp, esp, ah, sctp), or the IP protocol number.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key("IPProtocol")
private java.lang.String iPProtocol;
/**
* An optional list of ports which are allowed. This field is only applicable for UDP or TCP
* protocol. Each entry must be either an integer or a range. If not specified, connections
* through any port are allowed
*
* Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.List ports;
/**
* The IP protocol that is allowed for this rule. The protocol type is required when creating a
* firewall rule. This value can either be one of the following well known protocol strings (tcp,
* udp, icmp, esp, ah, sctp), or the IP protocol number.
* @return value or {@code null} for none
*/
public java.lang.String getIPProtocol() {
return iPProtocol;
}
/**
* The IP protocol that is allowed for this rule. The protocol type is required when creating a
* firewall rule. This value can either be one of the following well known protocol strings (tcp,
* udp, icmp, esp, ah, sctp), or the IP protocol number.
* @param iPProtocol iPProtocol or {@code null} for none
*/
public Allowed setIPProtocol(java.lang.String iPProtocol) {
this.iPProtocol = iPProtocol;
return this;
}
/**
* An optional list of ports which are allowed. This field is only applicable for UDP or TCP
* protocol. Each entry must be either an integer or a range. If not specified, connections
* through any port are allowed
*
* Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
* @return value or {@code null} for none
*/
public java.util.List getPorts() {
return ports;
}
/**
* An optional list of ports which are allowed. This field is only applicable for UDP or TCP
* protocol. Each entry must be either an integer or a range. If not specified, connections
* through any port are allowed
*
* Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
* @param ports ports or {@code null} for none
*/
public Allowed setPorts(java.util.List ports) {
this.ports = ports;
return this;
}
@Override
public Allowed set(String fieldName, Object value) {
return (Allowed) super.set(fieldName, value);
}
@Override
public Allowed clone() {
return (Allowed) super.clone();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy