|
| 1 | +// smithy-typescript generated code |
| 2 | +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; |
| 5 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 6 | +import { |
| 7 | + FinalizeHandlerArguments, |
| 8 | + Handler, |
| 9 | + HandlerExecutionContext, |
| 10 | + HttpHandlerOptions as __HttpHandlerOptions, |
| 11 | + MetadataBearer as __MetadataBearer, |
| 12 | + MiddlewareStack, |
| 13 | + SerdeContext as __SerdeContext, |
| 14 | + SMITHY_CONTEXT_KEY, |
| 15 | +} from "@smithy/types"; |
| 16 | + |
| 17 | +import { CloudTrailClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudTrailClient"; |
| 18 | +import { DisableFederationRequest, DisableFederationResponse } from "../models/models_0"; |
| 19 | +import { de_DisableFederationCommand, se_DisableFederationCommand } from "../protocols/Aws_json1_1"; |
| 20 | + |
| 21 | +/** |
| 22 | + * @public |
| 23 | + */ |
| 24 | +export { __MetadataBearer, $Command }; |
| 25 | +/** |
| 26 | + * @public |
| 27 | + * |
| 28 | + * The input for {@link DisableFederationCommand}. |
| 29 | + */ |
| 30 | +export interface DisableFederationCommandInput extends DisableFederationRequest {} |
| 31 | +/** |
| 32 | + * @public |
| 33 | + * |
| 34 | + * The output of {@link DisableFederationCommand}. |
| 35 | + */ |
| 36 | +export interface DisableFederationCommandOutput extends DisableFederationResponse, __MetadataBearer {} |
| 37 | + |
| 38 | +/** |
| 39 | + * @public |
| 40 | + * <p> |
| 41 | + * Disables Lake query federation on the specified event data store. When you disable federation, CloudTrail |
| 42 | + * removes the metadata associated with the federated event data store in the Glue Data Catalog and removes registration for |
| 43 | + * the federation role ARN and event data store in Lake Formation. No CloudTrail Lake data is deleted |
| 44 | + * when you disable federation. |
| 45 | + * </p> |
| 46 | + * @example |
| 47 | + * Use a bare-bones client and the command you need to make an API call. |
| 48 | + * ```javascript |
| 49 | + * import { CloudTrailClient, DisableFederationCommand } from "@aws-sdk/client-cloudtrail"; // ES Modules import |
| 50 | + * // const { CloudTrailClient, DisableFederationCommand } = require("@aws-sdk/client-cloudtrail"); // CommonJS import |
| 51 | + * const client = new CloudTrailClient(config); |
| 52 | + * const input = { // DisableFederationRequest |
| 53 | + * EventDataStore: "STRING_VALUE", // required |
| 54 | + * }; |
| 55 | + * const command = new DisableFederationCommand(input); |
| 56 | + * const response = await client.send(command); |
| 57 | + * // { // DisableFederationResponse |
| 58 | + * // EventDataStoreArn: "STRING_VALUE", |
| 59 | + * // FederationStatus: "ENABLING" || "ENABLED" || "DISABLING" || "DISABLED", |
| 60 | + * // }; |
| 61 | + * |
| 62 | + * ``` |
| 63 | + * |
| 64 | + * @param DisableFederationCommandInput - {@link DisableFederationCommandInput} |
| 65 | + * @returns {@link DisableFederationCommandOutput} |
| 66 | + * @see {@link DisableFederationCommandInput} for command's `input` shape. |
| 67 | + * @see {@link DisableFederationCommandOutput} for command's `response` shape. |
| 68 | + * @see {@link CloudTrailClientResolvedConfig | config} for CloudTrailClient's `config` shape. |
| 69 | + * |
| 70 | + * @throws {@link AccessDeniedException} (client fault) |
| 71 | + * <p> |
| 72 | + * You do not have sufficient access to perform this action. |
| 73 | + * </p> |
| 74 | + * |
| 75 | + * @throws {@link CloudTrailAccessNotEnabledException} (client fault) |
| 76 | + * <p>This exception is thrown when trusted access has not been enabled between CloudTrail and Organizations. For more information, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html">Enabling Trusted Access with Other Amazon Web Services Services</a> and <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html">Prepare For Creating a Trail For Your Organization</a>. </p> |
| 77 | + * |
| 78 | + * @throws {@link ConcurrentModificationException} (client fault) |
| 79 | + * <p> |
| 80 | + * You are trying to update a resource when another request is in progress. Allow sufficient wait time for the previous request to complete, then retry your request. |
| 81 | + * </p> |
| 82 | + * |
| 83 | + * @throws {@link EventDataStoreARNInvalidException} (client fault) |
| 84 | + * <p>The specified event data store ARN is not valid or does not map to an event data store |
| 85 | + * in your account.</p> |
| 86 | + * |
| 87 | + * @throws {@link EventDataStoreNotFoundException} (client fault) |
| 88 | + * <p>The specified event data store was not found.</p> |
| 89 | + * |
| 90 | + * @throws {@link InactiveEventDataStoreException} (client fault) |
| 91 | + * <p>The event data store is inactive.</p> |
| 92 | + * |
| 93 | + * @throws {@link InsufficientDependencyServiceAccessPermissionException} (client fault) |
| 94 | + * <p>This exception is thrown when the IAM identity that is used to create |
| 95 | + * the organization resource lacks one or more required permissions for creating an |
| 96 | + * organization resource in a required service.</p> |
| 97 | + * |
| 98 | + * @throws {@link InvalidParameterException} (client fault) |
| 99 | + * <p>The request includes a parameter that is not valid.</p> |
| 100 | + * |
| 101 | + * @throws {@link NoManagementAccountSLRExistsException} (client fault) |
| 102 | + * <p> This exception is thrown when the management account does not have a service-linked |
| 103 | + * role. </p> |
| 104 | + * |
| 105 | + * @throws {@link NotOrganizationMasterAccountException} (client fault) |
| 106 | + * <p>This exception is thrown when the Amazon Web Services account making the request to |
| 107 | + * create or update an organization trail or event data store is not the management account |
| 108 | + * for an organization in Organizations. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html">Prepare For Creating a Trail For Your Organization</a> or <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html">Create an event data store</a>.</p> |
| 109 | + * |
| 110 | + * @throws {@link OperationNotPermittedException} (client fault) |
| 111 | + * <p>This exception is thrown when the requested operation is not permitted.</p> |
| 112 | + * |
| 113 | + * @throws {@link OrganizationNotInAllFeaturesModeException} (client fault) |
| 114 | + * <p>This exception is thrown when Organizations is not configured to support all |
| 115 | + * features. All features must be enabled in Organizations to support creating an |
| 116 | + * organization trail or event data store.</p> |
| 117 | + * |
| 118 | + * @throws {@link OrganizationsNotInUseException} (client fault) |
| 119 | + * <p>This exception is thrown when the request is made from an Amazon Web Services account |
| 120 | + * that is not a member of an organization. To make this request, sign in using the |
| 121 | + * credentials of an account that belongs to an organization.</p> |
| 122 | + * |
| 123 | + * @throws {@link UnsupportedOperationException} (client fault) |
| 124 | + * <p>This exception is thrown when the requested operation is not supported.</p> |
| 125 | + * |
| 126 | + * @throws {@link CloudTrailServiceException} |
| 127 | + * <p>Base exception class for all service exceptions from CloudTrail service.</p> |
| 128 | + * |
| 129 | + */ |
| 130 | +export class DisableFederationCommand extends $Command< |
| 131 | + DisableFederationCommandInput, |
| 132 | + DisableFederationCommandOutput, |
| 133 | + CloudTrailClientResolvedConfig |
| 134 | +> { |
| 135 | + public static getEndpointParameterInstructions(): EndpointParameterInstructions { |
| 136 | + return { |
| 137 | + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, |
| 138 | + Endpoint: { type: "builtInParams", name: "endpoint" }, |
| 139 | + Region: { type: "builtInParams", name: "region" }, |
| 140 | + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, |
| 141 | + }; |
| 142 | + } |
| 143 | + |
| 144 | + /** |
| 145 | + * @public |
| 146 | + */ |
| 147 | + constructor(readonly input: DisableFederationCommandInput) { |
| 148 | + super(); |
| 149 | + } |
| 150 | + |
| 151 | + /** |
| 152 | + * @internal |
| 153 | + */ |
| 154 | + resolveMiddleware( |
| 155 | + clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, |
| 156 | + configuration: CloudTrailClientResolvedConfig, |
| 157 | + options?: __HttpHandlerOptions |
| 158 | + ): Handler<DisableFederationCommandInput, DisableFederationCommandOutput> { |
| 159 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 160 | + this.middlewareStack.use( |
| 161 | + getEndpointPlugin(configuration, DisableFederationCommand.getEndpointParameterInstructions()) |
| 162 | + ); |
| 163 | + |
| 164 | + const stack = clientStack.concat(this.middlewareStack); |
| 165 | + |
| 166 | + const { logger } = configuration; |
| 167 | + const clientName = "CloudTrailClient"; |
| 168 | + const commandName = "DisableFederationCommand"; |
| 169 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 170 | + logger, |
| 171 | + clientName, |
| 172 | + commandName, |
| 173 | + inputFilterSensitiveLog: (_: any) => _, |
| 174 | + outputFilterSensitiveLog: (_: any) => _, |
| 175 | + [SMITHY_CONTEXT_KEY]: { |
| 176 | + service: "CloudTrail_20131101", |
| 177 | + operation: "DisableFederation", |
| 178 | + }, |
| 179 | + }; |
| 180 | + const { requestHandler } = configuration; |
| 181 | + return stack.resolve( |
| 182 | + (request: FinalizeHandlerArguments<any>) => |
| 183 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 184 | + handlerExecutionContext |
| 185 | + ); |
| 186 | + } |
| 187 | + |
| 188 | + /** |
| 189 | + * @internal |
| 190 | + */ |
| 191 | + private serialize(input: DisableFederationCommandInput, context: __SerdeContext): Promise<__HttpRequest> { |
| 192 | + return se_DisableFederationCommand(input, context); |
| 193 | + } |
| 194 | + |
| 195 | + /** |
| 196 | + * @internal |
| 197 | + */ |
| 198 | + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DisableFederationCommandOutput> { |
| 199 | + return de_DisableFederationCommand(output, context); |
| 200 | + } |
| 201 | +} |
0 commit comments