Class: AWSCDK::ManagedBlockchain::CfnMember::ApprovalThresholdPolicyProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ManagedBlockchain::CfnMember::ApprovalThresholdPolicyProperty
- Defined in:
- managed_blockchain/cfn_member.rb
Overview
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.
Instance Attribute Summary collapse
-
#proposal_duration_in_hours ⇒ Numeric?
readonly
The duration from the time that a proposal is created until it expires.
-
#threshold_comparator ⇒ String?
readonly
Determines whether the vote percentage must be greater than the
ThresholdPercentageor must be greater than or equal to theThresholdPercentageto be approved. -
#threshold_percentage ⇒ Numeric?
readonly
The percentage of votes among all members that must be
YESfor a proposal to be approved.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(proposal_duration_in_hours: nil, threshold_comparator: nil, threshold_percentage: nil) ⇒ ApprovalThresholdPolicyProperty
constructor
A new instance of ApprovalThresholdPolicyProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(proposal_duration_in_hours: nil, threshold_comparator: nil, threshold_percentage: nil) ⇒ ApprovalThresholdPolicyProperty
Returns a new instance of ApprovalThresholdPolicyProperty.
577 578 579 580 581 582 583 584 |
# File 'managed_blockchain/cfn_member.rb', line 577 def initialize(proposal_duration_in_hours: nil, threshold_comparator: nil, threshold_percentage: nil) @proposal_duration_in_hours = proposal_duration_in_hours Jsii::Type.check_type(@proposal_duration_in_hours, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "proposalDurationInHours") unless @proposal_duration_in_hours.nil? @threshold_comparator = threshold_comparator Jsii::Type.check_type(@threshold_comparator, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "thresholdComparator") unless @threshold_comparator.nil? @threshold_percentage = threshold_percentage Jsii::Type.check_type(@threshold_percentage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "thresholdPercentage") unless @threshold_percentage.nil? end |
Instance Attribute Details
#proposal_duration_in_hours ⇒ Numeric? (readonly)
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.
592 593 594 |
# File 'managed_blockchain/cfn_member.rb', line 592 def proposal_duration_in_hours @proposal_duration_in_hours end |
#threshold_comparator ⇒ String? (readonly)
Determines whether the vote percentage must be greater than the ThresholdPercentage or must be greater than or equal to the ThresholdPercentage to be approved.
597 598 599 |
# File 'managed_blockchain/cfn_member.rb', line 597 def threshold_comparator @threshold_comparator end |
#threshold_percentage ⇒ Numeric? (readonly)
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.
604 605 606 |
# File 'managed_blockchain/cfn_member.rb', line 604 def threshold_percentage @threshold_percentage end |
Class Method Details
.jsii_properties ⇒ Object
606 607 608 609 610 611 612 |
# File 'managed_blockchain/cfn_member.rb', line 606 def self.jsii_properties { :proposal_duration_in_hours => "proposalDurationInHours", :threshold_comparator => "thresholdComparator", :threshold_percentage => "thresholdPercentage", } end |
Instance Method Details
#to_jsii ⇒ Object
614 615 616 617 618 619 620 621 622 |
# File 'managed_blockchain/cfn_member.rb', line 614 def to_jsii result = {} result.merge!({ "proposalDurationInHours" => @proposal_duration_in_hours, "thresholdComparator" => @threshold_comparator, "thresholdPercentage" => @threshold_percentage, }) result.compact end |