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

#pragma once
#include <aws/config/ConfigService_EXPORTS.h>
#include <aws/config/model/Compliance.h>
#include <aws/core/utils/memory/stl/AWSString.h>

#include <utility>

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

/**
 * <p>Indicates whether an Amazon Web Services resource that is evaluated according
 * to one or more Config rules is compliant. A resource is compliant if it complies
 * with all of the rules that evaluate it. A resource is noncompliant if it does
 * not comply with one or more of these rules.</p><p><h3>See Also:</h3>   <a
 * href="http://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ComplianceByResource">AWS
 * API Reference</a></p>
 */
class ComplianceByResource {
 public:
  AWS_CONFIGSERVICE_API ComplianceByResource() = default;
  AWS_CONFIGSERVICE_API ComplianceByResource(Aws::Utils::Json::JsonView jsonValue);
  AWS_CONFIGSERVICE_API ComplianceByResource& operator=(Aws::Utils::Json::JsonView jsonValue);
  AWS_CONFIGSERVICE_API Aws::Utils::Json::JsonValue Jsonize() const;

  ///@{
  /**
   * <p>The type of the Amazon Web Services resource that was evaluated.</p>
   */
  inline const Aws::String& GetResourceType() const { return m_resourceType; }
  inline bool ResourceTypeHasBeenSet() const { return m_resourceTypeHasBeenSet; }
  template <typename ResourceTypeT = Aws::String>
  void SetResourceType(ResourceTypeT&& value) {
    m_resourceTypeHasBeenSet = true;
    m_resourceType = std::forward<ResourceTypeT>(value);
  }
  template <typename ResourceTypeT = Aws::String>
  ComplianceByResource& WithResourceType(ResourceTypeT&& value) {
    SetResourceType(std::forward<ResourceTypeT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ID of the Amazon Web Services resource that was evaluated.</p>
   */
  inline const Aws::String& GetResourceId() const { return m_resourceId; }
  inline bool ResourceIdHasBeenSet() const { return m_resourceIdHasBeenSet; }
  template <typename ResourceIdT = Aws::String>
  void SetResourceId(ResourceIdT&& value) {
    m_resourceIdHasBeenSet = true;
    m_resourceId = std::forward<ResourceIdT>(value);
  }
  template <typename ResourceIdT = Aws::String>
  ComplianceByResource& WithResourceId(ResourceIdT&& value) {
    SetResourceId(std::forward<ResourceIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>Indicates whether the Amazon Web Services resource complies with all of the
   * Config rules that evaluated it.</p>
   */
  inline const Compliance& GetCompliance() const { return m_compliance; }
  inline bool ComplianceHasBeenSet() const { return m_complianceHasBeenSet; }
  template <typename ComplianceT = Compliance>
  void SetCompliance(ComplianceT&& value) {
    m_complianceHasBeenSet = true;
    m_compliance = std::forward<ComplianceT>(value);
  }
  template <typename ComplianceT = Compliance>
  ComplianceByResource& WithCompliance(ComplianceT&& value) {
    SetCompliance(std::forward<ComplianceT>(value));
    return *this;
  }
  ///@}
 private:
  Aws::String m_resourceType;

  Aws::String m_resourceId;

  Compliance m_compliance;
  bool m_resourceTypeHasBeenSet = false;
  bool m_resourceIdHasBeenSet = false;
  bool m_complianceHasBeenSet = false;
};

}  // namespace Model
}  // namespace ConfigService
}  // namespace Aws
