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

software.amazon.awssdk.services.datapipeline.model.InstanceIdentity Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.28.4
Show 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.datapipeline.model;

import java.io.Serializable;
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;

/**
 * 

*

* Identity information for the EC2 instance that is hosting the task runner. You can get this value by calling a * metadata URI from the EC2 instance. For more information, see Instance Metadata in * the Amazon Elastic Compute Cloud User Guide. Passing in this value proves that your task runner is running on * an EC2 instance, and ensures the proper AWS Data Pipeline service charges are applied to your pipeline. *

*

*/ @Generated("software.amazon.awssdk:codegen") public final class InstanceIdentity implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField DOCUMENT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("document").getter(getter(InstanceIdentity::document)).setter(setter(Builder::document)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("document").build()).build(); private static final SdkField SIGNATURE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("signature").getter(getter(InstanceIdentity::signature)).setter(setter(Builder::signature)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("signature").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DOCUMENT_FIELD, SIGNATURE_FIELD)); private static final long serialVersionUID = 1L; private final String document; private final String signature; private InstanceIdentity(BuilderImpl builder) { this.document = builder.document; this.signature = builder.signature; } /** *

* A description of an EC2 instance that is generated when the instance is launched and exposed to the instance via * the instance metadata service in the form of a JSON representation of an object. *

* * @return A description of an EC2 instance that is generated when the instance is launched and exposed to the * instance via the instance metadata service in the form of a JSON representation of an object. */ public final String document() { return document; } /** *

* A signature which can be used to verify the accuracy and authenticity of the information provided in the instance * identity document. *

* * @return A signature which can be used to verify the accuracy and authenticity of the information provided in the * instance identity document. */ public final String signature() { return signature; } @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(document()); hashCode = 31 * hashCode + Objects.hashCode(signature()); 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 InstanceIdentity)) { return false; } InstanceIdentity other = (InstanceIdentity) obj; return Objects.equals(document(), other.document()) && Objects.equals(signature(), other.signature()); } /** * 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("InstanceIdentity").add("Document", document()).add("Signature", signature()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "document": return Optional.ofNullable(clazz.cast(document())); case "signature": return Optional.ofNullable(clazz.cast(signature())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((InstanceIdentity) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* A description of an EC2 instance that is generated when the instance is launched and exposed to the instance * via the instance metadata service in the form of a JSON representation of an object. *

* * @param document * A description of an EC2 instance that is generated when the instance is launched and exposed to the * instance via the instance metadata service in the form of a JSON representation of an object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder document(String document); /** *

* A signature which can be used to verify the accuracy and authenticity of the information provided in the * instance identity document. *

* * @param signature * A signature which can be used to verify the accuracy and authenticity of the information provided in * the instance identity document. * @return Returns a reference to this object so that method calls can be chained together. */ Builder signature(String signature); } static final class BuilderImpl implements Builder { private String document; private String signature; private BuilderImpl() { } private BuilderImpl(InstanceIdentity model) { document(model.document); signature(model.signature); } public final String getDocument() { return document; } public final void setDocument(String document) { this.document = document; } @Override public final Builder document(String document) { this.document = document; return this; } public final String getSignature() { return signature; } public final void setSignature(String signature) { this.signature = signature; } @Override public final Builder signature(String signature) { this.signature = signature; return this; } @Override public InstanceIdentity build() { return new InstanceIdentity(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy