com.amazonaws.services.networkmanager.model.NetworkResource Maven / Gradle / Ivy
Show all versions of aws-java-sdk-networkmanager Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
package com.amazonaws.services.networkmanager.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes a network resource.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class NetworkResource implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ARN of the gateway.
*
*/
private String registeredGatewayArn;
/**
*
* The ID of a core network.
*
*/
private String coreNetworkId;
/**
*
* The Amazon Web Services Region.
*
*/
private String awsRegion;
/**
*
* The Amazon Web Services account ID.
*
*/
private String accountId;
/**
*
* The resource type.
*
*
* The following are the supported resource types for Direct Connect:
*
*
* -
*
* dxcon
*
*
* -
*
* dx-gateway
*
*
* -
*
* dx-vif
*
*
*
*
* The following are the supported resource types for Network Manager:
*
*
* -
*
* attachment
*
*
* -
*
* connect-peer
*
*
* -
*
* connection
*
*
* -
*
* core-network
*
*
* -
*
* device
*
*
* -
*
* link
*
*
* -
*
* peering
*
*
* -
*
* site
*
*
*
*
* The following are the supported resource types for Amazon VPC:
*
*
* -
*
* customer-gateway
*
*
* -
*
* transit-gateway
*
*
* -
*
* transit-gateway-attachment
*
*
* -
*
* transit-gateway-connect-peer
*
*
* -
*
* transit-gateway-route-table
*
*
* -
*
* vpn-connection
*
*
*
*/
private String resourceType;
/**
*
* The ID of the resource.
*
*/
private String resourceId;
/**
*
* The ARN of the resource.
*
*/
private String resourceArn;
/**
*
* Information about the resource, in JSON format. Network Manager gets this information by describing the resource
* using its Describe API call.
*
*/
private String definition;
/**
*
* The time that the resource definition was retrieved.
*
*/
private java.util.Date definitionTimestamp;
/**
*
* The tags.
*
*/
private java.util.List tags;
/**
*
* The resource metadata.
*
*/
private java.util.Map metadata;
/**
*
* The ARN of the gateway.
*
*
* @param registeredGatewayArn
* The ARN of the gateway.
*/
public void setRegisteredGatewayArn(String registeredGatewayArn) {
this.registeredGatewayArn = registeredGatewayArn;
}
/**
*
* The ARN of the gateway.
*
*
* @return The ARN of the gateway.
*/
public String getRegisteredGatewayArn() {
return this.registeredGatewayArn;
}
/**
*
* The ARN of the gateway.
*
*
* @param registeredGatewayArn
* The ARN of the gateway.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource withRegisteredGatewayArn(String registeredGatewayArn) {
setRegisteredGatewayArn(registeredGatewayArn);
return this;
}
/**
*
* The ID of a core network.
*
*
* @param coreNetworkId
* The ID of a core network.
*/
public void setCoreNetworkId(String coreNetworkId) {
this.coreNetworkId = coreNetworkId;
}
/**
*
* The ID of a core network.
*
*
* @return The ID of a core network.
*/
public String getCoreNetworkId() {
return this.coreNetworkId;
}
/**
*
* The ID of a core network.
*
*
* @param coreNetworkId
* The ID of a core network.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource withCoreNetworkId(String coreNetworkId) {
setCoreNetworkId(coreNetworkId);
return this;
}
/**
*
* The Amazon Web Services Region.
*
*
* @param awsRegion
* The Amazon Web Services Region.
*/
public void setAwsRegion(String awsRegion) {
this.awsRegion = awsRegion;
}
/**
*
* The Amazon Web Services Region.
*
*
* @return The Amazon Web Services Region.
*/
public String getAwsRegion() {
return this.awsRegion;
}
/**
*
* The Amazon Web Services Region.
*
*
* @param awsRegion
* The Amazon Web Services Region.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource withAwsRegion(String awsRegion) {
setAwsRegion(awsRegion);
return this;
}
/**
*
* The Amazon Web Services account ID.
*
*
* @param accountId
* The Amazon Web Services account ID.
*/
public void setAccountId(String accountId) {
this.accountId = accountId;
}
/**
*
* The Amazon Web Services account ID.
*
*
* @return The Amazon Web Services account ID.
*/
public String getAccountId() {
return this.accountId;
}
/**
*
* The Amazon Web Services account ID.
*
*
* @param accountId
* The Amazon Web Services account ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource withAccountId(String accountId) {
setAccountId(accountId);
return this;
}
/**
*
* The resource type.
*
*
* The following are the supported resource types for Direct Connect:
*
*
* -
*
* dxcon
*
*
* -
*
* dx-gateway
*
*
* -
*
* dx-vif
*
*
*
*
* The following are the supported resource types for Network Manager:
*
*
* -
*
* attachment
*
*
* -
*
* connect-peer
*
*
* -
*
* connection
*
*
* -
*
* core-network
*
*
* -
*
* device
*
*
* -
*
* link
*
*
* -
*
* peering
*
*
* -
*
* site
*
*
*
*
* The following are the supported resource types for Amazon VPC:
*
*
* -
*
* customer-gateway
*
*
* -
*
* transit-gateway
*
*
* -
*
* transit-gateway-attachment
*
*
* -
*
* transit-gateway-connect-peer
*
*
* -
*
* transit-gateway-route-table
*
*
* -
*
* vpn-connection
*
*
*
*
* @param resourceType
* The resource type.
*
* The following are the supported resource types for Direct Connect:
*
*
* -
*
* dxcon
*
*
* -
*
* dx-gateway
*
*
* -
*
* dx-vif
*
*
*
*
* The following are the supported resource types for Network Manager:
*
*
* -
*
* attachment
*
*
* -
*
* connect-peer
*
*
* -
*
* connection
*
*
* -
*
* core-network
*
*
* -
*
* device
*
*
* -
*
* link
*
*
* -
*
* peering
*
*
* -
*
* site
*
*
*
*
* The following are the supported resource types for Amazon VPC:
*
*
* -
*
* customer-gateway
*
*
* -
*
* transit-gateway
*
*
* -
*
* transit-gateway-attachment
*
*
* -
*
* transit-gateway-connect-peer
*
*
* -
*
* transit-gateway-route-table
*
*
* -
*
* vpn-connection
*
*
*/
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
/**
*
* The resource type.
*
*
* The following are the supported resource types for Direct Connect:
*
*
* -
*
* dxcon
*
*
* -
*
* dx-gateway
*
*
* -
*
* dx-vif
*
*
*
*
* The following are the supported resource types for Network Manager:
*
*
* -
*
* attachment
*
*
* -
*
* connect-peer
*
*
* -
*
* connection
*
*
* -
*
* core-network
*
*
* -
*
* device
*
*
* -
*
* link
*
*
* -
*
* peering
*
*
* -
*
* site
*
*
*
*
* The following are the supported resource types for Amazon VPC:
*
*
* -
*
* customer-gateway
*
*
* -
*
* transit-gateway
*
*
* -
*
* transit-gateway-attachment
*
*
* -
*
* transit-gateway-connect-peer
*
*
* -
*
* transit-gateway-route-table
*
*
* -
*
* vpn-connection
*
*
*
*
* @return The resource type.
*
* The following are the supported resource types for Direct Connect:
*
*
* -
*
* dxcon
*
*
* -
*
* dx-gateway
*
*
* -
*
* dx-vif
*
*
*
*
* The following are the supported resource types for Network Manager:
*
*
* -
*
* attachment
*
*
* -
*
* connect-peer
*
*
* -
*
* connection
*
*
* -
*
* core-network
*
*
* -
*
* device
*
*
* -
*
* link
*
*
* -
*
* peering
*
*
* -
*
* site
*
*
*
*
* The following are the supported resource types for Amazon VPC:
*
*
* -
*
* customer-gateway
*
*
* -
*
* transit-gateway
*
*
* -
*
* transit-gateway-attachment
*
*
* -
*
* transit-gateway-connect-peer
*
*
* -
*
* transit-gateway-route-table
*
*
* -
*
* vpn-connection
*
*
*/
public String getResourceType() {
return this.resourceType;
}
/**
*
* The resource type.
*
*
* The following are the supported resource types for Direct Connect:
*
*
* -
*
* dxcon
*
*
* -
*
* dx-gateway
*
*
* -
*
* dx-vif
*
*
*
*
* The following are the supported resource types for Network Manager:
*
*
* -
*
* attachment
*
*
* -
*
* connect-peer
*
*
* -
*
* connection
*
*
* -
*
* core-network
*
*
* -
*
* device
*
*
* -
*
* link
*
*
* -
*
* peering
*
*
* -
*
* site
*
*
*
*
* The following are the supported resource types for Amazon VPC:
*
*
* -
*
* customer-gateway
*
*
* -
*
* transit-gateway
*
*
* -
*
* transit-gateway-attachment
*
*
* -
*
* transit-gateway-connect-peer
*
*
* -
*
* transit-gateway-route-table
*
*
* -
*
* vpn-connection
*
*
*
*
* @param resourceType
* The resource type.
*
* The following are the supported resource types for Direct Connect:
*
*
* -
*
* dxcon
*
*
* -
*
* dx-gateway
*
*
* -
*
* dx-vif
*
*
*
*
* The following are the supported resource types for Network Manager:
*
*
* -
*
* attachment
*
*
* -
*
* connect-peer
*
*
* -
*
* connection
*
*
* -
*
* core-network
*
*
* -
*
* device
*
*
* -
*
* link
*
*
* -
*
* peering
*
*
* -
*
* site
*
*
*
*
* The following are the supported resource types for Amazon VPC:
*
*
* -
*
* customer-gateway
*
*
* -
*
* transit-gateway
*
*
* -
*
* transit-gateway-attachment
*
*
* -
*
* transit-gateway-connect-peer
*
*
* -
*
* transit-gateway-route-table
*
*
* -
*
* vpn-connection
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource withResourceType(String resourceType) {
setResourceType(resourceType);
return this;
}
/**
*
* The ID of the resource.
*
*
* @param resourceId
* The ID of the resource.
*/
public void setResourceId(String resourceId) {
this.resourceId = resourceId;
}
/**
*
* The ID of the resource.
*
*
* @return The ID of the resource.
*/
public String getResourceId() {
return this.resourceId;
}
/**
*
* The ID of the resource.
*
*
* @param resourceId
* The ID of the resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource withResourceId(String resourceId) {
setResourceId(resourceId);
return this;
}
/**
*
* The ARN of the resource.
*
*
* @param resourceArn
* The ARN of the resource.
*/
public void setResourceArn(String resourceArn) {
this.resourceArn = resourceArn;
}
/**
*
* The ARN of the resource.
*
*
* @return The ARN of the resource.
*/
public String getResourceArn() {
return this.resourceArn;
}
/**
*
* The ARN of the resource.
*
*
* @param resourceArn
* The ARN of the resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource withResourceArn(String resourceArn) {
setResourceArn(resourceArn);
return this;
}
/**
*
* Information about the resource, in JSON format. Network Manager gets this information by describing the resource
* using its Describe API call.
*
*
* @param definition
* Information about the resource, in JSON format. Network Manager gets this information by describing the
* resource using its Describe API call.
*/
public void setDefinition(String definition) {
this.definition = definition;
}
/**
*
* Information about the resource, in JSON format. Network Manager gets this information by describing the resource
* using its Describe API call.
*
*
* @return Information about the resource, in JSON format. Network Manager gets this information by describing the
* resource using its Describe API call.
*/
public String getDefinition() {
return this.definition;
}
/**
*
* Information about the resource, in JSON format. Network Manager gets this information by describing the resource
* using its Describe API call.
*
*
* @param definition
* Information about the resource, in JSON format. Network Manager gets this information by describing the
* resource using its Describe API call.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource withDefinition(String definition) {
setDefinition(definition);
return this;
}
/**
*
* The time that the resource definition was retrieved.
*
*
* @param definitionTimestamp
* The time that the resource definition was retrieved.
*/
public void setDefinitionTimestamp(java.util.Date definitionTimestamp) {
this.definitionTimestamp = definitionTimestamp;
}
/**
*
* The time that the resource definition was retrieved.
*
*
* @return The time that the resource definition was retrieved.
*/
public java.util.Date getDefinitionTimestamp() {
return this.definitionTimestamp;
}
/**
*
* The time that the resource definition was retrieved.
*
*
* @param definitionTimestamp
* The time that the resource definition was retrieved.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource withDefinitionTimestamp(java.util.Date definitionTimestamp) {
setDefinitionTimestamp(definitionTimestamp);
return this;
}
/**
*
* The tags.
*
*
* @return The tags.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* The tags.
*
*
* @param tags
* The tags.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* The tags.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* The tags.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* The tags.
*
*
* @param tags
* The tags.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
*
* The resource metadata.
*
*
* @return The resource metadata.
*/
public java.util.Map getMetadata() {
return metadata;
}
/**
*
* The resource metadata.
*
*
* @param metadata
* The resource metadata.
*/
public void setMetadata(java.util.Map metadata) {
this.metadata = metadata;
}
/**
*
* The resource metadata.
*
*
* @param metadata
* The resource metadata.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource withMetadata(java.util.Map metadata) {
setMetadata(metadata);
return this;
}
/**
* Add a single Metadata entry
*
* @see NetworkResource#withMetadata
* @returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource addMetadataEntry(String key, String value) {
if (null == this.metadata) {
this.metadata = new java.util.HashMap();
}
if (this.metadata.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.metadata.put(key, value);
return this;
}
/**
* Removes all the entries added into Metadata.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NetworkResource clearMetadataEntries() {
this.metadata = null;
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getRegisteredGatewayArn() != null)
sb.append("RegisteredGatewayArn: ").append(getRegisteredGatewayArn()).append(",");
if (getCoreNetworkId() != null)
sb.append("CoreNetworkId: ").append(getCoreNetworkId()).append(",");
if (getAwsRegion() != null)
sb.append("AwsRegion: ").append(getAwsRegion()).append(",");
if (getAccountId() != null)
sb.append("AccountId: ").append(getAccountId()).append(",");
if (getResourceType() != null)
sb.append("ResourceType: ").append(getResourceType()).append(",");
if (getResourceId() != null)
sb.append("ResourceId: ").append(getResourceId()).append(",");
if (getResourceArn() != null)
sb.append("ResourceArn: ").append(getResourceArn()).append(",");
if (getDefinition() != null)
sb.append("Definition: ").append(getDefinition()).append(",");
if (getDefinitionTimestamp() != null)
sb.append("DefinitionTimestamp: ").append(getDefinitionTimestamp()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getMetadata() != null)
sb.append("Metadata: ").append(getMetadata());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof NetworkResource == false)
return false;
NetworkResource other = (NetworkResource) obj;
if (other.getRegisteredGatewayArn() == null ^ this.getRegisteredGatewayArn() == null)
return false;
if (other.getRegisteredGatewayArn() != null && other.getRegisteredGatewayArn().equals(this.getRegisteredGatewayArn()) == false)
return false;
if (other.getCoreNetworkId() == null ^ this.getCoreNetworkId() == null)
return false;
if (other.getCoreNetworkId() != null && other.getCoreNetworkId().equals(this.getCoreNetworkId()) == false)
return false;
if (other.getAwsRegion() == null ^ this.getAwsRegion() == null)
return false;
if (other.getAwsRegion() != null && other.getAwsRegion().equals(this.getAwsRegion()) == false)
return false;
if (other.getAccountId() == null ^ this.getAccountId() == null)
return false;
if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false)
return false;
if (other.getResourceType() == null ^ this.getResourceType() == null)
return false;
if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == false)
return false;
if (other.getResourceId() == null ^ this.getResourceId() == null)
return false;
if (other.getResourceId() != null && other.getResourceId().equals(this.getResourceId()) == false)
return false;
if (other.getResourceArn() == null ^ this.getResourceArn() == null)
return false;
if (other.getResourceArn() != null && other.getResourceArn().equals(this.getResourceArn()) == false)
return false;
if (other.getDefinition() == null ^ this.getDefinition() == null)
return false;
if (other.getDefinition() != null && other.getDefinition().equals(this.getDefinition()) == false)
return false;
if (other.getDefinitionTimestamp() == null ^ this.getDefinitionTimestamp() == null)
return false;
if (other.getDefinitionTimestamp() != null && other.getDefinitionTimestamp().equals(this.getDefinitionTimestamp()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getMetadata() == null ^ this.getMetadata() == null)
return false;
if (other.getMetadata() != null && other.getMetadata().equals(this.getMetadata()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getRegisteredGatewayArn() == null) ? 0 : getRegisteredGatewayArn().hashCode());
hashCode = prime * hashCode + ((getCoreNetworkId() == null) ? 0 : getCoreNetworkId().hashCode());
hashCode = prime * hashCode + ((getAwsRegion() == null) ? 0 : getAwsRegion().hashCode());
hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode());
hashCode = prime * hashCode + ((getResourceId() == null) ? 0 : getResourceId().hashCode());
hashCode = prime * hashCode + ((getResourceArn() == null) ? 0 : getResourceArn().hashCode());
hashCode = prime * hashCode + ((getDefinition() == null) ? 0 : getDefinition().hashCode());
hashCode = prime * hashCode + ((getDefinitionTimestamp() == null) ? 0 : getDefinitionTimestamp().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getMetadata() == null) ? 0 : getMetadata().hashCode());
return hashCode;
}
@Override
public NetworkResource clone() {
try {
return (NetworkResource) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.networkmanager.model.transform.NetworkResourceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}