All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.quicksight.model.RowLevelPermissionDataSet Maven / Gradle / Ivy

Go to download

The AWS Java SDK for QuickSight module holds the client classes that are used for communicating with QuickSight.

There is a newer version: 2.28.3
Show newest version
/*
 * Copyright 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 software.amazon.awssdk.services.quicksight.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* 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. *

*/ @Generated("software.amazon.awssdk:codegen") public final class RowLevelPermissionDataSet implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NAMESPACE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Namespace").getter(getter(RowLevelPermissionDataSet::namespace)).setter(setter(Builder::namespace)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Namespace").build()).build(); private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn") .getter(getter(RowLevelPermissionDataSet::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build(); private static final SdkField PERMISSION_POLICY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("PermissionPolicy").getter(getter(RowLevelPermissionDataSet::permissionPolicyAsString)) .setter(setter(Builder::permissionPolicy)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PermissionPolicy").build()).build(); private static final SdkField FORMAT_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("FormatVersion").getter(getter(RowLevelPermissionDataSet::formatVersionAsString)) .setter(setter(Builder::formatVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FormatVersion").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(RowLevelPermissionDataSet::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAMESPACE_FIELD, ARN_FIELD, PERMISSION_POLICY_FIELD, FORMAT_VERSION_FIELD, STATUS_FIELD)); private static final long serialVersionUID = 1L; private final String namespace; private final String arn; private final String permissionPolicy; private final String formatVersion; private final String status; private RowLevelPermissionDataSet(BuilderImpl builder) { this.namespace = builder.namespace; this.arn = builder.arn; this.permissionPolicy = builder.permissionPolicy; this.formatVersion = builder.formatVersion; this.status = builder.status; } /** *

* The namespace associated with the dataset that contains permissions for RLS. *

* * @return The namespace associated with the dataset that contains permissions for RLS. */ public final String namespace() { return namespace; } /** *

* 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 final String arn() { return arn; } /** *

* The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS is included * for backward compatibility only. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #permissionPolicy} * will return {@link RowLevelPermissionPolicy#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #permissionPolicyAsString}. *

* * @return The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS is * included for backward compatibility only. * @see RowLevelPermissionPolicy */ public final RowLevelPermissionPolicy permissionPolicy() { return RowLevelPermissionPolicy.fromValue(permissionPolicy); } /** *

* The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS is included * for backward compatibility only. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #permissionPolicy} * will return {@link RowLevelPermissionPolicy#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #permissionPolicyAsString}. *

* * @return The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS is * included for backward compatibility only. * @see RowLevelPermissionPolicy */ public final String permissionPolicyAsString() { return permissionPolicy; } /** *

* 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. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #formatVersion} * will return {@link RowLevelPermissionFormatVersion#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service * is available from {@link #formatVersionAsString}. *

* * @return 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. * @see RowLevelPermissionFormatVersion */ public final RowLevelPermissionFormatVersion formatVersion() { return RowLevelPermissionFormatVersion.fromValue(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. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #formatVersion} * will return {@link RowLevelPermissionFormatVersion#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service * is available from {@link #formatVersionAsString}. *

* * @return 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. * @see RowLevelPermissionFormatVersion */ public final String formatVersionAsString() { return formatVersion; } /** *

* The status of the row-level security permission dataset. If enabled, the status is ENABLED. If * disabled, the status is DISABLED. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link Status#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The status of the row-level security permission dataset. If enabled, the status is ENABLED. * If disabled, the status is DISABLED. * @see Status */ public final Status status() { return Status.fromValue(status); } /** *

* The status of the row-level security permission dataset. If enabled, the status is ENABLED. If * disabled, the status is DISABLED. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link Status#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The status of the row-level security permission dataset. If enabled, the status is ENABLED. * If disabled, the status is DISABLED. * @see Status */ public final String statusAsString() { return status; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(namespace()); hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(permissionPolicyAsString()); hashCode = 31 * hashCode + Objects.hashCode(formatVersionAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof RowLevelPermissionDataSet)) { return false; } RowLevelPermissionDataSet other = (RowLevelPermissionDataSet) obj; return Objects.equals(namespace(), other.namespace()) && Objects.equals(arn(), other.arn()) && Objects.equals(permissionPolicyAsString(), other.permissionPolicyAsString()) && Objects.equals(formatVersionAsString(), other.formatVersionAsString()) && Objects.equals(statusAsString(), other.statusAsString()); } /** * 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. */ @Override public final String toString() { return ToString.builder("RowLevelPermissionDataSet").add("Namespace", namespace()).add("Arn", arn()) .add("PermissionPolicy", permissionPolicyAsString()).add("FormatVersion", formatVersionAsString()) .add("Status", statusAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Namespace": return Optional.ofNullable(clazz.cast(namespace())); case "Arn": return Optional.ofNullable(clazz.cast(arn())); case "PermissionPolicy": return Optional.ofNullable(clazz.cast(permissionPolicyAsString())); case "FormatVersion": return Optional.ofNullable(clazz.cast(formatVersionAsString())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((RowLevelPermissionDataSet) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* 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. */ Builder namespace(String namespace); /** *

* 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. */ Builder arn(String arn); /** *

* The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS is * included for backward compatibility only. *

* * @param permissionPolicy * The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS is * included for backward compatibility only. * @see RowLevelPermissionPolicy * @return Returns a reference to this object so that method calls can be chained together. * @see RowLevelPermissionPolicy */ Builder permissionPolicy(String permissionPolicy); /** *

* The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS is * included for backward compatibility only. *

* * @param permissionPolicy * The type of permissions to use when interpreting the permissions for RLS. DENY_ACCESS is * included for backward compatibility only. * @see RowLevelPermissionPolicy * @return Returns a reference to this object so that method calls can be chained together. * @see RowLevelPermissionPolicy */ Builder permissionPolicy(RowLevelPermissionPolicy permissionPolicy); /** *

* 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. *

* * @param 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. * @see RowLevelPermissionFormatVersion * @return Returns a reference to this object so that method calls can be chained together. * @see RowLevelPermissionFormatVersion */ Builder formatVersion(String 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. *

* * @param 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. * @see RowLevelPermissionFormatVersion * @return Returns a reference to this object so that method calls can be chained together. * @see RowLevelPermissionFormatVersion */ Builder formatVersion(RowLevelPermissionFormatVersion formatVersion); /** *

* The status of the row-level security permission dataset. If enabled, the status is ENABLED. If * disabled, the status is DISABLED. *

* * @param status * The status of the row-level security permission dataset. If enabled, the status is * ENABLED. If disabled, the status is DISABLED. * @see Status * @return Returns a reference to this object so that method calls can be chained together. * @see Status */ Builder status(String status); /** *

* The status of the row-level security permission dataset. If enabled, the status is ENABLED. If * disabled, the status is DISABLED. *

* * @param status * The status of the row-level security permission dataset. If enabled, the status is * ENABLED. If disabled, the status is DISABLED. * @see Status * @return Returns a reference to this object so that method calls can be chained together. * @see Status */ Builder status(Status status); } static final class BuilderImpl implements Builder { private String namespace; private String arn; private String permissionPolicy; private String formatVersion; private String status; private BuilderImpl() { } private BuilderImpl(RowLevelPermissionDataSet model) { namespace(model.namespace); arn(model.arn); permissionPolicy(model.permissionPolicy); formatVersion(model.formatVersion); status(model.status); } public final String getNamespace() { return namespace; } public final void setNamespace(String namespace) { this.namespace = namespace; } @Override public final Builder namespace(String namespace) { this.namespace = namespace; return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getPermissionPolicy() { return permissionPolicy; } public final void setPermissionPolicy(String permissionPolicy) { this.permissionPolicy = permissionPolicy; } @Override public final Builder permissionPolicy(String permissionPolicy) { this.permissionPolicy = permissionPolicy; return this; } @Override public final Builder permissionPolicy(RowLevelPermissionPolicy permissionPolicy) { this.permissionPolicy(permissionPolicy == null ? null : permissionPolicy.toString()); return this; } public final String getFormatVersion() { return formatVersion; } public final void setFormatVersion(String formatVersion) { this.formatVersion = formatVersion; } @Override public final Builder formatVersion(String formatVersion) { this.formatVersion = formatVersion; return this; } @Override public final Builder formatVersion(RowLevelPermissionFormatVersion formatVersion) { this.formatVersion(formatVersion == null ? null : formatVersion.toString()); return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(Status status) { this.status(status == null ? null : status.toString()); return this; } @Override public RowLevelPermissionDataSet build() { return new RowLevelPermissionDataSet(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy