Skip to content

Commit 184ef26

Browse files
committed
feat!: stronger typing for lifecycle rules (googleapis#2215)
1 parent e0f45c2 commit 184ef26

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/bucket.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,25 @@ export interface LifecycleRule {
150150
condition: LifecycleCondition;
151151
}
152152

153+
export interface LifecycleCondition {
154+
age?: number;
155+
createdBefore?: Date | string;
156+
customTimeBefore?: Date | string;
157+
daysSinceCustomTime?: number;
158+
daysSinceNoncurrentTime?: number;
159+
isLive?: boolean;
160+
matchesPrefix?: string[];
161+
matchesSuffix?: string[];
162+
matchesStorageClass?: string[];
163+
noncurrentTimeBefore?: Date | string;
164+
numNewerVersions?: number;
165+
}
166+
167+
export interface LifecycleRule {
168+
action: LifecycleAction;
169+
condition: LifecycleCondition;
170+
}
171+
153172
export interface EnableLoggingOptions extends PreconditionOptions {
154173
bucket?: string | Bucket;
155174
prefix: string;

0 commit comments

Comments
 (0)