/* * 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.glue.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* The details for a source control configuration for a job, allowing synchronization of job artifacts to or from a * remote repository. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SourceControlDetails implements Serializable, Cloneable, StructuredPojo { /** ** The provider for the remote repository. *
*/ private String provider; /** ** The name of the remote repository that contains the job artifacts. *
*/ private String repository; /** ** The owner of the remote repository that contains the job artifacts. *
*/ private String owner; /** ** An optional branch in the remote repository. *
*/ private String branch; /** ** An optional folder in the remote repository. *
*/ private String folder; /** ** The last commit ID for a commit in the remote repository. *
*/ private String lastCommitId; /** ** The type of authentication, which can be an authentication token stored in Amazon Web Services Secrets Manager, * or a personal access token. *
*/ private String authStrategy; /** ** The value of an authorization token. *
*/ private String authToken; /** ** The provider for the remote repository. *
* * @param provider * The provider for the remote repository. * @see SourceControlProvider */ public void setProvider(String provider) { this.provider = provider; } /** ** The provider for the remote repository. *
* * @return The provider for the remote repository. * @see SourceControlProvider */ public String getProvider() { return this.provider; } /** ** The provider for the remote repository. *
* * @param provider * The provider for the remote repository. * @return Returns a reference to this object so that method calls can be chained together. * @see SourceControlProvider */ public SourceControlDetails withProvider(String provider) { setProvider(provider); return this; } /** ** The provider for the remote repository. *
* * @param provider * The provider for the remote repository. * @return Returns a reference to this object so that method calls can be chained together. * @see SourceControlProvider */ public SourceControlDetails withProvider(SourceControlProvider provider) { this.provider = provider.toString(); return this; } /** ** The name of the remote repository that contains the job artifacts. *
* * @param repository * The name of the remote repository that contains the job artifacts. */ public void setRepository(String repository) { this.repository = repository; } /** ** The name of the remote repository that contains the job artifacts. *
* * @return The name of the remote repository that contains the job artifacts. */ public String getRepository() { return this.repository; } /** ** The name of the remote repository that contains the job artifacts. *
* * @param repository * The name of the remote repository that contains the job artifacts. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceControlDetails withRepository(String repository) { setRepository(repository); return this; } /** ** The owner of the remote repository that contains the job artifacts. *
* * @param owner * The owner of the remote repository that contains the job artifacts. */ public void setOwner(String owner) { this.owner = owner; } /** ** The owner of the remote repository that contains the job artifacts. *
* * @return The owner of the remote repository that contains the job artifacts. */ public String getOwner() { return this.owner; } /** ** The owner of the remote repository that contains the job artifacts. *
* * @param owner * The owner of the remote repository that contains the job artifacts. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceControlDetails withOwner(String owner) { setOwner(owner); return this; } /** ** An optional branch in the remote repository. *
* * @param branch * An optional branch in the remote repository. */ public void setBranch(String branch) { this.branch = branch; } /** ** An optional branch in the remote repository. *
* * @return An optional branch in the remote repository. */ public String getBranch() { return this.branch; } /** ** An optional branch in the remote repository. *
* * @param branch * An optional branch in the remote repository. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceControlDetails withBranch(String branch) { setBranch(branch); return this; } /** ** An optional folder in the remote repository. *
* * @param folder * An optional folder in the remote repository. */ public void setFolder(String folder) { this.folder = folder; } /** ** An optional folder in the remote repository. *
* * @return An optional folder in the remote repository. */ public String getFolder() { return this.folder; } /** ** An optional folder in the remote repository. *
* * @param folder * An optional folder in the remote repository. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceControlDetails withFolder(String folder) { setFolder(folder); return this; } /** ** The last commit ID for a commit in the remote repository. *
* * @param lastCommitId * The last commit ID for a commit in the remote repository. */ public void setLastCommitId(String lastCommitId) { this.lastCommitId = lastCommitId; } /** ** The last commit ID for a commit in the remote repository. *
* * @return The last commit ID for a commit in the remote repository. */ public String getLastCommitId() { return this.lastCommitId; } /** ** The last commit ID for a commit in the remote repository. *
* * @param lastCommitId * The last commit ID for a commit in the remote repository. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceControlDetails withLastCommitId(String lastCommitId) { setLastCommitId(lastCommitId); return this; } /** ** The type of authentication, which can be an authentication token stored in Amazon Web Services Secrets Manager, * or a personal access token. *
* * @param authStrategy * The type of authentication, which can be an authentication token stored in Amazon Web Services Secrets * Manager, or a personal access token. * @see SourceControlAuthStrategy */ public void setAuthStrategy(String authStrategy) { this.authStrategy = authStrategy; } /** ** The type of authentication, which can be an authentication token stored in Amazon Web Services Secrets Manager, * or a personal access token. *
* * @return The type of authentication, which can be an authentication token stored in Amazon Web Services Secrets * Manager, or a personal access token. * @see SourceControlAuthStrategy */ public String getAuthStrategy() { return this.authStrategy; } /** ** The type of authentication, which can be an authentication token stored in Amazon Web Services Secrets Manager, * or a personal access token. *
* * @param authStrategy * The type of authentication, which can be an authentication token stored in Amazon Web Services Secrets * Manager, or a personal access token. * @return Returns a reference to this object so that method calls can be chained together. * @see SourceControlAuthStrategy */ public SourceControlDetails withAuthStrategy(String authStrategy) { setAuthStrategy(authStrategy); return this; } /** ** The type of authentication, which can be an authentication token stored in Amazon Web Services Secrets Manager, * or a personal access token. *
* * @param authStrategy * The type of authentication, which can be an authentication token stored in Amazon Web Services Secrets * Manager, or a personal access token. * @return Returns a reference to this object so that method calls can be chained together. * @see SourceControlAuthStrategy */ public SourceControlDetails withAuthStrategy(SourceControlAuthStrategy authStrategy) { this.authStrategy = authStrategy.toString(); return this; } /** ** The value of an authorization token. *
* * @param authToken * The value of an authorization token. */ public void setAuthToken(String authToken) { this.authToken = authToken; } /** ** The value of an authorization token. *
* * @return The value of an authorization token. */ public String getAuthToken() { return this.authToken; } /** ** The value of an authorization token. *
* * @param authToken * The value of an authorization token. * @return Returns a reference to this object so that method calls can be chained together. */ public SourceControlDetails withAuthToken(String authToken) { setAuthToken(authToken); return this; } /** * 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 (getProvider() != null) sb.append("Provider: ").append(getProvider()).append(","); if (getRepository() != null) sb.append("Repository: ").append(getRepository()).append(","); if (getOwner() != null) sb.append("Owner: ").append(getOwner()).append(","); if (getBranch() != null) sb.append("Branch: ").append(getBranch()).append(","); if (getFolder() != null) sb.append("Folder: ").append(getFolder()).append(","); if (getLastCommitId() != null) sb.append("LastCommitId: ").append(getLastCommitId()).append(","); if (getAuthStrategy() != null) sb.append("AuthStrategy: ").append(getAuthStrategy()).append(","); if (getAuthToken() != null) sb.append("AuthToken: ").append(getAuthToken()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SourceControlDetails == false) return false; SourceControlDetails other = (SourceControlDetails) obj; if (other.getProvider() == null ^ this.getProvider() == null) return false; if (other.getProvider() != null && other.getProvider().equals(this.getProvider()) == false) return false; if (other.getRepository() == null ^ this.getRepository() == null) return false; if (other.getRepository() != null && other.getRepository().equals(this.getRepository()) == false) return false; if (other.getOwner() == null ^ this.getOwner() == null) return false; if (other.getOwner() != null && other.getOwner().equals(this.getOwner()) == false) return false; if (other.getBranch() == null ^ this.getBranch() == null) return false; if (other.getBranch() != null && other.getBranch().equals(this.getBranch()) == false) return false; if (other.getFolder() == null ^ this.getFolder() == null) return false; if (other.getFolder() != null && other.getFolder().equals(this.getFolder()) == false) return false; if (other.getLastCommitId() == null ^ this.getLastCommitId() == null) return false; if (other.getLastCommitId() != null && other.getLastCommitId().equals(this.getLastCommitId()) == false) return false; if (other.getAuthStrategy() == null ^ this.getAuthStrategy() == null) return false; if (other.getAuthStrategy() != null && other.getAuthStrategy().equals(this.getAuthStrategy()) == false) return false; if (other.getAuthToken() == null ^ this.getAuthToken() == null) return false; if (other.getAuthToken() != null && other.getAuthToken().equals(this.getAuthToken()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getProvider() == null) ? 0 : getProvider().hashCode()); hashCode = prime * hashCode + ((getRepository() == null) ? 0 : getRepository().hashCode()); hashCode = prime * hashCode + ((getOwner() == null) ? 0 : getOwner().hashCode()); hashCode = prime * hashCode + ((getBranch() == null) ? 0 : getBranch().hashCode()); hashCode = prime * hashCode + ((getFolder() == null) ? 0 : getFolder().hashCode()); hashCode = prime * hashCode + ((getLastCommitId() == null) ? 0 : getLastCommitId().hashCode()); hashCode = prime * hashCode + ((getAuthStrategy() == null) ? 0 : getAuthStrategy().hashCode()); hashCode = prime * hashCode + ((getAuthToken() == null) ? 0 : getAuthToken().hashCode()); return hashCode; } @Override public SourceControlDetails clone() { try { return (SourceControlDetails) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.glue.model.transform.SourceControlDetailsMarshaller.getInstance().marshall(this, protocolMarshaller); } }