1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/codebuild/CodeBuild_EXPORTS.h>
8 #include <aws/codebuild/CodeBuildRequest.h>
9 #include <aws/core/utils/memory/stl/AWSString.h>
10 #include <aws/codebuild/model/ServerType.h>
11 #include <aws/codebuild/model/AuthType.h>
12 #include <utility>
13 
14 namespace Aws
15 {
16 namespace CodeBuild
17 {
18 namespace Model
19 {
20 
21   /**
22    */
23   class AWS_CODEBUILD_API ImportSourceCredentialsRequest : public CodeBuildRequest
24   {
25   public:
26     ImportSourceCredentialsRequest();
27 
28     // Service request name is the Operation name which will send this request out,
29     // each operation should has unique request name, so that we can get operation's name from this request.
30     // Note: this is not true for response, multiple operations may have the same response name,
31     // so we can not get operation's name from response.
GetServiceRequestName()32     inline virtual const char* GetServiceRequestName() const override { return "ImportSourceCredentials"; }
33 
34     Aws::String SerializePayload() const override;
35 
36     Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
37 
38 
39     /**
40      * <p> The Bitbucket username when the <code>authType</code> is BASIC_AUTH. This
41      * parameter is not valid for other types of source providers or connections. </p>
42      */
GetUsername()43     inline const Aws::String& GetUsername() const{ return m_username; }
44 
45     /**
46      * <p> The Bitbucket username when the <code>authType</code> is BASIC_AUTH. This
47      * parameter is not valid for other types of source providers or connections. </p>
48      */
UsernameHasBeenSet()49     inline bool UsernameHasBeenSet() const { return m_usernameHasBeenSet; }
50 
51     /**
52      * <p> The Bitbucket username when the <code>authType</code> is BASIC_AUTH. This
53      * parameter is not valid for other types of source providers or connections. </p>
54      */
SetUsername(const Aws::String & value)55     inline void SetUsername(const Aws::String& value) { m_usernameHasBeenSet = true; m_username = value; }
56 
57     /**
58      * <p> The Bitbucket username when the <code>authType</code> is BASIC_AUTH. This
59      * parameter is not valid for other types of source providers or connections. </p>
60      */
SetUsername(Aws::String && value)61     inline void SetUsername(Aws::String&& value) { m_usernameHasBeenSet = true; m_username = std::move(value); }
62 
63     /**
64      * <p> The Bitbucket username when the <code>authType</code> is BASIC_AUTH. This
65      * parameter is not valid for other types of source providers or connections. </p>
66      */
SetUsername(const char * value)67     inline void SetUsername(const char* value) { m_usernameHasBeenSet = true; m_username.assign(value); }
68 
69     /**
70      * <p> The Bitbucket username when the <code>authType</code> is BASIC_AUTH. This
71      * parameter is not valid for other types of source providers or connections. </p>
72      */
WithUsername(const Aws::String & value)73     inline ImportSourceCredentialsRequest& WithUsername(const Aws::String& value) { SetUsername(value); return *this;}
74 
75     /**
76      * <p> The Bitbucket username when the <code>authType</code> is BASIC_AUTH. This
77      * parameter is not valid for other types of source providers or connections. </p>
78      */
WithUsername(Aws::String && value)79     inline ImportSourceCredentialsRequest& WithUsername(Aws::String&& value) { SetUsername(std::move(value)); return *this;}
80 
81     /**
82      * <p> The Bitbucket username when the <code>authType</code> is BASIC_AUTH. This
83      * parameter is not valid for other types of source providers or connections. </p>
84      */
WithUsername(const char * value)85     inline ImportSourceCredentialsRequest& WithUsername(const char* value) { SetUsername(value); return *this;}
86 
87 
88     /**
89      * <p> For GitHub or GitHub Enterprise, this is the personal access token. For
90      * Bitbucket, this is the app password. </p>
91      */
GetToken()92     inline const Aws::String& GetToken() const{ return m_token; }
93 
94     /**
95      * <p> For GitHub or GitHub Enterprise, this is the personal access token. For
96      * Bitbucket, this is the app password. </p>
97      */
TokenHasBeenSet()98     inline bool TokenHasBeenSet() const { return m_tokenHasBeenSet; }
99 
100     /**
101      * <p> For GitHub or GitHub Enterprise, this is the personal access token. For
102      * Bitbucket, this is the app password. </p>
103      */
SetToken(const Aws::String & value)104     inline void SetToken(const Aws::String& value) { m_tokenHasBeenSet = true; m_token = value; }
105 
106     /**
107      * <p> For GitHub or GitHub Enterprise, this is the personal access token. For
108      * Bitbucket, this is the app password. </p>
109      */
SetToken(Aws::String && value)110     inline void SetToken(Aws::String&& value) { m_tokenHasBeenSet = true; m_token = std::move(value); }
111 
112     /**
113      * <p> For GitHub or GitHub Enterprise, this is the personal access token. For
114      * Bitbucket, this is the app password. </p>
115      */
SetToken(const char * value)116     inline void SetToken(const char* value) { m_tokenHasBeenSet = true; m_token.assign(value); }
117 
118     /**
119      * <p> For GitHub or GitHub Enterprise, this is the personal access token. For
120      * Bitbucket, this is the app password. </p>
121      */
WithToken(const Aws::String & value)122     inline ImportSourceCredentialsRequest& WithToken(const Aws::String& value) { SetToken(value); return *this;}
123 
124     /**
125      * <p> For GitHub or GitHub Enterprise, this is the personal access token. For
126      * Bitbucket, this is the app password. </p>
127      */
WithToken(Aws::String && value)128     inline ImportSourceCredentialsRequest& WithToken(Aws::String&& value) { SetToken(std::move(value)); return *this;}
129 
130     /**
131      * <p> For GitHub or GitHub Enterprise, this is the personal access token. For
132      * Bitbucket, this is the app password. </p>
133      */
WithToken(const char * value)134     inline ImportSourceCredentialsRequest& WithToken(const char* value) { SetToken(value); return *this;}
135 
136 
137     /**
138      * <p> The source provider used for this project. </p>
139      */
GetServerType()140     inline const ServerType& GetServerType() const{ return m_serverType; }
141 
142     /**
143      * <p> The source provider used for this project. </p>
144      */
ServerTypeHasBeenSet()145     inline bool ServerTypeHasBeenSet() const { return m_serverTypeHasBeenSet; }
146 
147     /**
148      * <p> The source provider used for this project. </p>
149      */
SetServerType(const ServerType & value)150     inline void SetServerType(const ServerType& value) { m_serverTypeHasBeenSet = true; m_serverType = value; }
151 
152     /**
153      * <p> The source provider used for this project. </p>
154      */
SetServerType(ServerType && value)155     inline void SetServerType(ServerType&& value) { m_serverTypeHasBeenSet = true; m_serverType = std::move(value); }
156 
157     /**
158      * <p> The source provider used for this project. </p>
159      */
WithServerType(const ServerType & value)160     inline ImportSourceCredentialsRequest& WithServerType(const ServerType& value) { SetServerType(value); return *this;}
161 
162     /**
163      * <p> The source provider used for this project. </p>
164      */
WithServerType(ServerType && value)165     inline ImportSourceCredentialsRequest& WithServerType(ServerType&& value) { SetServerType(std::move(value)); return *this;}
166 
167 
168     /**
169      * <p> The type of authentication used to connect to a GitHub, GitHub Enterprise,
170      * or Bitbucket repository. An OAUTH connection is not supported by the API and
171      * must be created using the CodeBuild console. </p>
172      */
GetAuthType()173     inline const AuthType& GetAuthType() const{ return m_authType; }
174 
175     /**
176      * <p> The type of authentication used to connect to a GitHub, GitHub Enterprise,
177      * or Bitbucket repository. An OAUTH connection is not supported by the API and
178      * must be created using the CodeBuild console. </p>
179      */
AuthTypeHasBeenSet()180     inline bool AuthTypeHasBeenSet() const { return m_authTypeHasBeenSet; }
181 
182     /**
183      * <p> The type of authentication used to connect to a GitHub, GitHub Enterprise,
184      * or Bitbucket repository. An OAUTH connection is not supported by the API and
185      * must be created using the CodeBuild console. </p>
186      */
SetAuthType(const AuthType & value)187     inline void SetAuthType(const AuthType& value) { m_authTypeHasBeenSet = true; m_authType = value; }
188 
189     /**
190      * <p> The type of authentication used to connect to a GitHub, GitHub Enterprise,
191      * or Bitbucket repository. An OAUTH connection is not supported by the API and
192      * must be created using the CodeBuild console. </p>
193      */
SetAuthType(AuthType && value)194     inline void SetAuthType(AuthType&& value) { m_authTypeHasBeenSet = true; m_authType = std::move(value); }
195 
196     /**
197      * <p> The type of authentication used to connect to a GitHub, GitHub Enterprise,
198      * or Bitbucket repository. An OAUTH connection is not supported by the API and
199      * must be created using the CodeBuild console. </p>
200      */
WithAuthType(const AuthType & value)201     inline ImportSourceCredentialsRequest& WithAuthType(const AuthType& value) { SetAuthType(value); return *this;}
202 
203     /**
204      * <p> The type of authentication used to connect to a GitHub, GitHub Enterprise,
205      * or Bitbucket repository. An OAUTH connection is not supported by the API and
206      * must be created using the CodeBuild console. </p>
207      */
WithAuthType(AuthType && value)208     inline ImportSourceCredentialsRequest& WithAuthType(AuthType&& value) { SetAuthType(std::move(value)); return *this;}
209 
210 
211     /**
212      * <p> Set to <code>false</code> to prevent overwriting the repository source
213      * credentials. Set to <code>true</code> to overwrite the repository source
214      * credentials. The default value is <code>true</code>. </p>
215      */
GetShouldOverwrite()216     inline bool GetShouldOverwrite() const{ return m_shouldOverwrite; }
217 
218     /**
219      * <p> Set to <code>false</code> to prevent overwriting the repository source
220      * credentials. Set to <code>true</code> to overwrite the repository source
221      * credentials. The default value is <code>true</code>. </p>
222      */
ShouldOverwriteHasBeenSet()223     inline bool ShouldOverwriteHasBeenSet() const { return m_shouldOverwriteHasBeenSet; }
224 
225     /**
226      * <p> Set to <code>false</code> to prevent overwriting the repository source
227      * credentials. Set to <code>true</code> to overwrite the repository source
228      * credentials. The default value is <code>true</code>. </p>
229      */
SetShouldOverwrite(bool value)230     inline void SetShouldOverwrite(bool value) { m_shouldOverwriteHasBeenSet = true; m_shouldOverwrite = value; }
231 
232     /**
233      * <p> Set to <code>false</code> to prevent overwriting the repository source
234      * credentials. Set to <code>true</code> to overwrite the repository source
235      * credentials. The default value is <code>true</code>. </p>
236      */
WithShouldOverwrite(bool value)237     inline ImportSourceCredentialsRequest& WithShouldOverwrite(bool value) { SetShouldOverwrite(value); return *this;}
238 
239   private:
240 
241     Aws::String m_username;
242     bool m_usernameHasBeenSet;
243 
244     Aws::String m_token;
245     bool m_tokenHasBeenSet;
246 
247     ServerType m_serverType;
248     bool m_serverTypeHasBeenSet;
249 
250     AuthType m_authType;
251     bool m_authTypeHasBeenSet;
252 
253     bool m_shouldOverwrite;
254     bool m_shouldOverwriteHasBeenSet;
255   };
256 
257 } // namespace Model
258 } // namespace CodeBuild
259 } // namespace Aws
260