All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.managedblockchain.model.Proposal Maven / Gradle / Ivy

/*
 * Copyright 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 software.amazon.awssdk.services.managedblockchain.model;

import java.beans.Transient;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Properties of a proposal on a Managed Blockchain network. *

*

* Applies only to Hyperledger Fabric. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Proposal implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField PROPOSAL_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ProposalId").getter(getter(Proposal::proposalId)).setter(setter(Builder::proposalId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProposalId").build()).build(); private static final SdkField NETWORK_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("NetworkId").getter(getter(Proposal::networkId)).setter(setter(Builder::networkId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NetworkId").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(Proposal::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final SdkField ACTIONS_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("Actions").getter(getter(Proposal::actions)).setter(setter(Builder::actions)) .constructor(ProposalActions::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Actions").build()).build(); private static final SdkField PROPOSED_BY_MEMBER_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ProposedByMemberId").getter(getter(Proposal::proposedByMemberId)) .setter(setter(Builder::proposedByMemberId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProposedByMemberId").build()) .build(); private static final SdkField PROPOSED_BY_MEMBER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ProposedByMemberName").getter(getter(Proposal::proposedByMemberName)) .setter(setter(Builder::proposedByMemberName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProposedByMemberName").build()) .build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(Proposal::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField CREATION_DATE_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("CreationDate") .getter(getter(Proposal::creationDate)) .setter(setter(Builder::creationDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationDate").build(), TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build(); private static final SdkField EXPIRATION_DATE_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("ExpirationDate") .getter(getter(Proposal::expirationDate)) .setter(setter(Builder::expirationDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExpirationDate").build(), TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build(); private static final SdkField YES_VOTE_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("YesVoteCount").getter(getter(Proposal::yesVoteCount)).setter(setter(Builder::yesVoteCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("YesVoteCount").build()).build(); private static final SdkField NO_VOTE_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("NoVoteCount").getter(getter(Proposal::noVoteCount)).setter(setter(Builder::noVoteCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NoVoteCount").build()).build(); private static final SdkField OUTSTANDING_VOTE_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("OutstandingVoteCount").getter(getter(Proposal::outstandingVoteCount)) .setter(setter(Builder::outstandingVoteCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutstandingVoteCount").build()) .build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("Tags") .getter(getter(Proposal::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn") .getter(getter(Proposal::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PROPOSAL_ID_FIELD, NETWORK_ID_FIELD, DESCRIPTION_FIELD, ACTIONS_FIELD, PROPOSED_BY_MEMBER_ID_FIELD, PROPOSED_BY_MEMBER_NAME_FIELD, STATUS_FIELD, CREATION_DATE_FIELD, EXPIRATION_DATE_FIELD, YES_VOTE_COUNT_FIELD, NO_VOTE_COUNT_FIELD, OUTSTANDING_VOTE_COUNT_FIELD, TAGS_FIELD, ARN_FIELD)); private static final long serialVersionUID = 1L; private final String proposalId; private final String networkId; private final String description; private final ProposalActions actions; private final String proposedByMemberId; private final String proposedByMemberName; private final String status; private final Instant creationDate; private final Instant expirationDate; private final Integer yesVoteCount; private final Integer noVoteCount; private final Integer outstandingVoteCount; private final Map tags; private final String arn; private Proposal(BuilderImpl builder) { this.proposalId = builder.proposalId; this.networkId = builder.networkId; this.description = builder.description; this.actions = builder.actions; this.proposedByMemberId = builder.proposedByMemberId; this.proposedByMemberName = builder.proposedByMemberName; this.status = builder.status; this.creationDate = builder.creationDate; this.expirationDate = builder.expirationDate; this.yesVoteCount = builder.yesVoteCount; this.noVoteCount = builder.noVoteCount; this.outstandingVoteCount = builder.outstandingVoteCount; this.tags = builder.tags; this.arn = builder.arn; } /** *

* The unique identifier of the proposal. *

* * @return The unique identifier of the proposal. */ public final String proposalId() { return proposalId; } /** *

* The unique identifier of the network for which the proposal is made. *

* * @return The unique identifier of the network for which the proposal is made. */ public final String networkId() { return networkId; } /** *

* The description of the proposal. *

* * @return The description of the proposal. */ public final String description() { return description; } /** *

* The actions to perform on the network if the proposal is APPROVED. *

* * @return The actions to perform on the network if the proposal is APPROVED. */ public final ProposalActions actions() { return actions; } /** *

* The unique identifier of the member that created the proposal. *

* * @return The unique identifier of the member that created the proposal. */ public final String proposedByMemberId() { return proposedByMemberId; } /** *

* The name of the member that created the proposal. *

* * @return The name of the member that created the proposal. */ public final String proposedByMemberName() { return proposedByMemberName; } /** *

* The status of the proposal. Values are as follows: *

*
    *
  • *

    * IN_PROGRESS - The proposal is active and open for member voting. *

    *
  • *
  • *

    * APPROVED - The proposal was approved with sufficient YES votes among members according * to the VotingPolicy specified for the Network. The specified proposal actions are * carried out. *

    *
  • *
  • *

    * REJECTED - The proposal was rejected with insufficient YES votes among members * according to the VotingPolicy specified for the Network. The specified * ProposalActions are not carried out. *

    *
  • *
  • *

    * EXPIRED - Members did not cast the number of votes required to determine the proposal outcome before * the proposal expired. The specified ProposalActions are not carried out. *

    *
  • *
  • *

    * ACTION_FAILED - One or more of the specified ProposalActions in a proposal that was * approved could not be completed because of an error. The ACTION_FAILED status occurs even if only * one ProposalAction fails and other actions are successful. *

    *
  • *
*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link ProposalStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The status of the proposal. Values are as follows:

*
    *
  • *

    * IN_PROGRESS - The proposal is active and open for member voting. *

    *
  • *
  • *

    * APPROVED - The proposal was approved with sufficient YES votes among members * according to the VotingPolicy specified for the Network. The specified proposal * actions are carried out. *

    *
  • *
  • *

    * REJECTED - The proposal was rejected with insufficient YES votes among members * according to the VotingPolicy specified for the Network. The specified * ProposalActions are not carried out. *

    *
  • *
  • *

    * EXPIRED - Members did not cast the number of votes required to determine the proposal * outcome before the proposal expired. The specified ProposalActions are not carried out. *

    *
  • *
  • *

    * ACTION_FAILED - One or more of the specified ProposalActions in a proposal that * was approved could not be completed because of an error. The ACTION_FAILED status occurs * even if only one ProposalAction fails and other actions are successful. *

    *
  • * @see ProposalStatus */ public final ProposalStatus status() { return ProposalStatus.fromValue(status); } /** *

    * The status of the proposal. Values are as follows: *

    *
      *
    • *

      * IN_PROGRESS - The proposal is active and open for member voting. *

      *
    • *
    • *

      * APPROVED - The proposal was approved with sufficient YES votes among members according * to the VotingPolicy specified for the Network. The specified proposal actions are * carried out. *

      *
    • *
    • *

      * REJECTED - The proposal was rejected with insufficient YES votes among members * according to the VotingPolicy specified for the Network. The specified * ProposalActions are not carried out. *

      *
    • *
    • *

      * EXPIRED - Members did not cast the number of votes required to determine the proposal outcome before * the proposal expired. The specified ProposalActions are not carried out. *

      *
    • *
    • *

      * ACTION_FAILED - One or more of the specified ProposalActions in a proposal that was * approved could not be completed because of an error. The ACTION_FAILED status occurs even if only * one ProposalAction fails and other actions are successful. *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link ProposalStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

    * * @return The status of the proposal. Values are as follows:

    *
      *
    • *

      * IN_PROGRESS - The proposal is active and open for member voting. *

      *
    • *
    • *

      * APPROVED - The proposal was approved with sufficient YES votes among members * according to the VotingPolicy specified for the Network. The specified proposal * actions are carried out. *

      *
    • *
    • *

      * REJECTED - The proposal was rejected with insufficient YES votes among members * according to the VotingPolicy specified for the Network. The specified * ProposalActions are not carried out. *

      *
    • *
    • *

      * EXPIRED - Members did not cast the number of votes required to determine the proposal * outcome before the proposal expired. The specified ProposalActions are not carried out. *

      *
    • *
    • *

      * ACTION_FAILED - One or more of the specified ProposalActions in a proposal that * was approved could not be completed because of an error. The ACTION_FAILED status occurs * even if only one ProposalAction fails and other actions are successful. *

      *
    • * @see ProposalStatus */ public final String statusAsString() { return status; } /** *

      * The date and time that the proposal was created. *

      * * @return The date and time that the proposal was created. */ public final Instant creationDate() { return creationDate; } /** *

      * The date and time that the proposal expires. This is the CreationDate plus the * ProposalDurationInHours that is specified in the ProposalThresholdPolicy. After this * date and time, if members have not cast enough votes to determine the outcome according to the voting policy, the * proposal is EXPIRED and Actions are not carried out. *

      * * @return The date and time that the proposal expires. This is the CreationDate plus the * ProposalDurationInHours that is specified in the ProposalThresholdPolicy. After * this date and time, if members have not cast enough votes to determine the outcome according to the * voting policy, the proposal is EXPIRED and Actions are not carried out. */ public final Instant expirationDate() { return expirationDate; } /** *

      * The current total of YES votes cast on the proposal by members. *

      * * @return The current total of YES votes cast on the proposal by members. */ public final Integer yesVoteCount() { return yesVoteCount; } /** *

      * The current total of NO votes cast on the proposal by members. *

      * * @return The current total of NO votes cast on the proposal by members. */ public final Integer noVoteCount() { return noVoteCount; } /** *

      * The number of votes remaining to be cast on the proposal by members. In other words, the number of members minus * the sum of YES votes and NO votes. *

      * * @return The number of votes remaining to be cast on the proposal by members. In other words, the number of * members minus the sum of YES votes and NO votes. */ public final Integer outstandingVoteCount() { return outstandingVoteCount; } /** * Returns true if the Tags property was specified by the sender (it may be empty), or false if the sender did not * specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructMap); } /** *

      * Tags assigned to the proposal. Each tag consists of a key and optional value. *

      *

      * For more information about tags, see Tagging * Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * You can use {@link #hasTags()} to see if a value was sent in this field. *

      * * @return Tags assigned to the proposal. Each tag consists of a key and optional value.

      *

      * For more information about tags, see Tagging * Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. */ public final Map tags() { return tags; } /** *

      * The Amazon Resource Name (ARN) of the proposal. For more information about ARNs and their format, see Amazon Resource Names * (ARNs) in the AWS General Reference. *

      * * @return The Amazon Resource Name (ARN) of the proposal. For more information about ARNs and their format, see Amazon Resource Names * (ARNs) in the AWS General Reference. */ public final String arn() { return arn; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(proposalId()); hashCode = 31 * hashCode + Objects.hashCode(networkId()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(actions()); hashCode = 31 * hashCode + Objects.hashCode(proposedByMemberId()); hashCode = 31 * hashCode + Objects.hashCode(proposedByMemberName()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(creationDate()); hashCode = 31 * hashCode + Objects.hashCode(expirationDate()); hashCode = 31 * hashCode + Objects.hashCode(yesVoteCount()); hashCode = 31 * hashCode + Objects.hashCode(noVoteCount()); hashCode = 31 * hashCode + Objects.hashCode(outstandingVoteCount()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(arn()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Proposal)) { return false; } Proposal other = (Proposal) obj; return Objects.equals(proposalId(), other.proposalId()) && Objects.equals(networkId(), other.networkId()) && Objects.equals(description(), other.description()) && Objects.equals(actions(), other.actions()) && Objects.equals(proposedByMemberId(), other.proposedByMemberId()) && Objects.equals(proposedByMemberName(), other.proposedByMemberName()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(creationDate(), other.creationDate()) && Objects.equals(expirationDate(), other.expirationDate()) && Objects.equals(yesVoteCount(), other.yesVoteCount()) && Objects.equals(noVoteCount(), other.noVoteCount()) && Objects.equals(outstandingVoteCount(), other.outstandingVoteCount()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(arn(), other.arn()); } /** * 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. */ @Override public final String toString() { return ToString.builder("Proposal").add("ProposalId", proposalId()).add("NetworkId", networkId()) .add("Description", description()).add("Actions", actions()).add("ProposedByMemberId", proposedByMemberId()) .add("ProposedByMemberName", proposedByMemberName()).add("Status", statusAsString()) .add("CreationDate", creationDate()).add("ExpirationDate", expirationDate()).add("YesVoteCount", yesVoteCount()) .add("NoVoteCount", noVoteCount()).add("OutstandingVoteCount", outstandingVoteCount()) .add("Tags", hasTags() ? tags() : null).add("Arn", arn()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ProposalId": return Optional.ofNullable(clazz.cast(proposalId())); case "NetworkId": return Optional.ofNullable(clazz.cast(networkId())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Actions": return Optional.ofNullable(clazz.cast(actions())); case "ProposedByMemberId": return Optional.ofNullable(clazz.cast(proposedByMemberId())); case "ProposedByMemberName": return Optional.ofNullable(clazz.cast(proposedByMemberName())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "CreationDate": return Optional.ofNullable(clazz.cast(creationDate())); case "ExpirationDate": return Optional.ofNullable(clazz.cast(expirationDate())); case "YesVoteCount": return Optional.ofNullable(clazz.cast(yesVoteCount())); case "NoVoteCount": return Optional.ofNullable(clazz.cast(noVoteCount())); case "OutstandingVoteCount": return Optional.ofNullable(clazz.cast(outstandingVoteCount())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "Arn": return Optional.ofNullable(clazz.cast(arn())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Proposal) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The unique identifier of the proposal. *

      * * @param proposalId * The unique identifier of the proposal. * @return Returns a reference to this object so that method calls can be chained together. */ Builder proposalId(String proposalId); /** *

      * The unique identifier of the network for which the proposal is made. *

      * * @param networkId * The unique identifier of the network for which the proposal is made. * @return Returns a reference to this object so that method calls can be chained together. */ Builder networkId(String networkId); /** *

      * The description of the proposal. *

      * * @param description * The description of the proposal. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

      * The actions to perform on the network if the proposal is APPROVED. *

      * * @param actions * The actions to perform on the network if the proposal is APPROVED. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actions(ProposalActions actions); /** *

      * The actions to perform on the network if the proposal is APPROVED. *

      * This is a convenience that creates an instance of the {@link ProposalActions.Builder} avoiding the need to * create one manually via {@link ProposalActions#builder()}. * * When the {@link Consumer} completes, {@link ProposalActions.Builder#build()} is called immediately and its * result is passed to {@link #actions(ProposalActions)}. * * @param actions * a consumer that will call methods on {@link ProposalActions.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #actions(ProposalActions) */ default Builder actions(Consumer actions) { return actions(ProposalActions.builder().applyMutation(actions).build()); } /** *

      * The unique identifier of the member that created the proposal. *

      * * @param proposedByMemberId * The unique identifier of the member that created the proposal. * @return Returns a reference to this object so that method calls can be chained together. */ Builder proposedByMemberId(String proposedByMemberId); /** *

      * The name of the member that created the proposal. *

      * * @param proposedByMemberName * The name of the member that created the proposal. * @return Returns a reference to this object so that method calls can be chained together. */ Builder proposedByMemberName(String proposedByMemberName); /** *

      * The status of the proposal. Values are as follows: *

      *
        *
      • *

        * IN_PROGRESS - The proposal is active and open for member voting. *

        *
      • *
      • *

        * APPROVED - The proposal was approved with sufficient YES votes among members * according to the VotingPolicy specified for the Network. The specified proposal * actions are carried out. *

        *
      • *
      • *

        * REJECTED - The proposal was rejected with insufficient YES votes among members * according to the VotingPolicy specified for the Network. The specified * ProposalActions are not carried out. *

        *
      • *
      • *

        * EXPIRED - Members did not cast the number of votes required to determine the proposal outcome * before the proposal expired. The specified ProposalActions are not carried out. *

        *
      • *
      • *

        * ACTION_FAILED - One or more of the specified ProposalActions in a proposal that was * approved could not be completed because of an error. The ACTION_FAILED status occurs even if * only one ProposalAction fails and other actions are successful. *

        *
      • *
      * * @param status * The status of the proposal. Values are as follows:

      *
        *
      • *

        * IN_PROGRESS - The proposal is active and open for member voting. *

        *
      • *
      • *

        * APPROVED - The proposal was approved with sufficient YES votes among members * according to the VotingPolicy specified for the Network. The specified * proposal actions are carried out. *

        *
      • *
      • *

        * REJECTED - The proposal was rejected with insufficient YES votes among * members according to the VotingPolicy specified for the Network. The * specified ProposalActions are not carried out. *

        *
      • *
      • *

        * EXPIRED - Members did not cast the number of votes required to determine the proposal * outcome before the proposal expired. The specified ProposalActions are not carried out. *

        *
      • *
      • *

        * ACTION_FAILED - One or more of the specified ProposalActions in a proposal * that was approved could not be completed because of an error. The ACTION_FAILED status * occurs even if only one ProposalAction fails and other actions are successful. *

        *
      • * @see ProposalStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ProposalStatus */ Builder status(String status); /** *

        * The status of the proposal. Values are as follows: *

        *
          *
        • *

          * IN_PROGRESS - The proposal is active and open for member voting. *

          *
        • *
        • *

          * APPROVED - The proposal was approved with sufficient YES votes among members * according to the VotingPolicy specified for the Network. The specified proposal * actions are carried out. *

          *
        • *
        • *

          * REJECTED - The proposal was rejected with insufficient YES votes among members * according to the VotingPolicy specified for the Network. The specified * ProposalActions are not carried out. *

          *
        • *
        • *

          * EXPIRED - Members did not cast the number of votes required to determine the proposal outcome * before the proposal expired. The specified ProposalActions are not carried out. *

          *
        • *
        • *

          * ACTION_FAILED - One or more of the specified ProposalActions in a proposal that was * approved could not be completed because of an error. The ACTION_FAILED status occurs even if * only one ProposalAction fails and other actions are successful. *

          *
        • *
        * * @param status * The status of the proposal. Values are as follows:

        *
          *
        • *

          * IN_PROGRESS - The proposal is active and open for member voting. *

          *
        • *
        • *

          * APPROVED - The proposal was approved with sufficient YES votes among members * according to the VotingPolicy specified for the Network. The specified * proposal actions are carried out. *

          *
        • *
        • *

          * REJECTED - The proposal was rejected with insufficient YES votes among * members according to the VotingPolicy specified for the Network. The * specified ProposalActions are not carried out. *

          *
        • *
        • *

          * EXPIRED - Members did not cast the number of votes required to determine the proposal * outcome before the proposal expired. The specified ProposalActions are not carried out. *

          *
        • *
        • *

          * ACTION_FAILED - One or more of the specified ProposalActions in a proposal * that was approved could not be completed because of an error. The ACTION_FAILED status * occurs even if only one ProposalAction fails and other actions are successful. *

          *
        • * @see ProposalStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ProposalStatus */ Builder status(ProposalStatus status); /** *

          * The date and time that the proposal was created. *

          * * @param creationDate * The date and time that the proposal was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationDate(Instant creationDate); /** *

          * The date and time that the proposal expires. This is the CreationDate plus the * ProposalDurationInHours that is specified in the ProposalThresholdPolicy. After * this date and time, if members have not cast enough votes to determine the outcome according to the voting * policy, the proposal is EXPIRED and Actions are not carried out. *

          * * @param expirationDate * The date and time that the proposal expires. This is the CreationDate plus the * ProposalDurationInHours that is specified in the ProposalThresholdPolicy. * After this date and time, if members have not cast enough votes to determine the outcome according to * the voting policy, the proposal is EXPIRED and Actions are not carried out. * @return Returns a reference to this object so that method calls can be chained together. */ Builder expirationDate(Instant expirationDate); /** *

          * The current total of YES votes cast on the proposal by members. *

          * * @param yesVoteCount * The current total of YES votes cast on the proposal by members. * @return Returns a reference to this object so that method calls can be chained together. */ Builder yesVoteCount(Integer yesVoteCount); /** *

          * The current total of NO votes cast on the proposal by members. *

          * * @param noVoteCount * The current total of NO votes cast on the proposal by members. * @return Returns a reference to this object so that method calls can be chained together. */ Builder noVoteCount(Integer noVoteCount); /** *

          * The number of votes remaining to be cast on the proposal by members. In other words, the number of members * minus the sum of YES votes and NO votes. *

          * * @param outstandingVoteCount * The number of votes remaining to be cast on the proposal by members. In other words, the number of * members minus the sum of YES votes and NO votes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outstandingVoteCount(Integer outstandingVoteCount); /** *

          * Tags assigned to the proposal. Each tag consists of a key and optional value. *

          *

          * For more information about tags, see Tagging * Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. *

          * * @param tags * Tags assigned to the proposal. Each tag consists of a key and optional value.

          *

          * For more information about tags, see Tagging Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); /** *

          * The Amazon Resource Name (ARN) of the proposal. For more information about ARNs and their format, see Amazon Resource Names * (ARNs) in the AWS General Reference. *

          * * @param arn * The Amazon Resource Name (ARN) of the proposal. For more information about ARNs and their format, see * Amazon Resource * Names (ARNs) in the AWS General Reference. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); } static final class BuilderImpl implements Builder { private String proposalId; private String networkId; private String description; private ProposalActions actions; private String proposedByMemberId; private String proposedByMemberName; private String status; private Instant creationDate; private Instant expirationDate; private Integer yesVoteCount; private Integer noVoteCount; private Integer outstandingVoteCount; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private String arn; private BuilderImpl() { } private BuilderImpl(Proposal model) { proposalId(model.proposalId); networkId(model.networkId); description(model.description); actions(model.actions); proposedByMemberId(model.proposedByMemberId); proposedByMemberName(model.proposedByMemberName); status(model.status); creationDate(model.creationDate); expirationDate(model.expirationDate); yesVoteCount(model.yesVoteCount); noVoteCount(model.noVoteCount); outstandingVoteCount(model.outstandingVoteCount); tags(model.tags); arn(model.arn); } public final String getProposalId() { return proposalId; } public final void setProposalId(String proposalId) { this.proposalId = proposalId; } @Override @Transient public final Builder proposalId(String proposalId) { this.proposalId = proposalId; return this; } public final String getNetworkId() { return networkId; } public final void setNetworkId(String networkId) { this.networkId = networkId; } @Override @Transient public final Builder networkId(String networkId) { this.networkId = networkId; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override @Transient public final Builder description(String description) { this.description = description; return this; } public final ProposalActions.Builder getActions() { return actions != null ? actions.toBuilder() : null; } public final void setActions(ProposalActions.BuilderImpl actions) { this.actions = actions != null ? actions.build() : null; } @Override @Transient public final Builder actions(ProposalActions actions) { this.actions = actions; return this; } public final String getProposedByMemberId() { return proposedByMemberId; } public final void setProposedByMemberId(String proposedByMemberId) { this.proposedByMemberId = proposedByMemberId; } @Override @Transient public final Builder proposedByMemberId(String proposedByMemberId) { this.proposedByMemberId = proposedByMemberId; return this; } public final String getProposedByMemberName() { return proposedByMemberName; } public final void setProposedByMemberName(String proposedByMemberName) { this.proposedByMemberName = proposedByMemberName; } @Override @Transient public final Builder proposedByMemberName(String proposedByMemberName) { this.proposedByMemberName = proposedByMemberName; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override @Transient public final Builder status(String status) { this.status = status; return this; } @Override @Transient public final Builder status(ProposalStatus status) { this.status(status == null ? null : status.toString()); return this; } public final Instant getCreationDate() { return creationDate; } public final void setCreationDate(Instant creationDate) { this.creationDate = creationDate; } @Override @Transient public final Builder creationDate(Instant creationDate) { this.creationDate = creationDate; return this; } public final Instant getExpirationDate() { return expirationDate; } public final void setExpirationDate(Instant expirationDate) { this.expirationDate = expirationDate; } @Override @Transient public final Builder expirationDate(Instant expirationDate) { this.expirationDate = expirationDate; return this; } public final Integer getYesVoteCount() { return yesVoteCount; } public final void setYesVoteCount(Integer yesVoteCount) { this.yesVoteCount = yesVoteCount; } @Override @Transient public final Builder yesVoteCount(Integer yesVoteCount) { this.yesVoteCount = yesVoteCount; return this; } public final Integer getNoVoteCount() { return noVoteCount; } public final void setNoVoteCount(Integer noVoteCount) { this.noVoteCount = noVoteCount; } @Override @Transient public final Builder noVoteCount(Integer noVoteCount) { this.noVoteCount = noVoteCount; return this; } public final Integer getOutstandingVoteCount() { return outstandingVoteCount; } public final void setOutstandingVoteCount(Integer outstandingVoteCount) { this.outstandingVoteCount = outstandingVoteCount; } @Override @Transient public final Builder outstandingVoteCount(Integer outstandingVoteCount) { this.outstandingVoteCount = outstandingVoteCount; return this; } public final Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = OutputTagMapCopier.copy(tags); } @Override @Transient public final Builder tags(Map tags) { this.tags = OutputTagMapCopier.copy(tags); return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override @Transient public final Builder arn(String arn) { this.arn = arn; return this; } @Override public Proposal build() { return new Proposal(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy