kcr_lambda_services_k8s_aws 3.20260602.223721

Kubernetes Custom Resource Bindings
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
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --derive=Default --derive=PartialEq --smart-derive-elision --filename crd-catalog/aws-controllers-k8s/lambda-controller/lambda.services.k8s.aws/v1alpha1/eventsourcemappings.yaml
// kopium version: 0.23.0

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use serde::{Serialize, Deserialize};
    pub use std::collections::BTreeMap;
    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
}

use self::prelude::*;

/// EventSourceMappingSpec defines the desired state of EventSourceMapping.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[kube(group = "lambda.services.k8s.aws", version = "v1alpha1", kind = "EventSourceMapping", plural = "eventsourcemappings")]
#[kube(namespaced)]
#[kube(status = "EventSourceMappingStatus")]
#[kube(schema = "disabled")]
#[kube(derive="Default")]
#[kube(derive="PartialEq")]
pub struct EventSourceMappingSpec {
    /// Specific configuration settings for an Amazon Managed Streaming for Apache
    /// Kafka (Amazon MSK) event source.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "amazonManagedKafkaEventSourceConfig")]
    pub amazon_managed_kafka_event_source_config: Option<EventSourceMappingAmazonManagedKafkaEventSourceConfig>,
    /// The maximum number of records in each batch that Lambda pulls from your stream
    /// or queue and sends to your function. Lambda passes all of the records in
    /// the batch to the function in a single call, up to the payload limit for synchronous
    /// invocation (6 MB).
    /// 
    ///    * Amazon Kinesis – Default 100. Max 10,000.
    /// 
    ///    * Amazon DynamoDB Streams – Default 100. Max 10,000.
    /// 
    ///    * Amazon Simple Queue Service – Default 10. For standard queues the
    ///    max is 10,000. For FIFO queues the max is 10.
    /// 
    ///    * Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000.
    /// 
    ///    * Self-managed Apache Kafka – Default 100. Max 10,000.
    /// 
    ///    * Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000.
    /// 
    ///    * DocumentDB – Default 100. Max 10,000.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "batchSize")]
    pub batch_size: Option<i64>,
    /// (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) If
    /// the function returns an error, split the batch in two and retry.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "bisectBatchOnFunctionError")]
    pub bisect_batch_on_function_error: Option<bool>,
    /// (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A
    /// configuration object that specifies the destination of an event after Lambda
    /// processes it.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "destinationConfig")]
    pub destination_config: Option<EventSourceMappingDestinationConfig>,
    /// When true, the event source mapping is active. When false, Lambda pauses
    /// polling and invocation.
    /// 
    /// Default: True
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// The Amazon Resource Name (ARN) of the event source.
    /// 
    ///    * Amazon Kinesis – The ARN of the data stream or a stream consumer.
    /// 
    ///    * Amazon DynamoDB Streams – The ARN of the stream.
    /// 
    ///    * Amazon Simple Queue Service – The ARN of the queue.
    /// 
    ///    * Amazon Managed Streaming for Apache Kafka – The ARN of the cluster
    ///    or the ARN of the VPC connection (for cross-account event source mappings
    ///    (<https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)).>
    /// 
    ///    * Amazon MQ – The ARN of the broker.
    /// 
    ///    * Amazon DocumentDB – The ARN of the DocumentDB change stream.
    /// 
    /// Regex Pattern: `^arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)$`
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "eventSourceARN")]
    pub event_source_arn: Option<String>,
    /// AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference
    /// type to provide more user friendly syntax for references using 'from' field
    /// Ex:
    /// APIIDRef:
    /// 
    /// 	from:
    /// 	  name: my-api
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "eventSourceRef")]
    pub event_source_ref: Option<EventSourceMappingEventSourceRef>,
    /// An object that defines the filter criteria that determine whether Lambda
    /// should process an event. For more information, see Lambda event filtering
    /// (<https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html).>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "filterCriteria")]
    pub filter_criteria: Option<EventSourceMappingFilterCriteria>,
    /// The name or ARN of the Lambda function.
    /// 
    /// Name formats
    /// 
    ///    * Function name – MyFunction.
    /// 
    ///    * Function ARN – arn:aws:lambda:us-west-2:123456789012:function:MyFunction.
    /// 
    ///    * Version or Alias ARN – arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.
    /// 
    ///    * Partial ARN – 123456789012:function:MyFunction.
    /// 
    /// The length constraint applies only to the full ARN. If you specify only the
    /// function name, it's limited to 64 characters in length.
    /// 
    /// Regex Pattern: `^(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST(\.PUBLISHED)?|[a-zA-Z0-9-_]+))?$`
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionName")]
    pub function_name: Option<String>,
    /// AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference
    /// type to provide more user friendly syntax for references using 'from' field
    /// Ex:
    /// APIIDRef:
    /// 
    /// 	from:
    /// 	  name: my-api
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionRef")]
    pub function_ref: Option<EventSourceMappingFunctionRef>,
    /// (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and Amazon
    /// SQS) A list of current response type enums applied to the event source mapping.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionResponseTypes")]
    pub function_response_types: Option<Vec<String>>,
    /// The maximum amount of time, in seconds, that Lambda spends gathering records
    /// before invoking the function. You can configure MaximumBatchingWindowInSeconds
    /// to any value from 0 seconds to 300 seconds in increments of seconds.
    /// 
    /// For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching
    /// window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ,
    /// and DocumentDB event sources, the default batching window is 500 ms. Note
    /// that because you can only change MaximumBatchingWindowInSeconds in increments
    /// of seconds, you cannot revert back to the 500 ms default batching window
    /// after you have changed it. To restore the default batching window, you must
    /// create a new event source mapping.
    /// 
    /// Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when
    /// you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds
    /// to at least 1.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maximumBatchingWindowInSeconds")]
    pub maximum_batching_window_in_seconds: Option<i64>,
    /// (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard
    /// records older than the specified age. The default value is infinite (-1).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maximumRecordAgeInSeconds")]
    pub maximum_record_age_in_seconds: Option<i64>,
    /// (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard
    /// records after the specified number of retries. The default value is infinite
    /// (-1). When set to infinite (-1), failed records are retried until the record
    /// expires.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maximumRetryAttempts")]
    pub maximum_retry_attempts: Option<i64>,
    /// (Kinesis and DynamoDB Streams only) The number of batches to process from
    /// each shard concurrently.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "parallelizationFactor")]
    pub parallelization_factor: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "queueRefs")]
    pub queue_refs: Option<Vec<EventSourceMappingQueueRefs>>,
    /// (MQ) The name of the Amazon MQ broker destination queue to consume.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub queues: Option<Vec<String>>,
    /// (Amazon SQS only) The scaling configuration for the event source. For more
    /// information, see Configuring maximum concurrency for Amazon SQS event sources
    /// (<https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency).>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "scalingConfig")]
    pub scaling_config: Option<EventSourceMappingScalingConfig>,
    /// The self-managed Apache Kafka cluster to receive records from.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "selfManagedEventSource")]
    pub self_managed_event_source: Option<EventSourceMappingSelfManagedEventSource>,
    /// Specific configuration settings for a self-managed Apache Kafka event source.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "selfManagedKafkaEventSourceConfig")]
    pub self_managed_kafka_event_source_config: Option<EventSourceMappingSelfManagedKafkaEventSourceConfig>,
    /// An array of authentication protocols or VPC components required to secure
    /// your event source.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sourceAccessConfigurations")]
    pub source_access_configurations: Option<Vec<EventSourceMappingSourceAccessConfigurations>>,
    /// The position in a stream from which to start reading. Required for Amazon
    /// Kinesis and Amazon DynamoDB Stream event sources. AT_TIMESTAMP is supported
    /// only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed
    /// Apache Kafka.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "startingPosition")]
    pub starting_position: Option<String>,
    /// With StartingPosition set to AT_TIMESTAMP, the time from which to start reading.
    /// StartingPositionTimestamp cannot be in the future.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "startingPositionTimestamp")]
    pub starting_position_timestamp: Option<String>,
    /// The name of the Kafka topic.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub topics: Option<Vec<String>>,
    /// (Kinesis and DynamoDB Streams only) The duration in seconds of a processing
    /// window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds
    /// indicates no tumbling window.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "tumblingWindowInSeconds")]
    pub tumbling_window_in_seconds: Option<i64>,
}

