
com.amazonaws.services.ram.model.AssociateResourceSharePermissionRequest 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 AssociateResourceSharePermissionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) of the resource share.
*
*/
private String resourceShareArn;
/**
*
* The Amazon Resource Name (ARN) of the RAM permission to associate with the resource share.
*
*/
private String permissionArn;
/**
*
* Indicates whether the permission should replace the permissions that are currently associated with the resource
* share. Use true
to replace the current permissions. Use false
to add the permission to
* the current permission.
*
*/
private Boolean replace;
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*
*/
private String clientToken;
/**
*
* The version of the RAM permissions to associate with the resource share.
*
*/
private Integer permissionVersion;
/**
*
* The Amazon Resource Name (ARN) of the resource share.
*
*
* @param resourceShareArn
* The Amazon Resource Name (ARN) of the resource share.
*/
public void setResourceShareArn(String resourceShareArn) {
this.resourceShareArn = resourceShareArn;
}
/**
*
* The Amazon Resource Name (ARN) of the resource share.
*
*
* @return The Amazon Resource Name (ARN) of the resource share.
*/
public String getResourceShareArn() {
return this.resourceShareArn;
}
/**
*
* The Amazon Resource Name (ARN) of the resource share.
*
*
* @param resourceShareArn
* The Amazon Resource Name (ARN) of the resource share.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociateResourceSharePermissionRequest withResourceShareArn(String resourceShareArn) {
setResourceShareArn(resourceShareArn);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the RAM permission to associate with the resource share.
*
*
* @param permissionArn
* The Amazon Resource Name (ARN) of the RAM permission to associate with the resource share.
*/
public void setPermissionArn(String permissionArn) {
this.permissionArn = permissionArn;
}
/**
*
* The Amazon Resource Name (ARN) of the RAM permission to associate with the resource share.
*
*
* @return The Amazon Resource Name (ARN) of the RAM permission to associate with the resource share.
*/
public String getPermissionArn() {
return this.permissionArn;
}
/**
*
* The Amazon Resource Name (ARN) of the RAM permission to associate with the resource share.
*
*
* @param permissionArn
* The Amazon Resource Name (ARN) of the RAM permission to associate with the resource share.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociateResourceSharePermissionRequest withPermissionArn(String permissionArn) {
setPermissionArn(permissionArn);
return this;
}
/**
*
* Indicates whether the permission should replace the permissions that are currently associated with the resource
* share. Use true
to replace the current permissions. Use false
to add the permission to
* the current permission.
*
*
* @param replace
* Indicates whether the permission should replace the permissions that are currently associated with the
* resource share. Use true
to replace the current permissions. Use false
to add
* the permission to the current permission.
*/
public void setReplace(Boolean replace) {
this.replace = replace;
}
/**
*
* Indicates whether the permission should replace the permissions that are currently associated with the resource
* share. Use true
to replace the current permissions. Use false
to add the permission to
* the current permission.
*
*
* @return Indicates whether the permission should replace the permissions that are currently associated with the
* resource share. Use true
to replace the current permissions. Use false
to add
* the permission to the current permission.
*/
public Boolean getReplace() {
return this.replace;
}
/**
*
* Indicates whether the permission should replace the permissions that are currently associated with the resource
* share. Use true
to replace the current permissions. Use false
to add the permission to
* the current permission.
*
*
* @param replace
* Indicates whether the permission should replace the permissions that are currently associated with the
* resource share. Use true
to replace the current permissions. Use false
to add
* the permission to the current permission.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociateResourceSharePermissionRequest withReplace(Boolean replace) {
setReplace(replace);
return this;
}
/**
*
* Indicates whether the permission should replace the permissions that are currently associated with the resource
* share. Use true
to replace the current permissions. Use false
to add the permission to
* the current permission.
*
*
* @return Indicates whether the permission should replace the permissions that are currently associated with the
* resource share. Use true
to replace the current permissions. Use false
to add
* the permission to the current permission.
*/
public Boolean isReplace() {
return this.replace;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*
*
* @param clientToken
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*
*
* @return A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*
*
* @param clientToken
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociateResourceSharePermissionRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
*
* The version of the RAM permissions to associate with the resource share.
*
*
* @param permissionVersion
* The version of the RAM permissions to associate with the resource share.
*/
public void setPermissionVersion(Integer permissionVersion) {
this.permissionVersion = permissionVersion;
}
/**
*
* The version of the RAM permissions to associate with the resource share.
*
*
* @return The version of the RAM permissions to associate with the resource share.
*/
public Integer getPermissionVersion() {
return this.permissionVersion;
}
/**
*
* The version of the RAM permissions to associate with the resource share.
*
*
* @param permissionVersion
* The version of the RAM permissions to associate with the resource share.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociateResourceSharePermissionRequest withPermissionVersion(Integer permissionVersion) {
setPermissionVersion(permissionVersion);
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 (getResourceShareArn() != null)
sb.append("ResourceShareArn: ").append(getResourceShareArn()).append(",");
if (getPermissionArn() != null)
sb.append("PermissionArn: ").append(getPermissionArn()).append(",");
if (getReplace() != null)
sb.append("Replace: ").append(getReplace()).append(",");
if (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken()).append(",");
if (getPermissionVersion() != null)
sb.append("PermissionVersion: ").append(getPermissionVersion());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AssociateResourceSharePermissionRequest == false)
return false;
AssociateResourceSharePermissionRequest other = (AssociateResourceSharePermissionRequest) obj;
if (other.getResourceShareArn() == null ^ this.getResourceShareArn() == null)
return false;
if (other.getResourceShareArn() != null && other.getResourceShareArn().equals(this.getResourceShareArn()) == false)
return false;
if (other.getPermissionArn() == null ^ this.getPermissionArn() == null)
return false;
if (other.getPermissionArn() != null && other.getPermissionArn().equals(this.getPermissionArn()) == false)
return false;
if (other.getReplace() == null ^ this.getReplace() == null)
return false;
if (other.getReplace() != null && other.getReplace().equals(this.getReplace()) == false)
return false;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false)
return false;
if (other.getPermissionVersion() == null ^ this.getPermissionVersion() == null)
return false;
if (other.getPermissionVersion() != null && other.getPermissionVersion().equals(this.getPermissionVersion()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getResourceShareArn() == null) ? 0 : getResourceShareArn().hashCode());
hashCode = prime * hashCode + ((getPermissionArn() == null) ? 0 : getPermissionArn().hashCode());
hashCode = prime * hashCode + ((getReplace() == null) ? 0 : getReplace().hashCode());
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
hashCode = prime * hashCode + ((getPermissionVersion() == null) ? 0 : getPermissionVersion().hashCode());
return hashCode;
}
@Override
public AssociateResourceSharePermissionRequest clone() {
return (AssociateResourceSharePermissionRequest) super.clone();
}
}