/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace CodePipeline { namespace Model { /** *

Represents information about a webhook and its definition.

See * Also:

AWS * API Reference

*/ class WebhookDefinition { public: AWS_CODEPIPELINE_API WebhookDefinition(); AWS_CODEPIPELINE_API WebhookDefinition(Aws::Utils::Json::JsonView jsonValue); AWS_CODEPIPELINE_API WebhookDefinition& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_CODEPIPELINE_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The name of the webhook.

*/ inline const Aws::String& GetName() const{ return m_name; } /** *

The name of the webhook.

*/ inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } /** *

The name of the webhook.

*/ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** *

The name of the webhook.

*/ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** *

The name of the webhook.

*/ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** *

The name of the webhook.

*/ inline WebhookDefinition& WithName(const Aws::String& value) { SetName(value); return *this;} /** *

The name of the webhook.

*/ inline WebhookDefinition& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** *

The name of the webhook.

*/ inline WebhookDefinition& WithName(const char* value) { SetName(value); return *this;} /** *

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

*/ inline const Aws::String& GetTargetPipeline() const{ return m_targetPipeline; } /** *

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

*/ inline bool TargetPipelineHasBeenSet() const { return m_targetPipelineHasBeenSet; } /** *

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

*/ inline void SetTargetPipeline(const Aws::String& value) { m_targetPipelineHasBeenSet = true; m_targetPipeline = value; } /** *

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

*/ inline void SetTargetPipeline(Aws::String&& value) { m_targetPipelineHasBeenSet = true; m_targetPipeline = std::move(value); } /** *

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

*/ inline void SetTargetPipeline(const char* value) { m_targetPipelineHasBeenSet = true; m_targetPipeline.assign(value); } /** *

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

*/ inline WebhookDefinition& WithTargetPipeline(const Aws::String& value) { SetTargetPipeline(value); return *this;} /** *

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

*/ inline WebhookDefinition& WithTargetPipeline(Aws::String&& value) { SetTargetPipeline(std::move(value)); return *this;} /** *

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

*/ inline WebhookDefinition& WithTargetPipeline(const char* value) { SetTargetPipeline(value); return *this;} /** *

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.

*/ inline const Aws::String& GetTargetAction() const{ return m_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.

*/ inline bool TargetActionHasBeenSet() const { return m_targetActionHasBeenSet; } /** *

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.

*/ inline void SetTargetAction(const Aws::String& value) { m_targetActionHasBeenSet = true; m_targetAction = value; } /** *

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.

*/ inline void SetTargetAction(Aws::String&& value) { m_targetActionHasBeenSet = true; m_targetAction = std::move(value); } /** *

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.

*/ inline void SetTargetAction(const char* value) { m_targetActionHasBeenSet = true; m_targetAction.assign(value); } /** *

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.

*/ inline WebhookDefinition& WithTargetAction(const Aws::String& value) { SetTargetAction(value); return *this;} /** *

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.

*/ inline WebhookDefinition& WithTargetAction(Aws::String&& value) { SetTargetAction(std::move(value)); return *this;} /** *

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.

*/ inline WebhookDefinition& WithTargetAction(const char* value) { SetTargetAction(value); return *this;} /** *

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.

*/ inline const Aws::Vector& GetFilters() const{ return m_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.

*/ inline bool FiltersHasBeenSet() const { return m_filtersHasBeenSet; } /** *

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.

*/ inline void SetFilters(const Aws::Vector& value) { m_filtersHasBeenSet = true; m_filters = value; } /** *

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.

*/ inline void SetFilters(Aws::Vector&& value) { m_filtersHasBeenSet = true; m_filters = std::move(value); } /** *

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.

*/ inline WebhookDefinition& WithFilters(const Aws::Vector& value) { SetFilters(value); return *this;} /** *

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.

*/ inline WebhookDefinition& WithFilters(Aws::Vector&& value) { SetFilters(std::move(value)); return *this;} /** *

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.

*/ inline WebhookDefinition& AddFilters(const WebhookFilterRule& value) { m_filtersHasBeenSet = true; m_filters.push_back(value); return *this; } /** *

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.

*/ inline WebhookDefinition& AddFilters(WebhookFilterRule&& value) { m_filtersHasBeenSet = true; m_filters.push_back(std::move(value)); return *this; } /** *

Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

  • *

    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.

    *
*/ inline const WebhookAuthenticationType& GetAuthentication() const{ return m_authentication; } /** *

Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

  • *

    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.

    *
*/ inline bool AuthenticationHasBeenSet() const { return m_authenticationHasBeenSet; } /** *

Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

  • *

    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.

    *
*/ inline void SetAuthentication(const WebhookAuthenticationType& value) { m_authenticationHasBeenSet = true; m_authentication = value; } /** *

Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

  • *

    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.

    *
*/ inline void SetAuthentication(WebhookAuthenticationType&& value) { m_authenticationHasBeenSet = true; m_authentication = std::move(value); } /** *

Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

  • *

    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.

    *
*/ inline WebhookDefinition& WithAuthentication(const WebhookAuthenticationType& value) { SetAuthentication(value); return *this;} /** *

Supported options are GITHUB_HMAC, IP, and UNAUTHENTICATED.

  • *

    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.

    *
*/ inline WebhookDefinition& WithAuthentication(WebhookAuthenticationType&& value) { SetAuthentication(std::move(value)); return *this;} /** *

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.

*/ inline const WebhookAuthConfiguration& GetAuthenticationConfiguration() const{ return m_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.

*/ inline bool AuthenticationConfigurationHasBeenSet() const { return m_authenticationConfigurationHasBeenSet; } /** *

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.

*/ inline void SetAuthenticationConfiguration(const WebhookAuthConfiguration& value) { m_authenticationConfigurationHasBeenSet = true; m_authenticationConfiguration = value; } /** *

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.

*/ inline void SetAuthenticationConfiguration(WebhookAuthConfiguration&& value) { m_authenticationConfigurationHasBeenSet = true; m_authenticationConfiguration = std::move(value); } /** *

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.

*/ inline WebhookDefinition& WithAuthenticationConfiguration(const WebhookAuthConfiguration& value) { SetAuthenticationConfiguration(value); return *this;} /** *

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.

*/ inline WebhookDefinition& WithAuthenticationConfiguration(WebhookAuthConfiguration&& value) { SetAuthenticationConfiguration(std::move(value)); return *this;} private: Aws::String m_name; bool m_nameHasBeenSet = false; Aws::String m_targetPipeline; bool m_targetPipelineHasBeenSet = false; Aws::String m_targetAction; bool m_targetActionHasBeenSet = false; Aws::Vector m_filters; bool m_filtersHasBeenSet = false; WebhookAuthenticationType m_authentication; bool m_authenticationHasBeenSet = false; WebhookAuthConfiguration m_authenticationConfiguration; bool m_authenticationConfigurationHasBeenSet = false; }; } // namespace Model } // namespace CodePipeline } // namespace Aws