updateThemePermissions method

Future<UpdateThemePermissionsResponse> updateThemePermissions({
  1. required String awsAccountId,
  2. required String themeId,
  3. List<ResourcePermission>? grantPermissions,
  4. List<ResourcePermission>? revokePermissions,
})

Updates the resource permissions for a theme. Permissions apply to the action to grant or revoke permissions on, for example "quicksight:DescribeTheme".

Theme permissions apply in groupings. Valid groupings include the following for the three levels of permissions, which are user, owner, or no permissions:

  • User
    • "quicksight:DescribeTheme"
    • "quicksight:DescribeThemeAlias"
    • "quicksight:ListThemeAliases"
    • "quicksight:ListThemeVersions"
  • Owner
    • "quicksight:DescribeTheme"
    • "quicksight:DescribeThemeAlias"
    • "quicksight:ListThemeAliases"
    • "quicksight:ListThemeVersions"
    • "quicksight:DeleteTheme"
    • "quicksight:UpdateTheme"
    • "quicksight:CreateThemeAlias"
    • "quicksight:DeleteThemeAlias"
    • "quicksight:UpdateThemeAlias"
    • "quicksight:UpdateThemePermissions"
    • "quicksight:DescribeThemePermissions"
  • To specify no permissions, omit the permissions list.

May throw AccessDeniedException. May throw InvalidParameterValueException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw UnsupportedUserEditionException. May throw InternalFailureException.

Parameter awsAccountId : The ID of the AWS account that contains the theme.

Parameter themeId : The ID for the theme.

Parameter grantPermissions : A list of resource permissions to be granted for the theme.

Parameter revokePermissions : A list of resource permissions to be revoked from the theme.

Implementation

Future<UpdateThemePermissionsResponse> updateThemePermissions({
  required String awsAccountId,
  required String themeId,
  List<ResourcePermission>? grantPermissions,
  List<ResourcePermission>? revokePermissions,
}) async {
  ArgumentError.checkNotNull(awsAccountId, 'awsAccountId');
  _s.validateStringLength(
    'awsAccountId',
    awsAccountId,
    12,
    12,
    isRequired: true,
  );
  ArgumentError.checkNotNull(themeId, 'themeId');
  _s.validateStringLength(
    'themeId',
    themeId,
    1,
    2048,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    if (grantPermissions != null) 'GrantPermissions': grantPermissions,
    if (revokePermissions != null) 'RevokePermissions': revokePermissions,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/themes/${Uri.encodeComponent(themeId)}/permissions',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateThemePermissionsResponse.fromJson(response);
}