Skip to content

Commit

Permalink
feat(client-quicksight): API UpdatePublicSharingSettings enables IAM …
Browse files Browse the repository at this point in the history
…admins to enable/disable account level setting for public access of dashboards. When enabled, owners/co-owners for dashboards can enable public access on their dashboards. These dashboards can only be accessed through share link or embedding.
  • Loading branch information
awstools committed May 18, 2022
1 parent c528661 commit 389837a
Show file tree
Hide file tree
Showing 10 changed files with 405 additions and 8 deletions.
43 changes: 41 additions & 2 deletions clients/client-quicksight/src/QuickSight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ import {
UpdateIpRestrictionCommandInput,
UpdateIpRestrictionCommandOutput,
} from "./commands/UpdateIpRestrictionCommand";
import {
UpdatePublicSharingSettingsCommand,
UpdatePublicSharingSettingsCommandInput,
UpdatePublicSharingSettingsCommandOutput,
} from "./commands/UpdatePublicSharingSettingsCommand";
import {
UpdateTemplateAliasCommand,
UpdateTemplateAliasCommandInput,
Expand Down Expand Up @@ -2579,7 +2584,7 @@ export class QuickSight extends QuickSightClient {
* that can be customized using the <code>
* <a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_GenerateEmbedUrlForAnonymousUser.html#QS-GenerateEmbedUrlForAnonymousUser-request-SessionLifetimeInMinutes">SessionLifetimeInMinutes</a>
* </code> parameter.</p>
* <p>The resulting user session is valid for 15 minutes (default) to 10 hours (maximum).</p>
* <p>The resulting user session is valid for 15 minutes (minimum) to 10 hours (maximum). The default session duration is 10 hours. </p>
* </li>
* <li>
* <p>You are charged only when the URL is used or there is interaction with Amazon QuickSight.</p>
Expand Down Expand Up @@ -2630,7 +2635,7 @@ export class QuickSight extends QuickSightClient {
* that can be customized using the <code>
* <a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_GenerateEmbedUrlForRegisteredUser.html#QS-GenerateEmbedUrlForRegisteredUser-request-SessionLifetimeInMinutes">SessionLifetimeInMinutes</a>
* </code> parameter.</p>
* <p>The resulting user session is valid for 15 minutes (default) to 10 hours (maximum).</p>
* <p>The resulting user session is valid for 15 minutes (minimum) to 10 hours (maximum). The default session duration is 10 hours.</p>
* </li>
* <li>
* <p>You are charged only when the URL is used or there is interaction with Amazon QuickSight.</p>
Expand Down Expand Up @@ -4248,6 +4253,40 @@ export class QuickSight extends QuickSightClient {
}
}

/**
* <p>Use the UpdatePublicSharingSettings operation to enable or disable the public sharing settings of an Amazon QuickSight dashboard.</p>
* <p>To use this operation, enable session capacity pricing on your Amazon QuickSight account.</p>
* <p>Before you can enable public sharing on your account, you need to allow public sharing permissions to an administrative user in the IAM console. For more information on using IAM with Amazon QuickSight, see <a href="https://docs.aws.amazon.com/quicksight/latest/user/security_iam_service-with-iam.html">Using Amazon QuickSight with IAM</a>.</p>
*/
public updatePublicSharingSettings(
args: UpdatePublicSharingSettingsCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdatePublicSharingSettingsCommandOutput>;
public updatePublicSharingSettings(
args: UpdatePublicSharingSettingsCommandInput,
cb: (err: any, data?: UpdatePublicSharingSettingsCommandOutput) => void
): void;
public updatePublicSharingSettings(
args: UpdatePublicSharingSettingsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdatePublicSharingSettingsCommandOutput) => void
): void;
public updatePublicSharingSettings(
args: UpdatePublicSharingSettingsCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdatePublicSharingSettingsCommandOutput) => void),
cb?: (err: any, data?: UpdatePublicSharingSettingsCommandOutput) => void
): Promise<UpdatePublicSharingSettingsCommandOutput> | void {
const command = new UpdatePublicSharingSettingsCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Updates a template from an existing Amazon QuickSight analysis or another template.</p>
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-quicksight/src/QuickSightClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ import {
UpdateIpRestrictionCommandInput,
UpdateIpRestrictionCommandOutput,
} from "./commands/UpdateIpRestrictionCommand";
import {
UpdatePublicSharingSettingsCommandInput,
UpdatePublicSharingSettingsCommandOutput,
} from "./commands/UpdatePublicSharingSettingsCommand";
import {
UpdateTemplateAliasCommandInput,
UpdateTemplateAliasCommandOutput,
Expand Down Expand Up @@ -426,6 +430,7 @@ export type ServiceInputTypes =
| UpdateGroupCommandInput
| UpdateIAMPolicyAssignmentCommandInput
| UpdateIpRestrictionCommandInput
| UpdatePublicSharingSettingsCommandInput
| UpdateTemplateAliasCommandInput
| UpdateTemplateCommandInput
| UpdateTemplatePermissionsCommandInput
Expand Down Expand Up @@ -545,6 +550,7 @@ export type ServiceOutputTypes =
| UpdateGroupCommandOutput
| UpdateIAMPolicyAssignmentCommandOutput
| UpdateIpRestrictionCommandOutput
| UpdatePublicSharingSettingsCommandOutput
| UpdateTemplateAliasCommandOutput
| UpdateTemplateCommandOutput
| UpdateTemplatePermissionsCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface GenerateEmbedUrlForAnonymousUserCommandOutput
* that can be customized using the <code>
* <a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_GenerateEmbedUrlForAnonymousUser.html#QS-GenerateEmbedUrlForAnonymousUser-request-SessionLifetimeInMinutes">SessionLifetimeInMinutes</a>
* </code> parameter.</p>
* <p>The resulting user session is valid for 15 minutes (default) to 10 hours (maximum).</p>
* <p>The resulting user session is valid for 15 minutes (minimum) to 10 hours (maximum). The default session duration is 10 hours. </p>
* </li>
* <li>
* <p>You are charged only when the URL is used or there is interaction with Amazon QuickSight.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface GenerateEmbedUrlForRegisteredUserCommandOutput
* that can be customized using the <code>
* <a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_GenerateEmbedUrlForRegisteredUser.html#QS-GenerateEmbedUrlForRegisteredUser-request-SessionLifetimeInMinutes">SessionLifetimeInMinutes</a>
* </code> parameter.</p>
* <p>The resulting user session is valid for 15 minutes (default) to 10 hours (maximum).</p>
* <p>The resulting user session is valid for 15 minutes (minimum) to 10 hours (maximum). The default session duration is 10 hours.</p>
* </li>
* <li>
* <p>You are charged only when the URL is used or there is interaction with Amazon QuickSight.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// smithy-typescript generated code
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import { UpdatePublicSharingSettingsRequest, UpdatePublicSharingSettingsResponse } from "../models/models_1";
import {
deserializeAws_restJson1UpdatePublicSharingSettingsCommand,
serializeAws_restJson1UpdatePublicSharingSettingsCommand,
} from "../protocols/Aws_restJson1";
import { QuickSightClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QuickSightClient";

export interface UpdatePublicSharingSettingsCommandInput extends UpdatePublicSharingSettingsRequest {}
export interface UpdatePublicSharingSettingsCommandOutput
extends UpdatePublicSharingSettingsResponse,
__MetadataBearer {}

/**
* <p>Use the UpdatePublicSharingSettings operation to enable or disable the public sharing settings of an Amazon QuickSight dashboard.</p>
* <p>To use this operation, enable session capacity pricing on your Amazon QuickSight account.</p>
* <p>Before you can enable public sharing on your account, you need to allow public sharing permissions to an administrative user in the IAM console. For more information on using IAM with Amazon QuickSight, see <a href="https://docs.aws.amazon.com/quicksight/latest/user/security_iam_service-with-iam.html">Using Amazon QuickSight with IAM</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { QuickSightClient, UpdatePublicSharingSettingsCommand } from "@aws-sdk/client-quicksight"; // ES Modules import
* // const { QuickSightClient, UpdatePublicSharingSettingsCommand } = require("@aws-sdk/client-quicksight"); // CommonJS import
* const client = new QuickSightClient(config);
* const command = new UpdatePublicSharingSettingsCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link UpdatePublicSharingSettingsCommandInput} for command's `input` shape.
* @see {@link UpdatePublicSharingSettingsCommandOutput} for command's `response` shape.
* @see {@link QuickSightClientResolvedConfig | config} for QuickSightClient's `config` shape.
*
*/
export class UpdatePublicSharingSettingsCommand extends $Command<
UpdatePublicSharingSettingsCommandInput,
UpdatePublicSharingSettingsCommandOutput,
QuickSightClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: UpdatePublicSharingSettingsCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: QuickSightClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<UpdatePublicSharingSettingsCommandInput, UpdatePublicSharingSettingsCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "QuickSightClient";
const commandName = "UpdatePublicSharingSettingsCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: UpdatePublicSharingSettingsRequest.filterSensitiveLog,
outputFilterSensitiveLog: UpdatePublicSharingSettingsResponse.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: UpdatePublicSharingSettingsCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1UpdatePublicSharingSettingsCommand(input, context);
}

private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<UpdatePublicSharingSettingsCommandOutput> {
return deserializeAws_restJson1UpdatePublicSharingSettingsCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
1 change: 1 addition & 0 deletions clients/client-quicksight/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export * from "./UpdateFolderPermissionsCommand";
export * from "./UpdateGroupCommand";
export * from "./UpdateIAMPolicyAssignmentCommand";
export * from "./UpdateIpRestrictionCommand";
export * from "./UpdatePublicSharingSettingsCommand";
export * from "./UpdateTemplateAliasCommand";
export * from "./UpdateTemplateCommand";
export * from "./UpdateTemplatePermissionsCommand";
Expand Down
5 changes: 5 additions & 0 deletions clients/client-quicksight/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ export interface AccountSettings {
* <p>The main notification email for your Amazon QuickSight subscription.</p>
*/
NotificationEmail?: string;

/**
* <p>A boolean that indicates whether or not public sharing is enabled on an Amazon QuickSight account. For more information about enabling public sharing, see <a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_UpdatePublicSharingSettings.html">UpdatePublicSharingSettings</a>.</p>
*/
PublicSharingEnabled?: boolean;
}

export namespace AccountSettings {
Expand Down
44 changes: 43 additions & 1 deletion clients/client-quicksight/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ export interface GenerateEmbedUrlForAnonymousUserRequest {
SessionTags?: SessionTag[];

/**
* <p>The Amazon Resource Names for the Amazon QuickSight resources that the user is authorized to access during the lifetime of the session. If you choose <code>Dashboard</code> embedding experience, pass the list of dashboard ARNs in the account that you want the user to be able to view.</p>
* <p>The Amazon Resource Names for the Amazon QuickSight resources that the user is authorized to access during the lifetime of the session. If you choose <code>Dashboard</code> embedding experience, pass the list of dashboard ARNs in the account that you want the user to be able to view. Currently, you can pass up to 25 dashboard ARNs in each API call.</p>
*/
AuthorizedResourceArns: string[] | undefined;

Expand Down Expand Up @@ -4459,6 +4459,48 @@ export namespace UpdateIpRestrictionResponse {
});
}

export interface UpdatePublicSharingSettingsRequest {
/**
* <p>The Amazon Web Services account ID associated with your Amazon QuickSight subscription.</p>
*/
AwsAccountId: string | undefined;

/**
* <p>A boolean that indicates whether or not public sharing is enabled on a Amazon QuickSight account.</p>
*/
PublicSharingEnabled?: boolean;
}

export namespace UpdatePublicSharingSettingsRequest {
/**
* @internal
*/
export const filterSensitiveLog = (obj: UpdatePublicSharingSettingsRequest): any => ({
...obj,
});
}

export interface UpdatePublicSharingSettingsResponse {
/**
* <p>The Amazon Web Services request ID for this operation.</p>
*/
RequestId?: string;

/**
* <p>The HTTP status of the request.</p>
*/
Status?: number;
}

export namespace UpdatePublicSharingSettingsResponse {
/**
* @internal
*/
export const filterSensitiveLog = (obj: UpdatePublicSharingSettingsResponse): any => ({
...obj,
});
}

export interface UpdateTemplateRequest {
/**
* <p>The ID of the Amazon Web Services account that contains the template that you're updating.</p>
Expand Down
Loading

0 comments on commit 389837a

Please sign in to comment.