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