com.amazonaws.services.codepipeline.model.ListWebhookItem Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codepipeline Show documentation
/*
* Copyright 2015-2020 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.codepipeline.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The detail returned for each webhook after listing webhooks, such as the webhook URL, the webhook name, and the
* webhook ARN.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListWebhookItem implements Serializable, Cloneable, StructuredPojo {
/**
*
* The detail returned for each webhook, such as the webhook authentication type and filter rules.
*
*/
private WebhookDefinition definition;
/**
*
* A unique URL generated by CodePipeline. When a POST request is made to this URL, the defined pipeline is started
* as long as the body of the post request satisfies the defined authentication and filtering conditions. Deleting
* and re-creating a webhook makes the old URL invalid and generates a new one.
*
*/
private String url;
/**
*
* The text of the error message about the webhook.
*
*/
private String errorMessage;
/**
*
* The number code of the error.
*
*/
private String errorCode;
/**
*
* The date and time a webhook was last successfully triggered, in timestamp format.
*
*/
private java.util.Date lastTriggered;
/**
*
* The Amazon Resource Name (ARN) of the webhook.
*
*/
private String arn;
/**
*
* Specifies the tags applied to the webhook.
*
*/
private java.util.List tags;
/**
*
* The detail returned for each webhook, such as the webhook authentication type and filter rules.
*
*
* @param definition
* The detail returned for each webhook, such as the webhook authentication type and filter rules.
*/
public void setDefinition(WebhookDefinition definition) {
this.definition = definition;
}
/**
*
* The detail returned for each webhook, such as the webhook authentication type and filter rules.
*
*
* @return The detail returned for each webhook, such as the webhook authentication type and filter rules.
*/
public WebhookDefinition getDefinition() {
return this.definition;
}
/**
*
* The detail returned for each webhook, such as the webhook authentication type and filter rules.
*
*
* @param definition
* The detail returned for each webhook, such as the webhook authentication type and filter rules.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListWebhookItem withDefinition(WebhookDefinition definition) {
setDefinition(definition);
return this;
}
/**
*
* A unique URL generated by CodePipeline. When a POST request is made to this URL, the defined pipeline is started
* as long as the body of the post request satisfies the defined authentication and filtering conditions. Deleting
* and re-creating a webhook makes the old URL invalid and generates a new one.
*
*
* @param url
* A unique URL generated by CodePipeline. When a POST request is made to this URL, the defined pipeline is
* started as long as the body of the post request satisfies the defined authentication and filtering
* conditions. Deleting and re-creating a webhook makes the old URL invalid and generates a new one.
*/
public void setUrl(String url) {
this.url = url;
}
/**
*
* A unique URL generated by CodePipeline. When a POST request is made to this URL, the defined pipeline is started
* as long as the body of the post request satisfies the defined authentication and filtering conditions. Deleting
* and re-creating a webhook makes the old URL invalid and generates a new one.
*
*
* @return A unique URL generated by CodePipeline. When a POST request is made to this URL, the defined pipeline is
* started as long as the body of the post request satisfies the defined authentication and filtering
* conditions. Deleting and re-creating a webhook makes the old URL invalid and generates a new one.
*/
public String getUrl() {
return this.url;
}
/**
*
* A unique URL generated by CodePipeline. When a POST request is made to this URL, the defined pipeline is started
* as long as the body of the post request satisfies the defined authentication and filtering conditions. Deleting
* and re-creating a webhook makes the old URL invalid and generates a new one.
*
*
* @param url
* A unique URL generated by CodePipeline. When a POST request is made to this URL, the defined pipeline is
* started as long as the body of the post request satisfies the defined authentication and filtering
* conditions. Deleting and re-creating a webhook makes the old URL invalid and generates a new one.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListWebhookItem withUrl(String url) {
setUrl(url);
return this;
}
/**
*
* The text of the error message about the webhook.
*
*
* @param errorMessage
* The text of the error message about the webhook.
*/
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
/**
*
* The text of the error message about the webhook.
*
*
* @return The text of the error message about the webhook.
*/
public String getErrorMessage() {
return this.errorMessage;
}
/**
*
* The text of the error message about the webhook.
*
*
* @param errorMessage
* The text of the error message about the webhook.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListWebhookItem withErrorMessage(String errorMessage) {
setErrorMessage(errorMessage);
return this;
}
/**
*
* The number code of the error.
*
*
* @param errorCode
* The number code of the error.
*/
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
/**
*
* The number code of the error.
*
*
* @return The number code of the error.
*/
public String getErrorCode() {
return this.errorCode;
}
/**
*
* The number code of the error.
*
*
* @param errorCode
* The number code of the error.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListWebhookItem withErrorCode(String errorCode) {
setErrorCode(errorCode);
return this;
}
/**
*
* The date and time a webhook was last successfully triggered, in timestamp format.
*
*
* @param lastTriggered
* The date and time a webhook was last successfully triggered, in timestamp format.
*/
public void setLastTriggered(java.util.Date lastTriggered) {
this.lastTriggered = lastTriggered;
}
/**
*
* The date and time a webhook was last successfully triggered, in timestamp format.
*
*
* @return The date and time a webhook was last successfully triggered, in timestamp format.
*/
public java.util.Date getLastTriggered() {
return this.lastTriggered;
}
/**
*
* The date and time a webhook was last successfully triggered, in timestamp format.
*
*
* @param lastTriggered
* The date and time a webhook was last successfully triggered, in timestamp format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListWebhookItem withLastTriggered(java.util.Date lastTriggered) {
setLastTriggered(lastTriggered);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the webhook.
*
*
* @param arn
* The Amazon Resource Name (ARN) of the webhook.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The Amazon Resource Name (ARN) of the webhook.
*
*
* @return The Amazon Resource Name (ARN) of the webhook.
*/
public String getArn() {
return this.arn;
}
/**
*
* The Amazon Resource Name (ARN) of the webhook.
*
*
* @param arn
* The Amazon Resource Name (ARN) of the webhook.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListWebhookItem withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* Specifies the tags applied to the webhook.
*
*
* @return Specifies the tags applied to the webhook.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* Specifies the tags applied to the webhook.
*
*
* @param tags
* Specifies the tags applied to the webhook.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* Specifies the tags applied to the webhook.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* Specifies the tags applied to the webhook.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListWebhookItem withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* Specifies the tags applied to the webhook.
*
*
* @param tags
* Specifies the tags applied to the webhook.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListWebhookItem withTags(java.util.Collection tags) {
setTags(tags);
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 (getDefinition() != null)
sb.append("Definition: ").append(getDefinition()).append(",");
if (getUrl() != null)
sb.append("Url: ").append(getUrl()).append(",");
if (getErrorMessage() != null)
sb.append("ErrorMessage: ").append(getErrorMessage()).append(",");
if (getErrorCode() != null)
sb.append("ErrorCode: ").append(getErrorCode()).append(",");
if (getLastTriggered() != null)
sb.append("LastTriggered: ").append(getLastTriggered()).append(",");
if (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ListWebhookItem == false)
return false;
ListWebhookItem other = (ListWebhookItem) obj;
if (other.getDefinition() == null ^ this.getDefinition() == null)
return false;
if (other.getDefinition() != null && other.getDefinition().equals(this.getDefinition()) == 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.getErrorMessage() == null ^ this.getErrorMessage() == null)
return false;
if (other.getErrorMessage() != null && other.getErrorMessage().equals(this.getErrorMessage()) == false)
return false;
if (other.getErrorCode() == null ^ this.getErrorCode() == null)
return false;
if (other.getErrorCode() != null && other.getErrorCode().equals(this.getErrorCode()) == false)
return false;
if (other.getLastTriggered() == null ^ this.getLastTriggered() == null)
return false;
if (other.getLastTriggered() != null && other.getLastTriggered().equals(this.getLastTriggered()) == false)
return false;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDefinition() == null) ? 0 : getDefinition().hashCode());
hashCode = prime * hashCode + ((getUrl() == null) ? 0 : getUrl().hashCode());
hashCode = prime * hashCode + ((getErrorMessage() == null) ? 0 : getErrorMessage().hashCode());
hashCode = prime * hashCode + ((getErrorCode() == null) ? 0 : getErrorCode().hashCode());
hashCode = prime * hashCode + ((getLastTriggered() == null) ? 0 : getLastTriggered().hashCode());
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public ListWebhookItem clone() {
try {
return (ListWebhookItem) 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.codepipeline.model.transform.ListWebhookItemMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}