rusoto_codestar_notifications/
generated.rs

1// =================================================================
2//
3//                           * WARNING *
4//
5//                    This file is generated!
6//
7//  Changes made to this file will be overwritten. If changes are
8//  required to the generated code, the service_crategen project
9//  must be updated to generate the changes.
10//
11// =================================================================
12
13use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::proto;
23use rusoto_core::signature::SignedRequest;
24#[allow(unused_imports)]
25use serde::{Deserialize, Serialize};
26use serde_json;
27#[derive(Clone, Debug, Default, PartialEq, Serialize)]
28#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
29pub struct CreateNotificationRuleRequest {
30    /// <p><p>A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request with the same parameters is received and a token is included, the request returns information about the initial request that used that token.</p> <note> <p>The AWS SDKs prepopulate client request tokens. If you are using an AWS SDK, an idempotency token is created for you.</p> </note></p>
31    #[serde(rename = "ClientRequestToken")]
32    #[serde(skip_serializing_if = "Option::is_none")]
33    pub client_request_token: Option<String>,
34    /// <p>The level of detail to include in the notifications for this resource. BASIC will include only the contents of the event as it would appear in AWS CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.</p>
35    #[serde(rename = "DetailType")]
36    pub detail_type: String,
37    /// <p>A list of event types associated with this notification rule. For a list of allowed events, see <a>EventTypeSummary</a>.</p>
38    #[serde(rename = "EventTypeIds")]
39    pub event_type_ids: Vec<String>,
40    /// <p>The name for the notification rule. Notifictaion rule names must be unique in your AWS account.</p>
41    #[serde(rename = "Name")]
42    pub name: String,
43    /// <p>The Amazon Resource Name (ARN) of the resource to associate with the notification rule. Supported resources include pipelines in AWS CodePipeline, repositories in AWS CodeCommit, and build projects in AWS CodeBuild.</p>
44    #[serde(rename = "Resource")]
45    pub resource: String,
46    /// <p>The status of the notification rule. The default value is ENABLED. If the status is set to DISABLED, notifications aren't sent for the notification rule.</p>
47    #[serde(rename = "Status")]
48    #[serde(skip_serializing_if = "Option::is_none")]
49    pub status: Option<String>,
50    /// <p>A list of tags to apply to this notification rule. Key names cannot start with "aws". </p>
51    #[serde(rename = "Tags")]
52    #[serde(skip_serializing_if = "Option::is_none")]
53    pub tags: Option<::std::collections::HashMap<String, String>>,
54    /// <p>A list of Amazon Resource Names (ARNs) of SNS topics to associate with the notification rule.</p>
55    #[serde(rename = "Targets")]
56    pub targets: Vec<Target>,
57}
58
59#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
60#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
61pub struct CreateNotificationRuleResult {
62    /// <p>The Amazon Resource Name (ARN) of the notification rule.</p>
63    #[serde(rename = "Arn")]
64    #[serde(skip_serializing_if = "Option::is_none")]
65    pub arn: Option<String>,
66}
67
68#[derive(Clone, Debug, Default, PartialEq, Serialize)]
69#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
70pub struct DeleteNotificationRuleRequest {
71    /// <p>The Amazon Resource Name (ARN) of the notification rule you want to delete.</p>
72    #[serde(rename = "Arn")]
73    pub arn: String,
74}
75
76#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
77#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
78pub struct DeleteNotificationRuleResult {
79    /// <p>The Amazon Resource Name (ARN) of the deleted notification rule.</p>
80    #[serde(rename = "Arn")]
81    #[serde(skip_serializing_if = "Option::is_none")]
82    pub arn: Option<String>,
83}
84
85#[derive(Clone, Debug, Default, PartialEq, Serialize)]
86#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
87pub struct DeleteTargetRequest {
88    /// <p>A Boolean value that can be used to delete all associations with this SNS topic. The default value is FALSE. If set to TRUE, all associations between that target and every notification rule in your AWS account are deleted.</p>
89    #[serde(rename = "ForceUnsubscribeAll")]
90    #[serde(skip_serializing_if = "Option::is_none")]
91    pub force_unsubscribe_all: Option<bool>,
92    /// <p>The Amazon Resource Name (ARN) of the SNS topic to delete.</p>
93    #[serde(rename = "TargetAddress")]
94    pub target_address: String,
95}
96
97#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
98#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
99pub struct DeleteTargetResult {}
100
101#[derive(Clone, Debug, Default, PartialEq, Serialize)]
102#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
103pub struct DescribeNotificationRuleRequest {
104    /// <p>The Amazon Resource Name (ARN) of the notification rule.</p>
105    #[serde(rename = "Arn")]
106    pub arn: String,
107}
108
109#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
110#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
111pub struct DescribeNotificationRuleResult {
112    /// <p>The Amazon Resource Name (ARN) of the notification rule.</p>
113    #[serde(rename = "Arn")]
114    pub arn: String,
115    /// <p>The name or email alias of the person who created the notification rule.</p>
116    #[serde(rename = "CreatedBy")]
117    #[serde(skip_serializing_if = "Option::is_none")]
118    pub created_by: Option<String>,
119    /// <p>The date and time the notification rule was created, in timestamp format.</p>
120    #[serde(rename = "CreatedTimestamp")]
121    #[serde(skip_serializing_if = "Option::is_none")]
122    pub created_timestamp: Option<f64>,
123    /// <p>The level of detail included in the notifications for this resource. BASIC will include only the contents of the event as it would appear in AWS CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.</p>
124    #[serde(rename = "DetailType")]
125    #[serde(skip_serializing_if = "Option::is_none")]
126    pub detail_type: Option<String>,
127    /// <p>A list of the event types associated with the notification rule.</p>
128    #[serde(rename = "EventTypes")]
129    #[serde(skip_serializing_if = "Option::is_none")]
130    pub event_types: Option<Vec<EventTypeSummary>>,
131    /// <p>The date and time the notification rule was most recently updated, in timestamp format.</p>
132    #[serde(rename = "LastModifiedTimestamp")]
133    #[serde(skip_serializing_if = "Option::is_none")]
134    pub last_modified_timestamp: Option<f64>,
135    /// <p>The name of the notification rule.</p>
136    #[serde(rename = "Name")]
137    #[serde(skip_serializing_if = "Option::is_none")]
138    pub name: Option<String>,
139    /// <p>The Amazon Resource Name (ARN) of the resource associated with the notification rule.</p>
140    #[serde(rename = "Resource")]
141    #[serde(skip_serializing_if = "Option::is_none")]
142    pub resource: Option<String>,
143    /// <p>The status of the notification rule. Valid statuses are on (sending notifications) or off (not sending notifications).</p>
144    #[serde(rename = "Status")]
145    #[serde(skip_serializing_if = "Option::is_none")]
146    pub status: Option<String>,
147    /// <p>The tags associated with the notification rule.</p>
148    #[serde(rename = "Tags")]
149    #[serde(skip_serializing_if = "Option::is_none")]
150    pub tags: Option<::std::collections::HashMap<String, String>>,
151    /// <p>A list of the SNS topics associated with the notification rule.</p>
152    #[serde(rename = "Targets")]
153    #[serde(skip_serializing_if = "Option::is_none")]
154    pub targets: Option<Vec<TargetSummary>>,
155}
156
157/// <p>Returns information about an event that has triggered a notification rule.</p>
158#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
159#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
160pub struct EventTypeSummary {
161    /// <p>The system-generated ID of the event.</p>
162    #[serde(rename = "EventTypeId")]
163    #[serde(skip_serializing_if = "Option::is_none")]
164    pub event_type_id: Option<String>,
165    /// <p>The name of the event.</p>
166    #[serde(rename = "EventTypeName")]
167    #[serde(skip_serializing_if = "Option::is_none")]
168    pub event_type_name: Option<String>,
169    /// <p>The resource type of the event.</p>
170    #[serde(rename = "ResourceType")]
171    #[serde(skip_serializing_if = "Option::is_none")]
172    pub resource_type: Option<String>,
173    /// <p>The name of the service for which the event applies.</p>
174    #[serde(rename = "ServiceName")]
175    #[serde(skip_serializing_if = "Option::is_none")]
176    pub service_name: Option<String>,
177}
178
179/// <p>Information about a filter to apply to the list of returned event types. You can filter by resource type or service name.</p>
180#[derive(Clone, Debug, Default, PartialEq, Serialize)]
181#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
182pub struct ListEventTypesFilter {
183    /// <p>The system-generated name of the filter type you want to filter by.</p>
184    #[serde(rename = "Name")]
185    pub name: String,
186    /// <p>The name of the resource type (for example, pipeline) or service name (for example, CodePipeline) that you want to filter by.</p>
187    #[serde(rename = "Value")]
188    pub value: String,
189}
190
191#[derive(Clone, Debug, Default, PartialEq, Serialize)]
192#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
193pub struct ListEventTypesRequest {
194    /// <p>The filters to use to return information by service or resource type.</p>
195    #[serde(rename = "Filters")]
196    #[serde(skip_serializing_if = "Option::is_none")]
197    pub filters: Option<Vec<ListEventTypesFilter>>,
198    /// <p>A non-negative integer used to limit the number of returned results. The default number is 50. The maximum number of results that can be returned is 100.</p>
199    #[serde(rename = "MaxResults")]
200    #[serde(skip_serializing_if = "Option::is_none")]
201    pub max_results: Option<i64>,
202    /// <p>An enumeration token that, when provided in a request, returns the next batch of the results.</p>
203    #[serde(rename = "NextToken")]
204    #[serde(skip_serializing_if = "Option::is_none")]
205    pub next_token: Option<String>,
206}
207
208#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
209#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
210pub struct ListEventTypesResult {
211    /// <p>Information about each event, including service name, resource type, event ID, and event name.</p>
212    #[serde(rename = "EventTypes")]
213    #[serde(skip_serializing_if = "Option::is_none")]
214    pub event_types: Option<Vec<EventTypeSummary>>,
215    /// <p>An enumeration token that can be used in a request to return the next batch of the results.</p>
216    #[serde(rename = "NextToken")]
217    #[serde(skip_serializing_if = "Option::is_none")]
218    pub next_token: Option<String>,
219}
220
221/// <p>Information about a filter to apply to the list of returned notification rules. You can filter by event type, owner, resource, or target.</p>
222#[derive(Clone, Debug, Default, PartialEq, Serialize)]
223#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
224pub struct ListNotificationRulesFilter {
225    /// <p>The name of the attribute you want to use to filter the returned notification rules.</p>
226    #[serde(rename = "Name")]
227    pub name: String,
228    /// <p>The value of the attribute you want to use to filter the returned notification rules. For example, if you specify filtering by <i>RESOURCE</i> in Name, you might specify the ARN of a pipeline in AWS CodePipeline for the value.</p>
229    #[serde(rename = "Value")]
230    pub value: String,
231}
232
233#[derive(Clone, Debug, Default, PartialEq, Serialize)]
234#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
235pub struct ListNotificationRulesRequest {
236    /// <p><p>The filters to use to return information by service or resource type. For valid values, see <a>ListNotificationRulesFilter</a>.</p> <note> <p>A filter with the same name can appear more than once when used with OR statements. Filters with different names should be applied with AND statements.</p> </note></p>
237    #[serde(rename = "Filters")]
238    #[serde(skip_serializing_if = "Option::is_none")]
239    pub filters: Option<Vec<ListNotificationRulesFilter>>,
240    /// <p>A non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.</p>
241    #[serde(rename = "MaxResults")]
242    #[serde(skip_serializing_if = "Option::is_none")]
243    pub max_results: Option<i64>,
244    /// <p>An enumeration token that, when provided in a request, returns the next batch of the results.</p>
245    #[serde(rename = "NextToken")]
246    #[serde(skip_serializing_if = "Option::is_none")]
247    pub next_token: Option<String>,
248}
249
250#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
251#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
252pub struct ListNotificationRulesResult {
253    /// <p>An enumeration token that can be used in a request to return the next batch of the results.</p>
254    #[serde(rename = "NextToken")]
255    #[serde(skip_serializing_if = "Option::is_none")]
256    pub next_token: Option<String>,
257    /// <p>The list of notification rules for the AWS account, by Amazon Resource Name (ARN) and ID. </p>
258    #[serde(rename = "NotificationRules")]
259    #[serde(skip_serializing_if = "Option::is_none")]
260    pub notification_rules: Option<Vec<NotificationRuleSummary>>,
261}
262
263#[derive(Clone, Debug, Default, PartialEq, Serialize)]
264#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
265pub struct ListTagsForResourceRequest {
266    /// <p>The Amazon Resource Name (ARN) for the notification rule.</p>
267    #[serde(rename = "Arn")]
268    pub arn: String,
269}
270
271#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
272#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
273pub struct ListTagsForResourceResult {
274    /// <p>The tags associated with the notification rule.</p>
275    #[serde(rename = "Tags")]
276    #[serde(skip_serializing_if = "Option::is_none")]
277    pub tags: Option<::std::collections::HashMap<String, String>>,
278}
279
280/// <p>Information about a filter to apply to the list of returned targets. You can filter by target type, address, or status. For example, to filter results to notification rules that have active Amazon SNS topics as targets, you could specify a ListTargetsFilter Name as TargetType and a Value of SNS, and a Name of TARGET_STATUS and a Value of ACTIVE.</p>
281#[derive(Clone, Debug, Default, PartialEq, Serialize)]
282#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
283pub struct ListTargetsFilter {
284    /// <p>The name of the attribute you want to use to filter the returned targets.</p>
285    #[serde(rename = "Name")]
286    pub name: String,
287    /// <p>The value of the attribute you want to use to filter the returned targets. For example, if you specify <i>SNS</i> for the Target type, you could specify an Amazon Resource Name (ARN) for a topic as the value.</p>
288    #[serde(rename = "Value")]
289    pub value: String,
290}
291
292#[derive(Clone, Debug, Default, PartialEq, Serialize)]
293#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
294pub struct ListTargetsRequest {
295    /// <p><p>The filters to use to return information by service or resource type. Valid filters include target type, target address, and target status.</p> <note> <p>A filter with the same name can appear more than once when used with OR statements. Filters with different names should be applied with AND statements.</p> </note></p>
296    #[serde(rename = "Filters")]
297    #[serde(skip_serializing_if = "Option::is_none")]
298    pub filters: Option<Vec<ListTargetsFilter>>,
299    /// <p>A non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.</p>
300    #[serde(rename = "MaxResults")]
301    #[serde(skip_serializing_if = "Option::is_none")]
302    pub max_results: Option<i64>,
303    /// <p>An enumeration token that, when provided in a request, returns the next batch of the results.</p>
304    #[serde(rename = "NextToken")]
305    #[serde(skip_serializing_if = "Option::is_none")]
306    pub next_token: Option<String>,
307}
308
309#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
310#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
311pub struct ListTargetsResult {
312    /// <p>An enumeration token that can be used in a request to return the next batch of results.</p>
313    #[serde(rename = "NextToken")]
314    #[serde(skip_serializing_if = "Option::is_none")]
315    pub next_token: Option<String>,
316    /// <p>The list of notification rule targets. </p>
317    #[serde(rename = "Targets")]
318    #[serde(skip_serializing_if = "Option::is_none")]
319    pub targets: Option<Vec<TargetSummary>>,
320}
321
322/// <p>Information about a specified notification rule.</p>
323#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
324#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
325pub struct NotificationRuleSummary {
326    /// <p>The Amazon Resource Name (ARN) of the notification rule.</p>
327    #[serde(rename = "Arn")]
328    #[serde(skip_serializing_if = "Option::is_none")]
329    pub arn: Option<String>,
330    /// <p>The unique ID of the notification rule.</p>
331    #[serde(rename = "Id")]
332    #[serde(skip_serializing_if = "Option::is_none")]
333    pub id: Option<String>,
334}
335
336#[derive(Clone, Debug, Default, PartialEq, Serialize)]
337#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
338pub struct SubscribeRequest {
339    /// <p>The Amazon Resource Name (ARN) of the notification rule for which you want to create the association.</p>
340    #[serde(rename = "Arn")]
341    pub arn: String,
342    /// <p>An enumeration token that, when provided in a request, returns the next batch of the results.</p>
343    #[serde(rename = "ClientRequestToken")]
344    #[serde(skip_serializing_if = "Option::is_none")]
345    pub client_request_token: Option<String>,
346    #[serde(rename = "Target")]
347    pub target: Target,
348}
349
350#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
351#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
352pub struct SubscribeResult {
353    /// <p>The Amazon Resource Name (ARN) of the notification rule for which you have created assocations.</p>
354    #[serde(rename = "Arn")]
355    #[serde(skip_serializing_if = "Option::is_none")]
356    pub arn: Option<String>,
357}
358
359#[derive(Clone, Debug, Default, PartialEq, Serialize)]
360#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
361pub struct TagResourceRequest {
362    /// <p>The Amazon Resource Name (ARN) of the notification rule to tag.</p>
363    #[serde(rename = "Arn")]
364    pub arn: String,
365    /// <p>The list of tags to associate with the resource. Tag key names cannot start with "aws".</p>
366    #[serde(rename = "Tags")]
367    pub tags: ::std::collections::HashMap<String, String>,
368}
369
370#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
371#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
372pub struct TagResourceResult {
373    /// <p>The list of tags associated with the resource.</p>
374    #[serde(rename = "Tags")]
375    #[serde(skip_serializing_if = "Option::is_none")]
376    pub tags: Option<::std::collections::HashMap<String, String>>,
377}
378
379/// <p>Information about the SNS topics associated with a notification rule.</p>
380#[derive(Clone, Debug, Default, PartialEq, Serialize)]
381#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
382pub struct Target {
383    /// <p>The Amazon Resource Name (ARN) of the SNS topic.</p>
384    #[serde(rename = "TargetAddress")]
385    #[serde(skip_serializing_if = "Option::is_none")]
386    pub target_address: Option<String>,
387    /// <p>The target type. Can be an Amazon SNS topic.</p>
388    #[serde(rename = "TargetType")]
389    #[serde(skip_serializing_if = "Option::is_none")]
390    pub target_type: Option<String>,
391}
392
393/// <p>Information about the targets specified for a notification rule.</p>
394#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
395#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
396pub struct TargetSummary {
397    /// <p>The Amazon Resource Name (ARN) of the SNS topic.</p>
398    #[serde(rename = "TargetAddress")]
399    #[serde(skip_serializing_if = "Option::is_none")]
400    pub target_address: Option<String>,
401    /// <p>The status of the target.</p>
402    #[serde(rename = "TargetStatus")]
403    #[serde(skip_serializing_if = "Option::is_none")]
404    pub target_status: Option<String>,
405    /// <p>The type of the target (for example, SNS).</p>
406    #[serde(rename = "TargetType")]
407    #[serde(skip_serializing_if = "Option::is_none")]
408    pub target_type: Option<String>,
409}
410
411#[derive(Clone, Debug, Default, PartialEq, Serialize)]
412#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
413pub struct UnsubscribeRequest {
414    /// <p>The Amazon Resource Name (ARN) of the notification rule.</p>
415    #[serde(rename = "Arn")]
416    pub arn: String,
417    /// <p>The ARN of the SNS topic to unsubscribe from the notification rule.</p>
418    #[serde(rename = "TargetAddress")]
419    pub target_address: String,
420}
421
422#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
423#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
424pub struct UnsubscribeResult {
425    /// <p>The Amazon Resource Name (ARN) of the the notification rule from which you have removed a subscription.</p>
426    #[serde(rename = "Arn")]
427    pub arn: String,
428}
429
430#[derive(Clone, Debug, Default, PartialEq, Serialize)]
431#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
432pub struct UntagResourceRequest {
433    /// <p>The Amazon Resource Name (ARN) of the notification rule from which to remove the tags.</p>
434    #[serde(rename = "Arn")]
435    pub arn: String,
436    /// <p>The key names of the tags to remove.</p>
437    #[serde(rename = "TagKeys")]
438    pub tag_keys: Vec<String>,
439}
440
441#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
442#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
443pub struct UntagResourceResult {}
444
445#[derive(Clone, Debug, Default, PartialEq, Serialize)]
446#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
447pub struct UpdateNotificationRuleRequest {
448    /// <p>The Amazon Resource Name (ARN) of the notification rule.</p>
449    #[serde(rename = "Arn")]
450    pub arn: String,
451    /// <p>The level of detail to include in the notifications for this resource. BASIC will include only the contents of the event as it would appear in AWS CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.</p>
452    #[serde(rename = "DetailType")]
453    #[serde(skip_serializing_if = "Option::is_none")]
454    pub detail_type: Option<String>,
455    /// <p>A list of event types associated with this notification rule.</p>
456    #[serde(rename = "EventTypeIds")]
457    #[serde(skip_serializing_if = "Option::is_none")]
458    pub event_type_ids: Option<Vec<String>>,
459    /// <p>The name of the notification rule.</p>
460    #[serde(rename = "Name")]
461    #[serde(skip_serializing_if = "Option::is_none")]
462    pub name: Option<String>,
463    /// <p>The status of the notification rule. Valid statuses include enabled (sending notifications) or disabled (not sending notifications).</p>
464    #[serde(rename = "Status")]
465    #[serde(skip_serializing_if = "Option::is_none")]
466    pub status: Option<String>,
467    /// <p>The address and type of the targets to receive notifications from this notification rule.</p>
468    #[serde(rename = "Targets")]
469    #[serde(skip_serializing_if = "Option::is_none")]
470    pub targets: Option<Vec<Target>>,
471}
472
473#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
474#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
475pub struct UpdateNotificationRuleResult {}
476
477/// Errors returned by CreateNotificationRule
478#[derive(Debug, PartialEq)]
479pub enum CreateNotificationRuleError {
480    /// <p>AWS CodeStar Notifications can't create the notification rule because you do not have sufficient permissions.</p>
481    AccessDenied(String),
482    /// <p>AWS CodeStar Notifications can't complete the request because the resource is being modified by another process. Wait a few minutes and try again.</p>
483    ConcurrentModification(String),
484    /// <p>Some or all of the configuration is incomplete, missing, or not valid.</p>
485    Configuration(String),
486    /// <p>One of the AWS CodeStar Notifications limits has been exceeded. Limits apply to accounts, notification rules, notifications, resources, and targets. For more information, see Limits.</p>
487    LimitExceeded(String),
488    /// <p>A resource with the same name or ID already exists. Notification rule names must be unique in your AWS account.</p>
489    ResourceAlreadyExists(String),
490}
491
492impl CreateNotificationRuleError {
493    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateNotificationRuleError> {
494        if let Some(err) = proto::json::Error::parse_rest(&res) {
495            match err.typ.as_str() {
496                "AccessDeniedException" => {
497                    return RusotoError::Service(CreateNotificationRuleError::AccessDenied(err.msg))
498                }
499                "ConcurrentModificationException" => {
500                    return RusotoError::Service(
501                        CreateNotificationRuleError::ConcurrentModification(err.msg),
502                    )
503                }
504                "ConfigurationException" => {
505                    return RusotoError::Service(CreateNotificationRuleError::Configuration(
506                        err.msg,
507                    ))
508                }
509                "LimitExceededException" => {
510                    return RusotoError::Service(CreateNotificationRuleError::LimitExceeded(
511                        err.msg,
512                    ))
513                }
514                "ResourceAlreadyExistsException" => {
515                    return RusotoError::Service(
516                        CreateNotificationRuleError::ResourceAlreadyExists(err.msg),
517                    )
518                }
519                "ValidationException" => return RusotoError::Validation(err.msg),
520                _ => {}
521            }
522        }
523        RusotoError::Unknown(res)
524    }
525}
526impl fmt::Display for CreateNotificationRuleError {
527    #[allow(unused_variables)]
528    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
529        match *self {
530            CreateNotificationRuleError::AccessDenied(ref cause) => write!(f, "{}", cause),
531            CreateNotificationRuleError::ConcurrentModification(ref cause) => {
532                write!(f, "{}", cause)
533            }
534            CreateNotificationRuleError::Configuration(ref cause) => write!(f, "{}", cause),
535            CreateNotificationRuleError::LimitExceeded(ref cause) => write!(f, "{}", cause),
536            CreateNotificationRuleError::ResourceAlreadyExists(ref cause) => write!(f, "{}", cause),
537        }
538    }
539}
540impl Error for CreateNotificationRuleError {}
541/// Errors returned by DeleteNotificationRule
542#[derive(Debug, PartialEq)]
543pub enum DeleteNotificationRuleError {
544    /// <p>AWS CodeStar Notifications can't complete the request because the resource is being modified by another process. Wait a few minutes and try again.</p>
545    ConcurrentModification(String),
546    /// <p>One of the AWS CodeStar Notifications limits has been exceeded. Limits apply to accounts, notification rules, notifications, resources, and targets. For more information, see Limits.</p>
547    LimitExceeded(String),
548}
549
550impl DeleteNotificationRuleError {
551    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteNotificationRuleError> {
552        if let Some(err) = proto::json::Error::parse_rest(&res) {
553            match err.typ.as_str() {
554                "ConcurrentModificationException" => {
555                    return RusotoError::Service(
556                        DeleteNotificationRuleError::ConcurrentModification(err.msg),
557                    )
558                }
559                "LimitExceededException" => {
560                    return RusotoError::Service(DeleteNotificationRuleError::LimitExceeded(
561                        err.msg,
562                    ))
563                }
564                "ValidationException" => return RusotoError::Validation(err.msg),
565                _ => {}
566            }
567        }
568        RusotoError::Unknown(res)
569    }
570}
571impl fmt::Display for DeleteNotificationRuleError {
572    #[allow(unused_variables)]
573    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
574        match *self {
575            DeleteNotificationRuleError::ConcurrentModification(ref cause) => {
576                write!(f, "{}", cause)
577            }
578            DeleteNotificationRuleError::LimitExceeded(ref cause) => write!(f, "{}", cause),
579        }
580    }
581}
582impl Error for DeleteNotificationRuleError {}
583/// Errors returned by DeleteTarget
584#[derive(Debug, PartialEq)]
585pub enum DeleteTargetError {}
586
587impl DeleteTargetError {
588    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteTargetError> {
589        if let Some(err) = proto::json::Error::parse_rest(&res) {
590            match err.typ.as_str() {
591                "ValidationException" => return RusotoError::Validation(err.msg),
592                _ => {}
593            }
594        }
595        RusotoError::Unknown(res)
596    }
597}
598impl fmt::Display for DeleteTargetError {
599    #[allow(unused_variables)]
600    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
601        match *self {}
602    }
603}
604impl Error for DeleteTargetError {}
605/// Errors returned by DescribeNotificationRule
606#[derive(Debug, PartialEq)]
607pub enum DescribeNotificationRuleError {
608    /// <p>AWS CodeStar Notifications can't find a resource that matches the provided ARN. </p>
609    ResourceNotFound(String),
610}
611
612impl DescribeNotificationRuleError {
613    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeNotificationRuleError> {
614        if let Some(err) = proto::json::Error::parse_rest(&res) {
615            match err.typ.as_str() {
616                "ResourceNotFoundException" => {
617                    return RusotoError::Service(DescribeNotificationRuleError::ResourceNotFound(
618                        err.msg,
619                    ))
620                }
621                "ValidationException" => return RusotoError::Validation(err.msg),
622                _ => {}
623            }
624        }
625        RusotoError::Unknown(res)
626    }
627}
628impl fmt::Display for DescribeNotificationRuleError {
629    #[allow(unused_variables)]
630    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
631        match *self {
632            DescribeNotificationRuleError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
633        }
634    }
635}
636impl Error for DescribeNotificationRuleError {}
637/// Errors returned by ListEventTypes
638#[derive(Debug, PartialEq)]
639pub enum ListEventTypesError {
640    /// <p>The value for the enumeration token used in the request to return the next batch of the results is not valid. </p>
641    InvalidNextToken(String),
642}
643
644impl ListEventTypesError {
645    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListEventTypesError> {
646        if let Some(err) = proto::json::Error::parse_rest(&res) {
647            match err.typ.as_str() {
648                "InvalidNextTokenException" => {
649                    return RusotoError::Service(ListEventTypesError::InvalidNextToken(err.msg))
650                }
651                "ValidationException" => return RusotoError::Validation(err.msg),
652                _ => {}
653            }
654        }
655        RusotoError::Unknown(res)
656    }
657}
658impl fmt::Display for ListEventTypesError {
659    #[allow(unused_variables)]
660    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
661        match *self {
662            ListEventTypesError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
663        }
664    }
665}
666impl Error for ListEventTypesError {}
667/// Errors returned by ListNotificationRules
668#[derive(Debug, PartialEq)]
669pub enum ListNotificationRulesError {
670    /// <p>The value for the enumeration token used in the request to return the next batch of the results is not valid. </p>
671    InvalidNextToken(String),
672}
673
674impl ListNotificationRulesError {
675    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListNotificationRulesError> {
676        if let Some(err) = proto::json::Error::parse_rest(&res) {
677            match err.typ.as_str() {
678                "InvalidNextTokenException" => {
679                    return RusotoError::Service(ListNotificationRulesError::InvalidNextToken(
680                        err.msg,
681                    ))
682                }
683                "ValidationException" => return RusotoError::Validation(err.msg),
684                _ => {}
685            }
686        }
687        RusotoError::Unknown(res)
688    }
689}
690impl fmt::Display for ListNotificationRulesError {
691    #[allow(unused_variables)]
692    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
693        match *self {
694            ListNotificationRulesError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
695        }
696    }
697}
698impl Error for ListNotificationRulesError {}
699/// Errors returned by ListTagsForResource
700#[derive(Debug, PartialEq)]
701pub enum ListTagsForResourceError {
702    /// <p>AWS CodeStar Notifications can't find a resource that matches the provided ARN. </p>
703    ResourceNotFound(String),
704}
705
706impl ListTagsForResourceError {
707    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
708        if let Some(err) = proto::json::Error::parse_rest(&res) {
709            match err.typ.as_str() {
710                "ResourceNotFoundException" => {
711                    return RusotoError::Service(ListTagsForResourceError::ResourceNotFound(
712                        err.msg,
713                    ))
714                }
715                "ValidationException" => return RusotoError::Validation(err.msg),
716                _ => {}
717            }
718        }
719        RusotoError::Unknown(res)
720    }
721}
722impl fmt::Display for ListTagsForResourceError {
723    #[allow(unused_variables)]
724    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
725        match *self {
726            ListTagsForResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
727        }
728    }
729}
730impl Error for ListTagsForResourceError {}
731/// Errors returned by ListTargets
732#[derive(Debug, PartialEq)]
733pub enum ListTargetsError {
734    /// <p>The value for the enumeration token used in the request to return the next batch of the results is not valid. </p>
735    InvalidNextToken(String),
736}
737
738impl ListTargetsError {
739    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTargetsError> {
740        if let Some(err) = proto::json::Error::parse_rest(&res) {
741            match err.typ.as_str() {
742                "InvalidNextTokenException" => {
743                    return RusotoError::Service(ListTargetsError::InvalidNextToken(err.msg))
744                }
745                "ValidationException" => return RusotoError::Validation(err.msg),
746                _ => {}
747            }
748        }
749        RusotoError::Unknown(res)
750    }
751}
752impl fmt::Display for ListTargetsError {
753    #[allow(unused_variables)]
754    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
755        match *self {
756            ListTargetsError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
757        }
758    }
759}
760impl Error for ListTargetsError {}
761/// Errors returned by Subscribe
762#[derive(Debug, PartialEq)]
763pub enum SubscribeError {
764    /// <p>AWS CodeStar Notifications can't find a resource that matches the provided ARN. </p>
765    ResourceNotFound(String),
766}
767
768impl SubscribeError {
769    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SubscribeError> {
770        if let Some(err) = proto::json::Error::parse_rest(&res) {
771            match err.typ.as_str() {
772                "ResourceNotFoundException" => {
773                    return RusotoError::Service(SubscribeError::ResourceNotFound(err.msg))
774                }
775                "ValidationException" => return RusotoError::Validation(err.msg),
776                _ => {}
777            }
778        }
779        RusotoError::Unknown(res)
780    }
781}
782impl fmt::Display for SubscribeError {
783    #[allow(unused_variables)]
784    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
785        match *self {
786            SubscribeError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
787        }
788    }
789}
790impl Error for SubscribeError {}
791/// Errors returned by TagResource
792#[derive(Debug, PartialEq)]
793pub enum TagResourceError {
794    /// <p>AWS CodeStar Notifications can't complete the request because the resource is being modified by another process. Wait a few minutes and try again.</p>
795    ConcurrentModification(String),
796    /// <p>AWS CodeStar Notifications can't find a resource that matches the provided ARN. </p>
797    ResourceNotFound(String),
798}
799
800impl TagResourceError {
801    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
802        if let Some(err) = proto::json::Error::parse_rest(&res) {
803            match err.typ.as_str() {
804                "ConcurrentModificationException" => {
805                    return RusotoError::Service(TagResourceError::ConcurrentModification(err.msg))
806                }
807                "ResourceNotFoundException" => {
808                    return RusotoError::Service(TagResourceError::ResourceNotFound(err.msg))
809                }
810                "ValidationException" => return RusotoError::Validation(err.msg),
811                _ => {}
812            }
813        }
814        RusotoError::Unknown(res)
815    }
816}
817impl fmt::Display for TagResourceError {
818    #[allow(unused_variables)]
819    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
820        match *self {
821            TagResourceError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
822            TagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
823        }
824    }
825}
826impl Error for TagResourceError {}
827/// Errors returned by Unsubscribe
828#[derive(Debug, PartialEq)]
829pub enum UnsubscribeError {}
830
831impl UnsubscribeError {
832    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UnsubscribeError> {
833        if let Some(err) = proto::json::Error::parse_rest(&res) {
834            match err.typ.as_str() {
835                "ValidationException" => return RusotoError::Validation(err.msg),
836                _ => {}
837            }
838        }
839        RusotoError::Unknown(res)
840    }
841}
842impl fmt::Display for UnsubscribeError {
843    #[allow(unused_variables)]
844    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
845        match *self {}
846    }
847}
848impl Error for UnsubscribeError {}
849/// Errors returned by UntagResource
850#[derive(Debug, PartialEq)]
851pub enum UntagResourceError {
852    /// <p>AWS CodeStar Notifications can't complete the request because the resource is being modified by another process. Wait a few minutes and try again.</p>
853    ConcurrentModification(String),
854    /// <p>AWS CodeStar Notifications can't find a resource that matches the provided ARN. </p>
855    ResourceNotFound(String),
856}
857
858impl UntagResourceError {
859    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
860        if let Some(err) = proto::json::Error::parse_rest(&res) {
861            match err.typ.as_str() {
862                "ConcurrentModificationException" => {
863                    return RusotoError::Service(UntagResourceError::ConcurrentModification(
864                        err.msg,
865                    ))
866                }
867                "ResourceNotFoundException" => {
868                    return RusotoError::Service(UntagResourceError::ResourceNotFound(err.msg))
869                }
870                "ValidationException" => return RusotoError::Validation(err.msg),
871                _ => {}
872            }
873        }
874        RusotoError::Unknown(res)
875    }
876}
877impl fmt::Display for UntagResourceError {
878    #[allow(unused_variables)]
879    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
880        match *self {
881            UntagResourceError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
882            UntagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
883        }
884    }
885}
886impl Error for UntagResourceError {}
887/// Errors returned by UpdateNotificationRule
888#[derive(Debug, PartialEq)]
889pub enum UpdateNotificationRuleError {
890    /// <p>AWS CodeStar Notifications can't find a resource that matches the provided ARN. </p>
891    ResourceNotFound(String),
892}
893
894impl UpdateNotificationRuleError {
895    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateNotificationRuleError> {
896        if let Some(err) = proto::json::Error::parse_rest(&res) {
897            match err.typ.as_str() {
898                "ResourceNotFoundException" => {
899                    return RusotoError::Service(UpdateNotificationRuleError::ResourceNotFound(
900                        err.msg,
901                    ))
902                }
903                "ValidationException" => return RusotoError::Validation(err.msg),
904                _ => {}
905            }
906        }
907        RusotoError::Unknown(res)
908    }
909}
910impl fmt::Display for UpdateNotificationRuleError {
911    #[allow(unused_variables)]
912    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
913        match *self {
914            UpdateNotificationRuleError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
915        }
916    }
917}
918impl Error for UpdateNotificationRuleError {}
919/// Trait representing the capabilities of the AWS CodeStar Notifications API. AWS CodeStar Notifications clients implement this trait.
920#[async_trait]
921pub trait CodeStarNotifications {
922    /// <p>Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as SNS topics) where you want to receive them.</p>
923    async fn create_notification_rule(
924        &self,
925        input: CreateNotificationRuleRequest,
926    ) -> Result<CreateNotificationRuleResult, RusotoError<CreateNotificationRuleError>>;
927
928    /// <p>Deletes a notification rule for a resource.</p>
929    async fn delete_notification_rule(
930        &self,
931        input: DeleteNotificationRuleRequest,
932    ) -> Result<DeleteNotificationRuleResult, RusotoError<DeleteNotificationRuleError>>;
933
934    /// <p>Deletes a specified target for notifications.</p>
935    async fn delete_target(
936        &self,
937        input: DeleteTargetRequest,
938    ) -> Result<DeleteTargetResult, RusotoError<DeleteTargetError>>;
939
940    /// <p>Returns information about a specified notification rule.</p>
941    async fn describe_notification_rule(
942        &self,
943        input: DescribeNotificationRuleRequest,
944    ) -> Result<DescribeNotificationRuleResult, RusotoError<DescribeNotificationRuleError>>;
945
946    /// <p>Returns information about the event types available for configuring notifications.</p>
947    async fn list_event_types(
948        &self,
949        input: ListEventTypesRequest,
950    ) -> Result<ListEventTypesResult, RusotoError<ListEventTypesError>>;
951
952    /// <p>Returns a list of the notification rules for an AWS account.</p>
953    async fn list_notification_rules(
954        &self,
955        input: ListNotificationRulesRequest,
956    ) -> Result<ListNotificationRulesResult, RusotoError<ListNotificationRulesError>>;
957
958    /// <p>Returns a list of the tags associated with a notification rule.</p>
959    async fn list_tags_for_resource(
960        &self,
961        input: ListTagsForResourceRequest,
962    ) -> Result<ListTagsForResourceResult, RusotoError<ListTagsForResourceError>>;
963
964    /// <p>Returns a list of the notification rule targets for an AWS account.</p>
965    async fn list_targets(
966        &self,
967        input: ListTargetsRequest,
968    ) -> Result<ListTargetsResult, RusotoError<ListTargetsError>>;
969
970    /// <p>Creates an association between a notification rule and an SNS topic so that the associated target can receive notifications when the events described in the rule are triggered.</p>
971    async fn subscribe(
972        &self,
973        input: SubscribeRequest,
974    ) -> Result<SubscribeResult, RusotoError<SubscribeError>>;
975
976    /// <p>Associates a set of provided tags with a notification rule.</p>
977    async fn tag_resource(
978        &self,
979        input: TagResourceRequest,
980    ) -> Result<TagResourceResult, RusotoError<TagResourceError>>;
981
982    /// <p>Removes an association between a notification rule and an Amazon SNS topic so that subscribers to that topic stop receiving notifications when the events described in the rule are triggered.</p>
983    async fn unsubscribe(
984        &self,
985        input: UnsubscribeRequest,
986    ) -> Result<UnsubscribeResult, RusotoError<UnsubscribeError>>;
987
988    /// <p>Removes the association between one or more provided tags and a notification rule.</p>
989    async fn untag_resource(
990        &self,
991        input: UntagResourceRequest,
992    ) -> Result<UntagResourceResult, RusotoError<UntagResourceError>>;
993
994    /// <p><p>Updates a notification rule for a resource. You can change the events that trigger the notification rule, the status of the rule, and the targets that receive the notifications.</p> <note> <p>To add or remove tags for a notification rule, you must use <a>TagResource</a> and <a>UntagResource</a>.</p> </note></p>
995    async fn update_notification_rule(
996        &self,
997        input: UpdateNotificationRuleRequest,
998    ) -> Result<UpdateNotificationRuleResult, RusotoError<UpdateNotificationRuleError>>;
999}
1000/// A client for the AWS CodeStar Notifications API.
1001#[derive(Clone)]
1002pub struct CodeStarNotificationsClient {
1003    client: Client,
1004    region: region::Region,
1005}
1006
1007impl CodeStarNotificationsClient {
1008    /// Creates a client backed by the default tokio event loop.
1009    ///
1010    /// The client will use the default credentials provider and tls client.
1011    pub fn new(region: region::Region) -> CodeStarNotificationsClient {
1012        CodeStarNotificationsClient {
1013            client: Client::shared(),
1014            region,
1015        }
1016    }
1017
1018    pub fn new_with<P, D>(
1019        request_dispatcher: D,
1020        credentials_provider: P,
1021        region: region::Region,
1022    ) -> CodeStarNotificationsClient
1023    where
1024        P: ProvideAwsCredentials + Send + Sync + 'static,
1025        D: DispatchSignedRequest + Send + Sync + 'static,
1026    {
1027        CodeStarNotificationsClient {
1028            client: Client::new_with(credentials_provider, request_dispatcher),
1029            region,
1030        }
1031    }
1032
1033    pub fn new_with_client(client: Client, region: region::Region) -> CodeStarNotificationsClient {
1034        CodeStarNotificationsClient { client, region }
1035    }
1036}
1037
1038#[async_trait]
1039impl CodeStarNotifications for CodeStarNotificationsClient {
1040    /// <p>Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as SNS topics) where you want to receive them.</p>
1041    #[allow(unused_mut)]
1042    async fn create_notification_rule(
1043        &self,
1044        input: CreateNotificationRuleRequest,
1045    ) -> Result<CreateNotificationRuleResult, RusotoError<CreateNotificationRuleError>> {
1046        let request_uri = "/createNotificationRule";
1047
1048        let mut request =
1049            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1050        request.set_content_type("application/x-amz-json-1.1".to_owned());
1051
1052        let encoded = Some(serde_json::to_vec(&input).unwrap());
1053        request.set_payload(encoded);
1054
1055        let mut response = self
1056            .client
1057            .sign_and_dispatch(request)
1058            .await
1059            .map_err(RusotoError::from)?;
1060        if response.status.is_success() {
1061            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1062            let result = proto::json::ResponsePayload::new(&response)
1063                .deserialize::<CreateNotificationRuleResult, _>()?;
1064
1065            Ok(result)
1066        } else {
1067            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1068            Err(CreateNotificationRuleError::from_response(response))
1069        }
1070    }
1071
1072    /// <p>Deletes a notification rule for a resource.</p>
1073    #[allow(unused_mut)]
1074    async fn delete_notification_rule(
1075        &self,
1076        input: DeleteNotificationRuleRequest,
1077    ) -> Result<DeleteNotificationRuleResult, RusotoError<DeleteNotificationRuleError>> {
1078        let request_uri = "/deleteNotificationRule";
1079
1080        let mut request =
1081            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1082        request.set_content_type("application/x-amz-json-1.1".to_owned());
1083
1084        let encoded = Some(serde_json::to_vec(&input).unwrap());
1085        request.set_payload(encoded);
1086
1087        let mut response = self
1088            .client
1089            .sign_and_dispatch(request)
1090            .await
1091            .map_err(RusotoError::from)?;
1092        if response.status.is_success() {
1093            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1094            let result = proto::json::ResponsePayload::new(&response)
1095                .deserialize::<DeleteNotificationRuleResult, _>()?;
1096
1097            Ok(result)
1098        } else {
1099            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1100            Err(DeleteNotificationRuleError::from_response(response))
1101        }
1102    }
1103
1104    /// <p>Deletes a specified target for notifications.</p>
1105    #[allow(unused_mut)]
1106    async fn delete_target(
1107        &self,
1108        input: DeleteTargetRequest,
1109    ) -> Result<DeleteTargetResult, RusotoError<DeleteTargetError>> {
1110        let request_uri = "/deleteTarget";
1111
1112        let mut request =
1113            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1114        request.set_content_type("application/x-amz-json-1.1".to_owned());
1115
1116        let encoded = Some(serde_json::to_vec(&input).unwrap());
1117        request.set_payload(encoded);
1118
1119        let mut response = self
1120            .client
1121            .sign_and_dispatch(request)
1122            .await
1123            .map_err(RusotoError::from)?;
1124        if response.status.is_success() {
1125            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1126            let result = proto::json::ResponsePayload::new(&response)
1127                .deserialize::<DeleteTargetResult, _>()?;
1128
1129            Ok(result)
1130        } else {
1131            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1132            Err(DeleteTargetError::from_response(response))
1133        }
1134    }
1135
1136    /// <p>Returns information about a specified notification rule.</p>
1137    #[allow(unused_mut)]
1138    async fn describe_notification_rule(
1139        &self,
1140        input: DescribeNotificationRuleRequest,
1141    ) -> Result<DescribeNotificationRuleResult, RusotoError<DescribeNotificationRuleError>> {
1142        let request_uri = "/describeNotificationRule";
1143
1144        let mut request =
1145            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1146        request.set_content_type("application/x-amz-json-1.1".to_owned());
1147
1148        let encoded = Some(serde_json::to_vec(&input).unwrap());
1149        request.set_payload(encoded);
1150
1151        let mut response = self
1152            .client
1153            .sign_and_dispatch(request)
1154            .await
1155            .map_err(RusotoError::from)?;
1156        if response.status.is_success() {
1157            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1158            let result = proto::json::ResponsePayload::new(&response)
1159                .deserialize::<DescribeNotificationRuleResult, _>()?;
1160
1161            Ok(result)
1162        } else {
1163            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1164            Err(DescribeNotificationRuleError::from_response(response))
1165        }
1166    }
1167
1168    /// <p>Returns information about the event types available for configuring notifications.</p>
1169    #[allow(unused_mut)]
1170    async fn list_event_types(
1171        &self,
1172        input: ListEventTypesRequest,
1173    ) -> Result<ListEventTypesResult, RusotoError<ListEventTypesError>> {
1174        let request_uri = "/listEventTypes";
1175
1176        let mut request =
1177            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1178        request.set_content_type("application/x-amz-json-1.1".to_owned());
1179
1180        let encoded = Some(serde_json::to_vec(&input).unwrap());
1181        request.set_payload(encoded);
1182
1183        let mut response = self
1184            .client
1185            .sign_and_dispatch(request)
1186            .await
1187            .map_err(RusotoError::from)?;
1188        if response.status.is_success() {
1189            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1190            let result = proto::json::ResponsePayload::new(&response)
1191                .deserialize::<ListEventTypesResult, _>()?;
1192
1193            Ok(result)
1194        } else {
1195            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1196            Err(ListEventTypesError::from_response(response))
1197        }
1198    }
1199
1200    /// <p>Returns a list of the notification rules for an AWS account.</p>
1201    #[allow(unused_mut)]
1202    async fn list_notification_rules(
1203        &self,
1204        input: ListNotificationRulesRequest,
1205    ) -> Result<ListNotificationRulesResult, RusotoError<ListNotificationRulesError>> {
1206        let request_uri = "/listNotificationRules";
1207
1208        let mut request =
1209            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1210        request.set_content_type("application/x-amz-json-1.1".to_owned());
1211
1212        let encoded = Some(serde_json::to_vec(&input).unwrap());
1213        request.set_payload(encoded);
1214
1215        let mut response = self
1216            .client
1217            .sign_and_dispatch(request)
1218            .await
1219            .map_err(RusotoError::from)?;
1220        if response.status.is_success() {
1221            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1222            let result = proto::json::ResponsePayload::new(&response)
1223                .deserialize::<ListNotificationRulesResult, _>()?;
1224
1225            Ok(result)
1226        } else {
1227            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1228            Err(ListNotificationRulesError::from_response(response))
1229        }
1230    }
1231
1232    /// <p>Returns a list of the tags associated with a notification rule.</p>
1233    #[allow(unused_mut)]
1234    async fn list_tags_for_resource(
1235        &self,
1236        input: ListTagsForResourceRequest,
1237    ) -> Result<ListTagsForResourceResult, RusotoError<ListTagsForResourceError>> {
1238        let request_uri = "/listTagsForResource";
1239
1240        let mut request =
1241            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1242        request.set_content_type("application/x-amz-json-1.1".to_owned());
1243
1244        let encoded = Some(serde_json::to_vec(&input).unwrap());
1245        request.set_payload(encoded);
1246
1247        let mut response = self
1248            .client
1249            .sign_and_dispatch(request)
1250            .await
1251            .map_err(RusotoError::from)?;
1252        if response.status.is_success() {
1253            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1254            let result = proto::json::ResponsePayload::new(&response)
1255                .deserialize::<ListTagsForResourceResult, _>()?;
1256
1257            Ok(result)
1258        } else {
1259            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1260            Err(ListTagsForResourceError::from_response(response))
1261        }
1262    }
1263
1264    /// <p>Returns a list of the notification rule targets for an AWS account.</p>
1265    #[allow(unused_mut)]
1266    async fn list_targets(
1267        &self,
1268        input: ListTargetsRequest,
1269    ) -> Result<ListTargetsResult, RusotoError<ListTargetsError>> {
1270        let request_uri = "/listTargets";
1271
1272        let mut request =
1273            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1274        request.set_content_type("application/x-amz-json-1.1".to_owned());
1275
1276        let encoded = Some(serde_json::to_vec(&input).unwrap());
1277        request.set_payload(encoded);
1278
1279        let mut response = self
1280            .client
1281            .sign_and_dispatch(request)
1282            .await
1283            .map_err(RusotoError::from)?;
1284        if response.status.is_success() {
1285            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1286            let result = proto::json::ResponsePayload::new(&response)
1287                .deserialize::<ListTargetsResult, _>()?;
1288
1289            Ok(result)
1290        } else {
1291            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1292            Err(ListTargetsError::from_response(response))
1293        }
1294    }
1295
1296    /// <p>Creates an association between a notification rule and an SNS topic so that the associated target can receive notifications when the events described in the rule are triggered.</p>
1297    #[allow(unused_mut)]
1298    async fn subscribe(
1299        &self,
1300        input: SubscribeRequest,
1301    ) -> Result<SubscribeResult, RusotoError<SubscribeError>> {
1302        let request_uri = "/subscribe";
1303
1304        let mut request =
1305            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1306        request.set_content_type("application/x-amz-json-1.1".to_owned());
1307
1308        let encoded = Some(serde_json::to_vec(&input).unwrap());
1309        request.set_payload(encoded);
1310
1311        let mut response = self
1312            .client
1313            .sign_and_dispatch(request)
1314            .await
1315            .map_err(RusotoError::from)?;
1316        if response.status.is_success() {
1317            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1318            let result =
1319                proto::json::ResponsePayload::new(&response).deserialize::<SubscribeResult, _>()?;
1320
1321            Ok(result)
1322        } else {
1323            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1324            Err(SubscribeError::from_response(response))
1325        }
1326    }
1327
1328    /// <p>Associates a set of provided tags with a notification rule.</p>
1329    #[allow(unused_mut)]
1330    async fn tag_resource(
1331        &self,
1332        input: TagResourceRequest,
1333    ) -> Result<TagResourceResult, RusotoError<TagResourceError>> {
1334        let request_uri = "/tagResource";
1335
1336        let mut request =
1337            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1338        request.set_content_type("application/x-amz-json-1.1".to_owned());
1339
1340        let encoded = Some(serde_json::to_vec(&input).unwrap());
1341        request.set_payload(encoded);
1342
1343        let mut response = self
1344            .client
1345            .sign_and_dispatch(request)
1346            .await
1347            .map_err(RusotoError::from)?;
1348        if response.status.is_success() {
1349            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1350            let result = proto::json::ResponsePayload::new(&response)
1351                .deserialize::<TagResourceResult, _>()?;
1352
1353            Ok(result)
1354        } else {
1355            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1356            Err(TagResourceError::from_response(response))
1357        }
1358    }
1359
1360    /// <p>Removes an association between a notification rule and an Amazon SNS topic so that subscribers to that topic stop receiving notifications when the events described in the rule are triggered.</p>
1361    #[allow(unused_mut)]
1362    async fn unsubscribe(
1363        &self,
1364        input: UnsubscribeRequest,
1365    ) -> Result<UnsubscribeResult, RusotoError<UnsubscribeError>> {
1366        let request_uri = "/unsubscribe";
1367
1368        let mut request =
1369            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1370        request.set_content_type("application/x-amz-json-1.1".to_owned());
1371
1372        let encoded = Some(serde_json::to_vec(&input).unwrap());
1373        request.set_payload(encoded);
1374
1375        let mut response = self
1376            .client
1377            .sign_and_dispatch(request)
1378            .await
1379            .map_err(RusotoError::from)?;
1380        if response.status.is_success() {
1381            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1382            let result = proto::json::ResponsePayload::new(&response)
1383                .deserialize::<UnsubscribeResult, _>()?;
1384
1385            Ok(result)
1386        } else {
1387            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1388            Err(UnsubscribeError::from_response(response))
1389        }
1390    }
1391
1392    /// <p>Removes the association between one or more provided tags and a notification rule.</p>
1393    #[allow(unused_mut)]
1394    async fn untag_resource(
1395        &self,
1396        input: UntagResourceRequest,
1397    ) -> Result<UntagResourceResult, RusotoError<UntagResourceError>> {
1398        let request_uri = "/untagResource";
1399
1400        let mut request =
1401            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1402        request.set_content_type("application/x-amz-json-1.1".to_owned());
1403
1404        let encoded = Some(serde_json::to_vec(&input).unwrap());
1405        request.set_payload(encoded);
1406
1407        let mut response = self
1408            .client
1409            .sign_and_dispatch(request)
1410            .await
1411            .map_err(RusotoError::from)?;
1412        if response.status.is_success() {
1413            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1414            let result = proto::json::ResponsePayload::new(&response)
1415                .deserialize::<UntagResourceResult, _>()?;
1416
1417            Ok(result)
1418        } else {
1419            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1420            Err(UntagResourceError::from_response(response))
1421        }
1422    }
1423
1424    /// <p><p>Updates a notification rule for a resource. You can change the events that trigger the notification rule, the status of the rule, and the targets that receive the notifications.</p> <note> <p>To add or remove tags for a notification rule, you must use <a>TagResource</a> and <a>UntagResource</a>.</p> </note></p>
1425    #[allow(unused_mut)]
1426    async fn update_notification_rule(
1427        &self,
1428        input: UpdateNotificationRuleRequest,
1429    ) -> Result<UpdateNotificationRuleResult, RusotoError<UpdateNotificationRuleError>> {
1430        let request_uri = "/updateNotificationRule";
1431
1432        let mut request =
1433            SignedRequest::new("POST", "codestar-notifications", &self.region, &request_uri);
1434        request.set_content_type("application/x-amz-json-1.1".to_owned());
1435
1436        let encoded = Some(serde_json::to_vec(&input).unwrap());
1437        request.set_payload(encoded);
1438
1439        let mut response = self
1440            .client
1441            .sign_and_dispatch(request)
1442            .await
1443            .map_err(RusotoError::from)?;
1444        if response.status.is_success() {
1445            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1446            let result = proto::json::ResponsePayload::new(&response)
1447                .deserialize::<UpdateNotificationRuleResult, _>()?;
1448
1449            Ok(result)
1450        } else {
1451            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1452            Err(UpdateNotificationRuleError::from_response(response))
1453        }
1454    }
1455}