/* * 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.quicksight.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Information about a dataset that contains permissions for row-level security (RLS). The permissions dataset maps * fields to users or groups. For more information, see Using Row-Level Security (RLS) to Restrict Access to a Dataset in the Amazon QuickSight User Guide. *
*
* The option to deny permissions by setting PermissionPolicy
to DENY_ACCESS
is not supported
* for new RLS datasets.
*
* The namespace associated with the dataset that contains permissions for RLS. *
*/ private String namespace; /** ** The Amazon Resource Name (ARN) of the dataset that contains permissions for RLS. *
*/ private String arn; /** *
* The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS
is included
* for backward compatibility only.
*
* The user or group rules associated with the dataset that contains permissions for RLS. *
*
* By default, FormatVersion
is VERSION_1
. When FormatVersion
is
* VERSION_1
, UserName
and GroupName
are required. When
* FormatVersion
is VERSION_2
, UserARN
and GroupARN
are
* required, and Namespace
must not exist.
*
* The status of the row-level security permission dataset. If enabled, the status is ENABLED
. If
* disabled, the status is DISABLED
.
*
* The namespace associated with the dataset that contains permissions for RLS. *
* * @param namespace * The namespace associated with the dataset that contains permissions for RLS. */ public void setNamespace(String namespace) { this.namespace = namespace; } /** ** The namespace associated with the dataset that contains permissions for RLS. *
* * @return The namespace associated with the dataset that contains permissions for RLS. */ public String getNamespace() { return this.namespace; } /** ** The namespace associated with the dataset that contains permissions for RLS. *
* * @param namespace * The namespace associated with the dataset that contains permissions for RLS. * @return Returns a reference to this object so that method calls can be chained together. */ public RowLevelPermissionDataSet withNamespace(String namespace) { setNamespace(namespace); return this; } /** ** The Amazon Resource Name (ARN) of the dataset that contains permissions for RLS. *
* * @param arn * The Amazon Resource Name (ARN) of the dataset that contains permissions for RLS. */ public void setArn(String arn) { this.arn = arn; } /** ** The Amazon Resource Name (ARN) of the dataset that contains permissions for RLS. *
* * @return The Amazon Resource Name (ARN) of the dataset that contains permissions for RLS. */ public String getArn() { return this.arn; } /** ** The Amazon Resource Name (ARN) of the dataset that contains permissions for RLS. *
* * @param arn * The Amazon Resource Name (ARN) of the dataset that contains permissions for RLS. * @return Returns a reference to this object so that method calls can be chained together. */ public RowLevelPermissionDataSet withArn(String arn) { setArn(arn); return this; } /** *
* The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS
is included
* for backward compatibility only.
*
DENY_ACCESS
is
* included for backward compatibility only.
* @see RowLevelPermissionPolicy
*/
public void setPermissionPolicy(String permissionPolicy) {
this.permissionPolicy = permissionPolicy;
}
/**
*
* The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS
is included
* for backward compatibility only.
*
DENY_ACCESS
is
* included for backward compatibility only.
* @see RowLevelPermissionPolicy
*/
public String getPermissionPolicy() {
return this.permissionPolicy;
}
/**
*
* The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS
is included
* for backward compatibility only.
*
DENY_ACCESS
is
* included for backward compatibility only.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RowLevelPermissionPolicy
*/
public RowLevelPermissionDataSet withPermissionPolicy(String permissionPolicy) {
setPermissionPolicy(permissionPolicy);
return this;
}
/**
*
* The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS
is included
* for backward compatibility only.
*
DENY_ACCESS
is
* included for backward compatibility only.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RowLevelPermissionPolicy
*/
public RowLevelPermissionDataSet withPermissionPolicy(RowLevelPermissionPolicy permissionPolicy) {
this.permissionPolicy = permissionPolicy.toString();
return this;
}
/**
* * The user or group rules associated with the dataset that contains permissions for RLS. *
*
* By default, FormatVersion
is VERSION_1
. When FormatVersion
is
* VERSION_1
, UserName
and GroupName
are required. When
* FormatVersion
is VERSION_2
, UserARN
and GroupARN
are
* required, and Namespace
must not exist.
*
* By default, FormatVersion
is VERSION_1
. When FormatVersion
is
* VERSION_1
, UserName
and GroupName
are required. When
* FormatVersion
is VERSION_2
, UserARN
and GroupARN
are
* required, and Namespace
must not exist.
* @see RowLevelPermissionFormatVersion
*/
public void setFormatVersion(String formatVersion) {
this.formatVersion = formatVersion;
}
/**
*
* The user or group rules associated with the dataset that contains permissions for RLS. *
*
* By default, FormatVersion
is VERSION_1
. When FormatVersion
is
* VERSION_1
, UserName
and GroupName
are required. When
* FormatVersion
is VERSION_2
, UserARN
and GroupARN
are
* required, and Namespace
must not exist.
*
* By default, FormatVersion
is VERSION_1
. When FormatVersion
is
* VERSION_1
, UserName
and GroupName
are required. When
* FormatVersion
is VERSION_2
, UserARN
and GroupARN
are
* required, and Namespace
must not exist.
* @see RowLevelPermissionFormatVersion
*/
public String getFormatVersion() {
return this.formatVersion;
}
/**
*
* The user or group rules associated with the dataset that contains permissions for RLS. *
*
* By default, FormatVersion
is VERSION_1
. When FormatVersion
is
* VERSION_1
, UserName
and GroupName
are required. When
* FormatVersion
is VERSION_2
, UserARN
and GroupARN
are
* required, and Namespace
must not exist.
*
* By default, FormatVersion
is VERSION_1
. When FormatVersion
is
* VERSION_1
, UserName
and GroupName
are required. When
* FormatVersion
is VERSION_2
, UserARN
and GroupARN
are
* required, and Namespace
must not exist.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RowLevelPermissionFormatVersion
*/
public RowLevelPermissionDataSet withFormatVersion(String formatVersion) {
setFormatVersion(formatVersion);
return this;
}
/**
*
* The user or group rules associated with the dataset that contains permissions for RLS. *
*
* By default, FormatVersion
is VERSION_1
. When FormatVersion
is
* VERSION_1
, UserName
and GroupName
are required. When
* FormatVersion
is VERSION_2
, UserARN
and GroupARN
are
* required, and Namespace
must not exist.
*
* By default, FormatVersion
is VERSION_1
. When FormatVersion
is
* VERSION_1
, UserName
and GroupName
are required. When
* FormatVersion
is VERSION_2
, UserARN
and GroupARN
are
* required, and Namespace
must not exist.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RowLevelPermissionFormatVersion
*/
public RowLevelPermissionDataSet withFormatVersion(RowLevelPermissionFormatVersion formatVersion) {
this.formatVersion = formatVersion.toString();
return this;
}
/**
*
* The status of the row-level security permission dataset. If enabled, the status is ENABLED
. If
* disabled, the status is DISABLED
.
*
ENABLED
.
* If disabled, the status is DISABLED
.
* @see Status
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the row-level security permission dataset. If enabled, the status is ENABLED
. If
* disabled, the status is DISABLED
.
*
ENABLED
.
* If disabled, the status is DISABLED
.
* @see Status
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the row-level security permission dataset. If enabled, the status is ENABLED
. If
* disabled, the status is DISABLED
.
*
ENABLED
.
* If disabled, the status is DISABLED
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Status
*/
public RowLevelPermissionDataSet withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The status of the row-level security permission dataset. If enabled, the status is ENABLED
. If
* disabled, the status is DISABLED
.
*
ENABLED
.
* If disabled, the status is DISABLED
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Status
*/
public RowLevelPermissionDataSet withStatus(Status status) {
this.status = status.toString();
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 (getNamespace() != null)
sb.append("Namespace: ").append(getNamespace()).append(",");
if (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getPermissionPolicy() != null)
sb.append("PermissionPolicy: ").append(getPermissionPolicy()).append(",");
if (getFormatVersion() != null)
sb.append("FormatVersion: ").append(getFormatVersion()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RowLevelPermissionDataSet == false)
return false;
RowLevelPermissionDataSet other = (RowLevelPermissionDataSet) obj;
if (other.getNamespace() == null ^ this.getNamespace() == null)
return false;
if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false)
return false;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getPermissionPolicy() == null ^ this.getPermissionPolicy() == null)
return false;
if (other.getPermissionPolicy() != null && other.getPermissionPolicy().equals(this.getPermissionPolicy()) == false)
return false;
if (other.getFormatVersion() == null ^ this.getFormatVersion() == null)
return false;
if (other.getFormatVersion() != null && other.getFormatVersion().equals(this.getFormatVersion()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode());
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getPermissionPolicy() == null) ? 0 : getPermissionPolicy().hashCode());
hashCode = prime * hashCode + ((getFormatVersion() == null) ? 0 : getFormatVersion().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
return hashCode;
}
@Override
public RowLevelPermissionDataSet clone() {
try {
return (RowLevelPermissionDataSet) 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.quicksight.model.transform.RowLevelPermissionDataSetMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}