
com.amazonaws.services.ram.model.ResourceSharePermissionDetail Maven / Gradle / Ivy
/*
* Copyright 2018-2023 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.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about an RAM permission.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ResourceSharePermissionDetail implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Amazon Resoure Name
* (ARN) of this RAM permission.
*
*/
private String arn;
/**
*
* The version of the permission represented in this structure.
*
*/
private String version;
/**
*
* Specifies whether the version of the permission represented in this structure is the default version for this
* permission.
*
*/
private Boolean defaultVersion;
/**
*
* The name of this permission.
*
*/
private String name;
/**
*
* The resource type to which this permission applies.
*
*/
private String resourceType;
/**
*
* The permission's effect and actions in JSON format. The effect
indicates whether the specified
* actions are allowed or denied. The actions
list the operations to which the principal is granted or
* denied access.
*
*/
private String permission;
/**
*
* The date and time when the permission was created.
*
*/
private java.util.Date creationTime;
/**
*
* The date and time when the permission was last updated.
*
*/
private java.util.Date lastUpdatedTime;
/**
*
* Specifies whether the version of the permission represented in this structure is the default version for all
* resources of this resource type.
*
*/
private Boolean isResourceTypeDefault;
/**
*
* The Amazon Resoure Name
* (ARN) of this RAM permission.
*
*
* @param arn
* The Amazon Resoure
* Name (ARN) of this RAM permission.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The Amazon Resoure Name
* (ARN) of this RAM permission.
*
*
* @return The Amazon Resoure
* Name (ARN) of this RAM permission.
*/
public String getArn() {
return this.arn;
}
/**
*
* The Amazon Resoure Name
* (ARN) of this RAM permission.
*
*
* @param arn
* The Amazon Resoure
* Name (ARN) of this RAM permission.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSharePermissionDetail withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* The version of the permission represented in this structure.
*
*
* @param version
* The version of the permission represented in this structure.
*/
public void setVersion(String version) {
this.version = version;
}
/**
*
* The version of the permission represented in this structure.
*
*
* @return The version of the permission represented in this structure.
*/
public String getVersion() {
return this.version;
}
/**
*
* The version of the permission represented in this structure.
*
*
* @param version
* The version of the permission represented in this structure.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSharePermissionDetail withVersion(String version) {
setVersion(version);
return this;
}
/**
*
* Specifies whether the version of the permission represented in this structure is the default version for this
* permission.
*
*
* @param defaultVersion
* Specifies whether the version of the permission represented in this structure is the default version for
* this permission.
*/
public void setDefaultVersion(Boolean defaultVersion) {
this.defaultVersion = defaultVersion;
}
/**
*
* Specifies whether the version of the permission represented in this structure is the default version for this
* permission.
*
*
* @return Specifies whether the version of the permission represented in this structure is the default version for
* this permission.
*/
public Boolean getDefaultVersion() {
return this.defaultVersion;
}
/**
*
* Specifies whether the version of the permission represented in this structure is the default version for this
* permission.
*
*
* @param defaultVersion
* Specifies whether the version of the permission represented in this structure is the default version for
* this permission.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSharePermissionDetail withDefaultVersion(Boolean defaultVersion) {
setDefaultVersion(defaultVersion);
return this;
}
/**
*
* Specifies whether the version of the permission represented in this structure is the default version for this
* permission.
*
*
* @return Specifies whether the version of the permission represented in this structure is the default version for
* this permission.
*/
public Boolean isDefaultVersion() {
return this.defaultVersion;
}
/**
*
* The name of this permission.
*
*
* @param name
* The name of this permission.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of this permission.
*
*
* @return The name of this permission.
*/
public String getName() {
return this.name;
}
/**
*
* The name of this permission.
*
*
* @param name
* The name of this permission.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSharePermissionDetail withName(String name) {
setName(name);
return this;
}
/**
*
* The resource type to which this permission applies.
*
*
* @param resourceType
* The resource type to which this permission applies.
*/
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
/**
*
* The resource type to which this permission applies.
*
*
* @return The resource type to which this permission applies.
*/
public String getResourceType() {
return this.resourceType;
}
/**
*
* The resource type to which this permission applies.
*
*
* @param resourceType
* The resource type to which this permission applies.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSharePermissionDetail withResourceType(String resourceType) {
setResourceType(resourceType);
return this;
}
/**
*
* The permission's effect and actions in JSON format. The effect
indicates whether the specified
* actions are allowed or denied. The actions
list the operations to which the principal is granted or
* denied access.
*
*
* @param permission
* The permission's effect and actions in JSON format. The effect
indicates whether the
* specified actions are allowed or denied. The actions
list the operations to which the
* principal is granted or denied access.
*/
public void setPermission(String permission) {
this.permission = permission;
}
/**
*
* The permission's effect and actions in JSON format. The effect
indicates whether the specified
* actions are allowed or denied. The actions
list the operations to which the principal is granted or
* denied access.
*
*
* @return The permission's effect and actions in JSON format. The effect
indicates whether the
* specified actions are allowed or denied. The actions
list the operations to which the
* principal is granted or denied access.
*/
public String getPermission() {
return this.permission;
}
/**
*
* The permission's effect and actions in JSON format. The effect
indicates whether the specified
* actions are allowed or denied. The actions
list the operations to which the principal is granted or
* denied access.
*
*
* @param permission
* The permission's effect and actions in JSON format. The effect
indicates whether the
* specified actions are allowed or denied. The actions
list the operations to which the
* principal is granted or denied access.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSharePermissionDetail withPermission(String permission) {
setPermission(permission);
return this;
}
/**
*
* The date and time when the permission was created.
*
*
* @param creationTime
* The date and time when the permission was created.
*/
public void setCreationTime(java.util.Date creationTime) {
this.creationTime = creationTime;
}
/**
*
* The date and time when the permission was created.
*
*
* @return The date and time when the permission was created.
*/
public java.util.Date getCreationTime() {
return this.creationTime;
}
/**
*
* The date and time when the permission was created.
*
*
* @param creationTime
* The date and time when the permission was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSharePermissionDetail withCreationTime(java.util.Date creationTime) {
setCreationTime(creationTime);
return this;
}
/**
*
* The date and time when the permission was last updated.
*
*
* @param lastUpdatedTime
* The date and time when the permission was last updated.
*/
public void setLastUpdatedTime(java.util.Date lastUpdatedTime) {
this.lastUpdatedTime = lastUpdatedTime;
}
/**
*
* The date and time when the permission was last updated.
*
*
* @return The date and time when the permission was last updated.
*/
public java.util.Date getLastUpdatedTime() {
return this.lastUpdatedTime;
}
/**
*
* The date and time when the permission was last updated.
*
*
* @param lastUpdatedTime
* The date and time when the permission was last updated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSharePermissionDetail withLastUpdatedTime(java.util.Date lastUpdatedTime) {
setLastUpdatedTime(lastUpdatedTime);
return this;
}
/**
*
* Specifies whether the version of the permission represented in this structure is the default version for all
* resources of this resource type.
*
*
* @param isResourceTypeDefault
* Specifies whether the version of the permission represented in this structure is the default version for
* all resources of this resource type.
*/
public void setIsResourceTypeDefault(Boolean isResourceTypeDefault) {
this.isResourceTypeDefault = isResourceTypeDefault;
}
/**
*
* Specifies whether the version of the permission represented in this structure is the default version for all
* resources of this resource type.
*
*
* @return Specifies whether the version of the permission represented in this structure is the default version for
* all resources of this resource type.
*/
public Boolean getIsResourceTypeDefault() {
return this.isResourceTypeDefault;
}
/**
*
* Specifies whether the version of the permission represented in this structure is the default version for all
* resources of this resource type.
*
*
* @param isResourceTypeDefault
* Specifies whether the version of the permission represented in this structure is the default version for
* all resources of this resource type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSharePermissionDetail withIsResourceTypeDefault(Boolean isResourceTypeDefault) {
setIsResourceTypeDefault(isResourceTypeDefault);
return this;
}
/**
*
* Specifies whether the version of the permission represented in this structure is the default version for all
* resources of this resource type.
*
*
* @return Specifies whether the version of the permission represented in this structure is the default version for
* all resources of this resource type.
*/
public Boolean isResourceTypeDefault() {
return this.isResourceTypeDefault;
}
/**
* 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 (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getVersion() != null)
sb.append("Version: ").append(getVersion()).append(",");
if (getDefaultVersion() != null)
sb.append("DefaultVersion: ").append(getDefaultVersion()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getResourceType() != null)
sb.append("ResourceType: ").append(getResourceType()).append(",");
if (getPermission() != null)
sb.append("Permission: ").append(getPermission()).append(",");
if (getCreationTime() != null)
sb.append("CreationTime: ").append(getCreationTime()).append(",");
if (getLastUpdatedTime() != null)
sb.append("LastUpdatedTime: ").append(getLastUpdatedTime()).append(",");
if (getIsResourceTypeDefault() != null)
sb.append("IsResourceTypeDefault: ").append(getIsResourceTypeDefault());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ResourceSharePermissionDetail == false)
return false;
ResourceSharePermissionDetail other = (ResourceSharePermissionDetail) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getVersion() == null ^ this.getVersion() == null)
return false;
if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false)
return false;
if (other.getDefaultVersion() == null ^ this.getDefaultVersion() == null)
return false;
if (other.getDefaultVersion() != null && other.getDefaultVersion().equals(this.getDefaultVersion()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getResourceType() == null ^ this.getResourceType() == null)
return false;
if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == false)
return false;
if (other.getPermission() == null ^ this.getPermission() == null)
return false;
if (other.getPermission() != null && other.getPermission().equals(this.getPermission()) == false)
return false;
if (other.getCreationTime() == null ^ this.getCreationTime() == null)
return false;
if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false)
return false;
if (other.getLastUpdatedTime() == null ^ this.getLastUpdatedTime() == null)
return false;
if (other.getLastUpdatedTime() != null && other.getLastUpdatedTime().equals(this.getLastUpdatedTime()) == false)
return false;
if (other.getIsResourceTypeDefault() == null ^ this.getIsResourceTypeDefault() == null)
return false;
if (other.getIsResourceTypeDefault() != null && other.getIsResourceTypeDefault().equals(this.getIsResourceTypeDefault()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode());
hashCode = prime * hashCode + ((getDefaultVersion() == null) ? 0 : getDefaultVersion().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode());
hashCode = prime * hashCode + ((getPermission() == null) ? 0 : getPermission().hashCode());
hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
hashCode = prime * hashCode + ((getLastUpdatedTime() == null) ? 0 : getLastUpdatedTime().hashCode());
hashCode = prime * hashCode + ((getIsResourceTypeDefault() == null) ? 0 : getIsResourceTypeDefault().hashCode());
return hashCode;
}
@Override
public ResourceSharePermissionDetail clone() {
try {
return (ResourceSharePermissionDetail) 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.ram.model.transform.ResourceSharePermissionDetailMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}