All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.codepipeline.model.WebhookDefinition Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS CodePipeline module holds the client classes that are used for communicating with AWS CodePipeline

There is a newer version: 2.30.1
Show newest version
/*
 * Copyright 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 software.amazon.awssdk.services.codepipeline.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Represents information about a webhook and its definition. *

*/ @Generated("software.amazon.awssdk:codegen") public final class WebhookDefinition implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name") .getter(getter(WebhookDefinition::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build(); private static final SdkField TARGET_PIPELINE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("targetPipeline").getter(getter(WebhookDefinition::targetPipeline)) .setter(setter(Builder::targetPipeline)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("targetPipeline").build()).build(); private static final SdkField TARGET_ACTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("targetAction").getter(getter(WebhookDefinition::targetAction)).setter(setter(Builder::targetAction)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("targetAction").build()).build(); private static final SdkField> FILTERS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("filters") .getter(getter(WebhookDefinition::filters)) .setter(setter(Builder::filters)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("filters").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(WebhookFilterRule::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField AUTHENTICATION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("authentication").getter(getter(WebhookDefinition::authenticationAsString)) .setter(setter(Builder::authentication)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("authentication").build()).build(); private static final SdkField AUTHENTICATION_CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("authenticationConfiguration") .getter(getter(WebhookDefinition::authenticationConfiguration)) .setter(setter(Builder::authenticationConfiguration)) .constructor(WebhookAuthConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("authenticationConfiguration") .build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, TARGET_PIPELINE_FIELD, TARGET_ACTION_FIELD, FILTERS_FIELD, AUTHENTICATION_FIELD, AUTHENTICATION_CONFIGURATION_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String name; private final String targetPipeline; private final String targetAction; private final List filters; private final String authentication; private final WebhookAuthConfiguration authenticationConfiguration; private WebhookDefinition(BuilderImpl builder) { this.name = builder.name; this.targetPipeline = builder.targetPipeline; this.targetAction = builder.targetAction; this.filters = builder.filters; this.authentication = builder.authentication; this.authenticationConfiguration = builder.authenticationConfiguration; } /** *

* The name of the webhook. *

