rustack-events-model 0.7.0

EventBridge model types for Rustack
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
//! EventBridge input types for Phase 0 through Phase 3 operations.
//!
//! All input structs use `PascalCase` JSON field naming to match the EventBridge
//! wire protocol (`awsJson1_1`). Optional fields are omitted when `None`.

use serde::{Deserialize, Serialize};
use serde_json::Value;

use crate::types::{Condition, DeadLetterConfig, Tag, Target};

// ===========================================================================
// Phase 0
// ===========================================================================

// ---------------------------------------------------------------------------
// CreateEventBus
// ---------------------------------------------------------------------------

/// Input for the `CreateEventBus` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct CreateEventBusInput {
    /// The name of the new event bus.
    pub name: String,

    /// A description of the event bus.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,

    /// Tags to associate with the event bus.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<Tag>,

    /// The name of the partner event source to associate with the event bus.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_source_name: Option<String>,

    /// Dead-letter queue configuration.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub dead_letter_config: Option<DeadLetterConfig>,

    /// The KMS key identifier for encryption.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub kms_key_identifier: Option<String>,
}

// ---------------------------------------------------------------------------
// DeleteEventBus
// ---------------------------------------------------------------------------

/// Input for the `DeleteEventBus` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct DeleteEventBusInput {
    /// The name of the event bus to delete.
    pub name: String,
}

// ---------------------------------------------------------------------------
// DescribeEventBus
// ---------------------------------------------------------------------------

/// Input for the `DescribeEventBus` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct DescribeEventBusInput {
    /// The name of the event bus to describe. Defaults to the default event bus.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

// ---------------------------------------------------------------------------
// ListEventBuses
// ---------------------------------------------------------------------------

/// Input for the `ListEventBuses` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ListEventBusesInput {
    /// Prefix to filter event bus names.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name_prefix: Option<String>,

    /// The token for the next set of results.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,

    /// The maximum number of results to return.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub limit: Option<i32>,
}

// ---------------------------------------------------------------------------
// PutRule
// ---------------------------------------------------------------------------

/// Input for the `PutRule` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PutRuleInput {
    /// The name of the rule.
    pub name: String,

    /// The event pattern in JSON format.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_pattern: Option<String>,

    /// The schedule expression (e.g., `"rate(5 minutes)"`).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub schedule_expression: Option<String>,

    /// The state of the rule (`ENABLED` or `DISABLED`).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub state: Option<String>,

    /// A description of the rule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,

    /// The IAM role ARN associated with the rule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub role_arn: Option<String>,

    /// Tags to associate with the rule.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<Tag>,

    /// The name of the event bus to associate with the rule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,
}

// ---------------------------------------------------------------------------
// DeleteRule
// ---------------------------------------------------------------------------

/// Input for the `DeleteRule` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct DeleteRuleInput {
    /// The name of the rule to delete.
    pub name: String,

    /// The name of the event bus associated with the rule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,

    /// Whether to force-delete a managed rule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub force: Option<bool>,
}

// ---------------------------------------------------------------------------
// DescribeRule
// ---------------------------------------------------------------------------

/// Input for the `DescribeRule` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct DescribeRuleInput {
    /// The name of the rule to describe.
    pub name: String,

    /// The name of the event bus associated with the rule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,
}

// ---------------------------------------------------------------------------
// ListRules
// ---------------------------------------------------------------------------

/// Input for the `ListRules` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ListRulesInput {
    /// Prefix to filter rule names.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name_prefix: Option<String>,

    /// The name of the event bus associated with the rules.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,

    /// The token for the next set of results.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,

    /// The maximum number of results to return.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub limit: Option<i32>,
}

// ---------------------------------------------------------------------------
// EnableRule
// ---------------------------------------------------------------------------

/// Input for the `EnableRule` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct EnableRuleInput {
    /// The name of the rule to enable.
    pub name: String,

    /// The name of the event bus associated with the rule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,
}

// ---------------------------------------------------------------------------
// DisableRule
// ---------------------------------------------------------------------------

/// Input for the `DisableRule` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct DisableRuleInput {
    /// The name of the rule to disable.
    pub name: String,

    /// The name of the event bus associated with the rule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,
}

// ---------------------------------------------------------------------------
// PutTargets
// ---------------------------------------------------------------------------

/// Input for the `PutTargets` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PutTargetsInput {
    /// The name of the rule to add targets to.
    pub rule: String,

    /// The targets to add to the rule.
    #[serde(default)]
    pub targets: Vec<Target>,

    /// The name of the event bus associated with the rule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,
}

// ---------------------------------------------------------------------------
// RemoveTargets
// ---------------------------------------------------------------------------

/// Input for the `RemoveTargets` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RemoveTargetsInput {
    /// The name of the rule to remove targets from.
    pub rule: String,

    /// The IDs of the targets to remove.
    #[serde(default)]
    pub ids: Vec<String>,

    /// The name of the event bus associated with the rule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,

    /// Whether to force-remove targets from a managed rule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub force: Option<bool>,
}

