
software.amazon.awssdk.services.quicksight.model.GetDashboardEmbedUrlRequest Maven / Gradle / Ivy
/*
* Copyright 2014-2019 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.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 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.LocationTrait;
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 GetDashboardEmbedUrlRequest extends QuickSightRequest implements
ToCopyableBuilder {
private static final SdkField AWS_ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetDashboardEmbedUrlRequest::awsAccountId)).setter(setter(Builder::awsAccountId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("AwsAccountId").build()).build();
private static final SdkField DASHBOARD_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetDashboardEmbedUrlRequest::dashboardId)).setter(setter(Builder::dashboardId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("DashboardId").build()).build();
private static final SdkField IDENTITY_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetDashboardEmbedUrlRequest::identityTypeAsString)).setter(setter(Builder::identityType))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("creds-type").build()).build();
private static final SdkField SESSION_LIFETIME_IN_MINUTES_FIELD = SdkField. builder(MarshallingType.LONG)
.getter(getter(GetDashboardEmbedUrlRequest::sessionLifetimeInMinutes))
.setter(setter(Builder::sessionLifetimeInMinutes))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("session-lifetime").build())
.build();
private static final SdkField UNDO_REDO_DISABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(GetDashboardEmbedUrlRequest::undoRedoDisabled)).setter(setter(Builder::undoRedoDisabled))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("undo-redo-disabled").build())
.build();
private static final SdkField RESET_DISABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(GetDashboardEmbedUrlRequest::resetDisabled)).setter(setter(Builder::resetDisabled))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("reset-disabled").build())
.build();
private static final SdkField USER_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetDashboardEmbedUrlRequest::userArn)).setter(setter(Builder::userArn))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("user-arn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AWS_ACCOUNT_ID_FIELD,
DASHBOARD_ID_FIELD, IDENTITY_TYPE_FIELD, SESSION_LIFETIME_IN_MINUTES_FIELD, UNDO_REDO_DISABLED_FIELD,
RESET_DISABLED_FIELD, USER_ARN_FIELD));
private final String awsAccountId;
private final String dashboardId;
private final String identityType;
private final Long sessionLifetimeInMinutes;
private final Boolean undoRedoDisabled;
private final Boolean resetDisabled;
private final String userArn;
private GetDashboardEmbedUrlRequest(BuilderImpl builder) {
super(builder);
this.awsAccountId = builder.awsAccountId;
this.dashboardId = builder.dashboardId;
this.identityType = builder.identityType;
this.sessionLifetimeInMinutes = builder.sessionLifetimeInMinutes;
this.undoRedoDisabled = builder.undoRedoDisabled;
this.resetDisabled = builder.resetDisabled;
this.userArn = builder.userArn;
}
/**
*
* AWS account ID that contains the dashboard you are embedding.
*
*
* @return AWS account ID that contains the dashboard you are embedding.
*/
public String awsAccountId() {
return awsAccountId;
}
/**
*
* The ID for the dashboard, also added to IAM policy
*
*
* @return The ID for the dashboard, also added to IAM policy
*/
public String dashboardId() {
return dashboardId;
}
/**
*
* The authentication method the user uses to sign in (IAM only).
*
*
* 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 authentication method the user uses to sign in (IAM only).
* @see IdentityType
*/
public IdentityType identityType() {
return IdentityType.fromValue(identityType);
}
/**
*
* The authentication method the user uses to sign in (IAM only).
*
*
* 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 authentication method the user uses to sign in (IAM only).
* @see IdentityType
*/
public String identityTypeAsString() {
return identityType;
}
/**
*
* How many minutes the session is valid. The session lifetime must be between 15 and 600 minutes.
*
*
* @return How many minutes the session is valid. The session lifetime must be between 15 and 600 minutes.
*/
public Long sessionLifetimeInMinutes() {
return sessionLifetimeInMinutes;
}
/**
*
* Remove the undo/redo button on embedded dashboard. The default is FALSE, which enables the undo/redo button.
*
*
* @return Remove the undo/redo button on embedded dashboard. The default is FALSE, which enables the undo/redo
* button.
*/
public Boolean undoRedoDisabled() {
return undoRedoDisabled;
}
/**
*
* Remove the reset button on embedded dashboard. The default is FALSE, which allows the reset button.
*
*
* @return Remove the reset button on embedded dashboard. The default is FALSE, which allows the reset button.
*/
public Boolean resetDisabled() {
return resetDisabled;
}
/**
*
* The Amazon QuickSight user's ARN, for use with QUICKSIGHT
identity type. You can use this for any of
* the following:
*
*
* -
*
* Amazon QuickSight users in your account (readers, authors, or admins)
*
*
* -
*
* AD users
*
*
* -
*
* Invited non-federated users
*
*
* -
*
* Federated IAM users
*
*
* -
*
* Federated IAM role-based sessions
*
*
*
*
* @return The Amazon QuickSight user's ARN, for use with QUICKSIGHT
identity type. You can use this
* for any of the following:
*
* -
*
* Amazon QuickSight users in your account (readers, authors, or admins)
*
*
* -
*
* AD users
*
*
* -
*
* Invited non-federated users
*
*
* -
*
* Federated IAM users
*
*
* -
*
* Federated IAM role-based sessions
*
*
*/
public String userArn() {
return userArn;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(awsAccountId());
hashCode = 31 * hashCode + Objects.hashCode(dashboardId());
hashCode = 31 * hashCode + Objects.hashCode(identityTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(sessionLifetimeInMinutes());
hashCode = 31 * hashCode + Objects.hashCode(undoRedoDisabled());
hashCode = 31 * hashCode + Objects.hashCode(resetDisabled());
hashCode = 31 * hashCode + Objects.hashCode(userArn());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetDashboardEmbedUrlRequest)) {
return false;
}
GetDashboardEmbedUrlRequest other = (GetDashboardEmbedUrlRequest) obj;
return Objects.equals(awsAccountId(), other.awsAccountId()) && Objects.equals(dashboardId(), other.dashboardId())
&& Objects.equals(identityTypeAsString(), other.identityTypeAsString())
&& Objects.equals(sessionLifetimeInMinutes(), other.sessionLifetimeInMinutes())
&& Objects.equals(undoRedoDisabled(), other.undoRedoDisabled())
&& Objects.equals(resetDisabled(), other.resetDisabled()) && Objects.equals(userArn(), other.userArn());
}
/**
* 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 String toString() {
return ToString.builder("GetDashboardEmbedUrlRequest").add("AwsAccountId", awsAccountId())
.add("DashboardId", dashboardId()).add("IdentityType", identityTypeAsString())
.add("SessionLifetimeInMinutes", sessionLifetimeInMinutes()).add("UndoRedoDisabled", undoRedoDisabled())
.add("ResetDisabled", resetDisabled()).add("UserArn", userArn()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AwsAccountId":
return Optional.ofNullable(clazz.cast(awsAccountId()));
case "DashboardId":
return Optional.ofNullable(clazz.cast(dashboardId()));
case "IdentityType":
return Optional.ofNullable(clazz.cast(identityTypeAsString()));
case "SessionLifetimeInMinutes":
return Optional.ofNullable(clazz.cast(sessionLifetimeInMinutes()));
case "UndoRedoDisabled":
return Optional.ofNullable(clazz.cast(undoRedoDisabled()));
case "ResetDisabled":
return Optional.ofNullable(clazz.cast(resetDisabled()));
case "UserArn":
return Optional.ofNullable(clazz.cast(userArn()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function