Commit 8e31156
chore(mixins-preview): do not extend event metadata (#36214)
### Issue # (if applicable)
Closes #<issue number here>.
### Reason for this change
Remove the detail interface that was extending the
`cdk.AWSEventMetadataProps` as extending creates problems in python.
### Description of changes
Before
```
export interface ObjectCreatedDetail {
readonly bucket?: BucketEvents.ObjectCreated.Bucket;
...otherfields
}
export interface PatternProps extends BucketEvents.ObjectCreated.ObjectCreatedDetail {
readonly eventMetadata?: cdk.AWSEventMetadataProps;
}
```
After this change:
```
export interface ObjectCreatedProps {
readonly eventMetadata?: cdk.AWSEventMetadataProps;
readonly bucket?: BucketEvents.ObjectCreated.Bucket;
...otherfields
}
```
The Pattern functions have been updated to:
```
public workSpacesAccessPattern(options?: WorkspaceEvents.WorkSpacesAccess.WorkSpacesAccessProps): events.EventPattern {
return {
source: ["aws.workspaces"],
detailType: ["WorkSpaces Access"],
detail: convertWorkSpacesAccessDetailToEventPattern(options, this.workspaceRef),
version: options?.eventMetadata?.version,
resources: options?.eventMetadata?.resources,
region: options?.eventMetadata?.region
};
}
```
And the `convertWorkSpacesAccessDetailToEventPattern` functions ignore
the `eventMetadata` property.
### Describe any new or updated permissions being added
<!-- What new or updated IAM permissions are needed to support the
changes being introduced? -->
### Description of how you validated changes
<!-- Have you added any unit tests and/or integration tests? Did you
test by hand? -->
Added unit test to ensure that the metadata was still being passed to
the `EventPattern`
### Checklist
- [X] My code adheres to the [CONTRIBUTING
GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and
[DESIGN
GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license*
Co-authored-by: Leon Michalski <leonmk@amazon.de>1 parent 18e18eb commit 8e31156
File tree
2 files changed
+54
-34
lines changed- packages/@aws-cdk/mixins-preview
- scripts/spec2eventbridge
- test/events
2 files changed
+54
-34
lines changedLines changed: 24 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| |||
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| 198 | + | |
197 | 199 | | |
198 | 200 | | |
199 | 201 | | |
| |||
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
231 | 245 | | |
232 | 246 | | |
233 | 247 | | |
| |||
329 | 343 | | |
330 | 344 | | |
331 | 345 | | |
| 346 | + | |
332 | 347 | | |
333 | 348 | | |
334 | 349 | | |
| |||
364 | 379 | | |
365 | 380 | | |
366 | 381 | | |
367 | | - | |
| 382 | + | |
368 | 383 | | |
369 | 384 | | |
370 | | - | |
| 385 | + | |
371 | 386 | | |
372 | 387 | | |
373 | 388 | | |
| |||
380 | 395 | | |
381 | 396 | | |
382 | 397 | | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
| 398 | + | |
403 | 399 | | |
404 | 400 | | |
405 | 401 | | |
| |||
411 | 407 | | |
412 | 408 | | |
413 | 409 | | |
414 | | - | |
| 410 | + | |
415 | 411 | | |
416 | | - | |
| 412 | + | |
417 | 413 | | |
418 | 414 | | |
419 | 415 | | |
420 | | - | |
421 | | - | |
422 | 416 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | 417 | | |
428 | 418 | | |
429 | 419 | | |
430 | 420 | | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
435 | 425 | | |
436 | 426 | | |
437 | 427 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
156 | 186 | | |
157 | 187 | | |
158 | 188 | | |
| |||
0 commit comments