/* * Copyright 2018-2023 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.codebuild.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ImportSourceCredentialsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The Bitbucket username when the authType
is BASIC_AUTH. This parameter is not valid for other types
* of source providers or connections.
*
* For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app password. *
*/ private String token; /** ** The source provider used for this project. *
*/ private String serverType; /** ** The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. An OAUTH * connection is not supported by the API and must be created using the CodeBuild console. *
*/ private String authType; /** *
* Set to false
to prevent overwriting the repository source credentials. Set to true
to
* overwrite the repository source credentials. The default value is true
.
*
* The Bitbucket username when the authType
is BASIC_AUTH. This parameter is not valid for other types
* of source providers or connections.
*
authType
is BASIC_AUTH. This parameter is not valid for other
* types of source providers or connections.
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
* The Bitbucket username when the authType
is BASIC_AUTH. This parameter is not valid for other types
* of source providers or connections.
*
authType
is BASIC_AUTH. This parameter is not valid for
* other types of source providers or connections.
*/
public String getUsername() {
return this.username;
}
/**
*
* The Bitbucket username when the authType
is BASIC_AUTH. This parameter is not valid for other types
* of source providers or connections.
*
authType
is BASIC_AUTH. This parameter is not valid for other
* types of source providers or connections.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportSourceCredentialsRequest withUsername(String username) {
setUsername(username);
return this;
}
/**
* * For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app password. *
* * @param token * For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app * password. */ public void setToken(String token) { this.token = token; } /** ** For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app password. *
* * @return For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app * password. */ public String getToken() { return this.token; } /** ** For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app password. *
* * @param token * For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app * password. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportSourceCredentialsRequest withToken(String token) { setToken(token); return this; } /** ** The source provider used for this project. *
* * @param serverType * The source provider used for this project. * @see ServerType */ public void setServerType(String serverType) { this.serverType = serverType; } /** ** The source provider used for this project. *
* * @return The source provider used for this project. * @see ServerType */ public String getServerType() { return this.serverType; } /** ** The source provider used for this project. *
* * @param serverType * The source provider used for this project. * @return Returns a reference to this object so that method calls can be chained together. * @see ServerType */ public ImportSourceCredentialsRequest withServerType(String serverType) { setServerType(serverType); return this; } /** ** The source provider used for this project. *
* * @param serverType * The source provider used for this project. * @return Returns a reference to this object so that method calls can be chained together. * @see ServerType */ public ImportSourceCredentialsRequest withServerType(ServerType serverType) { this.serverType = serverType.toString(); return this; } /** ** The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. An OAUTH * connection is not supported by the API and must be created using the CodeBuild console. *
* * @param authType * The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. An * OAUTH connection is not supported by the API and must be created using the CodeBuild console. * @see AuthType */ public void setAuthType(String authType) { this.authType = authType; } /** ** The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. An OAUTH * connection is not supported by the API and must be created using the CodeBuild console. *
* * @return The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. An * OAUTH connection is not supported by the API and must be created using the CodeBuild console. * @see AuthType */ public String getAuthType() { return this.authType; } /** ** The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. An OAUTH * connection is not supported by the API and must be created using the CodeBuild console. *
* * @param authType * The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. An * OAUTH connection is not supported by the API and must be created using the CodeBuild console. * @return Returns a reference to this object so that method calls can be chained together. * @see AuthType */ public ImportSourceCredentialsRequest withAuthType(String authType) { setAuthType(authType); return this; } /** ** The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. An OAUTH * connection is not supported by the API and must be created using the CodeBuild console. *
* * @param authType * The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. An * OAUTH connection is not supported by the API and must be created using the CodeBuild console. * @return Returns a reference to this object so that method calls can be chained together. * @see AuthType */ public ImportSourceCredentialsRequest withAuthType(AuthType authType) { this.authType = authType.toString(); return this; } /** *
* Set to false
to prevent overwriting the repository source credentials. Set to true
to
* overwrite the repository source credentials. The default value is true
.
*
false
to prevent overwriting the repository source credentials. Set to
* true
to overwrite the repository source credentials. The default value is true
.
*/
public void setShouldOverwrite(Boolean shouldOverwrite) {
this.shouldOverwrite = shouldOverwrite;
}
/**
*
* Set to false
to prevent overwriting the repository source credentials. Set to true
to
* overwrite the repository source credentials. The default value is true
.
*
false
to prevent overwriting the repository source credentials. Set to
* true
to overwrite the repository source credentials. The default value is true
.
*/
public Boolean getShouldOverwrite() {
return this.shouldOverwrite;
}
/**
*
* Set to false
to prevent overwriting the repository source credentials. Set to true
to
* overwrite the repository source credentials. The default value is true
.
*
false
to prevent overwriting the repository source credentials. Set to
* true
to overwrite the repository source credentials. The default value is true
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportSourceCredentialsRequest withShouldOverwrite(Boolean shouldOverwrite) {
setShouldOverwrite(shouldOverwrite);
return this;
}
/**
*
* Set to false
to prevent overwriting the repository source credentials. Set to true
to
* overwrite the repository source credentials. The default value is true
.
*
false
to prevent overwriting the repository source credentials. Set to
* true
to overwrite the repository source credentials. The default value is true
.
*/
public Boolean isShouldOverwrite() {
return this.shouldOverwrite;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getUsername() != null)
sb.append("Username: ").append(getUsername()).append(",");
if (getToken() != null)
sb.append("Token: ").append("***Sensitive Data Redacted***").append(",");
if (getServerType() != null)
sb.append("ServerType: ").append(getServerType()).append(",");
if (getAuthType() != null)
sb.append("AuthType: ").append(getAuthType()).append(",");
if (getShouldOverwrite() != null)
sb.append("ShouldOverwrite: ").append(getShouldOverwrite());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ImportSourceCredentialsRequest == false)
return false;
ImportSourceCredentialsRequest other = (ImportSourceCredentialsRequest) obj;
if (other.getUsername() == null ^ this.getUsername() == null)
return false;
if (other.getUsername() != null && other.getUsername().equals(this.getUsername()) == false)
return false;
if (other.getToken() == null ^ this.getToken() == null)
return false;
if (other.getToken() != null && other.getToken().equals(this.getToken()) == false)
return false;
if (other.getServerType() == null ^ this.getServerType() == null)
return false;
if (other.getServerType() != null && other.getServerType().equals(this.getServerType()) == false)
return false;
if (other.getAuthType() == null ^ this.getAuthType() == null)
return false;
if (other.getAuthType() != null && other.getAuthType().equals(this.getAuthType()) == false)
return false;
if (other.getShouldOverwrite() == null ^ this.getShouldOverwrite() == null)
return false;
if (other.getShouldOverwrite() != null && other.getShouldOverwrite().equals(this.getShouldOverwrite()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getUsername() == null) ? 0 : getUsername().hashCode());
hashCode = prime * hashCode + ((getToken() == null) ? 0 : getToken().hashCode());
hashCode = prime * hashCode + ((getServerType() == null) ? 0 : getServerType().hashCode());
hashCode = prime * hashCode + ((getAuthType() == null) ? 0 : getAuthType().hashCode());
hashCode = prime * hashCode + ((getShouldOverwrite() == null) ? 0 : getShouldOverwrite().hashCode());
return hashCode;
}
@Override
public ImportSourceCredentialsRequest clone() {
return (ImportSourceCredentialsRequest) super.clone();
}
}