1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/budgets/model/UpdateBudgetActionRequest.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8
9 #include <utility>
10
11 using namespace Aws::Budgets::Model;
12 using namespace Aws::Utils::Json;
13 using namespace Aws::Utils;
14
UpdateBudgetActionRequest()15 UpdateBudgetActionRequest::UpdateBudgetActionRequest() :
16 m_accountIdHasBeenSet(false),
17 m_budgetNameHasBeenSet(false),
18 m_actionIdHasBeenSet(false),
19 m_notificationType(NotificationType::NOT_SET),
20 m_notificationTypeHasBeenSet(false),
21 m_actionThresholdHasBeenSet(false),
22 m_definitionHasBeenSet(false),
23 m_executionRoleArnHasBeenSet(false),
24 m_approvalModel(ApprovalModel::NOT_SET),
25 m_approvalModelHasBeenSet(false),
26 m_subscribersHasBeenSet(false)
27 {
28 }
29
SerializePayload() const30 Aws::String UpdateBudgetActionRequest::SerializePayload() const
31 {
32 JsonValue payload;
33
34 if(m_accountIdHasBeenSet)
35 {
36 payload.WithString("AccountId", m_accountId);
37
38 }
39
40 if(m_budgetNameHasBeenSet)
41 {
42 payload.WithString("BudgetName", m_budgetName);
43
44 }
45
46 if(m_actionIdHasBeenSet)
47 {
48 payload.WithString("ActionId", m_actionId);
49
50 }
51
52 if(m_notificationTypeHasBeenSet)
53 {
54 payload.WithString("NotificationType", NotificationTypeMapper::GetNameForNotificationType(m_notificationType));
55 }
56
57 if(m_actionThresholdHasBeenSet)
58 {
59 payload.WithObject("ActionThreshold", m_actionThreshold.Jsonize());
60
61 }
62
63 if(m_definitionHasBeenSet)
64 {
65 payload.WithObject("Definition", m_definition.Jsonize());
66
67 }
68
69 if(m_executionRoleArnHasBeenSet)
70 {
71 payload.WithString("ExecutionRoleArn", m_executionRoleArn);
72
73 }
74
75 if(m_approvalModelHasBeenSet)
76 {
77 payload.WithString("ApprovalModel", ApprovalModelMapper::GetNameForApprovalModel(m_approvalModel));
78 }
79
80 if(m_subscribersHasBeenSet)
81 {
82 Array<JsonValue> subscribersJsonList(m_subscribers.size());
83 for(unsigned subscribersIndex = 0; subscribersIndex < subscribersJsonList.GetLength(); ++subscribersIndex)
84 {
85 subscribersJsonList[subscribersIndex].AsObject(m_subscribers[subscribersIndex].Jsonize());
86 }
87 payload.WithArray("Subscribers", std::move(subscribersJsonList));
88
89 }
90
91 return payload.View().WriteReadable();
92 }
93
GetRequestSpecificHeaders() const94 Aws::Http::HeaderValueCollection UpdateBudgetActionRequest::GetRequestSpecificHeaders() const
95 {
96 Aws::Http::HeaderValueCollection headers;
97 headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSBudgetServiceGateway.UpdateBudgetAction"));
98 return headers;
99
100 }
101
102
103
104
105