com.amazonaws.services.codebuild.model.CreateWebhookRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codebuild Show documentation
/*
* Copyright 2019-2024 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 CreateWebhookRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the CodeBuild project.
*
*/
private String projectName;
/**
*
* A regular expression used to determine which repository branches are built when a webhook is triggered. If the
* name of a branch matches the regular expression, then it is built. If branchFilter
is empty, then
* all branches are built.
*
*
*
* It is recommended that you use filterGroups
instead of branchFilter
.
*
*
*/
private String branchFilter;
/**
*
* An array of arrays of WebhookFilter
objects used to determine which webhooks are triggered. At least
* one WebhookFilter
in the array must specify EVENT
as its type
.
*
*
* For a build to be triggered, at least one filter group in the filterGroups
array must pass. For a
* filter group to pass, each of its filters must pass.
*
*/
private java.util.List> filterGroups;
/**
*
* Specifies the type of build this webhook will trigger.
*
*/
private String buildType;
/**
*
* If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns
* payloadUrl
and secret
values for the webhook. The payloadUrl
and
* secret
values in the output can be used to manually create a webhook within GitHub.
*
*
*
* manualCreation
is only available for GitHub webhooks.
*
*
*/
private Boolean manualCreation;
/**
*
* The scope configuration for global or organization webhooks.
*
*
*
* Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.
*
*
*/
private ScopeConfiguration scopeConfiguration;
/**
*
* The name of the CodeBuild project.
*
*
* @param projectName
* The name of the CodeBuild project.
*/
public void setProjectName(String projectName) {
this.projectName = projectName;
}
/**
*
* The name of the CodeBuild project.
*
*
* @return The name of the CodeBuild project.
*/
public String getProjectName() {
return this.projectName;
}
/**
*
* The name of the CodeBuild project.
*
*
* @param projectName
* The name of the CodeBuild project.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWebhookRequest withProjectName(String projectName) {
setProjectName(projectName);
return this;
}
/**
*
* A regular expression used to determine which repository branches are built when a webhook is triggered. If the
* name of a branch matches the regular expression, then it is built. If branchFilter
is empty, then
* all branches are built.
*
*
*
* It is recommended that you use filterGroups
instead of branchFilter
.
*
*
*
* @param branchFilter
* A regular expression used to determine which repository branches are built when a webhook is triggered. If
* the name of a branch matches the regular expression, then it is built. If branchFilter
is
* empty, then all branches are built.
*
* It is recommended that you use filterGroups
instead of branchFilter
.
*
*/
public void setBranchFilter(String branchFilter) {
this.branchFilter = branchFilter;
}
/**
*
* A regular expression used to determine which repository branches are built when a webhook is triggered. If the
* name of a branch matches the regular expression, then it is built. If branchFilter
is empty, then
* all branches are built.
*
*
*
* It is recommended that you use filterGroups
instead of branchFilter
.
*
*
*
* @return A regular expression used to determine which repository branches are built when a webhook is triggered.
* If the name of a branch matches the regular expression, then it is built. If branchFilter
is
* empty, then all branches are built.
*
* It is recommended that you use filterGroups
instead of branchFilter
.
*
*/
public String getBranchFilter() {
return this.branchFilter;
}
/**
*
* A regular expression used to determine which repository branches are built when a webhook is triggered. If the
* name of a branch matches the regular expression, then it is built. If branchFilter
is empty, then
* all branches are built.
*
*
*
* It is recommended that you use filterGroups
instead of branchFilter
.
*
*
*
* @param branchFilter
* A regular expression used to determine which repository branches are built when a webhook is triggered. If
* the name of a branch matches the regular expression, then it is built. If branchFilter
is
* empty, then all branches are built.
*
* It is recommended that you use filterGroups
instead of branchFilter
.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWebhookRequest withBranchFilter(String branchFilter) {
setBranchFilter(branchFilter);
return this;
}
/**
*
* An array of arrays of WebhookFilter
objects used to determine which webhooks are triggered. At least
* one WebhookFilter
in the array must specify EVENT
as its type
.
*
*
* For a build to be triggered, at least one filter group in the filterGroups
array must pass. For a
* filter group to pass, each of its filters must pass.
*
*
* @return An array of arrays of WebhookFilter
objects used to determine which webhooks are triggered.
* At least one WebhookFilter
in the array must specify EVENT
as its
* type
.
*
* For a build to be triggered, at least one filter group in the filterGroups
array must pass.
* For a filter group to pass, each of its filters must pass.
*/
public java.util.List> getFilterGroups() {
return filterGroups;
}
/**
*
* An array of arrays of WebhookFilter
objects used to determine which webhooks are triggered. At least
* one WebhookFilter
in the array must specify EVENT
as its type
.
*
*
* For a build to be triggered, at least one filter group in the filterGroups
array must pass. For a
* filter group to pass, each of its filters must pass.
*
*
* @param filterGroups
* An array of arrays of WebhookFilter
objects used to determine which webhooks are triggered.
* At least one WebhookFilter
in the array must specify EVENT
as its
* type
.
*
* For a build to be triggered, at least one filter group in the filterGroups
array must pass.
* For a filter group to pass, each of its filters must pass.
*/
public void setFilterGroups(java.util.Collection> filterGroups) {
if (filterGroups == null) {
this.filterGroups = null;
return;
}
this.filterGroups = new java.util.ArrayList>(filterGroups);
}
/**
*
* An array of arrays of WebhookFilter
objects used to determine which webhooks are triggered. At least
* one WebhookFilter
in the array must specify EVENT
as its type
.
*
*
* For a build to be triggered, at least one filter group in the filterGroups
array must pass. For a
* filter group to pass, each of its filters must pass.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setFilterGroups(java.util.Collection)} or {@link #withFilterGroups(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param filterGroups
* An array of arrays of WebhookFilter
objects used to determine which webhooks are triggered.
* At least one WebhookFilter
in the array must specify EVENT
as its
* type
.
*
* For a build to be triggered, at least one filter group in the filterGroups
array must pass.
* For a filter group to pass, each of its filters must pass.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWebhookRequest withFilterGroups(java.util.List... filterGroups) {
if (this.filterGroups == null) {
setFilterGroups(new java.util.ArrayList>(filterGroups.length));
}
for (java.util.List ele : filterGroups) {
this.filterGroups.add(ele);
}
return this;
}
/**
*
* An array of arrays of WebhookFilter
objects used to determine which webhooks are triggered. At least
* one WebhookFilter
in the array must specify EVENT
as its type
.
*
*
* For a build to be triggered, at least one filter group in the filterGroups
array must pass. For a
* filter group to pass, each of its filters must pass.
*
*
* @param filterGroups
* An array of arrays of WebhookFilter
objects used to determine which webhooks are triggered.
* At least one WebhookFilter
in the array must specify EVENT
as its
* type
.
*
* For a build to be triggered, at least one filter group in the filterGroups
array must pass.
* For a filter group to pass, each of its filters must pass.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWebhookRequest withFilterGroups(java.util.Collection> filterGroups) {
setFilterGroups(filterGroups);
return this;
}
/**
*
* Specifies the type of build this webhook will trigger.
*
*
* @param buildType
* Specifies the type of build this webhook will trigger.
* @see WebhookBuildType
*/
public void setBuildType(String buildType) {
this.buildType = buildType;
}
/**
*
* Specifies the type of build this webhook will trigger.
*
*
* @return Specifies the type of build this webhook will trigger.
* @see WebhookBuildType
*/
public String getBuildType() {
return this.buildType;
}
/**
*
* Specifies the type of build this webhook will trigger.
*
*
* @param buildType
* Specifies the type of build this webhook will trigger.
* @return Returns a reference to this object so that method calls can be chained together.
* @see WebhookBuildType
*/
public CreateWebhookRequest withBuildType(String buildType) {
setBuildType(buildType);
return this;
}
/**
*
* Specifies the type of build this webhook will trigger.
*
*
* @param buildType
* Specifies the type of build this webhook will trigger.
* @return Returns a reference to this object so that method calls can be chained together.
* @see WebhookBuildType
*/
public CreateWebhookRequest withBuildType(WebhookBuildType buildType) {
this.buildType = buildType.toString();
return this;
}
/**
*
* If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns
* payloadUrl
and secret
values for the webhook. The payloadUrl
and
* secret
values in the output can be used to manually create a webhook within GitHub.
*
*
*
* manualCreation
is only available for GitHub webhooks.
*
*
*
* @param manualCreation
* If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns
* payloadUrl
and secret
values for the webhook. The payloadUrl
and
* secret
values in the output can be used to manually create a webhook within GitHub.
*
*
* manualCreation
is only available for GitHub webhooks.
*
*/
public void setManualCreation(Boolean manualCreation) {
this.manualCreation = manualCreation;
}
/**
*
* If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns
* payloadUrl
and secret
values for the webhook. The payloadUrl
and
* secret
values in the output can be used to manually create a webhook within GitHub.
*
*
*
* manualCreation
is only available for GitHub webhooks.
*
*
*
* @return If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns
* payloadUrl
and secret
values for the webhook. The payloadUrl
and
* secret
values in the output can be used to manually create a webhook within GitHub.
*
*
* manualCreation
is only available for GitHub webhooks.
*
*/
public Boolean getManualCreation() {
return this.manualCreation;
}
/**
*
* If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns
* payloadUrl
and secret
values for the webhook. The payloadUrl
and
* secret
values in the output can be used to manually create a webhook within GitHub.
*
*
*
* manualCreation
is only available for GitHub webhooks.
*
*
*
* @param manualCreation
* If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns
* payloadUrl
and secret
values for the webhook. The payloadUrl
and
* secret
values in the output can be used to manually create a webhook within GitHub.
*
*
* manualCreation
is only available for GitHub webhooks.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWebhookRequest withManualCreation(Boolean manualCreation) {
setManualCreation(manualCreation);
return this;
}
/**
*
* If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns
* payloadUrl
and secret
values for the webhook. The payloadUrl
and
* secret
values in the output can be used to manually create a webhook within GitHub.
*
*
*
* manualCreation
is only available for GitHub webhooks.
*
*
*
* @return If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns
* payloadUrl
and secret
values for the webhook. The payloadUrl
and
* secret
values in the output can be used to manually create a webhook within GitHub.
*
*
* manualCreation
is only available for GitHub webhooks.
*
*/
public Boolean isManualCreation() {
return this.manualCreation;
}
/**
*
* The scope configuration for global or organization webhooks.
*
*
*
* Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.
*
*
*
* @param scopeConfiguration
* The scope configuration for global or organization webhooks.
*
* Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.
*
*/
public void setScopeConfiguration(ScopeConfiguration scopeConfiguration) {
this.scopeConfiguration = scopeConfiguration;
}
/**
*
* The scope configuration for global or organization webhooks.
*
*
*
* Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.
*
*
*
* @return The scope configuration for global or organization webhooks.
*
* Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.
*
*/
public ScopeConfiguration getScopeConfiguration() {
return this.scopeConfiguration;
}
/**
*
* The scope configuration for global or organization webhooks.
*
*
*
* Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.
*
*
*
* @param scopeConfiguration
* The scope configuration for global or organization webhooks.
*
* Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWebhookRequest withScopeConfiguration(ScopeConfiguration scopeConfiguration) {
setScopeConfiguration(scopeConfiguration);
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 (getProjectName() != null)
sb.append("ProjectName: ").append(getProjectName()).append(",");
if (getBranchFilter() != null)
sb.append("BranchFilter: ").append(getBranchFilter()).append(",");
if (getFilterGroups() != null)
sb.append("FilterGroups: ").append(getFilterGroups()).append(",");
if (getBuildType() != null)
sb.append("BuildType: ").append(getBuildType()).append(",");
if (getManualCreation() != null)
sb.append("ManualCreation: ").append(getManualCreation()).append(",");
if (getScopeConfiguration() != null)
sb.append("ScopeConfiguration: ").append(getScopeConfiguration());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateWebhookRequest == false)
return false;
CreateWebhookRequest other = (CreateWebhookRequest) obj;
if (other.getProjectName() == null ^ this.getProjectName() == null)
return false;
if (other.getProjectName() != null && other.getProjectName().equals(this.getProjectName()) == false)
return false;
if (other.getBranchFilter() == null ^ this.getBranchFilter() == null)
return false;
if (other.getBranchFilter() != null && other.getBranchFilter().equals(this.getBranchFilter()) == false)
return false;
if (other.getFilterGroups() == null ^ this.getFilterGroups() == null)
return false;
if (other.getFilterGroups() != null && other.getFilterGroups().equals(this.getFilterGroups()) == false)
return false;
if (other.getBuildType() == null ^ this.getBuildType() == null)
return false;
if (other.getBuildType() != null && other.getBuildType().equals(this.getBuildType()) == false)
return false;
if (other.getManualCreation() == null ^ this.getManualCreation() == null)
return false;
if (other.getManualCreation() != null && other.getManualCreation().equals(this.getManualCreation()) == false)
return false;
if (other.getScopeConfiguration() == null ^ this.getScopeConfiguration() == null)
return false;
if (other.getScopeConfiguration() != null && other.getScopeConfiguration().equals(this.getScopeConfiguration()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getProjectName() == null) ? 0 : getProjectName().hashCode());
hashCode = prime * hashCode + ((getBranchFilter() == null) ? 0 : getBranchFilter().hashCode());
hashCode = prime * hashCode + ((getFilterGroups() == null) ? 0 : getFilterGroups().hashCode());
hashCode = prime * hashCode + ((getBuildType() == null) ? 0 : getBuildType().hashCode());
hashCode = prime * hashCode + ((getManualCreation() == null) ? 0 : getManualCreation().hashCode());
hashCode = prime * hashCode + ((getScopeConfiguration() == null) ? 0 : getScopeConfiguration().hashCode());
return hashCode;
}
@Override
public CreateWebhookRequest clone() {
return (CreateWebhookRequest) super.clone();
}
}