1 | import { Bucket } from './bucket.js';
|
2 | export interface GetPolicyOptions {
|
3 | userProject?: string;
|
4 | requestedPolicyVersion?: number;
|
5 | }
|
6 | export type GetPolicyResponse = [Policy, unknown];
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export interface GetPolicyCallback {
|
14 | (err?: Error | null, acl?: Policy, apiResponse?: unknown): void;
|
15 | }
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | export interface SetPolicyOptions {
|
22 | userProject?: string;
|
23 | }
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | export type SetPolicyResponse = [Policy, unknown];
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | export interface SetPolicyCallback {
|
37 | (err?: Error | null, acl?: Policy, apiResponse?: object): void;
|
38 | }
|
39 | export interface Policy {
|
40 | bindings: PolicyBinding[];
|
41 | version?: number;
|
42 | etag?: string;
|
43 | }
|
44 | export interface PolicyBinding {
|
45 | role: string;
|
46 | members: string[];
|
47 | condition?: Expr;
|
48 | }
|
49 | export interface Expr {
|
50 | title?: string;
|
51 | description?: string;
|
52 | expression: string;
|
53 | }
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | export type TestIamPermissionsResponse = [{
|
60 | [key: string]: boolean;
|
61 | }, unknown];
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 | export interface TestIamPermissionsCallback {
|
69 | (err?: Error | null, acl?: {
|
70 | [key: string]: boolean;
|
71 | } | null, apiResponse?: unknown): void;
|
72 | }
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | export interface TestIamPermissionsOptions {
|
79 | userProject?: string;
|
80 | }
|
81 | export declare enum IAMExceptionMessages {
|
82 | POLICY_OBJECT_REQUIRED = "A policy object is required.",
|
83 | PERMISSIONS_REQUIRED = "Permissions are required."
|
84 | }
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 | declare class Iam {
|
104 | private request_;
|
105 | private resourceId_;
|
106 | constructor(bucket: Bucket);
|
107 | getPolicy(options?: GetPolicyOptions): Promise<GetPolicyResponse>;
|
108 | getPolicy(options: GetPolicyOptions, callback: GetPolicyCallback): void;
|
109 | getPolicy(callback: GetPolicyCallback): void;
|
110 | setPolicy(policy: Policy, options?: SetPolicyOptions): Promise<SetPolicyResponse>;
|
111 | setPolicy(policy: Policy, callback: SetPolicyCallback): void;
|
112 | setPolicy(policy: Policy, options: SetPolicyOptions, callback: SetPolicyCallback): void;
|
113 | testPermissions(permissions: string | string[], options?: TestIamPermissionsOptions): Promise<TestIamPermissionsResponse>;
|
114 | testPermissions(permissions: string | string[], callback: TestIamPermissionsCallback): void;
|
115 | testPermissions(permissions: string | string[], options: TestIamPermissionsOptions, callback: TestIamPermissionsCallback): void;
|
116 | }
|
117 | export { Iam };
|