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

software.amazon.awssdk.services.appmesh.model.VirtualServiceRef Maven / Gradle / Ivy

/*
 * 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.appmesh.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
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;

/**
 * 

* An object that represents a virtual service returned by a list operation. *

*/ @Generated("software.amazon.awssdk:codegen") public final class VirtualServiceRef implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn") .getter(getter(VirtualServiceRef::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build(); private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("createdAt").getter(getter(VirtualServiceRef::createdAt)).setter(setter(Builder::createdAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdAt").build()).build(); private static final SdkField LAST_UPDATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("lastUpdatedAt").getter(getter(VirtualServiceRef::lastUpdatedAt)).setter(setter(Builder::lastUpdatedAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastUpdatedAt").build()).build(); private static final SdkField MESH_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("meshName").getter(getter(VirtualServiceRef::meshName)).setter(setter(Builder::meshName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("meshName").build()).build(); private static final SdkField MESH_OWNER_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("meshOwner").getter(getter(VirtualServiceRef::meshOwner)).setter(setter(Builder::meshOwner)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("meshOwner").build()).build(); private static final SdkField RESOURCE_OWNER_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("resourceOwner").getter(getter(VirtualServiceRef::resourceOwner)).setter(setter(Builder::resourceOwner)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resourceOwner").build()).build(); private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.LONG).memberName("version") .getter(getter(VirtualServiceRef::version)).setter(setter(Builder::version)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("version").build()).build(); private static final SdkField VIRTUAL_SERVICE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("virtualServiceName").getter(getter(VirtualServiceRef::virtualServiceName)) .setter(setter(Builder::virtualServiceName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("virtualServiceName").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, CREATED_AT_FIELD, LAST_UPDATED_AT_FIELD, MESH_NAME_FIELD, MESH_OWNER_FIELD, RESOURCE_OWNER_FIELD, VERSION_FIELD, VIRTUAL_SERVICE_NAME_FIELD)); private static final long serialVersionUID = 1L; private final String arn; private final Instant createdAt; private final Instant lastUpdatedAt; private final String meshName; private final String meshOwner; private final String resourceOwner; private final Long version; private final String virtualServiceName; private VirtualServiceRef(BuilderImpl builder) { this.arn = builder.arn; this.createdAt = builder.createdAt; this.lastUpdatedAt = builder.lastUpdatedAt; this.meshName = builder.meshName; this.meshOwner = builder.meshOwner; this.resourceOwner = builder.resourceOwner; this.version = builder.version; this.virtualServiceName = builder.virtualServiceName; } /** *

* The full Amazon Resource Name (ARN) for the virtual service. *

* * @return The full Amazon Resource Name (ARN) for the virtual service. */ public final String arn() { return arn; } /** *

* The Unix epoch timestamp in seconds for when the resource was created. *

* * @return The Unix epoch timestamp in seconds for when the resource was created. */ public final Instant createdAt() { return createdAt; } /** *

* The Unix epoch timestamp in seconds for when the resource was last updated. *

* * @return The Unix epoch timestamp in seconds for when the resource was last updated. */ public final Instant lastUpdatedAt() { return lastUpdatedAt; } /** *

* The name of the service mesh that the virtual service resides in. *

* * @return The name of the service mesh that the virtual service resides in. */ public final String meshName() { return meshName; } /** *

* The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it's * the ID of the account that shared the mesh with your account. For more information about mesh sharing, see Working with shared meshes. *

* * @return The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then * it's the ID of the account that shared the mesh with your account. For more information about mesh * sharing, see Working with * shared meshes. */ public final String meshOwner() { return meshOwner; } /** *

* The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it's the ID * of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, * see Working with shared meshes. *

* * @return The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then * it's the ID of the mesh owner or of another account that the mesh is shared with. For more information * about mesh sharing, see Working with shared meshes. */ public final String resourceOwner() { return resourceOwner; } /** *

* The version of the resource. Resources are created at version 1, and this version is incremented each time that * they're updated. *

* * @return The version of the resource. Resources are created at version 1, and this version is incremented each * time that they're updated. */ public final Long version() { return version; } /** *

* The name of the virtual service. *

* * @return The name of the virtual service. */ public final String virtualServiceName() { return virtualServiceName; } @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(arn()); hashCode = 31 * hashCode + Objects.hashCode(createdAt()); hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedAt()); hashCode = 31 * hashCode + Objects.hashCode(meshName()); hashCode = 31 * hashCode + Objects.hashCode(meshOwner()); hashCode = 31 * hashCode + Objects.hashCode(resourceOwner()); hashCode = 31 * hashCode + Objects.hashCode(version()); hashCode = 31 * hashCode + Objects.hashCode(virtualServiceName()); 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 VirtualServiceRef)) { return false; } VirtualServiceRef other = (VirtualServiceRef) obj; return Objects.equals(arn(), other.arn()) && Objects.equals(createdAt(), other.createdAt()) && Objects.equals(lastUpdatedAt(), other.lastUpdatedAt()) && Objects.equals(meshName(), other.meshName()) && Objects.equals(meshOwner(), other.meshOwner()) && Objects.equals(resourceOwner(), other.resourceOwner()) && Objects.equals(version(), other.version()) && Objects.equals(virtualServiceName(), other.virtualServiceName()); } /** * 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("VirtualServiceRef").add("Arn", arn()).add("CreatedAt", createdAt()) .add("LastUpdatedAt", lastUpdatedAt()).add("MeshName", meshName()).add("MeshOwner", meshOwner()) .add("ResourceOwner", resourceOwner()).add("Version", version()).add("VirtualServiceName", virtualServiceName()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "arn": return Optional.ofNullable(clazz.cast(arn())); case "createdAt": return Optional.ofNullable(clazz.cast(createdAt())); case "lastUpdatedAt": return Optional.ofNullable(clazz.cast(lastUpdatedAt())); case "meshName": return Optional.ofNullable(clazz.cast(meshName())); case "meshOwner": return Optional.ofNullable(clazz.cast(meshOwner())); case "resourceOwner": return Optional.ofNullable(clazz.cast(resourceOwner())); case "version": return Optional.ofNullable(clazz.cast(version())); case "virtualServiceName": return Optional.ofNullable(clazz.cast(virtualServiceName())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((VirtualServiceRef) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The full Amazon Resource Name (ARN) for the virtual service. *

* * @param arn * The full Amazon Resource Name (ARN) for the virtual service. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* The Unix epoch timestamp in seconds for when the resource was created. *

* * @param createdAt * The Unix epoch timestamp in seconds for when the resource was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdAt(Instant createdAt); /** *

* The Unix epoch timestamp in seconds for when the resource was last updated. *

* * @param lastUpdatedAt * The Unix epoch timestamp in seconds for when the resource was last updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastUpdatedAt(Instant lastUpdatedAt); /** *

* The name of the service mesh that the virtual service resides in. *

* * @param meshName * The name of the service mesh that the virtual service resides in. * @return Returns a reference to this object so that method calls can be chained together. */ Builder meshName(String meshName); /** *

* The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then * it's the ID of the account that shared the mesh with your account. For more information about mesh sharing, * see Working with shared * meshes. *

* * @param meshOwner * The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, * then it's the ID of the account that shared the mesh with your account. For more information about * mesh sharing, see Working * with shared meshes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder meshOwner(String meshOwner); /** *

* The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it's * the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh * sharing, see Working with shared * meshes. *

* * @param resourceOwner * The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then * it's the ID of the mesh owner or of another account that the mesh is shared with. For more information * about mesh sharing, see Working with shared * meshes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourceOwner(String resourceOwner); /** *

* The version of the resource. Resources are created at version 1, and this version is incremented each time * that they're updated. *

* * @param version * The version of the resource. Resources are created at version 1, and this version is incremented each * time that they're updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder version(Long version); /** *

* The name of the virtual service. *

* * @param virtualServiceName * The name of the virtual service. * @return Returns a reference to this object so that method calls can be chained together. */ Builder virtualServiceName(String virtualServiceName); } static final class BuilderImpl implements Builder { private String arn; private Instant createdAt; private Instant lastUpdatedAt; private String meshName; private String meshOwner; private String resourceOwner; private Long version; private String virtualServiceName; private BuilderImpl() { } private BuilderImpl(VirtualServiceRef model) { arn(model.arn); createdAt(model.createdAt); lastUpdatedAt(model.lastUpdatedAt); meshName(model.meshName); meshOwner(model.meshOwner); resourceOwner(model.resourceOwner); version(model.version); virtualServiceName(model.virtualServiceName); } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final Instant getCreatedAt() { return createdAt; } public final void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; } @Override public final Builder createdAt(Instant createdAt) { this.createdAt = createdAt; return this; } public final Instant getLastUpdatedAt() { return lastUpdatedAt; } public final void setLastUpdatedAt(Instant lastUpdatedAt) { this.lastUpdatedAt = lastUpdatedAt; } @Override public final Builder lastUpdatedAt(Instant lastUpdatedAt) { this.lastUpdatedAt = lastUpdatedAt; return this; } public final String getMeshName() { return meshName; } public final void setMeshName(String meshName) { this.meshName = meshName; } @Override public final Builder meshName(String meshName) { this.meshName = meshName; return this; } public final String getMeshOwner() { return meshOwner; } public final void setMeshOwner(String meshOwner) { this.meshOwner = meshOwner; } @Override public final Builder meshOwner(String meshOwner) { this.meshOwner = meshOwner; return this; } public final String getResourceOwner() { return resourceOwner; } public final void setResourceOwner(String resourceOwner) { this.resourceOwner = resourceOwner; } @Override public final Builder resourceOwner(String resourceOwner) { this.resourceOwner = resourceOwner; return this; } public final Long getVersion() { return version; } public final void setVersion(Long version) { this.version = version; } @Override public final Builder version(Long version) { this.version = version; return this; } public final String getVirtualServiceName() { return virtualServiceName; } public final void setVirtualServiceName(String virtualServiceName) { this.virtualServiceName = virtualServiceName; } @Override public final Builder virtualServiceName(String virtualServiceName) { this.virtualServiceName = virtualServiceName; return this; } @Override public VirtualServiceRef build() { return new VirtualServiceRef(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy