
com.amazonaws.services.managedblockchain.model.Invitation 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.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* An invitation to an AWS account to create a member and join the network.
*
*
* Applies only to Hyperledger Fabric.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Invitation implements Serializable, Cloneable, StructuredPojo {
/**
*
* The unique identifier for the invitation.
*
*/
private String invitationId;
/**
*
* The date and time that the invitation was created.
*
*/
private java.util.Date creationDate;
/**
*
* The date and time that the invitation expires. This is the CreationDate
plus the
* ProposalDurationInHours
that is specified in the ProposalThresholdPolicy
. After this
* date and time, the invitee can no longer create a member and join the network using this
* InvitationId
.
*
*/
private java.util.Date expirationDate;
/**
*
* The status of the invitation:
*
*
* -
*
* PENDING
- The invitee has not created a member to join the network, and the invitation has not yet
* expired.
*
*
* -
*
* ACCEPTING
- The invitee has begun creating a member, and creation has not yet completed.
*
*
* -
*
* ACCEPTED
- The invitee created a member and joined the network using the InvitationID
.
*
*
* -
*
* REJECTED
- The invitee rejected the invitation.
*
*
* -
*
* EXPIRED
- The invitee neither created a member nor rejected the invitation before the
* ExpirationDate
.
*
*
*
*/
private String status;
private NetworkSummary networkSummary;
/**
*
* The Amazon Resource Name (ARN) of the invitation. For more information about ARNs and their format, see Amazon Resource Names
* (ARNs) in the AWS General Reference.
*
*/
private String arn;
/**
*
* The unique identifier for the invitation.
*
*
* @param invitationId
* The unique identifier for the invitation.
*/
public void setInvitationId(String invitationId) {
this.invitationId = invitationId;
}
/**
*
* The unique identifier for the invitation.
*
*
* @return The unique identifier for the invitation.
*/
public String getInvitationId() {
return this.invitationId;
}
/**
*
* The unique identifier for the invitation.
*
*
* @param invitationId
* The unique identifier for the invitation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Invitation withInvitationId(String invitationId) {
setInvitationId(invitationId);
return this;
}
/**
*
* The date and time that the invitation was created.
*
*
* @param creationDate
* The date and time that the invitation was created.
*/
public void setCreationDate(java.util.Date creationDate) {
this.creationDate = creationDate;
}
/**
*
* The date and time that the invitation was created.
*
*
* @return The date and time that the invitation was created.
*/
public java.util.Date getCreationDate() {
return this.creationDate;
}
/**
*
* The date and time that the invitation was created.
*
*
* @param creationDate
* The date and time that the invitation was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Invitation withCreationDate(java.util.Date creationDate) {
setCreationDate(creationDate);
return this;
}
/**
*
* The date and time that the invitation expires. This is the CreationDate
plus the
* ProposalDurationInHours
that is specified in the ProposalThresholdPolicy
. After this
* date and time, the invitee can no longer create a member and join the network using this
* InvitationId
.
*
*
* @param expirationDate
* The date and time that the invitation expires. This is the CreationDate
plus the
* ProposalDurationInHours
that is specified in the ProposalThresholdPolicy
. After
* this date and time, the invitee can no longer create a member and join the network using this
* InvitationId
.
*/
public void setExpirationDate(java.util.Date expirationDate) {
this.expirationDate = expirationDate;
}
/**
*
* The date and time that the invitation expires. This is the CreationDate
plus the
* ProposalDurationInHours
that is specified in the ProposalThresholdPolicy
. After this
* date and time, the invitee can no longer create a member and join the network using this
* InvitationId
.
*
*
* @return The date and time that the invitation expires. This is the CreationDate
plus the
* ProposalDurationInHours
that is specified in the ProposalThresholdPolicy
. After
* this date and time, the invitee can no longer create a member and join the network using this
* InvitationId
.
*/
public java.util.Date getExpirationDate() {
return this.expirationDate;
}
/**
*
* The date and time that the invitation expires. This is the CreationDate
plus the
* ProposalDurationInHours
that is specified in the ProposalThresholdPolicy
. After this
* date and time, the invitee can no longer create a member and join the network using this
* InvitationId
.
*
*
* @param expirationDate
* The date and time that the invitation expires. This is the CreationDate
plus the
* ProposalDurationInHours
that is specified in the ProposalThresholdPolicy
. After
* this date and time, the invitee can no longer create a member and join the network using this
* InvitationId
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Invitation withExpirationDate(java.util.Date expirationDate) {
setExpirationDate(expirationDate);
return this;
}
/**
*
* The status of the invitation:
*
*
* -
*
* PENDING
- The invitee has not created a member to join the network, and the invitation has not yet
* expired.
*
*
* -
*
* ACCEPTING
- The invitee has begun creating a member, and creation has not yet completed.
*
*
* -
*
* ACCEPTED
- The invitee created a member and joined the network using the InvitationID
.
*
*
* -
*
* REJECTED
- The invitee rejected the invitation.
*
*
* -
*
* EXPIRED
- The invitee neither created a member nor rejected the invitation before the
* ExpirationDate
.
*
*
*
*
* @param status
* The status of the invitation:
*
* -
*
* PENDING
- The invitee has not created a member to join the network, and the invitation has
* not yet expired.
*
*
* -
*
* ACCEPTING
- The invitee has begun creating a member, and creation has not yet completed.
*
*
* -
*
* ACCEPTED
- The invitee created a member and joined the network using the
* InvitationID
.
*
*
* -
*
* REJECTED
- The invitee rejected the invitation.
*
*
* -
*
* EXPIRED
- The invitee neither created a member nor rejected the invitation before the
* ExpirationDate
.
*
*
* @see InvitationStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the invitation:
*
*
* -
*
* PENDING
- The invitee has not created a member to join the network, and the invitation has not yet
* expired.
*
*
* -
*
* ACCEPTING
- The invitee has begun creating a member, and creation has not yet completed.
*
*
* -
*
* ACCEPTED
- The invitee created a member and joined the network using the InvitationID
.
*
*
* -
*
* REJECTED
- The invitee rejected the invitation.
*
*
* -
*
* EXPIRED
- The invitee neither created a member nor rejected the invitation before the
* ExpirationDate
.
*
*
*
*
* @return The status of the invitation:
*
* -
*
* PENDING
- The invitee has not created a member to join the network, and the invitation has
* not yet expired.
*
*
* -
*
* ACCEPTING
- The invitee has begun creating a member, and creation has not yet completed.
*
*
* -
*
* ACCEPTED
- The invitee created a member and joined the network using the
* InvitationID
.
*
*
* -
*
* REJECTED
- The invitee rejected the invitation.
*
*
* -
*
* EXPIRED
- The invitee neither created a member nor rejected the invitation before the
* ExpirationDate
.
*
*
* @see InvitationStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the invitation:
*
*
* -
*
* PENDING
- The invitee has not created a member to join the network, and the invitation has not yet
* expired.
*
*
* -
*
* ACCEPTING
- The invitee has begun creating a member, and creation has not yet completed.
*
*
* -
*
* ACCEPTED
- The invitee created a member and joined the network using the InvitationID
.
*
*
* -
*
* REJECTED
- The invitee rejected the invitation.
*
*
* -
*
* EXPIRED
- The invitee neither created a member nor rejected the invitation before the
* ExpirationDate
.
*
*
*
*
* @param status
* The status of the invitation:
*
* -
*
* PENDING
- The invitee has not created a member to join the network, and the invitation has
* not yet expired.
*
*
* -
*
* ACCEPTING
- The invitee has begun creating a member, and creation has not yet completed.
*
*
* -
*
* ACCEPTED
- The invitee created a member and joined the network using the
* InvitationID
.
*
*
* -
*
* REJECTED
- The invitee rejected the invitation.
*
*
* -
*
* EXPIRED
- The invitee neither created a member nor rejected the invitation before the
* ExpirationDate
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see InvitationStatus
*/
public Invitation withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The status of the invitation:
*
*
* -
*
* PENDING
- The invitee has not created a member to join the network, and the invitation has not yet
* expired.
*
*
* -
*
* ACCEPTING
- The invitee has begun creating a member, and creation has not yet completed.
*
*
* -
*
* ACCEPTED
- The invitee created a member and joined the network using the InvitationID
.
*
*
* -
*
* REJECTED
- The invitee rejected the invitation.
*
*
* -
*
* EXPIRED
- The invitee neither created a member nor rejected the invitation before the
* ExpirationDate
.
*
*
*
*
* @param status
* The status of the invitation:
*
* -
*
* PENDING
- The invitee has not created a member to join the network, and the invitation has
* not yet expired.
*
*
* -
*
* ACCEPTING
- The invitee has begun creating a member, and creation has not yet completed.
*
*
* -
*
* ACCEPTED
- The invitee created a member and joined the network using the
* InvitationID
.
*
*
* -
*
* REJECTED
- The invitee rejected the invitation.
*
*
* -
*
* EXPIRED
- The invitee neither created a member nor rejected the invitation before the
* ExpirationDate
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see InvitationStatus
*/
public Invitation withStatus(InvitationStatus status) {
this.status = status.toString();
return this;
}
/**
* @param networkSummary
*/
public void setNetworkSummary(NetworkSummary networkSummary) {
this.networkSummary = networkSummary;
}
/**
* @return
*/
public NetworkSummary getNetworkSummary() {
return this.networkSummary;
}
/**
* @param networkSummary
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Invitation withNetworkSummary(NetworkSummary networkSummary) {
setNetworkSummary(networkSummary);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the invitation. 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 invitation. For more information about ARNs and their format, see Amazon Resource Names
* (ARNs) in the AWS General Reference.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The Amazon Resource Name (ARN) of the invitation. 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 invitation. For more information about ARNs and their format, see
* Amazon Resource
* Names (ARNs) in the AWS General Reference.
*/
public String getArn() {
return this.arn;
}
/**
*
* The Amazon Resource Name (ARN) of the invitation. 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 invitation. 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.
*/
public Invitation withArn(String arn) {
setArn(arn);
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 (getInvitationId() != null)
sb.append("InvitationId: ").append(getInvitationId()).append(",");
if (getCreationDate() != null)
sb.append("CreationDate: ").append(getCreationDate()).append(",");
if (getExpirationDate() != null)
sb.append("ExpirationDate: ").append(getExpirationDate()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getNetworkSummary() != null)
sb.append("NetworkSummary: ").append(getNetworkSummary()).append(",");
if (getArn() != null)
sb.append("Arn: ").append(getArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Invitation == false)
return false;
Invitation other = (Invitation) obj;
if (other.getInvitationId() == null ^ this.getInvitationId() == null)
return false;
if (other.getInvitationId() != null && other.getInvitationId().equals(this.getInvitationId()) == false)
return false;
if (other.getCreationDate() == null ^ this.getCreationDate() == null)
return false;
if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == false)
return false;
if (other.getExpirationDate() == null ^ this.getExpirationDate() == null)
return false;
if (other.getExpirationDate() != null && other.getExpirationDate().equals(this.getExpirationDate()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getNetworkSummary() == null ^ this.getNetworkSummary() == null)
return false;
if (other.getNetworkSummary() != null && other.getNetworkSummary().equals(this.getNetworkSummary()) == false)
return false;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getInvitationId() == null) ? 0 : getInvitationId().hashCode());
hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode());
hashCode = prime * hashCode + ((getExpirationDate() == null) ? 0 : getExpirationDate().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getNetworkSummary() == null) ? 0 : getNetworkSummary().hashCode());
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
return hashCode;
}
@Override
public Invitation clone() {
try {
return (Invitation) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.managedblockchain.model.transform.InvitationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}