/// Specific configuration settings for an Amazon Managed Streaming for Apache
/// Kafka (Amazon MSK) event source.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingAmazonManagedKafkaEventSourceConfig {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "consumerGroupID")]
    pub consumer_group_id: Option<String>,
    /// Specific configuration settings for a Kafka schema registry.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "schemaRegistryConfig")]
    pub schema_registry_config: Option<EventSourceMappingAmazonManagedKafkaEventSourceConfigSchemaRegistryConfig>,
}

/// Specific configuration settings for a Kafka schema registry.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingAmazonManagedKafkaEventSourceConfigSchemaRegistryConfig {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "accessConfigs")]
    pub access_configs: Option<Vec<EventSourceMappingAmazonManagedKafkaEventSourceConfigSchemaRegistryConfigAccessConfigs>>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "eventRecordFormat")]
    pub event_record_format: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "schemaRegistryURI")]
    pub schema_registry_uri: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "schemaValidationConfigs")]
    pub schema_validation_configs: Option<Vec<EventSourceMappingAmazonManagedKafkaEventSourceConfigSchemaRegistryConfigSchemaValidationConfigs>>,
}

/// Specific access configuration settings that tell Lambda how to authenticate
/// with your schema registry.
/// 
/// If you're working with an Glue schema registry, don't provide authentication
/// details in this object. Instead, ensure that your execution role has the
/// required permissions for Lambda to access your cluster.
/// 
/// If you're working with a Confluent schema registry, choose the authentication
/// method in the Type field, and provide the Secrets Manager secret ARN in the
/// URI field.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingAmazonManagedKafkaEventSourceConfigSchemaRegistryConfigAccessConfigs {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub uri: Option<String>,
    /// Reference field for URI
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "uriRef")]
    pub uri_ref: Option<EventSourceMappingAmazonManagedKafkaEventSourceConfigSchemaRegistryConfigAccessConfigsUriRef>,
}

