
com.amazonaws.services.ram.model.GetResourceShareAssociationsRequest Maven / Gradle / Ivy
/*
* Copyright 2016-2021 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.ram.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 GetResourceShareAssociationsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The association type. Specify PRINCIPAL
to list the principals that are associated with the
* specified resource share. Specify RESOURCE
to list the resources that are associated with the
* specified resource share.
*
*/
private String associationType;
/**
*
* The Amazon Resource Names (ARN) of the resource shares.
*
*/
private java.util.List resourceShareArns;
/**
*
* The Amazon Resource Name (ARN) of the resource. You cannot specify this parameter if the association type is
* PRINCIPAL
.
*
*/
private String resourceArn;
/**
*
* The principal. You cannot specify this parameter if the association type is RESOURCE
.
*
*/
private String principal;
/**
*
* The association status.
*
*/
private String associationStatus;
/**
*
* The token for the next page of results.
*
*/
private String nextToken;
/**
*
* The maximum number of results to return with a single call. To retrieve the remaining results, make another call
* with the returned nextToken
value.
*
*/
private Integer maxResults;
/**
*
* The association type. Specify PRINCIPAL
to list the principals that are associated with the
* specified resource share. Specify RESOURCE
to list the resources that are associated with the
* specified resource share.
*
*
* @param associationType
* The association type. Specify PRINCIPAL
to list the principals that are associated with the
* specified resource share. Specify RESOURCE
to list the resources that are associated with the
* specified resource share.
* @see ResourceShareAssociationType
*/
public void setAssociationType(String associationType) {
this.associationType = associationType;
}
/**
*
* The association type. Specify PRINCIPAL
to list the principals that are associated with the
* specified resource share. Specify RESOURCE
to list the resources that are associated with the
* specified resource share.
*
*
* @return The association type. Specify PRINCIPAL
to list the principals that are associated with the
* specified resource share. Specify RESOURCE
to list the resources that are associated with
* the specified resource share.
* @see ResourceShareAssociationType
*/
public String getAssociationType() {
return this.associationType;
}
/**
*
* The association type. Specify PRINCIPAL
to list the principals that are associated with the
* specified resource share. Specify RESOURCE
to list the resources that are associated with the
* specified resource share.
*
*
* @param associationType
* The association type. Specify PRINCIPAL
to list the principals that are associated with the
* specified resource share. Specify RESOURCE
to list the resources that are associated with the
* specified resource share.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceShareAssociationType
*/
public GetResourceShareAssociationsRequest withAssociationType(String associationType) {
setAssociationType(associationType);
return this;
}
/**
*
* The association type. Specify PRINCIPAL
to list the principals that are associated with the
* specified resource share. Specify RESOURCE
to list the resources that are associated with the
* specified resource share.
*
*
* @param associationType
* The association type. Specify PRINCIPAL
to list the principals that are associated with the
* specified resource share. Specify RESOURCE
to list the resources that are associated with the
* specified resource share.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceShareAssociationType
*/
public GetResourceShareAssociationsRequest withAssociationType(ResourceShareAssociationType associationType) {
this.associationType = associationType.toString();
return this;
}
/**
*
* The Amazon Resource Names (ARN) of the resource shares.
*
*
* @return The Amazon Resource Names (ARN) of the resource shares.
*/
public java.util.List getResourceShareArns() {
return resourceShareArns;
}
/**
*
* The Amazon Resource Names (ARN) of the resource shares.
*
*
* @param resourceShareArns
* The Amazon Resource Names (ARN) of the resource shares.
*/
public void setResourceShareArns(java.util.Collection resourceShareArns) {
if (resourceShareArns == null) {
this.resourceShareArns = null;
return;
}
this.resourceShareArns = new java.util.ArrayList(resourceShareArns);
}
/**
*
* The Amazon Resource Names (ARN) of the resource shares.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResourceShareArns(java.util.Collection)} or {@link #withResourceShareArns(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param resourceShareArns
* The Amazon Resource Names (ARN) of the resource shares.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetResourceShareAssociationsRequest withResourceShareArns(String... resourceShareArns) {
if (this.resourceShareArns == null) {
setResourceShareArns(new java.util.ArrayList(resourceShareArns.length));
}
for (String ele : resourceShareArns) {
this.resourceShareArns.add(ele);
}
return this;
}
/**
*
* The Amazon Resource Names (ARN) of the resource shares.
*
*
* @param resourceShareArns
* The Amazon Resource Names (ARN) of the resource shares.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetResourceShareAssociationsRequest withResourceShareArns(java.util.Collection resourceShareArns) {
setResourceShareArns(resourceShareArns);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the resource. You cannot specify this parameter if the association type is
* PRINCIPAL
.
*
*
* @param resourceArn
* The Amazon Resource Name (ARN) of the resource. You cannot specify this parameter if the association type
* is PRINCIPAL
.
*/
public void setResourceArn(String resourceArn) {
this.resourceArn = resourceArn;
}
/**
*
* The Amazon Resource Name (ARN) of the resource. You cannot specify this parameter if the association type is
* PRINCIPAL
.
*
*
* @return The Amazon Resource Name (ARN) of the resource. You cannot specify this parameter if the association type
* is PRINCIPAL
.
*/
public String getResourceArn() {
return this.resourceArn;
}
/**
*
* The Amazon Resource Name (ARN) of the resource. You cannot specify this parameter if the association type is
* PRINCIPAL
.
*
*
* @param resourceArn
* The Amazon Resource Name (ARN) of the resource. You cannot specify this parameter if the association type
* is PRINCIPAL
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetResourceShareAssociationsRequest withResourceArn(String resourceArn) {
setResourceArn(resourceArn);
return this;
}
/**
*
* The principal. You cannot specify this parameter if the association type is RESOURCE
.
*
*
* @param principal
* The principal. You cannot specify this parameter if the association type is RESOURCE
.
*/
public void setPrincipal(String principal) {
this.principal = principal;
}
/**
*
* The principal. You cannot specify this parameter if the association type is RESOURCE
.
*
*
* @return The principal. You cannot specify this parameter if the association type is RESOURCE
.
*/
public String getPrincipal() {
return this.principal;
}
/**
*
* The principal. You cannot specify this parameter if the association type is RESOURCE
.
*
*
* @param principal
* The principal. You cannot specify this parameter if the association type is RESOURCE
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetResourceShareAssociationsRequest withPrincipal(String principal) {
setPrincipal(principal);
return this;
}
/**
*
* The association status.
*
*
* @param associationStatus
* The association status.
* @see ResourceShareAssociationStatus
*/
public void setAssociationStatus(String associationStatus) {
this.associationStatus = associationStatus;
}
/**
*
* The association status.
*
*
* @return The association status.
* @see ResourceShareAssociationStatus
*/
public String getAssociationStatus() {
return this.associationStatus;
}
/**
*
* The association status.
*
*
* @param associationStatus
* The association status.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceShareAssociationStatus
*/
public GetResourceShareAssociationsRequest withAssociationStatus(String associationStatus) {
setAssociationStatus(associationStatus);
return this;
}
/**
*
* The association status.
*
*
* @param associationStatus
* The association status.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceShareAssociationStatus
*/
public GetResourceShareAssociationsRequest withAssociationStatus(ResourceShareAssociationStatus associationStatus) {
this.associationStatus = associationStatus.toString();
return this;
}
/**
*
* The token for the next page of results.
*
*
* @param nextToken
* The token for the next page of results.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* The token for the next page of results.
*
*
* @return The token for the next page of results.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* The token for the next page of results.
*
*
* @param nextToken
* The token for the next page of results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetResourceShareAssociationsRequest withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
*
* The maximum number of results to return with a single call. To retrieve the remaining results, make another call
* with the returned nextToken
value.
*
*
* @param maxResults
* The maximum number of results to return with a single call. To retrieve the remaining results, make
* another call with the returned nextToken
value.
*/
public void setMaxResults(Integer maxResults) {
this.maxResults = maxResults;
}
/**
*
* The maximum number of results to return with a single call. To retrieve the remaining results, make another call
* with the returned nextToken
value.
*
*
* @return The maximum number of results to return with a single call. To retrieve the remaining results, make
* another call with the returned nextToken
value.
*/
public Integer getMaxResults() {
return this.maxResults;
}
/**
*
* The maximum number of results to return with a single call. To retrieve the remaining results, make another call
* with the returned nextToken
value.
*
*
* @param maxResults
* The maximum number of results to return with a single call. To retrieve the remaining results, make
* another call with the returned nextToken
value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetResourceShareAssociationsRequest withMaxResults(Integer maxResults) {
setMaxResults(maxResults);
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 (getAssociationType() != null)
sb.append("AssociationType: ").append(getAssociationType()).append(",");
if (getResourceShareArns() != null)
sb.append("ResourceShareArns: ").append(getResourceShareArns()).append(",");
if (getResourceArn() != null)
sb.append("ResourceArn: ").append(getResourceArn()).append(",");
if (getPrincipal() != null)
sb.append("Principal: ").append(getPrincipal()).append(",");
if (getAssociationStatus() != null)
sb.append("AssociationStatus: ").append(getAssociationStatus()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken()).append(",");
if (getMaxResults() != null)
sb.append("MaxResults: ").append(getMaxResults());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetResourceShareAssociationsRequest == false)
return false;
GetResourceShareAssociationsRequest other = (GetResourceShareAssociationsRequest) obj;
if (other.getAssociationType() == null ^ this.getAssociationType() == null)
return false;
if (other.getAssociationType() != null && other.getAssociationType().equals(this.getAssociationType()) == false)
return false;
if (other.getResourceShareArns() == null ^ this.getResourceShareArns() == null)
return false;
if (other.getResourceShareArns() != null && other.getResourceShareArns().equals(this.getResourceShareArns()) == false)
return false;
if (other.getResourceArn() == null ^ this.getResourceArn() == null)
return false;
if (other.getResourceArn() != null && other.getResourceArn().equals(this.getResourceArn()) == false)
return false;
if (other.getPrincipal() == null ^ this.getPrincipal() == null)
return false;
if (other.getPrincipal() != null && other.getPrincipal().equals(this.getPrincipal()) == false)
return false;
if (other.getAssociationStatus() == null ^ this.getAssociationStatus() == null)
return false;
if (other.getAssociationStatus() != null && other.getAssociationStatus().equals(this.getAssociationStatus()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
if (other.getMaxResults() == null ^ this.getMaxResults() == null)
return false;
if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAssociationType() == null) ? 0 : getAssociationType().hashCode());
hashCode = prime * hashCode + ((getResourceShareArns() == null) ? 0 : getResourceShareArns().hashCode());
hashCode = prime * hashCode + ((getResourceArn() == null) ? 0 : getResourceArn().hashCode());
hashCode = prime * hashCode + ((getPrincipal() == null) ? 0 : getPrincipal().hashCode());
hashCode = prime * hashCode + ((getAssociationStatus() == null) ? 0 : getAssociationStatus().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
return hashCode;
}
@Override
public GetResourceShareAssociationsRequest clone() {
return (GetResourceShareAssociationsRequest) super.clone();
}
}