// ---------------------------------------------------------------------------
// ListTargetsByRule
// ---------------------------------------------------------------------------

/// Input for the `ListTargetsByRule` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ListTargetsByRuleInput {
    /// The name of the rule whose targets to list.
    pub rule: String,

    /// The name of the event bus associated with the rule.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,

    /// The token for the next set of results.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,

    /// The maximum number of results to return.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub limit: Option<i32>,
}

// ---------------------------------------------------------------------------
// PutEvents
// ---------------------------------------------------------------------------

/// Input for the `PutEvents` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PutEventsInput {
    /// The entries to publish to the event bus.
    #[serde(default)]
    pub entries: Vec<PutEventsRequestEntry>,

    /// The URL subdomain of the endpoint.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub endpoint_id: Option<String>,
}

/// An event entry for the `PutEvents` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PutEventsRequestEntry {
    /// The source of the event.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub source: Option<String>,

    /// The detail type of the event.
    #[serde(rename = "DetailType", skip_serializing_if = "Option::is_none")]
    pub detail_type: Option<String>,

    /// The event detail as a JSON string.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub detail: Option<String>,

    /// AWS resources involved in the event.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub resources: Vec<String>,

    /// The timestamp of the event.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub time: Option<String>,

    /// The event bus to publish the event to.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,

    /// An AWS X-Ray trace header.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub trace_header: Option<String>,
}

// ---------------------------------------------------------------------------
// TestEventPattern
// ---------------------------------------------------------------------------

/// Input for the `TestEventPattern` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct TestEventPatternInput {
    /// The event pattern to test.
    pub event_pattern: String,

    /// The event to test against the pattern, in JSON format.
    pub event: String,
}

// ===========================================================================
// Phase 1
// ===========================================================================

// ---------------------------------------------------------------------------
// TagResource
// ---------------------------------------------------------------------------

/// Input for the `TagResource` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct TagResourceInput {
    /// The ARN of the resource to tag.
    #[serde(rename = "ResourceARN")]
    pub resource_arn: String,

    /// The tags to associate with the resource.
    #[serde(default)]
    pub tags: Vec<Tag>,
}

// ---------------------------------------------------------------------------
// UntagResource
// ---------------------------------------------------------------------------

/// Input for the `UntagResource` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct UntagResourceInput {
    /// The ARN of the resource to untag.
    #[serde(rename = "ResourceARN")]
    pub resource_arn: String,

    /// The tag keys to remove.
    #[serde(default)]
    pub tag_keys: Vec<String>,
}

// ---------------------------------------------------------------------------
// ListTagsForResource
// ---------------------------------------------------------------------------

/// Input for the `ListTagsForResource` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ListTagsForResourceInput {
    /// The ARN of the resource whose tags to list.
    #[serde(rename = "ResourceARN")]
    pub resource_arn: String,
}

// ---------------------------------------------------------------------------
// PutPermission
// ---------------------------------------------------------------------------

/// Input for the `PutPermission` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PutPermissionInput {
    /// The name of the event bus to modify.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,

    /// The action to allow (e.g., `events:PutEvents`).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub action: Option<String>,

    /// The AWS account ID or `*` for all accounts.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub principal: Option<String>,

    /// An identifier for the statement in the policy.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub statement_id: Option<String>,

    /// A condition for the permission.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub condition: Option<Condition>,

    /// A full JSON policy to set on the event bus.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub policy: Option<String>,
}

// ---------------------------------------------------------------------------
// RemovePermission
// ---------------------------------------------------------------------------

/// Input for the `RemovePermission` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RemovePermissionInput {
    /// The name of the event bus to modify.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,

    /// The statement ID of the permission to remove.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub statement_id: Option<String>,

    /// Whether to remove all permissions from the event bus.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub remove_all_permissions: Option<bool>,
}

// ---------------------------------------------------------------------------
// ListRuleNamesByTarget
// ---------------------------------------------------------------------------

/// Input for the `ListRuleNamesByTarget` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ListRuleNamesByTargetInput {
    /// The ARN of the target to list rules for.
    pub target_arn: String,

    /// The name of the event bus associated with the rules.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_bus_name: Option<String>,

    /// The token for the next set of results.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,

    /// The maximum number of results to return.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub limit: Option<i32>,
}

// ===========================================================================
// Phase 2
// ===========================================================================

// ---------------------------------------------------------------------------
// UpdateEventBus
// ---------------------------------------------------------------------------

/// Input for the `UpdateEventBus` operation.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct UpdateEventBusInput {
    /// The name of the event bus to update.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// The updated description.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,

    /// The updated dead-letter queue configuration.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub dead_letter_config: Option<DeadLetterConfig>,

    /// The updated KMS key identifier.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub kms_key_identifier: Option<String>,
}

// ===========================================================================
// Phase 3 (stubs)
// ===========================================================================

/// Generic input wrapper for stub operations that pass through raw JSON.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(transparent)]
pub struct GenericInput {
    /// The raw JSON value.
    pub value: Value,
}