/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace ManagedBlockchain { namespace Model { /** *

A policy type that defines the voting rules for the network. The rules decide * if a proposal is approved. Approval may be based on criteria such as the * percentage of YES votes and the duration of the proposal. The * policy applies to all proposals and is specified when the network is * created.

Applies only to Hyperledger Fabric.

See Also:

* AWS * API Reference

*/ class ApprovalThresholdPolicy { public: AWS_MANAGEDBLOCKCHAIN_API ApprovalThresholdPolicy(); AWS_MANAGEDBLOCKCHAIN_API ApprovalThresholdPolicy(Aws::Utils::Json::JsonView jsonValue); AWS_MANAGEDBLOCKCHAIN_API ApprovalThresholdPolicy& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_MANAGEDBLOCKCHAIN_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The percentage of votes among all members that must be YES for a * proposal to be approved. For example, a ThresholdPercentage value * of 50 indicates 50%. The ThresholdComparator * determines the precise comparison. If a ThresholdPercentage value * of 50 is specified on a network with 10 members, along with a * ThresholdComparator value of GREATER_THAN, this * indicates that 6 YES votes are required for the proposal to be * approved.

*/ inline int GetThresholdPercentage() const{ return m_thresholdPercentage; } /** *

The percentage of votes among all members that must be YES for a * proposal to be approved. For example, a ThresholdPercentage value * of 50 indicates 50%. The ThresholdComparator * determines the precise comparison. If a ThresholdPercentage value * of 50 is specified on a network with 10 members, along with a * ThresholdComparator value of GREATER_THAN, this * indicates that 6 YES votes are required for the proposal to be * approved.

*/ inline bool ThresholdPercentageHasBeenSet() const { return m_thresholdPercentageHasBeenSet; } /** *

The percentage of votes among all members that must be YES for a * proposal to be approved. For example, a ThresholdPercentage value * of 50 indicates 50%. The ThresholdComparator * determines the precise comparison. If a ThresholdPercentage value * of 50 is specified on a network with 10 members, along with a * ThresholdComparator value of GREATER_THAN, this * indicates that 6 YES votes are required for the proposal to be * approved.

*/ inline void SetThresholdPercentage(int value) { m_thresholdPercentageHasBeenSet = true; m_thresholdPercentage = value; } /** *

The percentage of votes among all members that must be YES for a * proposal to be approved. For example, a ThresholdPercentage value * of 50 indicates 50%. The ThresholdComparator * determines the precise comparison. If a ThresholdPercentage value * of 50 is specified on a network with 10 members, along with a * ThresholdComparator value of GREATER_THAN, this * indicates that 6 YES votes are required for the proposal to be * approved.

*/ inline ApprovalThresholdPolicy& WithThresholdPercentage(int value) { SetThresholdPercentage(value); return *this;} /** *

The duration from the time that a proposal is created until it expires. If * members cast neither the required number of YES votes to approve * the proposal nor the number of NO votes required to reject it * before the duration expires, the proposal is EXPIRED and * ProposalActions aren't carried out.

*/ inline int GetProposalDurationInHours() const{ return m_proposalDurationInHours; } /** *

The duration from the time that a proposal is created until it expires. If * members cast neither the required number of YES votes to approve * the proposal nor the number of NO votes required to reject it * before the duration expires, the proposal is EXPIRED and * ProposalActions aren't carried out.

*/ inline bool ProposalDurationInHoursHasBeenSet() const { return m_proposalDurationInHoursHasBeenSet; } /** *

The duration from the time that a proposal is created until it expires. If * members cast neither the required number of YES votes to approve * the proposal nor the number of NO votes required to reject it * before the duration expires, the proposal is EXPIRED and * ProposalActions aren't carried out.

*/ inline void SetProposalDurationInHours(int value) { m_proposalDurationInHoursHasBeenSet = true; m_proposalDurationInHours = value; } /** *

The duration from the time that a proposal is created until it expires. If * members cast neither the required number of YES votes to approve * the proposal nor the number of NO votes required to reject it * before the duration expires, the proposal is EXPIRED and * ProposalActions aren't carried out.

*/ inline ApprovalThresholdPolicy& WithProposalDurationInHours(int value) { SetProposalDurationInHours(value); return *this;} /** *

Determines whether the vote percentage must be greater than the * ThresholdPercentage or must be greater than or equal to the * ThreholdPercentage to be approved.

*/ inline const ThresholdComparator& GetThresholdComparator() const{ return m_thresholdComparator; } /** *

Determines whether the vote percentage must be greater than the * ThresholdPercentage or must be greater than or equal to the * ThreholdPercentage to be approved.

*/ inline bool ThresholdComparatorHasBeenSet() const { return m_thresholdComparatorHasBeenSet; } /** *

Determines whether the vote percentage must be greater than the * ThresholdPercentage or must be greater than or equal to the * ThreholdPercentage to be approved.

*/ inline void SetThresholdComparator(const ThresholdComparator& value) { m_thresholdComparatorHasBeenSet = true; m_thresholdComparator = value; } /** *

Determines whether the vote percentage must be greater than the * ThresholdPercentage or must be greater than or equal to the * ThreholdPercentage to be approved.

*/ inline void SetThresholdComparator(ThresholdComparator&& value) { m_thresholdComparatorHasBeenSet = true; m_thresholdComparator = std::move(value); } /** *

Determines whether the vote percentage must be greater than the * ThresholdPercentage or must be greater than or equal to the * ThreholdPercentage to be approved.

*/ inline ApprovalThresholdPolicy& WithThresholdComparator(const ThresholdComparator& value) { SetThresholdComparator(value); return *this;} /** *

Determines whether the vote percentage must be greater than the * ThresholdPercentage or must be greater than or equal to the * ThreholdPercentage to be approved.

*/ inline ApprovalThresholdPolicy& WithThresholdComparator(ThresholdComparator&& value) { SetThresholdComparator(std::move(value)); return *this;} private: int m_thresholdPercentage; bool m_thresholdPercentageHasBeenSet = false; int m_proposalDurationInHours; bool m_proposalDurationInHoursHasBeenSet = false; ThresholdComparator m_thresholdComparator; bool m_thresholdComparatorHasBeenSet = false; }; } // namespace Model } // namespace ManagedBlockchain } // namespace Aws