software.amazon.awssdk.services.quicksight.model.RegisterUserRequest Maven / Gradle / Ivy
Show all versions of quicksight Show documentation
/*
* 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.util.Arrays;
import java.util.Collection;
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.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class RegisterUserRequest extends QuickSightRequest implements
ToCopyableBuilder {
private static final SdkField IDENTITY_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IdentityType").getter(getter(RegisterUserRequest::identityTypeAsString))
.setter(setter(Builder::identityType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdentityType").build()).build();
private static final SdkField EMAIL_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Email")
.getter(getter(RegisterUserRequest::email)).setter(setter(Builder::email))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Email").build()).build();
private static final SdkField USER_ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("UserRole").getter(getter(RegisterUserRequest::userRoleAsString)).setter(setter(Builder::userRole))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserRole").build()).build();
private static final SdkField IAM_ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("IamArn")
.getter(getter(RegisterUserRequest::iamArn)).setter(setter(Builder::iamArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IamArn").build()).build();
private static final SdkField SESSION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SessionName").getter(getter(RegisterUserRequest::sessionName)).setter(setter(Builder::sessionName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SessionName").build()).build();
private static final SdkField AWS_ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AwsAccountId").getter(getter(RegisterUserRequest::awsAccountId)).setter(setter(Builder::awsAccountId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("AwsAccountId").build()).build();
private static final SdkField NAMESPACE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Namespace").getter(getter(RegisterUserRequest::namespace)).setter(setter(Builder::namespace))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("Namespace").build()).build();
private static final SdkField USER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("UserName").getter(getter(RegisterUserRequest::userName)).setter(setter(Builder::userName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserName").build()).build();
private static final SdkField CUSTOM_PERMISSIONS_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CustomPermissionsName").getter(getter(RegisterUserRequest::customPermissionsName))
.setter(setter(Builder::customPermissionsName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomPermissionsName").build())
.build();
private static final SdkField EXTERNAL_LOGIN_FEDERATION_PROVIDER_TYPE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ExternalLoginFederationProviderType")
.getter(getter(RegisterUserRequest::externalLoginFederationProviderType))
.setter(setter(Builder::externalLoginFederationProviderType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("ExternalLoginFederationProviderType").build()).build();
private static final SdkField CUSTOM_FEDERATION_PROVIDER_URL_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CustomFederationProviderUrl")
.getter(getter(RegisterUserRequest::customFederationProviderUrl))
.setter(setter(Builder::customFederationProviderUrl))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomFederationProviderUrl")
.build()).build();
private static final SdkField EXTERNAL_LOGIN_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ExternalLoginId").getter(getter(RegisterUserRequest::externalLoginId))
.setter(setter(Builder::externalLoginId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExternalLoginId").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Tags")
.getter(getter(RegisterUserRequest::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Tag::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(IDENTITY_TYPE_FIELD,
EMAIL_FIELD, USER_ROLE_FIELD, IAM_ARN_FIELD, SESSION_NAME_FIELD, AWS_ACCOUNT_ID_FIELD, NAMESPACE_FIELD,
USER_NAME_FIELD, CUSTOM_PERMISSIONS_NAME_FIELD, EXTERNAL_LOGIN_FEDERATION_PROVIDER_TYPE_FIELD,
CUSTOM_FEDERATION_PROVIDER_URL_FIELD, EXTERNAL_LOGIN_ID_FIELD, TAGS_FIELD));
private final String identityType;
private final String email;
private final String userRole;
private final String iamArn;
private final String sessionName;
private final String awsAccountId;
private final String namespace;
private final String userName;
private final String customPermissionsName;
private final String externalLoginFederationProviderType;
private final String customFederationProviderUrl;
private final String externalLoginId;
private final List tags;
private RegisterUserRequest(BuilderImpl builder) {
super(builder);
this.identityType = builder.identityType;
this.email = builder.email;
this.userRole = builder.userRole;
this.iamArn = builder.iamArn;
this.sessionName = builder.sessionName;
this.awsAccountId = builder.awsAccountId;
this.namespace = builder.namespace;
this.userName = builder.userName;
this.customPermissionsName = builder.customPermissionsName;
this.externalLoginFederationProviderType = builder.externalLoginFederationProviderType;
this.customFederationProviderUrl = builder.customFederationProviderUrl;
this.externalLoginId = builder.externalLoginId;
this.tags = builder.tags;
}
/**
*
* The identity type that your Amazon QuickSight account uses to manage the identity of users.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #identityType} will
* return {@link IdentityType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #identityTypeAsString}.
*
*
* @return The identity type that your Amazon QuickSight account uses to manage the identity of users.
* @see IdentityType
*/
public final IdentityType identityType() {
return IdentityType.fromValue(identityType);
}
/**
*
* The identity type that your Amazon QuickSight account uses to manage the identity of users.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #identityType} will
* return {@link IdentityType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #identityTypeAsString}.
*
*
* @return The identity type that your Amazon QuickSight account uses to manage the identity of users.
* @see IdentityType
*/
public final String identityTypeAsString() {
return identityType;
}
/**
*
* The email address of the user that you want to register.
*
*
* @return The email address of the user that you want to register.
*/
public final String email() {
return email;
}
/**
*
* The Amazon QuickSight role for the user. The user role can be one of the following:
*
*
* -
*
* READER
: A user who has read-only access to dashboards.
*
*
* -
*
* AUTHOR
: A user who can create data sources, datasets, analyses, and dashboards.
*
*
* -
*
* ADMIN
: A user who is an author, who can also manage Amazon QuickSight settings.
*
*
* -
*
* RESTRICTED_READER
: This role isn't currently available for use.
*
*
* -
*
* RESTRICTED_AUTHOR
: This role isn't currently available for use.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #userRole} will
* return {@link UserRole#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #userRoleAsString}.
*
*
* @return The Amazon QuickSight role for the user. The user role can be one of the following:
*
* -
*
* READER
: A user who has read-only access to dashboards.
*
*
* -
*
* AUTHOR
: A user who can create data sources, datasets, analyses, and dashboards.
*
*
* -
*
* ADMIN
: A user who is an author, who can also manage Amazon QuickSight settings.
*
*
* -
*
* RESTRICTED_READER
: This role isn't currently available for use.
*
*
* -
*
* RESTRICTED_AUTHOR
: This role isn't currently available for use.
*
*
* @see UserRole
*/
public final UserRole userRole() {
return UserRole.fromValue(userRole);
}
/**
*
* The Amazon QuickSight role for the user. The user role can be one of the following:
*
*
* -
*
* READER
: A user who has read-only access to dashboards.
*
*
* -
*
* AUTHOR
: A user who can create data sources, datasets, analyses, and dashboards.
*
*
* -
*
* ADMIN
: A user who is an author, who can also manage Amazon QuickSight settings.
*
*
* -
*
* RESTRICTED_READER
: This role isn't currently available for use.
*
*
* -
*
* RESTRICTED_AUTHOR
: This role isn't currently available for use.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #userRole} will
* return {@link UserRole#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #userRoleAsString}.
*
*
* @return The Amazon QuickSight role for the user. The user role can be one of the following:
*
* -
*
* READER
: A user who has read-only access to dashboards.
*
*
* -
*
* AUTHOR
: A user who can create data sources, datasets, analyses, and dashboards.
*
*
* -
*
* ADMIN
: A user who is an author, who can also manage Amazon QuickSight settings.
*
*
* -
*
* RESTRICTED_READER
: This role isn't currently available for use.
*
*
* -
*
* RESTRICTED_AUTHOR
: This role isn't currently available for use.
*
*
* @see UserRole
*/
public final String userRoleAsString() {
return userRole;
}
/**
*
* The ARN of the IAM user or role that you are registering with Amazon QuickSight.
*
*
* @return The ARN of the IAM user or role that you are registering with Amazon QuickSight.
*/
public final String iamArn() {
return iamArn;
}
/**
*
* You need to use this parameter only when you register one or more users using an assumed IAM role. You don't need
* to provide the session name for other scenarios, for example when you are registering an IAM user or an Amazon
* QuickSight user. You can register multiple users using the same IAM role if each user has a different session
* name. For more information on assuming IAM roles, see assume-role
in
* the CLI Reference.
*
*
* @return You need to use this parameter only when you register one or more users using an assumed IAM role. You
* don't need to provide the session name for other scenarios, for example when you are registering an IAM
* user or an Amazon QuickSight user. You can register multiple users using the same IAM role if each user
* has a different session name. For more information on assuming IAM roles, see assume-role
* in the CLI Reference.
*/
public final String sessionName() {
return sessionName;
}
/**
*
* The ID for the Amazon Web Services account that the user is in. Currently, you use the ID for the Amazon Web
* Services account that contains your Amazon QuickSight account.
*
*
* @return The ID for the Amazon Web Services account that the user is in. Currently, you use the ID for the Amazon
* Web Services account that contains your Amazon QuickSight account.
*/
public final String awsAccountId() {
return awsAccountId;
}
/**
*
* The namespace. Currently, you should set this to default
.
*
*
* @return The namespace. Currently, you should set this to default
.
*/
public final String namespace() {
return namespace;
}
/**
*
* The Amazon QuickSight user name that you want to create for the user you are registering.
*
*
* @return The Amazon QuickSight user name that you want to create for the user you are registering.
*/
public final String userName() {
return userName;
}
/**
*
* (Enterprise edition only) The name of the custom permissions profile that you want to assign to this user.
* Customized permissions allows you to control a user's access by restricting access the following operations:
*
*
* -
*
* Create and update data sources
*
*
* -
*
* Create and update datasets
*
*
* -
*
* Create and update email reports
*
*
* -
*
* Subscribe to email reports
*
*
*
*
* To add custom permissions to an existing user, use
* UpdateUser
* instead.
*
*
* A set of custom permissions includes any combination of these restrictions. Currently, you need to create the
* profile names for custom permission sets by using the Amazon QuickSight console. Then, you use the
* RegisterUser
API operation to assign the named set of permissions to a Amazon QuickSight user.
*
*
* Amazon QuickSight custom permissions are applied through IAM policies. Therefore, they override the permissions
* typically granted by assigning Amazon QuickSight users to one of the default security cohorts in Amazon
* QuickSight (admin, author, reader, admin pro, author pro, reader pro).
*
*
* This feature is available only to Amazon QuickSight Enterprise edition subscriptions.
*
*
* @return (Enterprise edition only) The name of the custom permissions profile that you want to assign to this
* user. Customized permissions allows you to control a user's access by restricting access the following
* operations:
*
* -
*
* Create and update data sources
*
*
* -
*
* Create and update datasets
*
*
* -
*
* Create and update email reports
*
*
* -
*
* Subscribe to email reports
*
*
*
*
* To add custom permissions to an existing user, use
* UpdateUser
* instead.
*
*
* A set of custom permissions includes any combination of these restrictions. Currently, you need to create
* the profile names for custom permission sets by using the Amazon QuickSight console. Then, you use the
* RegisterUser
API operation to assign the named set of permissions to a Amazon QuickSight
* user.
*
*
* Amazon QuickSight custom permissions are applied through IAM policies. Therefore, they override the
* permissions typically granted by assigning Amazon QuickSight users to one of the default security cohorts
* in Amazon QuickSight (admin, author, reader, admin pro, author pro, reader pro).
*
*
* This feature is available only to Amazon QuickSight Enterprise edition subscriptions.
*/
public final String customPermissionsName() {
return customPermissionsName;
}
/**
*
* The type of supported external login provider that provides identity to let a user federate into Amazon
* QuickSight with an associated Identity and Access Management(IAM) role. The type of supported external login
* provider can be one of the following.
*
*
* -
*
* COGNITO
: Amazon Cognito. The provider URL is cognito-identity.amazonaws.com. When choosing the
* COGNITO
provider type, don’t use the "CustomFederationProviderUrl" parameter which is only needed
* when the external provider is custom.
*
*
* -
*
* CUSTOM_OIDC
: Custom OpenID Connect (OIDC) provider. When choosing CUSTOM_OIDC
type, use
* the CustomFederationProviderUrl
parameter to provide the custom OIDC provider URL.
*
*
*
*
* @return The type of supported external login provider that provides identity to let a user federate into Amazon
* QuickSight with an associated Identity and Access Management(IAM) role. The type of supported external
* login provider can be one of the following.
*
* -
*
* COGNITO
: Amazon Cognito. The provider URL is cognito-identity.amazonaws.com. When choosing
* the COGNITO
provider type, don’t use the "CustomFederationProviderUrl" parameter which is
* only needed when the external provider is custom.
*
*
* -
*
* CUSTOM_OIDC
: Custom OpenID Connect (OIDC) provider. When choosing CUSTOM_OIDC
* type, use the CustomFederationProviderUrl
parameter to provide the custom OIDC provider URL.
*
*
*/
public final String externalLoginFederationProviderType() {
return externalLoginFederationProviderType;
}
/**
*
* The URL of the custom OpenID Connect (OIDC) provider that provides identity to let a user federate into Amazon
* QuickSight with an associated Identity and Access Management(IAM) role. This parameter should only be used when
* ExternalLoginFederationProviderType
parameter is set to CUSTOM_OIDC
.
*
*
* @return The URL of the custom OpenID Connect (OIDC) provider that provides identity to let a user federate into
* Amazon QuickSight with an associated Identity and Access Management(IAM) role. This parameter should only
* be used when ExternalLoginFederationProviderType
parameter is set to
* CUSTOM_OIDC
.
*/
public final String customFederationProviderUrl() {
return customFederationProviderUrl;
}
/**
*
* The identity ID for a user in the external login provider.
*
*
* @return The identity ID for a user in the external login provider.
*/
public final String externalLoginId() {
return externalLoginId;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructList);
}
/**
*
* The tags to associate with the user.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return The tags to associate with the user.
*/
public final List tags() {
return tags;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(identityTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(email());
hashCode = 31 * hashCode + Objects.hashCode(userRoleAsString());
hashCode = 31 * hashCode + Objects.hashCode(iamArn());
hashCode = 31 * hashCode + Objects.hashCode(sessionName());
hashCode = 31 * hashCode + Objects.hashCode(awsAccountId());
hashCode = 31 * hashCode + Objects.hashCode(namespace());
hashCode = 31 * hashCode + Objects.hashCode(userName());
hashCode = 31 * hashCode + Objects.hashCode(customPermissionsName());
hashCode = 31 * hashCode + Objects.hashCode(externalLoginFederationProviderType());
hashCode = 31 * hashCode + Objects.hashCode(customFederationProviderUrl());
hashCode = 31 * hashCode + Objects.hashCode(externalLoginId());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof RegisterUserRequest)) {
return false;
}
RegisterUserRequest other = (RegisterUserRequest) obj;
return Objects.equals(identityTypeAsString(), other.identityTypeAsString()) && Objects.equals(email(), other.email())
&& Objects.equals(userRoleAsString(), other.userRoleAsString()) && Objects.equals(iamArn(), other.iamArn())
&& Objects.equals(sessionName(), other.sessionName()) && Objects.equals(awsAccountId(), other.awsAccountId())
&& Objects.equals(namespace(), other.namespace()) && Objects.equals(userName(), other.userName())
&& Objects.equals(customPermissionsName(), other.customPermissionsName())
&& Objects.equals(externalLoginFederationProviderType(), other.externalLoginFederationProviderType())
&& Objects.equals(customFederationProviderUrl(), other.customFederationProviderUrl())
&& Objects.equals(externalLoginId(), other.externalLoginId()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags());
}
/**
* 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("RegisterUserRequest").add("IdentityType", identityTypeAsString()).add("Email", email())
.add("UserRole", userRoleAsString()).add("IamArn", iamArn()).add("SessionName", sessionName())
.add("AwsAccountId", awsAccountId()).add("Namespace", namespace()).add("UserName", userName())
.add("CustomPermissionsName", customPermissionsName())
.add("ExternalLoginFederationProviderType", externalLoginFederationProviderType())
.add("CustomFederationProviderUrl", customFederationProviderUrl()).add("ExternalLoginId", externalLoginId())
.add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "IdentityType":
return Optional.ofNullable(clazz.cast(identityTypeAsString()));
case "Email":
return Optional.ofNullable(clazz.cast(email()));
case "UserRole":
return Optional.ofNullable(clazz.cast(userRoleAsString()));
case "IamArn":
return Optional.ofNullable(clazz.cast(iamArn()));
case "SessionName":
return Optional.ofNullable(clazz.cast(sessionName()));
case "AwsAccountId":
return Optional.ofNullable(clazz.cast(awsAccountId()));
case "Namespace":
return Optional.ofNullable(clazz.cast(namespace()));
case "UserName":
return Optional.ofNullable(clazz.cast(userName()));
case "CustomPermissionsName":
return Optional.ofNullable(clazz.cast(customPermissionsName()));
case "ExternalLoginFederationProviderType":
return Optional.ofNullable(clazz.cast(externalLoginFederationProviderType()));
case "CustomFederationProviderUrl":
return Optional.ofNullable(clazz.cast(customFederationProviderUrl()));
case "ExternalLoginId":
return Optional.ofNullable(clazz.cast(externalLoginId()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function