@@ -139,6 +139,79 @@ public function addDeleteRule(array $condition)
139
139
return $ this ;
140
140
}
141
141
142
+ /**
143
+ * Adds a AbortIncompleteMultipartUpload lifecycle rule to Object Lifecycle.
144
+ *
145
+ * Example:
146
+ * ```
147
+ * $lifecycle->addAbortIncompleteMultipartUploadRule([
148
+ * 'age' => 50,
149
+ * 'isLive' => true
150
+ * ]);
151
+ * ```
152
+ *
153
+ * @param array $condition {
154
+ * The condition(s) where the rule will apply.
155
+ *
156
+ * @type int $age Age of an object (in days). This condition is
157
+ * satisfied when an object reaches the specified age.
158
+ * @type \DateTimeInterface|string $createdBefore This condition is
159
+ * satisfied when an object is created before midnight of the
160
+ * specified date in UTC. If a string is given, it must be a date
161
+ * in RFC 3339 format with only the date part (for instance,
162
+ * "2013-01-15").
163
+ * @type \DateTimeInterface|string $customTimeBefore This condition is
164
+ * satisfied when the custom time on an object is before this date
165
+ * in UTC. If a string is given, it must be a date in RFC 3339
166
+ * format with only the date part (for instance, "2013-01-15").
167
+ * @type int $daysSinceCustomTime Number of days elapsed since the
168
+ * user-specified timestamp set on an object. The condition is
169
+ * satisfied if the days elapsed is at least this number. If no
170
+ * custom timestamp is specified on an object, the condition does
171
+ * not apply.
172
+ * @type int $daysSinceNoncurrentTime Number of days elapsed since the
173
+ * noncurrent timestamp of an object. The condition is satisfied
174
+ * if the days elapsed is at least this number. This condition is
175
+ * relevant only for versioned objects. The value of the field
176
+ * must be a nonnegative integer. If it's zero, the object version
177
+ * will become eligible for Lifecycle action as soon as it becomes
178
+ * noncurrent.
179
+ * @type bool $isLive Relevant only for versioned objects. If the value
180
+ * is `true`, this condition matches live objects; if the value is
181
+ * `false`, it matches archived objects.
182
+ * @type string[] $matchesStorageClass Objects having any of the storage
183
+ * classes specified by this condition will be matched. Values
184
+ * include `"MULTI_REGIONAL"`, `"REGIONAL"`, `"NEARLINE"`,
185
+ * `"ARCHIVE"`, `"COLDLINE"`, `"STANDARD"`, and
186
+ * `"DURABLE_REDUCED_AVAILABILITY"`.
187
+ * @type \DateTimeInterface|string $noncurrentTimeBefore This condition
188
+ * is satisfied when the noncurrent time on an object is before
189
+ * this timestamp. This condition is relevant only for versioned
190
+ * objects. If a string is given, it must be a date in RFC 3339
191
+ * format with only the date part (for instance, "2013-01-15").
192
+ * @type int $numNewerVersions Relevant only for versioned objects. If
193
+ * the value is N, this condition is satisfied when there are at
194
+ * least N versions (including the live version) newer than this
195
+ * version of the object.
196
+ * @type string[] $matchesPrefix Objects having names which start with
197
+ * values specified by this condition will be matched.
198
+ * @type string[] $matchesSuffix Objects having names which end with
199
+ * values specified by this condition will be matched.
200
+ * }
201
+ * @return Lifecycle
202
+ */
203
+ public function addAbortIncompleteMultipartUploadRule (array $ condition )
204
+ {
205
+ $ this ->lifecycle ['rule ' ][] = [
206
+ 'action ' => [
207
+ 'type ' => 'AbortIncompleteMultipartUpload '
208
+ ],
209
+ 'condition ' => $ this ->formatCondition ($ condition )
210
+ ];
211
+
212
+ return $ this ;
213
+ }
214
+
142
215
/**
143
216
* Adds an Object Lifecycle Set Storage Class Rule.
144
217
*
0 commit comments