
com.amazonaws.services.opsworks.model.Source Maven / Gradle / Ivy
/*
* Copyright 2013-2018 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.opsworks.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains the information required to retrieve an app or cookbook from a repository. For more information, see Creating Apps or Custom Recipes and Cookbooks.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Source implements Serializable, Cloneable, StructuredPojo {
/**
*
* The repository type.
*
*/
private String type;
/**
*
* The source URL. The following is an example of an Amazon S3 source URL:
* https://s3.amazonaws.com/opsworks-demo-bucket/opsworks_cookbook_demo.tar.gz
.
*
*/
private String url;
/**
*
* This parameter depends on the repository type.
*
*
* -
*
* For Amazon S3 bundles, set Username
to the appropriate IAM access key ID.
*
*
* -
*
* For HTTP bundles, Git repositories, and Subversion repositories, set Username
to the user name.
*
*
*
*/
private String username;
/**
*
* When included in a request, the parameter depends on the repository type.
*
*
* -
*
* For Amazon S3 bundles, set Password
to the appropriate IAM secret access key.
*
*
* -
*
* For HTTP bundles and Subversion repositories, set Password
to the password.
*
*
*
*
* For more information on how to safely handle IAM credentials, see http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.
*
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*
*/
private String password;
/**
*
* In requests, the repository's SSH key.
*
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*
*/
private String sshKey;
/**
*
* The application's version. AWS OpsWorks Stacks enables you to easily deploy new versions of an application. One
* of the simplest approaches is to have branches or revisions in your repository that represent different versions
* that can potentially be deployed.
*
*/
private String revision;
/**
*
* The repository type.
*
*
* @param type
* The repository type.
* @see SourceType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The repository type.
*
*
* @return The repository type.
* @see SourceType
*/
public String getType() {
return this.type;
}
/**
*
* The repository type.
*
*
* @param type
* The repository type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SourceType
*/
public Source withType(String type) {
setType(type);
return this;
}
/**
*
* The repository type.
*
*
* @param type
* The repository type.
* @see SourceType
*/
public void setType(SourceType type) {
withType(type);
}
/**
*
* The repository type.
*
*
* @param type
* The repository type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SourceType
*/
public Source withType(SourceType type) {
this.type = type.toString();
return this;
}
/**
*
* The source URL. The following is an example of an Amazon S3 source URL:
* https://s3.amazonaws.com/opsworks-demo-bucket/opsworks_cookbook_demo.tar.gz
.
*
*
* @param url
* The source URL. The following is an example of an Amazon S3 source URL:
* https://s3.amazonaws.com/opsworks-demo-bucket/opsworks_cookbook_demo.tar.gz
.
*/
public void setUrl(String url) {
this.url = url;
}
/**
*
* The source URL. The following is an example of an Amazon S3 source URL:
* https://s3.amazonaws.com/opsworks-demo-bucket/opsworks_cookbook_demo.tar.gz
.
*
*
* @return The source URL. The following is an example of an Amazon S3 source URL:
* https://s3.amazonaws.com/opsworks-demo-bucket/opsworks_cookbook_demo.tar.gz
.
*/
public String getUrl() {
return this.url;
}
/**
*
* The source URL. The following is an example of an Amazon S3 source URL:
* https://s3.amazonaws.com/opsworks-demo-bucket/opsworks_cookbook_demo.tar.gz
.
*
*
* @param url
* The source URL. The following is an example of an Amazon S3 source URL:
* https://s3.amazonaws.com/opsworks-demo-bucket/opsworks_cookbook_demo.tar.gz
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Source withUrl(String url) {
setUrl(url);
return this;
}
/**
*
* This parameter depends on the repository type.
*
*
* -
*
* For Amazon S3 bundles, set Username
to the appropriate IAM access key ID.
*
*
* -
*
* For HTTP bundles, Git repositories, and Subversion repositories, set Username
to the user name.
*
*
*
*
* @param username
* This parameter depends on the repository type.
*
* -
*
* For Amazon S3 bundles, set Username
to the appropriate IAM access key ID.
*
*
* -
*
* For HTTP bundles, Git repositories, and Subversion repositories, set Username
to the user
* name.
*
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
* This parameter depends on the repository type.
*
*
* -
*
* For Amazon S3 bundles, set Username
to the appropriate IAM access key ID.
*
*
* -
*
* For HTTP bundles, Git repositories, and Subversion repositories, set Username
to the user name.
*
*
*
*
* @return This parameter depends on the repository type.
*
* -
*
* For Amazon S3 bundles, set Username
to the appropriate IAM access key ID.
*
*
* -
*
* For HTTP bundles, Git repositories, and Subversion repositories, set Username
to the user
* name.
*
*
*/
public String getUsername() {
return this.username;
}
/**
*
* This parameter depends on the repository type.
*
*
* -
*
* For Amazon S3 bundles, set Username
to the appropriate IAM access key ID.
*
*
* -
*
* For HTTP bundles, Git repositories, and Subversion repositories, set Username
to the user name.
*
*
*
*
* @param username
* This parameter depends on the repository type.
*
* -
*
* For Amazon S3 bundles, set Username
to the appropriate IAM access key ID.
*
*
* -
*
* For HTTP bundles, Git repositories, and Subversion repositories, set Username
to the user
* name.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Source withUsername(String username) {
setUsername(username);
return this;
}
/**
*
* When included in a request, the parameter depends on the repository type.
*
*
* -
*
* For Amazon S3 bundles, set Password
to the appropriate IAM secret access key.
*
*
* -
*
* For HTTP bundles and Subversion repositories, set Password
to the password.
*
*
*
*
* For more information on how to safely handle IAM credentials, see http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.
*
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*
*
* @param password
* When included in a request, the parameter depends on the repository type.
*
* -
*
* For Amazon S3 bundles, set Password
to the appropriate IAM secret access key.
*
*
* -
*
* For HTTP bundles and Subversion repositories, set Password
to the password.
*
*
*
*
* For more information on how to safely handle IAM credentials, see http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.
*
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*/
public void setPassword(String password) {
this.password = password;
}
/**
*
* When included in a request, the parameter depends on the repository type.
*
*
* -
*
* For Amazon S3 bundles, set Password
to the appropriate IAM secret access key.
*
*
* -
*
* For HTTP bundles and Subversion repositories, set Password
to the password.
*
*
*
*
* For more information on how to safely handle IAM credentials, see http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.
*
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*
*
* @return When included in a request, the parameter depends on the repository type.
*
* -
*
* For Amazon S3 bundles, set Password
to the appropriate IAM secret access key.
*
*
* -
*
* For HTTP bundles and Subversion repositories, set Password
to the password.
*
*
*
*
* For more information on how to safely handle IAM credentials, see http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.
*
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*/
public String getPassword() {
return this.password;
}
/**
*
* When included in a request, the parameter depends on the repository type.
*
*
* -
*
* For Amazon S3 bundles, set Password
to the appropriate IAM secret access key.
*
*
* -
*
* For HTTP bundles and Subversion repositories, set Password
to the password.
*
*
*
*
* For more information on how to safely handle IAM credentials, see http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.
*
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*
*
* @param password
* When included in a request, the parameter depends on the repository type.
*
* -
*
* For Amazon S3 bundles, set Password
to the appropriate IAM secret access key.
*
*
* -
*
* For HTTP bundles and Subversion repositories, set Password
to the password.
*
*
*
*
* For more information on how to safely handle IAM credentials, see http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.
*
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Source withPassword(String password) {
setPassword(password);
return this;
}
/**
*
* In requests, the repository's SSH key.
*
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*
*
* @param sshKey
* In requests, the repository's SSH key.
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*/
public void setSshKey(String sshKey) {
this.sshKey = sshKey;
}
/**
*
* In requests, the repository's SSH key.
*
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*
*
* @return In requests, the repository's SSH key.
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*/
public String getSshKey() {
return this.sshKey;
}
/**
*
* In requests, the repository's SSH key.
*
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*
*
* @param sshKey
* In requests, the repository's SSH key.
*
* In responses, AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Source withSshKey(String sshKey) {
setSshKey(sshKey);
return this;
}
/**
*
* The application's version. AWS OpsWorks Stacks enables you to easily deploy new versions of an application. One
* of the simplest approaches is to have branches or revisions in your repository that represent different versions
* that can potentially be deployed.
*
*
* @param revision
* The application's version. AWS OpsWorks Stacks enables you to easily deploy new versions of an
* application. One of the simplest approaches is to have branches or revisions in your repository that
* represent different versions that can potentially be deployed.
*/
public void setRevision(String revision) {
this.revision = revision;
}
/**
*
* The application's version. AWS OpsWorks Stacks enables you to easily deploy new versions of an application. One
* of the simplest approaches is to have branches or revisions in your repository that represent different versions
* that can potentially be deployed.
*
*
* @return The application's version. AWS OpsWorks Stacks enables you to easily deploy new versions of an
* application. One of the simplest approaches is to have branches or revisions in your repository that
* represent different versions that can potentially be deployed.
*/
public String getRevision() {
return this.revision;
}
/**
*
* The application's version. AWS OpsWorks Stacks enables you to easily deploy new versions of an application. One
* of the simplest approaches is to have branches or revisions in your repository that represent different versions
* that can potentially be deployed.
*
*
* @param revision
* The application's version. AWS OpsWorks Stacks enables you to easily deploy new versions of an
* application. One of the simplest approaches is to have branches or revisions in your repository that
* represent different versions that can potentially be deployed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Source withRevision(String revision) {
setRevision(revision);
return this;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getUrl() != null)
sb.append("Url: ").append(getUrl()).append(",");
if (getUsername() != null)
sb.append("Username: ").append(getUsername()).append(",");
if (getPassword() != null)
sb.append("Password: ").append(getPassword()).append(",");
if (getSshKey() != null)
sb.append("SshKey: ").append(getSshKey()).append(",");
if (getRevision() != null)
sb.append("Revision: ").append(getRevision());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Source == false)
return false;
Source other = (Source) obj;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getUrl() == null ^ this.getUrl() == null)
return false;
if (other.getUrl() != null && other.getUrl().equals(this.getUrl()) == false)
return false;
if (other.getUsername() == null ^ this.getUsername() == null)
return false;
if (other.getUsername() != null && other.getUsername().equals(this.getUsername()) == false)
return false;
if (other.getPassword() == null ^ this.getPassword() == null)
return false;
if (other.getPassword() != null && other.getPassword().equals(this.getPassword()) == false)
return false;
if (other.getSshKey() == null ^ this.getSshKey() == null)
return false;
if (other.getSshKey() != null && other.getSshKey().equals(this.getSshKey()) == false)
return false;
if (other.getRevision() == null ^ this.getRevision() == null)
return false;
if (other.getRevision() != null && other.getRevision().equals(this.getRevision()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getUrl() == null) ? 0 : getUrl().hashCode());
hashCode = prime * hashCode + ((getUsername() == null) ? 0 : getUsername().hashCode());
hashCode = prime * hashCode + ((getPassword() == null) ? 0 : getPassword().hashCode());
hashCode = prime * hashCode + ((getSshKey() == null) ? 0 : getSshKey().hashCode());
hashCode = prime * hashCode + ((getRevision() == null) ? 0 : getRevision().hashCode());
return hashCode;
}
@Override
public Source clone() {
try {
return (Source) 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.opsworks.model.transform.SourceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}