/* * 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.appconfigdata.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetLatestConfigurationResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable { /** *

* The latest token describing the current state of the configuration session. This must be provided to the * next call to GetLatestConfiguration. *

* *

* This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a * GetLatestConfiguration call uses an expired token, the system returns * BadRequestException. *

*
*/ private String nextPollConfigurationToken; /** *

* The amount of time the client should wait before polling for configuration updates again. Use * RequiredMinimumPollIntervalInSeconds to set the desired poll interval. *

*/ private Integer nextPollIntervalInSeconds; /** *

* A standard MIME type describing the format of the configuration content. *

*/ private String contentType; /** *

* The data of the configuration. This may be empty if the client already has the latest version of configuration. *

*/ private java.nio.ByteBuffer configuration; /** *

* The user-defined label for the AppConfig hosted configuration version. This attribute doesn't apply if the * configuration is not from an AppConfig hosted configuration version. If the client already has the latest version * of the configuration data, this value is empty. *

*/ private String versionLabel; /** *

* The latest token describing the current state of the configuration session. This must be provided to the * next call to GetLatestConfiguration. *

* *

* This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a * GetLatestConfiguration call uses an expired token, the system returns * BadRequestException. *

*
* * @param nextPollConfigurationToken * The latest token describing the current state of the configuration session. This must be provided * to the next call to GetLatestConfiguration.

*

* This token should only be used once. To support long poll use cases, the token is valid for up to 24 * hours. If a GetLatestConfiguration call uses an expired token, the system returns * BadRequestException. *

*/ public void setNextPollConfigurationToken(String nextPollConfigurationToken) { this.nextPollConfigurationToken = nextPollConfigurationToken; } /** *

* The latest token describing the current state of the configuration session. This must be provided to the * next call to GetLatestConfiguration. *

* *

* This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a * GetLatestConfiguration call uses an expired token, the system returns * BadRequestException. *

*
* * @return The latest token describing the current state of the configuration session. This must be provided * to the next call to GetLatestConfiguration.

*

* This token should only be used once. To support long poll use cases, the token is valid for up to 24 * hours. If a GetLatestConfiguration call uses an expired token, the system returns * BadRequestException. *

*/ public String getNextPollConfigurationToken() { return this.nextPollConfigurationToken; } /** *

* The latest token describing the current state of the configuration session. This must be provided to the * next call to GetLatestConfiguration. *

* *

* This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a * GetLatestConfiguration call uses an expired token, the system returns * BadRequestException. *

*
* * @param nextPollConfigurationToken * The latest token describing the current state of the configuration session. This must be provided * to the next call to GetLatestConfiguration.

*

* This token should only be used once. To support long poll use cases, the token is valid for up to 24 * hours. If a GetLatestConfiguration call uses an expired token, the system returns * BadRequestException. *

* @return Returns a reference to this object so that method calls can be chained together. */ public GetLatestConfigurationResult withNextPollConfigurationToken(String nextPollConfigurationToken) { setNextPollConfigurationToken(nextPollConfigurationToken); return this; } /** *

* The amount of time the client should wait before polling for configuration updates again. Use * RequiredMinimumPollIntervalInSeconds to set the desired poll interval. *

* * @param nextPollIntervalInSeconds * The amount of time the client should wait before polling for configuration updates again. Use * RequiredMinimumPollIntervalInSeconds to set the desired poll interval. */ public void setNextPollIntervalInSeconds(Integer nextPollIntervalInSeconds) { this.nextPollIntervalInSeconds = nextPollIntervalInSeconds; } /** *

* The amount of time the client should wait before polling for configuration updates again. Use * RequiredMinimumPollIntervalInSeconds to set the desired poll interval. *

* * @return The amount of time the client should wait before polling for configuration updates again. Use * RequiredMinimumPollIntervalInSeconds to set the desired poll interval. */ public Integer getNextPollIntervalInSeconds() { return this.nextPollIntervalInSeconds; } /** *

* The amount of time the client should wait before polling for configuration updates again. Use * RequiredMinimumPollIntervalInSeconds to set the desired poll interval. *

* * @param nextPollIntervalInSeconds * The amount of time the client should wait before polling for configuration updates again. Use * RequiredMinimumPollIntervalInSeconds to set the desired poll interval. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLatestConfigurationResult withNextPollIntervalInSeconds(Integer nextPollIntervalInSeconds) { setNextPollIntervalInSeconds(nextPollIntervalInSeconds); return this; } /** *

* A standard MIME type describing the format of the configuration content. *

* * @param contentType * A standard MIME type describing the format of the configuration content. */ public void setContentType(String contentType) { this.contentType = contentType; } /** *

* A standard MIME type describing the format of the configuration content. *

* * @return A standard MIME type describing the format of the configuration content. */ public String getContentType() { return this.contentType; } /** *

* A standard MIME type describing the format of the configuration content. *

* * @param contentType * A standard MIME type describing the format of the configuration content. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLatestConfigurationResult withContentType(String contentType) { setContentType(contentType); return this; } /** *

* The data of the configuration. This may be empty if the client already has the latest version of configuration. *

*

* The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. * Users of the SDK should not perform Base64 encoding on this field. *

*

* Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future * major version of the SDK. *

* * @param configuration * The data of the configuration. This may be empty if the client already has the latest version of * configuration. */ public void setConfiguration(java.nio.ByteBuffer configuration) { this.configuration = configuration; } /** *

* The data of the configuration. This may be empty if the client already has the latest version of configuration. *

*

* {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend * using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent * {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}. * Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the * {@code position}. *

* * @return The data of the configuration. This may be empty if the client already has the latest version of * configuration. */ public java.nio.ByteBuffer getConfiguration() { return this.configuration; } /** *

* The data of the configuration. This may be empty if the client already has the latest version of configuration. *

*

* The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. * Users of the SDK should not perform Base64 encoding on this field. *

*

* Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future * major version of the SDK. *

* * @param configuration * The data of the configuration. This may be empty if the client already has the latest version of * configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLatestConfigurationResult withConfiguration(java.nio.ByteBuffer configuration) { setConfiguration(configuration); return this; } /** *

* The user-defined label for the AppConfig hosted configuration version. This attribute doesn't apply if the * configuration is not from an AppConfig hosted configuration version. If the client already has the latest version * of the configuration data, this value is empty. *

* * @param versionLabel * The user-defined label for the AppConfig hosted configuration version. This attribute doesn't apply if the * configuration is not from an AppConfig hosted configuration version. If the client already has the latest * version of the configuration data, this value is empty. */ public void setVersionLabel(String versionLabel) { this.versionLabel = versionLabel; } /** *

* The user-defined label for the AppConfig hosted configuration version. This attribute doesn't apply if the * configuration is not from an AppConfig hosted configuration version. If the client already has the latest version * of the configuration data, this value is empty. *

* * @return The user-defined label for the AppConfig hosted configuration version. This attribute doesn't apply if * the configuration is not from an AppConfig hosted configuration version. If the client already has the * latest version of the configuration data, this value is empty. */ public String getVersionLabel() { return this.versionLabel; } /** *

* The user-defined label for the AppConfig hosted configuration version. This attribute doesn't apply if the * configuration is not from an AppConfig hosted configuration version. If the client already has the latest version * of the configuration data, this value is empty. *

* * @param versionLabel * The user-defined label for the AppConfig hosted configuration version. This attribute doesn't apply if the * configuration is not from an AppConfig hosted configuration version. If the client already has the latest * version of the configuration data, this value is empty. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLatestConfigurationResult withVersionLabel(String versionLabel) { setVersionLabel(versionLabel); 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 (getNextPollConfigurationToken() != null) sb.append("NextPollConfigurationToken: ").append(getNextPollConfigurationToken()).append(","); if (getNextPollIntervalInSeconds() != null) sb.append("NextPollIntervalInSeconds: ").append(getNextPollIntervalInSeconds()).append(","); if (getContentType() != null) sb.append("ContentType: ").append(getContentType()).append(","); if (getConfiguration() != null) sb.append("Configuration: ").append("***Sensitive Data Redacted***").append(","); if (getVersionLabel() != null) sb.append("VersionLabel: ").append(getVersionLabel()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetLatestConfigurationResult == false) return false; GetLatestConfigurationResult other = (GetLatestConfigurationResult) obj; if (other.getNextPollConfigurationToken() == null ^ this.getNextPollConfigurationToken() == null) return false; if (other.getNextPollConfigurationToken() != null && other.getNextPollConfigurationToken().equals(this.getNextPollConfigurationToken()) == false) return false; if (other.getNextPollIntervalInSeconds() == null ^ this.getNextPollIntervalInSeconds() == null) return false; if (other.getNextPollIntervalInSeconds() != null && other.getNextPollIntervalInSeconds().equals(this.getNextPollIntervalInSeconds()) == false) return false; if (other.getContentType() == null ^ this.getContentType() == null) return false; if (other.getContentType() != null && other.getContentType().equals(this.getContentType()) == false) return false; if (other.getConfiguration() == null ^ this.getConfiguration() == null) return false; if (other.getConfiguration() != null && other.getConfiguration().equals(this.getConfiguration()) == false) return false; if (other.getVersionLabel() == null ^ this.getVersionLabel() == null) return false; if (other.getVersionLabel() != null && other.getVersionLabel().equals(this.getVersionLabel()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getNextPollConfigurationToken() == null) ? 0 : getNextPollConfigurationToken().hashCode()); hashCode = prime * hashCode + ((getNextPollIntervalInSeconds() == null) ? 0 : getNextPollIntervalInSeconds().hashCode()); hashCode = prime * hashCode + ((getContentType() == null) ? 0 : getContentType().hashCode()); hashCode = prime * hashCode + ((getConfiguration() == null) ? 0 : getConfiguration().hashCode()); hashCode = prime * hashCode + ((getVersionLabel() == null) ? 0 : getVersionLabel().hashCode()); return hashCode; } @Override public GetLatestConfigurationResult clone() { try { return (GetLatestConfigurationResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }