1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/appflow/model/ZendeskConnectorProfileCredentials.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8 
9 #include <utility>
10 
11 using namespace Aws::Utils::Json;
12 using namespace Aws::Utils;
13 
14 namespace Aws
15 {
16 namespace Appflow
17 {
18 namespace Model
19 {
20 
ZendeskConnectorProfileCredentials()21 ZendeskConnectorProfileCredentials::ZendeskConnectorProfileCredentials() :
22     m_clientIdHasBeenSet(false),
23     m_clientSecretHasBeenSet(false),
24     m_accessTokenHasBeenSet(false),
25     m_oAuthRequestHasBeenSet(false)
26 {
27 }
28 
ZendeskConnectorProfileCredentials(JsonView jsonValue)29 ZendeskConnectorProfileCredentials::ZendeskConnectorProfileCredentials(JsonView jsonValue) :
30     m_clientIdHasBeenSet(false),
31     m_clientSecretHasBeenSet(false),
32     m_accessTokenHasBeenSet(false),
33     m_oAuthRequestHasBeenSet(false)
34 {
35   *this = jsonValue;
36 }
37 
operator =(JsonView jsonValue)38 ZendeskConnectorProfileCredentials& ZendeskConnectorProfileCredentials::operator =(JsonView jsonValue)
39 {
40   if(jsonValue.ValueExists("clientId"))
41   {
42     m_clientId = jsonValue.GetString("clientId");
43 
44     m_clientIdHasBeenSet = true;
45   }
46 
47   if(jsonValue.ValueExists("clientSecret"))
48   {
49     m_clientSecret = jsonValue.GetString("clientSecret");
50 
51     m_clientSecretHasBeenSet = true;
52   }
53 
54   if(jsonValue.ValueExists("accessToken"))
55   {
56     m_accessToken = jsonValue.GetString("accessToken");
57 
58     m_accessTokenHasBeenSet = true;
59   }
60 
61   if(jsonValue.ValueExists("oAuthRequest"))
62   {
63     m_oAuthRequest = jsonValue.GetObject("oAuthRequest");
64 
65     m_oAuthRequestHasBeenSet = true;
66   }
67 
68   return *this;
69 }
70 
Jsonize() const71 JsonValue ZendeskConnectorProfileCredentials::Jsonize() const
72 {
73   JsonValue payload;
74 
75   if(m_clientIdHasBeenSet)
76   {
77    payload.WithString("clientId", m_clientId);
78 
79   }
80 
81   if(m_clientSecretHasBeenSet)
82   {
83    payload.WithString("clientSecret", m_clientSecret);
84 
85   }
86 
87   if(m_accessTokenHasBeenSet)
88   {
89    payload.WithString("accessToken", m_accessToken);
90 
91   }
92 
93   if(m_oAuthRequestHasBeenSet)
94   {
95    payload.WithObject("oAuthRequest", m_oAuthRequest.Jsonize());
96 
97   }
98 
99   return payload;
100 }
101 
102 } // namespace Model
103 } // namespace Appflow
104 } // namespace Aws
105