/* * Copyright 2018-2023 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.securityhub.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Specifies the metadata options for an Amazon EC2 instance. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AwsEc2LaunchTemplateDataMetadataOptionsDetails implements Serializable, Cloneable, StructuredPojo { /** ** Enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default * state is enabled, and you won't be able to access your instance metadata. *
*/ private String httpEndpoint; /** ** Enables or disables the IPv6 endpoint for the instance metadata service. *
*/ private String httpProtocolIpv6; /** ** The state of token usage for your instance metadata requests. *
*/ private String httpTokens; /** ** The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further * instance metadata requests can travel. *
*/ private Integer httpPutResponseHopLimit; /** *
* When set to enabled
, this parameter allows access to instance tags from the instance metadata. When
* set to disabled
, it turns off access to instance tags from the instance metadata. For more
* information, see Work with
* instance tags in instance metadata in the Amazon EC2 User Guide.
*
* Enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default * state is enabled, and you won't be able to access your instance metadata. *
* * @param httpEndpoint * Enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the * default state is enabled, and you won't be able to access your instance metadata. */ public void setHttpEndpoint(String httpEndpoint) { this.httpEndpoint = httpEndpoint; } /** ** Enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default * state is enabled, and you won't be able to access your instance metadata. *
* * @return Enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the * default state is enabled, and you won't be able to access your instance metadata. */ public String getHttpEndpoint() { return this.httpEndpoint; } /** ** Enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default * state is enabled, and you won't be able to access your instance metadata. *
* * @param httpEndpoint * Enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the * default state is enabled, and you won't be able to access your instance metadata. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsEc2LaunchTemplateDataMetadataOptionsDetails withHttpEndpoint(String httpEndpoint) { setHttpEndpoint(httpEndpoint); return this; } /** ** Enables or disables the IPv6 endpoint for the instance metadata service. *
* * @param httpProtocolIpv6 * Enables or disables the IPv6 endpoint for the instance metadata service. */ public void setHttpProtocolIpv6(String httpProtocolIpv6) { this.httpProtocolIpv6 = httpProtocolIpv6; } /** ** Enables or disables the IPv6 endpoint for the instance metadata service. *
* * @return Enables or disables the IPv6 endpoint for the instance metadata service. */ public String getHttpProtocolIpv6() { return this.httpProtocolIpv6; } /** ** Enables or disables the IPv6 endpoint for the instance metadata service. *
* * @param httpProtocolIpv6 * Enables or disables the IPv6 endpoint for the instance metadata service. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsEc2LaunchTemplateDataMetadataOptionsDetails withHttpProtocolIpv6(String httpProtocolIpv6) { setHttpProtocolIpv6(httpProtocolIpv6); return this; } /** ** The state of token usage for your instance metadata requests. *
* * @param httpTokens * The state of token usage for your instance metadata requests. */ public void setHttpTokens(String httpTokens) { this.httpTokens = httpTokens; } /** ** The state of token usage for your instance metadata requests. *
* * @return The state of token usage for your instance metadata requests. */ public String getHttpTokens() { return this.httpTokens; } /** ** The state of token usage for your instance metadata requests. *
* * @param httpTokens * The state of token usage for your instance metadata requests. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsEc2LaunchTemplateDataMetadataOptionsDetails withHttpTokens(String httpTokens) { setHttpTokens(httpTokens); return this; } /** ** The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further * instance metadata requests can travel. *
* * @param httpPutResponseHopLimit * The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further * instance metadata requests can travel. */ public void setHttpPutResponseHopLimit(Integer httpPutResponseHopLimit) { this.httpPutResponseHopLimit = httpPutResponseHopLimit; } /** ** The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further * instance metadata requests can travel. *
* * @return The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the * further instance metadata requests can travel. */ public Integer getHttpPutResponseHopLimit() { return this.httpPutResponseHopLimit; } /** ** The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further * instance metadata requests can travel. *
* * @param httpPutResponseHopLimit * The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further * instance metadata requests can travel. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsEc2LaunchTemplateDataMetadataOptionsDetails withHttpPutResponseHopLimit(Integer httpPutResponseHopLimit) { setHttpPutResponseHopLimit(httpPutResponseHopLimit); return this; } /** *
* When set to enabled
, this parameter allows access to instance tags from the instance metadata. When
* set to disabled
, it turns off access to instance tags from the instance metadata. For more
* information, see Work with
* instance tags in instance metadata in the Amazon EC2 User Guide.
*
enabled
, this parameter allows access to instance tags from the instance
* metadata. When set to disabled
, it turns off access to instance tags from the instance
* metadata. For more information, see Work
* with instance tags in instance metadata in the Amazon EC2 User Guide.
*/
public void setInstanceMetadataTags(String instanceMetadataTags) {
this.instanceMetadataTags = instanceMetadataTags;
}
/**
*
* When set to enabled
, this parameter allows access to instance tags from the instance metadata. When
* set to disabled
, it turns off access to instance tags from the instance metadata. For more
* information, see Work with
* instance tags in instance metadata in the Amazon EC2 User Guide.
*
enabled
, this parameter allows access to instance tags from the instance
* metadata. When set to disabled
, it turns off access to instance tags from the instance
* metadata. For more information, see Work
* with instance tags in instance metadata in the Amazon EC2 User Guide.
*/
public String getInstanceMetadataTags() {
return this.instanceMetadataTags;
}
/**
*
* When set to enabled
, this parameter allows access to instance tags from the instance metadata. When
* set to disabled
, it turns off access to instance tags from the instance metadata. For more
* information, see Work with
* instance tags in instance metadata in the Amazon EC2 User Guide.
*
enabled
, this parameter allows access to instance tags from the instance
* metadata. When set to disabled
, it turns off access to instance tags from the instance
* metadata. For more information, see Work
* with instance tags in instance metadata in the Amazon EC2 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsEc2LaunchTemplateDataMetadataOptionsDetails withInstanceMetadataTags(String instanceMetadataTags) {
setInstanceMetadataTags(instanceMetadataTags);
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 (getHttpEndpoint() != null)
sb.append("HttpEndpoint: ").append(getHttpEndpoint()).append(",");
if (getHttpProtocolIpv6() != null)
sb.append("HttpProtocolIpv6: ").append(getHttpProtocolIpv6()).append(",");
if (getHttpTokens() != null)
sb.append("HttpTokens: ").append(getHttpTokens()).append(",");
if (getHttpPutResponseHopLimit() != null)
sb.append("HttpPutResponseHopLimit: ").append(getHttpPutResponseHopLimit()).append(",");
if (getInstanceMetadataTags() != null)
sb.append("InstanceMetadataTags: ").append(getInstanceMetadataTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AwsEc2LaunchTemplateDataMetadataOptionsDetails == false)
return false;
AwsEc2LaunchTemplateDataMetadataOptionsDetails other = (AwsEc2LaunchTemplateDataMetadataOptionsDetails) obj;
if (other.getHttpEndpoint() == null ^ this.getHttpEndpoint() == null)
return false;
if (other.getHttpEndpoint() != null && other.getHttpEndpoint().equals(this.getHttpEndpoint()) == false)
return false;
if (other.getHttpProtocolIpv6() == null ^ this.getHttpProtocolIpv6() == null)
return false;
if (other.getHttpProtocolIpv6() != null && other.getHttpProtocolIpv6().equals(this.getHttpProtocolIpv6()) == false)
return false;
if (other.getHttpTokens() == null ^ this.getHttpTokens() == null)
return false;
if (other.getHttpTokens() != null && other.getHttpTokens().equals(this.getHttpTokens()) == false)
return false;
if (other.getHttpPutResponseHopLimit() == null ^ this.getHttpPutResponseHopLimit() == null)
return false;
if (other.getHttpPutResponseHopLimit() != null && other.getHttpPutResponseHopLimit().equals(this.getHttpPutResponseHopLimit()) == false)
return false;
if (other.getInstanceMetadataTags() == null ^ this.getInstanceMetadataTags() == null)
return false;
if (other.getInstanceMetadataTags() != null && other.getInstanceMetadataTags().equals(this.getInstanceMetadataTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getHttpEndpoint() == null) ? 0 : getHttpEndpoint().hashCode());
hashCode = prime * hashCode + ((getHttpProtocolIpv6() == null) ? 0 : getHttpProtocolIpv6().hashCode());
hashCode = prime * hashCode + ((getHttpTokens() == null) ? 0 : getHttpTokens().hashCode());
hashCode = prime * hashCode + ((getHttpPutResponseHopLimit() == null) ? 0 : getHttpPutResponseHopLimit().hashCode());
hashCode = prime * hashCode + ((getInstanceMetadataTags() == null) ? 0 : getInstanceMetadataTags().hashCode());
return hashCode;
}
@Override
public AwsEc2LaunchTemplateDataMetadataOptionsDetails clone() {
try {
return (AwsEc2LaunchTemplateDataMetadataOptionsDetails) 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.securityhub.model.transform.AwsEc2LaunchTemplateDataMetadataOptionsDetailsMarshaller.getInstance().marshall(this,
protocolMarshaller);
}
}