/// Reference field for URI
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingAmazonManagedKafkaEventSourceConfigSchemaRegistryConfigAccessConfigsUriRef {
    /// AWSResourceReference provides all the values necessary to reference another
    /// k8s resource for finding the identifier(Id/ARN/Name)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub from: Option<EventSourceMappingAmazonManagedKafkaEventSourceConfigSchemaRegistryConfigAccessConfigsUriRefFrom>,
}

/// AWSResourceReference provides all the values necessary to reference another
/// k8s resource for finding the identifier(Id/ARN/Name)
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingAmazonManagedKafkaEventSourceConfigSchemaRegistryConfigAccessConfigsUriRefFrom {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// Specific schema validation configuration settings that tell Lambda the message
/// attributes you want to validate and filter using your schema registry.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingAmazonManagedKafkaEventSourceConfigSchemaRegistryConfigSchemaValidationConfigs {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub attribute: Option<String>,
}

/// (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A
/// configuration object that specifies the destination of an event after Lambda
/// processes it.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingDestinationConfig {
    /// A destination for events that failed processing. For more information, see
    /// Adding a destination (<https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-async-destinations).>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onFailure")]
    pub on_failure: Option<EventSourceMappingDestinationConfigOnFailure>,
    /// A destination for events that were processed successfully.
    /// 
    /// To retain records of successful asynchronous invocations (<https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations),>
    /// you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function,
    /// or Amazon EventBridge event bus as the destination.
    /// 
    /// OnSuccess is not supported in CreateEventSourceMapping or UpdateEventSourceMapping
    /// requests.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onSuccess")]
    pub on_success: Option<EventSourceMappingDestinationConfigOnSuccess>,
}

/// A destination for events that failed processing. For more information, see
/// Adding a destination (<https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-async-destinations).>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingDestinationConfigOnFailure {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub destination: Option<String>,
}

