/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

#pragma once
#include <aws/core/utils/DateTime.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/supplychain/SupplyChain_EXPORTS.h>
#include <aws/supplychain/model/InstanceState.h>

#include <utility>

namespace Aws {
namespace Utils {
namespace Json {
class JsonValue;
class JsonView;
}  // namespace Json
}  // namespace Utils
namespace SupplyChain {
namespace Model {

/**
 * <p>The details of the instance.</p><p><h3>See Also:</h3>   <a
 * href="http://docs.aws.amazon.com/goto/WebAPI/supplychain-2024-01-01/Instance">AWS
 * API Reference</a></p>
 */
class Instance {
 public:
  AWS_SUPPLYCHAIN_API Instance() = default;
  AWS_SUPPLYCHAIN_API Instance(Aws::Utils::Json::JsonView jsonValue);
  AWS_SUPPLYCHAIN_API Instance& operator=(Aws::Utils::Json::JsonView jsonValue);
  AWS_SUPPLYCHAIN_API Aws::Utils::Json::JsonValue Jsonize() const;

  ///@{
  /**
   * <p>The Amazon Web Services Supply Chain instance identifier.</p>
   */
  inline const Aws::String& GetInstanceId() const { return m_instanceId; }
  inline bool InstanceIdHasBeenSet() const { return m_instanceIdHasBeenSet; }
  template <typename InstanceIdT = Aws::String>
  void SetInstanceId(InstanceIdT&& value) {
    m_instanceIdHasBeenSet = true;
    m_instanceId = std::forward<InstanceIdT>(value);
  }
  template <typename InstanceIdT = Aws::String>
  Instance& WithInstanceId(InstanceIdT&& value) {
    SetInstanceId(std::forward<InstanceIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The Amazon Web Services account ID that owns the instance.</p>
   */
  inline const Aws::String& GetAwsAccountId() const { return m_awsAccountId; }
  inline bool AwsAccountIdHasBeenSet() const { return m_awsAccountIdHasBeenSet; }
  template <typename AwsAccountIdT = Aws::String>
  void SetAwsAccountId(AwsAccountIdT&& value) {
    m_awsAccountIdHasBeenSet = true;
    m_awsAccountId = std::forward<AwsAccountIdT>(value);
  }
  template <typename AwsAccountIdT = Aws::String>
  Instance& WithAwsAccountId(AwsAccountIdT&& value) {
    SetAwsAccountId(std::forward<AwsAccountIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The state of the instance.</p>
   */
  inline InstanceState GetState() const { return m_state; }
  inline bool StateHasBeenSet() const { return m_stateHasBeenSet; }
  inline void SetState(InstanceState value) {
    m_stateHasBeenSet = true;
    m_state = value;
  }
  inline Instance& WithState(InstanceState value) {
    SetState(value);
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The Amazon Web Services Supply Chain instance error message. If the instance
   * results in an unhealthy state, customers need to check the error message, delete
   * the current instance, and recreate a new one based on the mitigation from the
   * error message.</p>
   */
  inline const Aws::String& GetErrorMessage() const { return m_errorMessage; }
  inline bool ErrorMessageHasBeenSet() const { return m_errorMessageHasBeenSet; }
  template <typename ErrorMessageT = Aws::String>
  void SetErrorMessage(ErrorMessageT&& value) {
    m_errorMessageHasBeenSet = true;
    m_errorMessage = std::forward<ErrorMessageT>(value);
  }
  template <typename ErrorMessageT = Aws::String>
  Instance& WithErrorMessage(ErrorMessageT&& value) {
    SetErrorMessage(std::forward<ErrorMessageT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The WebApp DNS domain name of the instance.</p>
   */
  inline const Aws::String& GetWebAppDnsDomain() const { return m_webAppDnsDomain; }
  inline bool WebAppDnsDomainHasBeenSet() const { return m_webAppDnsDomainHasBeenSet; }
  template <typename WebAppDnsDomainT = Aws::String>
  void SetWebAppDnsDomain(WebAppDnsDomainT&& value) {
    m_webAppDnsDomainHasBeenSet = true;
    m_webAppDnsDomain = std::forward<WebAppDnsDomainT>(value);
  }
  template <typename WebAppDnsDomainT = Aws::String>
  Instance& WithWebAppDnsDomain(WebAppDnsDomainT&& value) {
    SetWebAppDnsDomain(std::forward<WebAppDnsDomainT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The instance creation timestamp.</p>
   */
  inline const Aws::Utils::DateTime& GetCreatedTime() const { return m_createdTime; }
  inline bool CreatedTimeHasBeenSet() const { return m_createdTimeHasBeenSet; }
  template <typename CreatedTimeT = Aws::Utils::DateTime>
  void SetCreatedTime(CreatedTimeT&& value) {
    m_createdTimeHasBeenSet = true;
    m_createdTime = std::forward<CreatedTimeT>(value);
  }
  template <typename CreatedTimeT = Aws::Utils::DateTime>
  Instance& WithCreatedTime(CreatedTimeT&& value) {
    SetCreatedTime(std::forward<CreatedTimeT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The instance last modified timestamp.</p>
   */
  inline const Aws::Utils::DateTime& GetLastModifiedTime() const { return m_lastModifiedTime; }
  inline bool LastModifiedTimeHasBeenSet() const { return m_lastModifiedTimeHasBeenSet; }
  template <typename LastModifiedTimeT = Aws::Utils::DateTime>
  void SetLastModifiedTime(LastModifiedTimeT&& value) {
    m_lastModifiedTimeHasBeenSet = true;
    m_lastModifiedTime = std::forward<LastModifiedTimeT>(value);
  }
  template <typename LastModifiedTimeT = Aws::Utils::DateTime>
  Instance& WithLastModifiedTime(LastModifiedTimeT&& value) {
    SetLastModifiedTime(std::forward<LastModifiedTimeT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The Amazon Web Services Supply Chain instance name.</p>
   */
  inline const Aws::String& GetInstanceName() const { return m_instanceName; }
  inline bool InstanceNameHasBeenSet() const { return m_instanceNameHasBeenSet; }
  template <typename InstanceNameT = Aws::String>
  void SetInstanceName(InstanceNameT&& value) {
    m_instanceNameHasBeenSet = true;
    m_instanceName = std::forward<InstanceNameT>(value);
  }
  template <typename InstanceNameT = Aws::String>
  Instance& WithInstanceName(InstanceNameT&& value) {
    SetInstanceName(std::forward<InstanceNameT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The Amazon Web Services Supply Chain instance description.</p>
   */
  inline const Aws::String& GetInstanceDescription() const { return m_instanceDescription; }
  inline bool InstanceDescriptionHasBeenSet() const { return m_instanceDescriptionHasBeenSet; }
  template <typename InstanceDescriptionT = Aws::String>
  void SetInstanceDescription(InstanceDescriptionT&& value) {
    m_instanceDescriptionHasBeenSet = true;
    m_instanceDescription = std::forward<InstanceDescriptionT>(value);
  }
  template <typename InstanceDescriptionT = Aws::String>
  Instance& WithInstanceDescription(InstanceDescriptionT&& value) {
    SetInstanceDescription(std::forward<InstanceDescriptionT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you
   * optionally provided for encryption. If you did not provide anything here, AWS
   * Supply Chain uses the Amazon Web Services owned KMS key and nothing is
   * returned.</p>
   */
  inline const Aws::String& GetKmsKeyArn() const { return m_kmsKeyArn; }
  inline bool KmsKeyArnHasBeenSet() const { return m_kmsKeyArnHasBeenSet; }
  template <typename KmsKeyArnT = Aws::String>
  void SetKmsKeyArn(KmsKeyArnT&& value) {
    m_kmsKeyArnHasBeenSet = true;
    m_kmsKeyArn = std::forward<KmsKeyArnT>(value);
  }
  template <typename KmsKeyArnT = Aws::String>
  Instance& WithKmsKeyArn(KmsKeyArnT&& value) {
    SetKmsKeyArn(std::forward<KmsKeyArnT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The version number of the instance.</p>
   */
  inline double GetVersionNumber() const { return m_versionNumber; }
  inline bool VersionNumberHasBeenSet() const { return m_versionNumberHasBeenSet; }
  inline void SetVersionNumber(double value) {
    m_versionNumberHasBeenSet = true;
    m_versionNumber = value;
  }
  inline Instance& WithVersionNumber(double value) {
    SetVersionNumber(value);
    return *this;
  }
  ///@}
 private:
  Aws::String m_instanceId;

  Aws::String m_awsAccountId;

  InstanceState m_state{InstanceState::NOT_SET};

  Aws::String m_errorMessage;

  Aws::String m_webAppDnsDomain;

  Aws::Utils::DateTime m_createdTime{};

  Aws::Utils::DateTime m_lastModifiedTime{};

  Aws::String m_instanceName;

  Aws::String m_instanceDescription;

  Aws::String m_kmsKeyArn;

  double m_versionNumber{0.0};
  bool m_instanceIdHasBeenSet = false;
  bool m_awsAccountIdHasBeenSet = false;
  bool m_stateHasBeenSet = false;
  bool m_errorMessageHasBeenSet = false;
  bool m_webAppDnsDomainHasBeenSet = false;
  bool m_createdTimeHasBeenSet = false;
  bool m_lastModifiedTimeHasBeenSet = false;
  bool m_instanceNameHasBeenSet = false;
  bool m_instanceDescriptionHasBeenSet = false;
  bool m_kmsKeyArnHasBeenSet = false;
  bool m_versionNumberHasBeenSet = false;
};

}  // namespace Model
}  // namespace SupplyChain
}  // namespace Aws
