
com.amazonaws.services.managedblockchain.model.CreateProposalRequest Maven / Gradle / Ivy
/*
* Copyright 2017-2022 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 com.amazonaws.services.managedblockchain.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateProposalRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent
* operation completes no more than one time. This identifier is required only if you make a service request
* directly using an HTTP client. It is generated automatically if you use an AWS SDK or the AWS CLI.
*
*/
private String clientRequestToken;
/**
*
* The unique identifier of the network for which the proposal is made.
*
*/
private String networkId;
/**
*
* The unique identifier of the member that is creating the proposal. This identifier is especially useful for
* identifying the member making the proposal when multiple members exist in a single AWS account.
*
*/
private String memberId;
/**
*
* The type of actions proposed, such as inviting a member or removing a member. The types of Actions
* in a proposal are mutually exclusive. For example, a proposal with Invitations
actions cannot also
* contain Removals
actions.
*
*/
private ProposalActions actions;
/**
*
* A description for the proposal that is visible to voting members, for example,
* "Proposal to add Example Corp. as member."
*
*/
private String description;
/**
*
* Tags to assign to the proposal. Each tag consists of a key and optional value.
*
*
* When specifying tags during creation, you can specify multiple key-value pairs in a single request, with an
* overall maximum of 50 tags added to each resource. If the proposal is for a network invitation, the invitation
* inherits the tags added to the proposal.
*
*
* 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.
*
*/
private java.util.Map tags;
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent
* operation completes no more than one time. This identifier is required only if you make a service request
* directly using an HTTP client. It is generated automatically if you use an AWS SDK or the AWS CLI.
*
*
* @param clientRequestToken
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An
* idempotent operation completes no more than one time. This identifier is required only if you make a
* service request directly using an HTTP client. It is generated automatically if you use an AWS SDK or the
* AWS CLI.
*/
public void setClientRequestToken(String clientRequestToken) {
this.clientRequestToken = clientRequestToken;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent
* operation completes no more than one time. This identifier is required only if you make a service request
* directly using an HTTP client. It is generated automatically if you use an AWS SDK or the AWS CLI.
*
*
* @return A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An
* idempotent operation completes no more than one time. This identifier is required only if you make a
* service request directly using an HTTP client. It is generated automatically if you use an AWS SDK or the
* AWS CLI.
*/
public String getClientRequestToken() {
return this.clientRequestToken;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent
* operation completes no more than one time. This identifier is required only if you make a service request
* directly using an HTTP client. It is generated automatically if you use an AWS SDK or the AWS CLI.
*
*
* @param clientRequestToken
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An
* idempotent operation completes no more than one time. This identifier is required only if you make a
* service request directly using an HTTP client. It is generated automatically if you use an AWS SDK or the
* AWS CLI.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProposalRequest withClientRequestToken(String clientRequestToken) {
setClientRequestToken(clientRequestToken);
return this;
}
/**
*
* 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.
*/
public void setNetworkId(String networkId) {
this.networkId = networkId;
}
/**
*
* 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 String getNetworkId() {
return this.networkId;
}
/**
*
* 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.
*/
public CreateProposalRequest withNetworkId(String networkId) {
setNetworkId(networkId);
return this;
}
/**
*
* The unique identifier of the member that is creating the proposal. This identifier is especially useful for
* identifying the member making the proposal when multiple members exist in a single AWS account.
*
*
* @param memberId
* The unique identifier of the member that is creating the proposal. This identifier is especially useful
* for identifying the member making the proposal when multiple members exist in a single AWS account.
*/
public void setMemberId(String memberId) {
this.memberId = memberId;
}
/**
*
* The unique identifier of the member that is creating the proposal. This identifier is especially useful for
* identifying the member making the proposal when multiple members exist in a single AWS account.
*
*
* @return The unique identifier of the member that is creating the proposal. This identifier is especially useful
* for identifying the member making the proposal when multiple members exist in a single AWS account.
*/
public String getMemberId() {
return this.memberId;
}
/**
*
* The unique identifier of the member that is creating the proposal. This identifier is especially useful for
* identifying the member making the proposal when multiple members exist in a single AWS account.
*
*
* @param memberId
* The unique identifier of the member that is creating the proposal. This identifier is especially useful
* for identifying the member making the proposal when multiple members exist in a single AWS account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProposalRequest withMemberId(String memberId) {
setMemberId(memberId);
return this;
}
/**
*
* The type of actions proposed, such as inviting a member or removing a member. The types of Actions
* in a proposal are mutually exclusive. For example, a proposal with Invitations
actions cannot also
* contain Removals
actions.
*
*
* @param actions
* The type of actions proposed, such as inviting a member or removing a member. The types of
* Actions
in a proposal are mutually exclusive. For example, a proposal with
* Invitations
actions cannot also contain Removals
actions.
*/
public void setActions(ProposalActions actions) {
this.actions = actions;
}
/**
*
* The type of actions proposed, such as inviting a member or removing a member. The types of Actions
* in a proposal are mutually exclusive. For example, a proposal with Invitations
actions cannot also
* contain Removals
actions.
*
*
* @return The type of actions proposed, such as inviting a member or removing a member. The types of
* Actions
in a proposal are mutually exclusive. For example, a proposal with
* Invitations
actions cannot also contain Removals
actions.
*/
public ProposalActions getActions() {
return this.actions;
}
/**
*
* The type of actions proposed, such as inviting a member or removing a member. The types of Actions
* in a proposal are mutually exclusive. For example, a proposal with Invitations
actions cannot also
* contain Removals
actions.
*
*
* @param actions
* The type of actions proposed, such as inviting a member or removing a member. The types of
* Actions
in a proposal are mutually exclusive. For example, a proposal with
* Invitations
actions cannot also contain Removals
actions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProposalRequest withActions(ProposalActions actions) {
setActions(actions);
return this;
}
/**
*
* A description for the proposal that is visible to voting members, for example,
* "Proposal to add Example Corp. as member."
*
*
* @param description
* A description for the proposal that is visible to voting members, for example,
* "Proposal to add Example Corp. as member."
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* A description for the proposal that is visible to voting members, for example,
* "Proposal to add Example Corp. as member."
*
*
* @return A description for the proposal that is visible to voting members, for example,
* "Proposal to add Example Corp. as member."
*/
public String getDescription() {
return this.description;
}
/**
*
* A description for the proposal that is visible to voting members, for example,
* "Proposal to add Example Corp. as member."
*
*
* @param description
* A description for the proposal that is visible to voting members, for example,
* "Proposal to add Example Corp. as member."
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProposalRequest withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* Tags to assign to the proposal. Each tag consists of a key and optional value.
*
*
* When specifying tags during creation, you can specify multiple key-value pairs in a single request, with an
* overall maximum of 50 tags added to each resource. If the proposal is for a network invitation, the invitation
* inherits the tags added to the proposal.
*
*
* 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 Tags to assign to the proposal. Each tag consists of a key and optional value.
*
* When specifying tags during creation, you can specify multiple key-value pairs in a single request, with
* an overall maximum of 50 tags added to each resource. If the proposal is for a network invitation, the
* invitation inherits the tags added to the proposal.
*
*
* 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 java.util.Map getTags() {
return tags;
}
/**
*
* Tags to assign to the proposal. Each tag consists of a key and optional value.
*
*
* When specifying tags during creation, you can specify multiple key-value pairs in a single request, with an
* overall maximum of 50 tags added to each resource. If the proposal is for a network invitation, the invitation
* inherits the tags added to the proposal.
*
*
* 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 to assign to the proposal. Each tag consists of a key and optional value.
*
* When specifying tags during creation, you can specify multiple key-value pairs in a single request, with
* an overall maximum of 50 tags added to each resource. If the proposal is for a network invitation, the
* invitation inherits the tags added to the proposal.
*
*
* 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 void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* Tags to assign to the proposal. Each tag consists of a key and optional value.
*
*
* When specifying tags during creation, you can specify multiple key-value pairs in a single request, with an
* overall maximum of 50 tags added to each resource. If the proposal is for a network invitation, the invitation
* inherits the tags added to the proposal.
*
*
* 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 to assign to the proposal. Each tag consists of a key and optional value.
*
* When specifying tags during creation, you can specify multiple key-value pairs in a single request, with
* an overall maximum of 50 tags added to each resource. If the proposal is for a network invitation, the
* invitation inherits the tags added to the proposal.
*
*
* 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.
*/
public CreateProposalRequest withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see CreateProposalRequest#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public CreateProposalRequest addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap();
}
if (this.tags.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.tags.put(key, value);
return this;
}
/**
* Removes all the entries added into Tags.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProposalRequest clearTagsEntries() {
this.tags = null;
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getClientRequestToken() != null)
sb.append("ClientRequestToken: ").append(getClientRequestToken()).append(",");
if (getNetworkId() != null)
sb.append("NetworkId: ").append(getNetworkId()).append(",");
if (getMemberId() != null)
sb.append("MemberId: ").append(getMemberId()).append(",");
if (getActions() != null)
sb.append("Actions: ").append(getActions()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateProposalRequest == false)
return false;
CreateProposalRequest other = (CreateProposalRequest) obj;
if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null)
return false;
if (other.getClientRequestToken() != null && other.getClientRequestToken().equals(this.getClientRequestToken()) == false)
return false;
if (other.getNetworkId() == null ^ this.getNetworkId() == null)
return false;
if (other.getNetworkId() != null && other.getNetworkId().equals(this.getNetworkId()) == false)
return false;
if (other.getMemberId() == null ^ this.getMemberId() == null)
return false;
if (other.getMemberId() != null && other.getMemberId().equals(this.getMemberId()) == false)
return false;
if (other.getActions() == null ^ this.getActions() == null)
return false;
if (other.getActions() != null && other.getActions().equals(this.getActions()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode());
hashCode = prime * hashCode + ((getNetworkId() == null) ? 0 : getNetworkId().hashCode());
hashCode = prime * hashCode + ((getMemberId() == null) ? 0 : getMemberId().hashCode());
hashCode = prime * hashCode + ((getActions() == null) ? 0 : getActions().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateProposalRequest clone() {
return (CreateProposalRequest) super.clone();
}
}