import { Command as $Command } from "@smithy/core/client"; import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { UpdatePolicyInput, UpdatePolicyOutput } from "../models/models_0"; import type { ServiceInputTypes, ServiceOutputTypes, VerifiedPermissionsClientResolvedConfig } from "../VerifiedPermissionsClient"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link UpdatePolicyCommand}. */ export interface UpdatePolicyCommandInput extends UpdatePolicyInput { } /** * @public * * The output of {@link UpdatePolicyCommand}. */ export interface UpdatePolicyCommandOutput extends UpdatePolicyOutput, __MetadataBearer { } declare const UpdatePolicyCommand_base: { new (input: UpdatePolicyCommandInput): import("@smithy/core/client").CommandImpl; new (input: UpdatePolicyCommandInput): import("@smithy/core/client").CommandImpl; getEndpointParameterInstructions(): { [x: string]: unknown; }; }; /** *

Modifies a Cedar static policy in the specified policy store. You can change only certain elements of the UpdatePolicyDefinition parameter. You can directly update only static policies. To change a template-linked policy, you must update the template instead, using UpdatePolicyTemplate.

  • If policy validation is enabled in the policy store, then updating a static policy causes Verified Permissions to validate the policy against the schema in the policy store. If the updated static policy doesn't pass validation, the operation fails and the update isn't stored.

  • When you edit a static policy, you can change only certain elements of a static policy:

    • The action referenced by the policy.

    • A condition clause, such as when and unless.

    You can't change these elements of a static policy:

    • Changing a policy from a static policy to a template-linked policy.

    • Changing the effect of a static policy from permit or forbid.

    • The principal referenced by a static policy.

    • The resource referenced by a static policy.

  • To update a template-linked policy, you must update the template instead.

Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { VerifiedPermissionsClient, UpdatePolicyCommand } from "@aws-sdk/client-verifiedpermissions"; // ES Modules import * // const { VerifiedPermissionsClient, UpdatePolicyCommand } = require("@aws-sdk/client-verifiedpermissions"); // CommonJS import * // import type { VerifiedPermissionsClientConfig } from "@aws-sdk/client-verifiedpermissions"; * const config = {}; // type is VerifiedPermissionsClientConfig * const client = new VerifiedPermissionsClient(config); * const input = { // UpdatePolicyInput * policyStoreId: "STRING_VALUE", // required * policyId: "STRING_VALUE", // required * definition: { // UpdatePolicyDefinition Union: only one key present * static: { // UpdateStaticPolicyDefinition * description: "STRING_VALUE", * statement: "STRING_VALUE", // required * }, * }, * name: "STRING_VALUE", * }; * const command = new UpdatePolicyCommand(input); * const response = await client.send(command); * // { // UpdatePolicyOutput * // policyStoreId: "STRING_VALUE", // required * // policyId: "STRING_VALUE", // required * // policyType: "STATIC" || "TEMPLATE_LINKED", // required * // principal: { // EntityIdentifier * // entityType: "STRING_VALUE", // required * // entityId: "STRING_VALUE", // required * // }, * // resource: { * // entityType: "STRING_VALUE", // required * // entityId: "STRING_VALUE", // required * // }, * // actions: [ // ActionIdentifierList * // { // ActionIdentifier * // actionType: "STRING_VALUE", // required * // actionId: "STRING_VALUE", // required * // }, * // ], * // createdDate: new Date("TIMESTAMP"), // required * // lastUpdatedDate: new Date("TIMESTAMP"), // required * // effect: "Permit" || "Forbid", * // }; * * ``` * * @param UpdatePolicyCommandInput - {@link UpdatePolicyCommandInput} * @returns {@link UpdatePolicyCommandOutput} * @see {@link UpdatePolicyCommandInput} for command's `input` shape. * @see {@link UpdatePolicyCommandOutput} for command's `response` shape. * @see {@link VerifiedPermissionsClientResolvedConfig | config} for VerifiedPermissionsClient's `config` shape. * * @throws {@link ConflictException} (client fault) *

The request failed because another request to modify a resource occurred at the same time.

* * @throws {@link ResourceNotFoundException} (client fault) *

The request failed because it references a resource that doesn't exist.

* * @throws {@link ServiceQuotaExceededException} (client fault) *

The request failed because it would cause a service quota to be exceeded.

* * @throws {@link AccessDeniedException} (client fault) *

You don't have sufficient access to perform this action.

* * @throws {@link InternalServerException} (server fault) *

The request failed because of an internal error. Try your request again later

* * @throws {@link ThrottlingException} (client fault) *

The request failed because it exceeded a throttling quota.

* * @throws {@link ValidationException} (client fault) *

The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid.

The possible reasons include the following:

* * @throws {@link VerifiedPermissionsServiceException} *

Base exception class for all service exceptions from VerifiedPermissions service.

* * * @example UpdatePolicy * ```javascript * // The following example replaces the definition of the specified static policy with a new one. * const input = { * definition: { * static: { * statement: `permit(principal, action, resource in Album::"public_folder");` * } * }, * name: "name/example-policy-2", * policyId: "9wYxMpljbbZQb5fcZHyJhY", * policyStoreId: "C7v5xMplfFH3i3e4Jrzb1a" * }; * const command = new UpdatePolicyCommand(input); * const response = await client.send(command); * /* response is * { * createdDate: "2024-08-12T18:20:50.99Z", * lastUpdatedDate: "2024-08-12T18:20:50.99Z", * policyId: "9wYxMpljbbZQb5fcZHyJhY", * policyStoreId: "C7v5xMplfFH3i3e4Jrzb1a", * policyType: "STATIC", * resource: { * entityId: "public_folder", * entityType: "Album" * } * } * *\/ * ``` * * @public */ export declare class UpdatePolicyCommand extends UpdatePolicyCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: UpdatePolicyInput; output: UpdatePolicyOutput; }; sdk: { input: UpdatePolicyCommandInput; output: UpdatePolicyCommandOutput; }; }; }