/// A destination for events that were processed successfully.
/// 
/// To retain records of successful asynchronous invocations (<https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations),>
/// you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function,
/// or Amazon EventBridge event bus as the destination.
/// 
/// OnSuccess is not supported in CreateEventSourceMapping or UpdateEventSourceMapping
/// requests.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingDestinationConfigOnSuccess {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub destination: Option<String>,
}

/// AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference
/// type to provide more user friendly syntax for references using 'from' field
/// Ex:
/// APIIDRef:
/// 
/// 	from:
/// 	  name: my-api
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingEventSourceRef {
    /// AWSResourceReference provides all the values necessary to reference another
    /// k8s resource for finding the identifier(Id/ARN/Name)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub from: Option<EventSourceMappingEventSourceRefFrom>,
}

/// AWSResourceReference provides all the values necessary to reference another
/// k8s resource for finding the identifier(Id/ARN/Name)
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingEventSourceRefFrom {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// An object that defines the filter criteria that determine whether Lambda
/// should process an event. For more information, see Lambda event filtering
/// (<https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html).>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingFilterCriteria {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub filters: Option<Vec<EventSourceMappingFilterCriteriaFilters>>,
}

/// A structure within a FilterCriteria object that defines an event filtering
/// pattern.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingFilterCriteriaFilters {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub pattern: Option<String>,
}

/// AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference
/// type to provide more user friendly syntax for references using 'from' field
/// Ex:
/// APIIDRef:
/// 
/// 	from:
/// 	  name: my-api
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingFunctionRef {
    /// AWSResourceReference provides all the values necessary to reference another
    /// k8s resource for finding the identifier(Id/ARN/Name)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub from: Option<EventSourceMappingFunctionRefFrom>,
}

/// AWSResourceReference provides all the values necessary to reference another
/// k8s resource for finding the identifier(Id/ARN/Name)
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingFunctionRefFrom {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference
/// type to provide more user friendly syntax for references using 'from' field
/// Ex:
/// APIIDRef:
/// 
/// 	from:
/// 	  name: my-api
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingQueueRefs {
    /// AWSResourceReference provides all the values necessary to reference another
    /// k8s resource for finding the identifier(Id/ARN/Name)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub from: Option<EventSourceMappingQueueRefsFrom>,
}

/// AWSResourceReference provides all the values necessary to reference another
/// k8s resource for finding the identifier(Id/ARN/Name)
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingQueueRefsFrom {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// (Amazon SQS only) The scaling configuration for the event source. For more
/// information, see Configuring maximum concurrency for Amazon SQS event sources
/// (<https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency).>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingScalingConfig {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maximumConcurrency")]
    pub maximum_concurrency: Option<i64>,
}

/// The self-managed Apache Kafka cluster to receive records from.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingSelfManagedEventSource {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub endpoints: Option<BTreeMap<String, Vec<String>>>,
}

/// Specific configuration settings for a self-managed Apache Kafka event source.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingSelfManagedKafkaEventSourceConfig {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "consumerGroupID")]
    pub consumer_group_id: Option<String>,
    /// Specific configuration settings for a Kafka schema registry.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "schemaRegistryConfig")]
    pub schema_registry_config: Option<EventSourceMappingSelfManagedKafkaEventSourceConfigSchemaRegistryConfig>,
}

/// Specific configuration settings for a Kafka schema registry.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingSelfManagedKafkaEventSourceConfigSchemaRegistryConfig {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "accessConfigs")]
    pub access_configs: Option<Vec<EventSourceMappingSelfManagedKafkaEventSourceConfigSchemaRegistryConfigAccessConfigs>>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "eventRecordFormat")]
    pub event_record_format: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "schemaRegistryURI")]
    pub schema_registry_uri: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "schemaValidationConfigs")]
    pub schema_validation_configs: Option<Vec<EventSourceMappingSelfManagedKafkaEventSourceConfigSchemaRegistryConfigSchemaValidationConfigs>>,
}

/// Specific access configuration settings that tell Lambda how to authenticate
/// with your schema registry.
/// 
/// If you're working with an Glue schema registry, don't provide authentication
/// details in this object. Instead, ensure that your execution role has the
/// required permissions for Lambda to access your cluster.
/// 
/// If you're working with a Confluent schema registry, choose the authentication
/// method in the Type field, and provide the Secrets Manager secret ARN in the
/// URI field.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingSelfManagedKafkaEventSourceConfigSchemaRegistryConfigAccessConfigs {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub uri: Option<String>,
    /// Reference field for URI
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "uriRef")]
    pub uri_ref: Option<EventSourceMappingSelfManagedKafkaEventSourceConfigSchemaRegistryConfigAccessConfigsUriRef>,
}

/// Reference field for URI
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingSelfManagedKafkaEventSourceConfigSchemaRegistryConfigAccessConfigsUriRef {
    /// AWSResourceReference provides all the values necessary to reference another
    /// k8s resource for finding the identifier(Id/ARN/Name)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub from: Option<EventSourceMappingSelfManagedKafkaEventSourceConfigSchemaRegistryConfigAccessConfigsUriRefFrom>,
}

/// AWSResourceReference provides all the values necessary to reference another
/// k8s resource for finding the identifier(Id/ARN/Name)
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingSelfManagedKafkaEventSourceConfigSchemaRegistryConfigAccessConfigsUriRefFrom {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// Specific schema validation configuration settings that tell Lambda the message
/// attributes you want to validate and filter using your schema registry.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingSelfManagedKafkaEventSourceConfigSchemaRegistryConfigSchemaValidationConfigs {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub attribute: Option<String>,
}

/// To secure and define access to your event source, you can specify the authentication
/// protocol, VPC components, or virtual host.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingSourceAccessConfigurations {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type_")]
    pub r#type: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "uRI")]
    pub u_ri: Option<String>,
}

/// EventSourceMappingStatus defines the observed state of EventSourceMapping
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingStatus {
    /// All CRs managed by ACK have a common `Status.ACKResourceMetadata` member
    /// that is used to contain resource sync state, account ownership,
    /// constructed ARN for the resource
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ackResourceMetadata")]
    pub ack_resource_metadata: Option<EventSourceMappingStatusAckResourceMetadata>,
    /// All CRs managed by ACK have a common `Status.Conditions` member that
    /// contains a collection of `ackv1alpha1.Condition` objects that describe
    /// the various terminal states of the CR and its backend AWS service API
    /// resource
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Vec<Condition>>,
    /// The ARN of the Lambda function.
    /// 
    /// Regex Pattern: `^arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?$`
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionARN")]
    pub function_arn: Option<String>,
    /// The date that the event source mapping was last updated or that its state
    /// changed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastModified")]
    pub last_modified: Option<String>,
    /// The result of the event source mapping's last processing attempt.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastProcessingResult")]
    pub last_processing_result: Option<String>,
    /// The state of the event source mapping. It can be one of the following: Creating,
    /// Enabling, Enabled, Disabling, Disabled, Updating, or Deleting.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub state: Option<String>,
    /// Indicates whether a user or Lambda made the last change to the event source
    /// mapping.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "stateTransitionReason")]
    pub state_transition_reason: Option<String>,
    /// The identifier of the event source mapping.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub uuid: Option<String>,
}

/// All CRs managed by ACK have a common `Status.ACKResourceMetadata` member
/// that is used to contain resource sync state, account ownership,
/// constructed ARN for the resource
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct EventSourceMappingStatusAckResourceMetadata {
    /// ARN is the Amazon Resource Name for the resource. This is a
    /// globally-unique identifier and is set only by the ACK service controller
    /// once the controller has orchestrated the creation of the resource OR
    /// when it has verified that an "adopted" resource (a resource where the
    /// ARN annotation was set by the Kubernetes user on the CR) exists and
    /// matches the supplied CR's Spec field values.
    /// <https://github.com/aws/aws-controllers-k8s/issues/270>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub arn: Option<String>,
    /// OwnerAccountID is the AWS Account ID of the account that owns the
    /// backend AWS service API resource.
    #[serde(rename = "ownerAccountID")]
    pub owner_account_id: String,
    /// Partition is the AWS partition in which the resource exists or will exist
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub partition: Option<String>,
    /// Region is the AWS region in which the resource exists or will exist.
    pub region: String,
}