* * @return The name of the webhook. */ public final String name() { return name; } /** *

* The name of the pipeline you want to connect to the webhook. *

* * @return The name of the pipeline you want to connect to the webhook. */ public final String targetPipeline() { return targetPipeline; } /** *

* The name of the action in a pipeline you want to connect to the webhook. The action must be from the source * (first) stage of the pipeline. *

* * @return The name of the action in a pipeline you want to connect to the webhook. The action must be from the * source (first) stage of the pipeline. */ public final String targetAction() { return targetAction; } /** * For responses, this returns true if the service returned a value for the Filters property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasFilters() { return filters != null && !(filters instanceof SdkAutoConstructList); } /** *

* A list of rules applied to the body/payload sent in the POST request to a webhook URL. All defined rules must * pass for the request to be accepted and the pipeline started. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasFilters} method. *

* * @return A list of rules applied to the body/payload sent in the POST request to a webhook URL. All defined rules * must pass for the request to be accepted and the pipeline started. */ public final List filters() { return filters; } /** *

* Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED. *

* *

* When creating CodePipeline webhooks, do not use your own credentials or reuse the same secret token across * multiple webhooks. For optimal security, generate a unique secret token for each webhook you create. The secret * token is an arbitrary string that you provide, which GitHub uses to compute and sign the webhook payloads sent to * CodePipeline, for protecting the integrity and authenticity of the webhook payloads. Using your own credentials * or reusing the same token across multiple webhooks can lead to security vulnerabilities. *

*
*

* If a secret token was provided, it will be redacted in the response. *

*
*
    *
  • *

    * For information about the authentication scheme implemented by GITHUB_HMAC, see Securing your webhooks on the GitHub Developer * website. *

    *
  • *
  • *

    * IP rejects webhooks trigger requests unless they originate from an IP address in the IP range whitelisted in the * authentication configuration. *

    *
  • *
  • *

    * UNAUTHENTICATED accepts all webhook trigger requests regardless of origin. *

    *
  • *
*

* If the service returns an enum value that is not available in the current SDK version, {@link #authentication} * will return {@link WebhookAuthenticationType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #authenticationAsString}. *

* * @return Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

*

* When creating CodePipeline webhooks, do not use your own credentials or reuse the same secret token * across multiple webhooks. For optimal security, generate a unique secret token for each webhook you * create. The secret token is an arbitrary string that you provide, which GitHub uses to compute and sign * the webhook payloads sent to CodePipeline, for protecting the integrity and authenticity of the webhook * payloads. Using your own credentials or reusing the same token across multiple webhooks can lead to * security vulnerabilities. *

*
*

* If a secret token was provided, it will be redacted in the response. *

*
*
    *
  • *

    * For information about the authentication scheme implemented by GITHUB_HMAC, see Securing your webhooks on the GitHub Developer * website. *

    *
  • *
  • *

    * IP rejects webhooks trigger requests unless they originate from an IP address in the IP range whitelisted * in the authentication configuration. *

    *
  • *
  • *

    * UNAUTHENTICATED accepts all webhook trigger requests regardless of origin. *

    *
  • * @see WebhookAuthenticationType */ public final WebhookAuthenticationType authentication() { return WebhookAuthenticationType.fromValue(authentication); } /** *

    * Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED. *

    * *

    * When creating CodePipeline webhooks, do not use your own credentials or reuse the same secret token across * multiple webhooks. For optimal security, generate a unique secret token for each webhook you create. The secret * token is an arbitrary string that you provide, which GitHub uses to compute and sign the webhook payloads sent to * CodePipeline, for protecting the integrity and authenticity of the webhook payloads. Using your own credentials * or reusing the same token across multiple webhooks can lead to security vulnerabilities. *

    *
    *

    * If a secret token was provided, it will be redacted in the response. *

    *
    *
      *
    • *

      * For information about the authentication scheme implemented by GITHUB_HMAC, see Securing your webhooks on the GitHub Developer * website. *

      *
    • *
    • *

      * IP rejects webhooks trigger requests unless they originate from an IP address in the IP range whitelisted in the * authentication configuration. *

      *
    • *
    • *

      * UNAUTHENTICATED accepts all webhook trigger requests regardless of origin. *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #authentication} * will return {@link WebhookAuthenticationType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #authenticationAsString}. *

    * * @return Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

    *

    * When creating CodePipeline webhooks, do not use your own credentials or reuse the same secret token * across multiple webhooks. For optimal security, generate a unique secret token for each webhook you * create. The secret token is an arbitrary string that you provide, which GitHub uses to compute and sign * the webhook payloads sent to CodePipeline, for protecting the integrity and authenticity of the webhook * payloads. Using your own credentials or reusing the same token across multiple webhooks can lead to * security vulnerabilities. *

    *
    *

    * If a secret token was provided, it will be redacted in the response. *

    *
    *
      *
    • *

      * For information about the authentication scheme implemented by GITHUB_HMAC, see Securing your webhooks on the GitHub Developer * website. *

      *
    • *
    • *

      * IP rejects webhooks trigger requests unless they originate from an IP address in the IP range whitelisted * in the authentication configuration. *

      *
    • *
    • *

      * UNAUTHENTICATED accepts all webhook trigger requests regardless of origin. *

      *
    • * @see WebhookAuthenticationType */ public final String authenticationAsString() { return authentication; } /** *

      * Properties that configure the authentication applied to incoming webhook trigger requests. The required * properties depend on the authentication type. For GITHUB_HMAC, only the SecretToken property must be * set. For IP, only the AllowedIPRange property must be set to a valid CIDR range. For * UNAUTHENTICATED, no properties can be set. *

      * * @return Properties that configure the authentication applied to incoming webhook trigger requests. The required * properties depend on the authentication type. For GITHUB_HMAC, only the SecretToken property * must be set. For IP, only the AllowedIPRange property must be set to a valid CIDR range. For * UNAUTHENTICATED, no properties can be set. */ public final WebhookAuthConfiguration authenticationConfiguration() { return authenticationConfiguration; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(targetPipeline()); hashCode = 31 * hashCode + Objects.hashCode(targetAction()); hashCode = 31 * hashCode + Objects.hashCode(hasFilters() ? filters() : null); hashCode = 31 * hashCode + Objects.hashCode(authenticationAsString()); hashCode = 31 * hashCode + Objects.hashCode(authenticationConfiguration()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof WebhookDefinition)) { return false; } WebhookDefinition other = (WebhookDefinition) obj; return Objects.equals(name(), other.name()) && Objects.equals(targetPipeline(), other.targetPipeline()) && Objects.equals(targetAction(), other.targetAction()) && hasFilters() == other.hasFilters() && Objects.equals(filters(), other.filters()) && Objects.equals(authenticationAsString(), other.authenticationAsString()) && Objects.equals(authenticationConfiguration(), other.authenticationConfiguration()); } /** * 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. */ @Override public final String toString() { return ToString.builder("WebhookDefinition").add("Name", name()).add("TargetPipeline", targetPipeline()) .add("TargetAction", targetAction()).add("Filters", hasFilters() ? filters() : null) .add("Authentication", authenticationAsString()) .add("AuthenticationConfiguration", authenticationConfiguration()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "name": return Optional.ofNullable(clazz.cast(name())); case "targetPipeline": return Optional.ofNullable(clazz.cast(targetPipeline())); case "targetAction": return Optional.ofNullable(clazz.cast(targetAction())); case "filters": return Optional.ofNullable(clazz.cast(filters())); case "authentication": return Optional.ofNullable(clazz.cast(authenticationAsString())); case "authenticationConfiguration": return Optional.ofNullable(clazz.cast(authenticationConfiguration())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("name", NAME_FIELD); map.put("targetPipeline", TARGET_PIPELINE_FIELD); map.put("targetAction", TARGET_ACTION_FIELD); map.put("filters", FILTERS_FIELD); map.put("authentication", AUTHENTICATION_FIELD); map.put("authenticationConfiguration", AUTHENTICATION_CONFIGURATION_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((WebhookDefinition) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The name of the webhook. *

      * * @param name * The name of the webhook. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

      * The name of the pipeline you want to connect to the webhook. *

      * * @param targetPipeline * The name of the pipeline you want to connect to the webhook. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetPipeline(String targetPipeline); /** *

      * The name of the action in a pipeline you want to connect to the webhook. The action must be from the source * (first) stage of the pipeline. *

      * * @param targetAction * The name of the action in a pipeline you want to connect to the webhook. The action must be from the * source (first) stage of the pipeline. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetAction(String targetAction); /** *

      * A list of rules applied to the body/payload sent in the POST request to a webhook URL. All defined rules must * pass for the request to be accepted and the pipeline started. *

      * * @param filters * A list of rules applied to the body/payload sent in the POST request to a webhook URL. All defined * rules must pass for the request to be accepted and the pipeline started. * @return Returns a reference to this object so that method calls can be chained together. */ Builder filters(Collection filters); /** *

      * A list of rules applied to the body/payload sent in the POST request to a webhook URL. All defined rules must * pass for the request to be accepted and the pipeline started. *

      * * @param filters * A list of rules applied to the body/payload sent in the POST request to a webhook URL. All defined * rules must pass for the request to be accepted and the pipeline started. * @return Returns a reference to this object so that method calls can be chained together. */ Builder filters(WebhookFilterRule... filters); /** *

      * A list of rules applied to the body/payload sent in the POST request to a webhook URL. All defined rules must * pass for the request to be accepted and the pipeline started. *

      * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.codepipeline.model.WebhookFilterRule.Builder} avoiding the need to * create one manually via * {@link software.amazon.awssdk.services.codepipeline.model.WebhookFilterRule#builder()}. * *

      * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.codepipeline.model.WebhookFilterRule.Builder#build()} is called * immediately and its result is passed to {@link #filters(List)}. * * @param filters * a consumer that will call methods on * {@link software.amazon.awssdk.services.codepipeline.model.WebhookFilterRule.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #filters(java.util.Collection) */ Builder filters(Consumer... filters); /** *

      * Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED. *

      * *

      * When creating CodePipeline webhooks, do not use your own credentials or reuse the same secret token across * multiple webhooks. For optimal security, generate a unique secret token for each webhook you create. The * secret token is an arbitrary string that you provide, which GitHub uses to compute and sign the webhook * payloads sent to CodePipeline, for protecting the integrity and authenticity of the webhook payloads. Using * your own credentials or reusing the same token across multiple webhooks can lead to security vulnerabilities. *

      *
      *

      * If a secret token was provided, it will be redacted in the response. *

      *
      *
        *
      • *

        * For information about the authentication scheme implemented by GITHUB_HMAC, see Securing your webhooks on the GitHub Developer * website. *

        *
      • *
      • *

        * IP rejects webhooks trigger requests unless they originate from an IP address in the IP range whitelisted in * the authentication configuration. *

        *
      • *
      • *

        * UNAUTHENTICATED accepts all webhook trigger requests regardless of origin. *

        *
      • *
      * * @param authentication * Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

      *

      * When creating CodePipeline webhooks, do not use your own credentials or reuse the same secret token * across multiple webhooks. For optimal security, generate a unique secret token for each webhook you * create. The secret token is an arbitrary string that you provide, which GitHub uses to compute and * sign the webhook payloads sent to CodePipeline, for protecting the integrity and authenticity of the * webhook payloads. Using your own credentials or reusing the same token across multiple webhooks can * lead to security vulnerabilities. *

      *
      *

      * If a secret token was provided, it will be redacted in the response. *

      *
      *
        *
      • *

        * For information about the authentication scheme implemented by GITHUB_HMAC, see Securing your webhooks on the GitHub * Developer website. *

        *
      • *
      • *

        * IP rejects webhooks trigger requests unless they originate from an IP address in the IP range * whitelisted in the authentication configuration. *

        *
      • *
      • *

        * UNAUTHENTICATED accepts all webhook trigger requests regardless of origin. *

        *
      • * @see WebhookAuthenticationType * @return Returns a reference to this object so that method calls can be chained together. * @see WebhookAuthenticationType */ Builder authentication(String authentication); /** *

        * Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED. *

        * *

        * When creating CodePipeline webhooks, do not use your own credentials or reuse the same secret token across * multiple webhooks. For optimal security, generate a unique secret token for each webhook you create. The * secret token is an arbitrary string that you provide, which GitHub uses to compute and sign the webhook * payloads sent to CodePipeline, for protecting the integrity and authenticity of the webhook payloads. Using * your own credentials or reusing the same token across multiple webhooks can lead to security vulnerabilities. *

        *
        *

        * If a secret token was provided, it will be redacted in the response. *

        *
        *
          *
        • *

          * For information about the authentication scheme implemented by GITHUB_HMAC, see Securing your webhooks on the GitHub Developer * website. *

          *
        • *
        • *

          * IP rejects webhooks trigger requests unless they originate from an IP address in the IP range whitelisted in * the authentication configuration. *

          *
        • *
        • *

          * UNAUTHENTICATED accepts all webhook trigger requests regardless of origin. *

          *
        • *
        * * @param authentication * Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

        *

        * When creating CodePipeline webhooks, do not use your own credentials or reuse the same secret token * across multiple webhooks. For optimal security, generate a unique secret token for each webhook you * create. The secret token is an arbitrary string that you provide, which GitHub uses to compute and * sign the webhook payloads sent to CodePipeline, for protecting the integrity and authenticity of the * webhook payloads. Using your own credentials or reusing the same token across multiple webhooks can * lead to security vulnerabilities. *

        *
        *

        * If a secret token was provided, it will be redacted in the response. *

        *
        *
          *
        • *

          * For information about the authentication scheme implemented by GITHUB_HMAC, see Securing your webhooks on the GitHub * Developer website. *

          *
        • *
        • *

          * IP rejects webhooks trigger requests unless they originate from an IP address in the IP range * whitelisted in the authentication configuration. *

          *
        • *
        • *

          * UNAUTHENTICATED accepts all webhook trigger requests regardless of origin. *

          *
        • * @see WebhookAuthenticationType * @return Returns a reference to this object so that method calls can be chained together. * @see WebhookAuthenticationType */ Builder authentication(WebhookAuthenticationType authentication); /** *

          * Properties that configure the authentication applied to incoming webhook trigger requests. The required * properties depend on the authentication type. For GITHUB_HMAC, only the SecretToken property * must be set. For IP, only the AllowedIPRange property must be set to a valid CIDR range. For * UNAUTHENTICATED, no properties can be set. *

          * * @param authenticationConfiguration * Properties that configure the authentication applied to incoming webhook trigger requests. The * required properties depend on the authentication type. For GITHUB_HMAC, only the * SecretToken property must be set. For IP, only the AllowedIPRange property * must be set to a valid CIDR range. For UNAUTHENTICATED, no properties can be set. * @return Returns a reference to this object so that method calls can be chained together. */ Builder authenticationConfiguration(WebhookAuthConfiguration authenticationConfiguration); /** *

          * Properties that configure the authentication applied to incoming webhook trigger requests. The required * properties depend on the authentication type. For GITHUB_HMAC, only the SecretToken property * must be set. For IP, only the AllowedIPRange property must be set to a valid CIDR range. For * UNAUTHENTICATED, no properties can be set. *

          * This is a convenience method that creates an instance of the {@link WebhookAuthConfiguration.Builder} * avoiding the need to create one manually via {@link WebhookAuthConfiguration#builder()}. * *

          * When the {@link Consumer} completes, {@link WebhookAuthConfiguration.Builder#build()} is called immediately * and its result is passed to {@link #authenticationConfiguration(WebhookAuthConfiguration)}. * * @param authenticationConfiguration * a consumer that will call methods on {@link WebhookAuthConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #authenticationConfiguration(WebhookAuthConfiguration) */ default Builder authenticationConfiguration(Consumer authenticationConfiguration) { return authenticationConfiguration(WebhookAuthConfiguration.builder().applyMutation(authenticationConfiguration) .build()); } } static final class BuilderImpl implements Builder { private String name; private String targetPipeline; private String targetAction; private List filters = DefaultSdkAutoConstructList.getInstance(); private String authentication; private WebhookAuthConfiguration authenticationConfiguration; private BuilderImpl() { } private BuilderImpl(WebhookDefinition model) { name(model.name); targetPipeline(model.targetPipeline); targetAction(model.targetAction); filters(model.filters); authentication(model.authentication); authenticationConfiguration(model.authenticationConfiguration); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getTargetPipeline() { return targetPipeline; } public final void setTargetPipeline(String targetPipeline) { this.targetPipeline = targetPipeline; } @Override public final Builder targetPipeline(String targetPipeline) { this.targetPipeline = targetPipeline; return this; } public final String getTargetAction() { return targetAction; } public final void setTargetAction(String targetAction) { this.targetAction = targetAction; } @Override public final Builder targetAction(String targetAction) { this.targetAction = targetAction; return this; } public final List getFilters() { List result = WebhookFiltersCopier.copyToBuilder(this.filters); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setFilters(Collection filters) { this.filters = WebhookFiltersCopier.copyFromBuilder(filters); } @Override public final Builder filters(Collection filters) { this.filters = WebhookFiltersCopier.copy(filters); return this; } @Override @SafeVarargs public final Builder filters(WebhookFilterRule... filters) { filters(Arrays.asList(filters)); return this; } @Override @SafeVarargs public final Builder filters(Consumer... filters) { filters(Stream.of(filters).map(c -> WebhookFilterRule.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getAuthentication() { return authentication; } public final void setAuthentication(String authentication) { this.authentication = authentication; } @Override public final Builder authentication(String authentication) { this.authentication = authentication; return this; } @Override public final Builder authentication(WebhookAuthenticationType authentication) { this.authentication(authentication == null ? null : authentication.toString()); return this; } public final WebhookAuthConfiguration.Builder getAuthenticationConfiguration() { return authenticationConfiguration != null ? authenticationConfiguration.toBuilder() : null; } public final void setAuthenticationConfiguration(WebhookAuthConfiguration.BuilderImpl authenticationConfiguration) { this.authenticationConfiguration = authenticationConfiguration != null ? authenticationConfiguration.build() : null; } @Override public final Builder authenticationConfiguration(WebhookAuthConfiguration authenticationConfiguration) { this.authenticationConfiguration = authenticationConfiguration; return this; } @Override public WebhookDefinition build() { return new WebhookDefinition(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy