All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.ec2.model.TransitGatewayPropagation Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon EC2 module holds the client classes that are used for communicating with Amazon EC2 Service

The newest version!
/*
 * Copyright 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 software.amazon.awssdk.services.ec2.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes route propagation. *

*/ @Generated("software.amazon.awssdk:codegen") public final class TransitGatewayPropagation implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TRANSIT_GATEWAY_ATTACHMENT_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("TransitGatewayAttachmentId") .getter(getter(TransitGatewayPropagation::transitGatewayAttachmentId)) .setter(setter(Builder::transitGatewayAttachmentId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TransitGatewayAttachmentId") .unmarshallLocationName("transitGatewayAttachmentId").build()).build(); private static final SdkField RESOURCE_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("ResourceId") .getter(getter(TransitGatewayPropagation::resourceId)) .setter(setter(Builder::resourceId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceId") .unmarshallLocationName("resourceId").build()).build(); private static final SdkField RESOURCE_TYPE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("ResourceType") .getter(getter(TransitGatewayPropagation::resourceTypeAsString)) .setter(setter(Builder::resourceType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceType") .unmarshallLocationName("resourceType").build()).build(); private static final SdkField TRANSIT_GATEWAY_ROUTE_TABLE_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("TransitGatewayRouteTableId") .getter(getter(TransitGatewayPropagation::transitGatewayRouteTableId)) .setter(setter(Builder::transitGatewayRouteTableId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TransitGatewayRouteTableId") .unmarshallLocationName("transitGatewayRouteTableId").build()).build(); private static final SdkField STATE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("State") .getter(getter(TransitGatewayPropagation::stateAsString)) .setter(setter(Builder::state)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State") .unmarshallLocationName("state").build()).build(); private static final SdkField TRANSIT_GATEWAY_ROUTE_TABLE_ANNOUNCEMENT_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("TransitGatewayRouteTableAnnouncementId") .getter(getter(TransitGatewayPropagation::transitGatewayRouteTableAnnouncementId)) .setter(setter(Builder::transitGatewayRouteTableAnnouncementId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("TransitGatewayRouteTableAnnouncementId") .unmarshallLocationName("transitGatewayRouteTableAnnouncementId").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList( TRANSIT_GATEWAY_ATTACHMENT_ID_FIELD, RESOURCE_ID_FIELD, RESOURCE_TYPE_FIELD, TRANSIT_GATEWAY_ROUTE_TABLE_ID_FIELD, STATE_FIELD, TRANSIT_GATEWAY_ROUTE_TABLE_ANNOUNCEMENT_ID_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("TransitGatewayAttachmentId", TRANSIT_GATEWAY_ATTACHMENT_ID_FIELD); put("ResourceId", RESOURCE_ID_FIELD); put("ResourceType", RESOURCE_TYPE_FIELD); put("TransitGatewayRouteTableId", TRANSIT_GATEWAY_ROUTE_TABLE_ID_FIELD); put("State", STATE_FIELD); put("TransitGatewayRouteTableAnnouncementId", TRANSIT_GATEWAY_ROUTE_TABLE_ANNOUNCEMENT_ID_FIELD); } }); private static final long serialVersionUID = 1L; private final String transitGatewayAttachmentId; private final String resourceId; private final String resourceType; private final String transitGatewayRouteTableId; private final String state; private final String transitGatewayRouteTableAnnouncementId; private TransitGatewayPropagation(BuilderImpl builder) { this.transitGatewayAttachmentId = builder.transitGatewayAttachmentId; this.resourceId = builder.resourceId; this.resourceType = builder.resourceType; this.transitGatewayRouteTableId = builder.transitGatewayRouteTableId; this.state = builder.state; this.transitGatewayRouteTableAnnouncementId = builder.transitGatewayRouteTableAnnouncementId; } /** *

* The ID of the attachment. *

* * @return The ID of the attachment. */ public final String transitGatewayAttachmentId() { return transitGatewayAttachmentId; } /** *

* The ID of the resource. *

* * @return The ID of the resource. */ public final String resourceId() { return resourceId; } /** *

* The resource type. Note that the tgw-peering resource type has been deprecated. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #resourceType} will * return {@link TransitGatewayAttachmentResourceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service * is available from {@link #resourceTypeAsString}. *

* * @return The resource type. Note that the tgw-peering resource type has been deprecated. * @see TransitGatewayAttachmentResourceType */ public final TransitGatewayAttachmentResourceType resourceType() { return TransitGatewayAttachmentResourceType.fromValue(resourceType); } /** *

* The resource type. Note that the tgw-peering resource type has been deprecated. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #resourceType} will * return {@link TransitGatewayAttachmentResourceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service * is available from {@link #resourceTypeAsString}. *

* * @return The resource type. Note that the tgw-peering resource type has been deprecated. * @see TransitGatewayAttachmentResourceType */ public final String resourceTypeAsString() { return resourceType; } /** *

* The ID of the transit gateway route table. *

* * @return The ID of the transit gateway route table. */ public final String transitGatewayRouteTableId() { return transitGatewayRouteTableId; } /** *

* The state. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return * {@link TransitGatewayPropagationState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #stateAsString}. *

* * @return The state. * @see TransitGatewayPropagationState */ public final TransitGatewayPropagationState state() { return TransitGatewayPropagationState.fromValue(state); } /** *

* The state. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return * {@link TransitGatewayPropagationState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #stateAsString}. *

* * @return The state. * @see TransitGatewayPropagationState */ public final String stateAsString() { return state; } /** *

* The ID of the transit gateway route table announcement. *

* * @return The ID of the transit gateway route table announcement. */ public final String transitGatewayRouteTableAnnouncementId() { return transitGatewayRouteTableAnnouncementId; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(transitGatewayAttachmentId()); hashCode = 31 * hashCode + Objects.hashCode(resourceId()); hashCode = 31 * hashCode + Objects.hashCode(resourceTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(transitGatewayRouteTableId()); hashCode = 31 * hashCode + Objects.hashCode(stateAsString()); hashCode = 31 * hashCode + Objects.hashCode(transitGatewayRouteTableAnnouncementId()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof TransitGatewayPropagation)) { return false; } TransitGatewayPropagation other = (TransitGatewayPropagation) obj; return Objects.equals(transitGatewayAttachmentId(), other.transitGatewayAttachmentId()) && Objects.equals(resourceId(), other.resourceId()) && Objects.equals(resourceTypeAsString(), other.resourceTypeAsString()) && Objects.equals(transitGatewayRouteTableId(), other.transitGatewayRouteTableId()) && Objects.equals(stateAsString(), other.stateAsString()) && Objects.equals(transitGatewayRouteTableAnnouncementId(), other.transitGatewayRouteTableAnnouncementId()); } /** * 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. */ @Override public final String toString() { return ToString.builder("TransitGatewayPropagation").add("TransitGatewayAttachmentId", transitGatewayAttachmentId()) .add("ResourceId", resourceId()).add("ResourceType", resourceTypeAsString()) .add("TransitGatewayRouteTableId", transitGatewayRouteTableId()).add("State", stateAsString()) .add("TransitGatewayRouteTableAnnouncementId", transitGatewayRouteTableAnnouncementId()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "TransitGatewayAttachmentId": return Optional.ofNullable(clazz.cast(transitGatewayAttachmentId())); case "ResourceId": return Optional.ofNullable(clazz.cast(resourceId())); case "ResourceType": return Optional.ofNullable(clazz.cast(resourceTypeAsString())); case "TransitGatewayRouteTableId": return Optional.ofNullable(clazz.cast(transitGatewayRouteTableId())); case "State": return Optional.ofNullable(clazz.cast(stateAsString())); case "TransitGatewayRouteTableAnnouncementId": return Optional.ofNullable(clazz.cast(transitGatewayRouteTableAnnouncementId())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((TransitGatewayPropagation) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ID of the attachment. *

* * @param transitGatewayAttachmentId * The ID of the attachment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder transitGatewayAttachmentId(String transitGatewayAttachmentId); /** *

* 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. */ Builder resourceId(String resourceId); /** *

* The resource type. Note that the tgw-peering resource type has been deprecated. *

* * @param resourceType * The resource type. Note that the tgw-peering resource type has been deprecated. * @see TransitGatewayAttachmentResourceType * @return Returns a reference to this object so that method calls can be chained together. * @see TransitGatewayAttachmentResourceType */ Builder resourceType(String resourceType); /** *

* The resource type. Note that the tgw-peering resource type has been deprecated. *

* * @param resourceType * The resource type. Note that the tgw-peering resource type has been deprecated. * @see TransitGatewayAttachmentResourceType * @return Returns a reference to this object so that method calls can be chained together. * @see TransitGatewayAttachmentResourceType */ Builder resourceType(TransitGatewayAttachmentResourceType resourceType); /** *

* The ID of the transit gateway route table. *

* * @param transitGatewayRouteTableId * The ID of the transit gateway route table. * @return Returns a reference to this object so that method calls can be chained together. */ Builder transitGatewayRouteTableId(String transitGatewayRouteTableId); /** *

* The state. *

* * @param state * The state. * @see TransitGatewayPropagationState * @return Returns a reference to this object so that method calls can be chained together. * @see TransitGatewayPropagationState */ Builder state(String state); /** *

* The state. *

* * @param state * The state. * @see TransitGatewayPropagationState * @return Returns a reference to this object so that method calls can be chained together. * @see TransitGatewayPropagationState */ Builder state(TransitGatewayPropagationState state); /** *

* The ID of the transit gateway route table announcement. *

* * @param transitGatewayRouteTableAnnouncementId * The ID of the transit gateway route table announcement. * @return Returns a reference to this object so that method calls can be chained together. */ Builder transitGatewayRouteTableAnnouncementId(String transitGatewayRouteTableAnnouncementId); } static final class BuilderImpl implements Builder { private String transitGatewayAttachmentId; private String resourceId; private String resourceType; private String transitGatewayRouteTableId; private String state; private String transitGatewayRouteTableAnnouncementId; private BuilderImpl() { } private BuilderImpl(TransitGatewayPropagation model) { transitGatewayAttachmentId(model.transitGatewayAttachmentId); resourceId(model.resourceId); resourceType(model.resourceType); transitGatewayRouteTableId(model.transitGatewayRouteTableId); state(model.state); transitGatewayRouteTableAnnouncementId(model.transitGatewayRouteTableAnnouncementId); } public final String getTransitGatewayAttachmentId() { return transitGatewayAttachmentId; } public final void setTransitGatewayAttachmentId(String transitGatewayAttachmentId) { this.transitGatewayAttachmentId = transitGatewayAttachmentId; } @Override public final Builder transitGatewayAttachmentId(String transitGatewayAttachmentId) { this.transitGatewayAttachmentId = transitGatewayAttachmentId; return this; } public final String getResourceId() { return resourceId; } public final void setResourceId(String resourceId) { this.resourceId = resourceId; } @Override public final Builder resourceId(String resourceId) { this.resourceId = resourceId; return this; } public final String getResourceType() { return resourceType; } public final void setResourceType(String resourceType) { this.resourceType = resourceType; } @Override public final Builder resourceType(String resourceType) { this.resourceType = resourceType; return this; } @Override public final Builder resourceType(TransitGatewayAttachmentResourceType resourceType) { this.resourceType(resourceType == null ? null : resourceType.toString()); return this; } public final String getTransitGatewayRouteTableId() { return transitGatewayRouteTableId; } public final void setTransitGatewayRouteTableId(String transitGatewayRouteTableId) { this.transitGatewayRouteTableId = transitGatewayRouteTableId; } @Override public final Builder transitGatewayRouteTableId(String transitGatewayRouteTableId) { this.transitGatewayRouteTableId = transitGatewayRouteTableId; return this; } public final String getState() { return state; } public final void setState(String state) { this.state = state; } @Override public final Builder state(String state) { this.state = state; return this; } @Override public final Builder state(TransitGatewayPropagationState state) { this.state(state == null ? null : state.toString()); return this; } public final String getTransitGatewayRouteTableAnnouncementId() { return transitGatewayRouteTableAnnouncementId; } public final void setTransitGatewayRouteTableAnnouncementId(String transitGatewayRouteTableAnnouncementId) { this.transitGatewayRouteTableAnnouncementId = transitGatewayRouteTableAnnouncementId; } @Override public final Builder transitGatewayRouteTableAnnouncementId(String transitGatewayRouteTableAnnouncementId) { this.transitGatewayRouteTableAnnouncementId = transitGatewayRouteTableAnnouncementId; return this; } @Override public TransitGatewayPropagation build() { return new TransitGatewayPropagation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy