forked from aws/aws-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventSubscription.java
More file actions
589 lines (528 loc) · 23.1 KB
/
EventSubscription.java
File metadata and controls
589 lines (528 loc) · 23.1 KB
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
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
/*
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.rds.model;
import java.io.Serializable;
/**
* <p>
* Contains the results of a successful invocation of the DescribeEventSubscriptions action.
* </p>
*/
public class EventSubscription implements Serializable {
/**
* The AWS customer account associated with the RDS event notification
* subscription.
*/
private String customerAwsId;
/**
* The RDS event notification subscription Id.
*/
private String custSubscriptionId;
/**
* The topic ARN of the RDS event notification subscription.
*/
private String snsTopicArn;
/**
* The status of the RDS event notification subscription. <p>Constraints:
* <p>Can be one of the following: creating | modifying | deleting |
* active | no-permission | topic-not-exist <p>The status "no-permission"
* indicates that RDS no longer has permission to post to the SNS topic.
* The status "topic-not-exist" indicates that the topic was deleted
* after the subscription was created.
*/
private String status;
/**
* The time the RDS event notification subscription was created.
*/
private String subscriptionCreationTime;
/**
* The source type for the RDS event notification subscription.
*/
private String sourceType;
/**
* A list of source Ids for the RDS event notification subscription.
*/
private com.amazonaws.internal.ListWithAutoConstructFlag<String> sourceIdsList;
/**
* A list of event categories for the RDS event notification
* subscription.
*/
private com.amazonaws.internal.ListWithAutoConstructFlag<String> eventCategoriesList;
/**
* A Boolean value indicating if the subscription is enabled. True
* indicates the subscription is enabled.
*/
private Boolean enabled;
/**
* The AWS customer account associated with the RDS event notification
* subscription.
*
* @return The AWS customer account associated with the RDS event notification
* subscription.
*/
public String getCustomerAwsId() {
return customerAwsId;
}
/**
* The AWS customer account associated with the RDS event notification
* subscription.
*
* @param customerAwsId The AWS customer account associated with the RDS event notification
* subscription.
*/
public void setCustomerAwsId(String customerAwsId) {
this.customerAwsId = customerAwsId;
}
/**
* The AWS customer account associated with the RDS event notification
* subscription.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param customerAwsId The AWS customer account associated with the RDS event notification
* subscription.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public EventSubscription withCustomerAwsId(String customerAwsId) {
this.customerAwsId = customerAwsId;
return this;
}
/**
* The RDS event notification subscription Id.
*
* @return The RDS event notification subscription Id.
*/
public String getCustSubscriptionId() {
return custSubscriptionId;
}
/**
* The RDS event notification subscription Id.
*
* @param custSubscriptionId The RDS event notification subscription Id.
*/
public void setCustSubscriptionId(String custSubscriptionId) {
this.custSubscriptionId = custSubscriptionId;
}
/**
* The RDS event notification subscription Id.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param custSubscriptionId The RDS event notification subscription Id.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public EventSubscription withCustSubscriptionId(String custSubscriptionId) {
this.custSubscriptionId = custSubscriptionId;
return this;
}
/**
* The topic ARN of the RDS event notification subscription.
*
* @return The topic ARN of the RDS event notification subscription.
*/
public String getSnsTopicArn() {
return snsTopicArn;
}
/**
* The topic ARN of the RDS event notification subscription.
*
* @param snsTopicArn The topic ARN of the RDS event notification subscription.
*/
public void setSnsTopicArn(String snsTopicArn) {
this.snsTopicArn = snsTopicArn;
}
/**
* The topic ARN of the RDS event notification subscription.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param snsTopicArn The topic ARN of the RDS event notification subscription.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public EventSubscription withSnsTopicArn(String snsTopicArn) {
this.snsTopicArn = snsTopicArn;
return this;
}
/**
* The status of the RDS event notification subscription. <p>Constraints:
* <p>Can be one of the following: creating | modifying | deleting |
* active | no-permission | topic-not-exist <p>The status "no-permission"
* indicates that RDS no longer has permission to post to the SNS topic.
* The status "topic-not-exist" indicates that the topic was deleted
* after the subscription was created.
*
* @return The status of the RDS event notification subscription. <p>Constraints:
* <p>Can be one of the following: creating | modifying | deleting |
* active | no-permission | topic-not-exist <p>The status "no-permission"
* indicates that RDS no longer has permission to post to the SNS topic.
* The status "topic-not-exist" indicates that the topic was deleted
* after the subscription was created.
*/
public String getStatus() {
return status;
}
/**
* The status of the RDS event notification subscription. <p>Constraints:
* <p>Can be one of the following: creating | modifying | deleting |
* active | no-permission | topic-not-exist <p>The status "no-permission"
* indicates that RDS no longer has permission to post to the SNS topic.
* The status "topic-not-exist" indicates that the topic was deleted
* after the subscription was created.
*
* @param status The status of the RDS event notification subscription. <p>Constraints:
* <p>Can be one of the following: creating | modifying | deleting |
* active | no-permission | topic-not-exist <p>The status "no-permission"
* indicates that RDS no longer has permission to post to the SNS topic.
* The status "topic-not-exist" indicates that the topic was deleted
* after the subscription was created.
*/
public void setStatus(String status) {
this.status = status;
}
/**
* The status of the RDS event notification subscription. <p>Constraints:
* <p>Can be one of the following: creating | modifying | deleting |
* active | no-permission | topic-not-exist <p>The status "no-permission"
* indicates that RDS no longer has permission to post to the SNS topic.
* The status "topic-not-exist" indicates that the topic was deleted
* after the subscription was created.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param status The status of the RDS event notification subscription. <p>Constraints:
* <p>Can be one of the following: creating | modifying | deleting |
* active | no-permission | topic-not-exist <p>The status "no-permission"
* indicates that RDS no longer has permission to post to the SNS topic.
* The status "topic-not-exist" indicates that the topic was deleted
* after the subscription was created.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public EventSubscription withStatus(String status) {
this.status = status;
return this;
}
/**
* The time the RDS event notification subscription was created.
*
* @return The time the RDS event notification subscription was created.
*/
public String getSubscriptionCreationTime() {
return subscriptionCreationTime;
}
/**
* The time the RDS event notification subscription was created.
*
* @param subscriptionCreationTime The time the RDS event notification subscription was created.
*/
public void setSubscriptionCreationTime(String subscriptionCreationTime) {
this.subscriptionCreationTime = subscriptionCreationTime;
}
/**
* The time the RDS event notification subscription was created.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param subscriptionCreationTime The time the RDS event notification subscription was created.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public EventSubscription withSubscriptionCreationTime(String subscriptionCreationTime) {
this.subscriptionCreationTime = subscriptionCreationTime;
return this;
}
/**
* The source type for the RDS event notification subscription.
*
* @return The source type for the RDS event notification subscription.
*/
public String getSourceType() {
return sourceType;
}
/**
* The source type for the RDS event notification subscription.
*
* @param sourceType The source type for the RDS event notification subscription.
*/
public void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
/**
* The source type for the RDS event notification subscription.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param sourceType The source type for the RDS event notification subscription.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public EventSubscription withSourceType(String sourceType) {
this.sourceType = sourceType;
return this;
}
/**
* A list of source Ids for the RDS event notification subscription.
*
* @return A list of source Ids for the RDS event notification subscription.
*/
public java.util.List<String> getSourceIdsList() {
if (sourceIdsList == null) {
sourceIdsList = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
sourceIdsList.setAutoConstruct(true);
}
return sourceIdsList;
}
/**
* A list of source Ids for the RDS event notification subscription.
*
* @param sourceIdsList A list of source Ids for the RDS event notification subscription.
*/
public void setSourceIdsList(java.util.Collection<String> sourceIdsList) {
if (sourceIdsList == null) {
this.sourceIdsList = null;
return;
}
com.amazonaws.internal.ListWithAutoConstructFlag<String> sourceIdsListCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(sourceIdsList.size());
sourceIdsListCopy.addAll(sourceIdsList);
this.sourceIdsList = sourceIdsListCopy;
}
/**
* A list of source Ids for the RDS event notification subscription.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param sourceIdsList A list of source Ids for the RDS event notification subscription.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public EventSubscription withSourceIdsList(String... sourceIdsList) {
if (getSourceIdsList() == null) setSourceIdsList(new java.util.ArrayList<String>(sourceIdsList.length));
for (String value : sourceIdsList) {
getSourceIdsList().add(value);
}
return this;
}
/**
* A list of source Ids for the RDS event notification subscription.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param sourceIdsList A list of source Ids for the RDS event notification subscription.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public EventSubscription withSourceIdsList(java.util.Collection<String> sourceIdsList) {
if (sourceIdsList == null) {
this.sourceIdsList = null;
} else {
com.amazonaws.internal.ListWithAutoConstructFlag<String> sourceIdsListCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(sourceIdsList.size());
sourceIdsListCopy.addAll(sourceIdsList);
this.sourceIdsList = sourceIdsListCopy;
}
return this;
}
/**
* A list of event categories for the RDS event notification
* subscription.
*
* @return A list of event categories for the RDS event notification
* subscription.
*/
public java.util.List<String> getEventCategoriesList() {
if (eventCategoriesList == null) {
eventCategoriesList = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
eventCategoriesList.setAutoConstruct(true);
}
return eventCategoriesList;
}
/**
* A list of event categories for the RDS event notification
* subscription.
*
* @param eventCategoriesList A list of event categories for the RDS event notification
* subscription.
*/
public void setEventCategoriesList(java.util.Collection<String> eventCategoriesList) {
if (eventCategoriesList == null) {
this.eventCategoriesList = null;
return;
}
com.amazonaws.internal.ListWithAutoConstructFlag<String> eventCategoriesListCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(eventCategoriesList.size());
eventCategoriesListCopy.addAll(eventCategoriesList);
this.eventCategoriesList = eventCategoriesListCopy;
}
/**
* A list of event categories for the RDS event notification
* subscription.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param eventCategoriesList A list of event categories for the RDS event notification
* subscription.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public EventSubscription withEventCategoriesList(String... eventCategoriesList) {
if (getEventCategoriesList() == null) setEventCategoriesList(new java.util.ArrayList<String>(eventCategoriesList.length));
for (String value : eventCategoriesList) {
getEventCategoriesList().add(value);
}
return this;
}
/**
* A list of event categories for the RDS event notification
* subscription.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param eventCategoriesList A list of event categories for the RDS event notification
* subscription.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public EventSubscription withEventCategoriesList(java.util.Collection<String> eventCategoriesList) {
if (eventCategoriesList == null) {
this.eventCategoriesList = null;
} else {
com.amazonaws.internal.ListWithAutoConstructFlag<String> eventCategoriesListCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(eventCategoriesList.size());
eventCategoriesListCopy.addAll(eventCategoriesList);
this.eventCategoriesList = eventCategoriesListCopy;
}
return this;
}
/**
* A Boolean value indicating if the subscription is enabled. True
* indicates the subscription is enabled.
*
* @return A Boolean value indicating if the subscription is enabled. True
* indicates the subscription is enabled.
*/
public Boolean isEnabled() {
return enabled;
}
/**
* A Boolean value indicating if the subscription is enabled. True
* indicates the subscription is enabled.
*
* @param enabled A Boolean value indicating if the subscription is enabled. True
* indicates the subscription is enabled.
*/
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
/**
* A Boolean value indicating if the subscription is enabled. True
* indicates the subscription is enabled.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param enabled A Boolean value indicating if the subscription is enabled. True
* indicates the subscription is enabled.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public EventSubscription withEnabled(Boolean enabled) {
this.enabled = enabled;
return this;
}
/**
* A Boolean value indicating if the subscription is enabled. True
* indicates the subscription is enabled.
*
* @return A Boolean value indicating if the subscription is enabled. True
* indicates the subscription is enabled.
*/
public Boolean getEnabled() {
return enabled;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getCustomerAwsId() != null) sb.append("CustomerAwsId: " + getCustomerAwsId() + ",");
if (getCustSubscriptionId() != null) sb.append("CustSubscriptionId: " + getCustSubscriptionId() + ",");
if (getSnsTopicArn() != null) sb.append("SnsTopicArn: " + getSnsTopicArn() + ",");
if (getStatus() != null) sb.append("Status: " + getStatus() + ",");
if (getSubscriptionCreationTime() != null) sb.append("SubscriptionCreationTime: " + getSubscriptionCreationTime() + ",");
if (getSourceType() != null) sb.append("SourceType: " + getSourceType() + ",");
if (getSourceIdsList() != null) sb.append("SourceIdsList: " + getSourceIdsList() + ",");
if (getEventCategoriesList() != null) sb.append("EventCategoriesList: " + getEventCategoriesList() + ",");
if (isEnabled() != null) sb.append("Enabled: " + isEnabled() );
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCustomerAwsId() == null) ? 0 : getCustomerAwsId().hashCode());
hashCode = prime * hashCode + ((getCustSubscriptionId() == null) ? 0 : getCustSubscriptionId().hashCode());
hashCode = prime * hashCode + ((getSnsTopicArn() == null) ? 0 : getSnsTopicArn().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getSubscriptionCreationTime() == null) ? 0 : getSubscriptionCreationTime().hashCode());
hashCode = prime * hashCode + ((getSourceType() == null) ? 0 : getSourceType().hashCode());
hashCode = prime * hashCode + ((getSourceIdsList() == null) ? 0 : getSourceIdsList().hashCode());
hashCode = prime * hashCode + ((getEventCategoriesList() == null) ? 0 : getEventCategoriesList().hashCode());
hashCode = prime * hashCode + ((isEnabled() == null) ? 0 : isEnabled().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof EventSubscription == false) return false;
EventSubscription other = (EventSubscription)obj;
if (other.getCustomerAwsId() == null ^ this.getCustomerAwsId() == null) return false;
if (other.getCustomerAwsId() != null && other.getCustomerAwsId().equals(this.getCustomerAwsId()) == false) return false;
if (other.getCustSubscriptionId() == null ^ this.getCustSubscriptionId() == null) return false;
if (other.getCustSubscriptionId() != null && other.getCustSubscriptionId().equals(this.getCustSubscriptionId()) == false) return false;
if (other.getSnsTopicArn() == null ^ this.getSnsTopicArn() == null) return false;
if (other.getSnsTopicArn() != null && other.getSnsTopicArn().equals(this.getSnsTopicArn()) == false) return false;
if (other.getStatus() == null ^ this.getStatus() == null) return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false;
if (other.getSubscriptionCreationTime() == null ^ this.getSubscriptionCreationTime() == null) return false;
if (other.getSubscriptionCreationTime() != null && other.getSubscriptionCreationTime().equals(this.getSubscriptionCreationTime()) == false) return false;
if (other.getSourceType() == null ^ this.getSourceType() == null) return false;
if (other.getSourceType() != null && other.getSourceType().equals(this.getSourceType()) == false) return false;
if (other.getSourceIdsList() == null ^ this.getSourceIdsList() == null) return false;
if (other.getSourceIdsList() != null && other.getSourceIdsList().equals(this.getSourceIdsList()) == false) return false;
if (other.getEventCategoriesList() == null ^ this.getEventCategoriesList() == null) return false;
if (other.getEventCategoriesList() != null && other.getEventCategoriesList().equals(this.getEventCategoriesList()) == false) return false;
if (other.isEnabled() == null ^ this.isEnabled() == null) return false;
if (other.isEnabled() != null && other.isEnabled().equals(this.isEnabled()) == false) return false;
return true;
}
}