From 212028437940e71fbe6ae83277646780ac1e3273 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:37:10 -0800 Subject: [PATCH] docs: announce that `ListAudienceLists`, `GetAudienceList`, `QueryAudienceList`, `CreateAudienceList` methods are now available in the v1beta version of the Data API (#6988) feat: add the `webhook_notification` field to the `RecurringAudienceList` resource feat: add the `webhook_notification` field to the `AudienceList` resource feat: add the `WebhookNotification` type PiperOrigin-RevId: 600815983 Source-Link: https://github.com/googleapis/googleapis/commit/b76a27e4a29d18f385c61ca9d9a1fcc368cf0ee6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f45fce9abb89b425c5b5f4add2d7b4bcc4289e25 Copy-Tag: eyJwIjoiQW5hbHl0aWNzRGF0YS8uT3dsQm90LnlhbWwiLCJoIjoiZjQ1ZmNlOWFiYjg5YjQyNWM1YjVmNGFkZDJkN2I0YmNjNDI4OWUyNSJ9 --- .../metadata/V1Alpha/AnalyticsDataApi.php | Bin 8191 -> 8530 bytes .../create_audience_list.php | 9 +- .../get_audience_list.php | 6 +- .../list_audience_lists.php | 6 +- .../query_audience_list.php | 9 +- AnalyticsData/src/V1alpha/AudienceList.php | 92 +++++++ .../Client/AlphaAnalyticsDataClient.php | 30 +- .../Gapic/AlphaAnalyticsDataGapicClient.php | 30 +- .../src/V1alpha/RecurringAudienceList.php | 84 ++++++ .../src/V1alpha/WebhookNotification.php | 258 ++++++++++++++++++ 10 files changed, 476 insertions(+), 48 deletions(-) create mode 100644 AnalyticsData/src/V1alpha/WebhookNotification.php diff --git a/AnalyticsData/metadata/V1Alpha/AnalyticsDataApi.php b/AnalyticsData/metadata/V1Alpha/AnalyticsDataApi.php index 42f1195ca0d70d260b9206eacf3c674dfa6dd310..a717634999520b9b303c929ee5080a0725b0fc7b 100644 GIT binary patch delta 360 zcmexwf5~aXG-j4BR$OKiz0EdXU|zwvAvv delta 64 zcmV-G0KfmzLjOOomIDN#I0`nAOE$C61E>K6#RCczld&8XlN$`3lP(5Elh6jtvmOZT W0|K@NvkeUP0kdBYKmoJ351JAD-WJ0E diff --git a/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/create_audience_list.php b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/create_audience_list.php index 38e2cb379aab..60f00596f479 100644 --- a/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/create_audience_list.php +++ b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/create_audience_list.php @@ -52,11 +52,10 @@ * https://support.google.com/analytics/answer/9267572. Audience lists contain * the users in each audience. * - * This method is introduced at alpha stability with the intention of - * gathering feedback on syntax and capabilities before entering beta. To give - * your feedback on this API, complete the - * [Google Analytics Audience Export API - * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. + * This method is available at beta stability at + * [audienceExports.create](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/create). + * To give your feedback on this API, complete the [Google Analytics Audience + * Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. * * @param string $formattedParent The parent resource where this audience list will be created. * Format: `properties/{property}` diff --git a/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/get_audience_list.php b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/get_audience_list.php index b6937c9c8b1d..55c893ca8260 100644 --- a/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/get_audience_list.php +++ b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/get_audience_list.php @@ -36,9 +36,9 @@ * List](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) * for an introduction to Audience Lists with examples. * - * This method is introduced at alpha stability with the intention of - * gathering feedback on syntax and capabilities before entering beta. To give - * your feedback on this API, complete the + * This method is available at beta stability at + * [audienceExports.get](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/get). + * To give your feedback on this API, complete the * [Google Analytics Audience Export API * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. * diff --git a/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/list_audience_lists.php b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/list_audience_lists.php index 55a4e0f05f84..dac54f222830 100644 --- a/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/list_audience_lists.php +++ b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/list_audience_lists.php @@ -39,9 +39,9 @@ * List](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) * for an introduction to Audience Lists with examples. * - * This method is introduced at alpha stability with the intention of - * gathering feedback on syntax and capabilities before entering beta. To give - * your feedback on this API, complete the + * This method is available at beta stability at + * [audienceExports.list](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/list). + * To give your feedback on this API, complete the * [Google Analytics Audience Export API * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. * diff --git a/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/query_audience_list.php b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/query_audience_list.php index a1b5fe260a8d..e4d3e33d8d43 100644 --- a/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/query_audience_list.php +++ b/AnalyticsData/samples/V1alpha/AlphaAnalyticsDataClient/query_audience_list.php @@ -43,11 +43,10 @@ * that are important to your business. To learn more, see * https://support.google.com/analytics/answer/9267572. * - * This method is introduced at alpha stability with the intention of - * gathering feedback on syntax and capabilities before entering beta. To give - * your feedback on this API, complete the - * [Google Analytics Audience Export API - * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. + * This method is available at beta stability at + * [audienceExports.query](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/query). + * To give your feedback on this API, complete the [Google Analytics Audience + * Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. * * @param string $name The name of the audience list to retrieve users from. * Format: `properties/{property}/audienceLists/{audience_list}` diff --git a/AnalyticsData/src/V1alpha/AudienceList.php b/AnalyticsData/src/V1alpha/AudienceList.php index e5063897532f..cd0bc2d51d5e 100644 --- a/AnalyticsData/src/V1alpha/AudienceList.php +++ b/AnalyticsData/src/V1alpha/AudienceList.php @@ -98,6 +98,24 @@ class AudienceList extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional string recurring_audience_list = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $recurring_audience_list = null; + /** + * Optional. Configures webhook notifications to be sent from the Google + * Analytics Data API to your webhook server. Use of webhooks is optional. If + * unused, you'll need to poll this API to determine when an audience list is + * ready to be used. Webhooks allow a notification to be sent to your servers + * & avoid the need for polling. + * Either one or two POST requests will be sent to the webhook. The first POST + * request will be sent immediately showing the newly created audience list in + * its CREATING state. The second POST request will be sent after the audience + * list completes creation (either the ACTIVE or FAILED state). + * If identical audience lists are requested in quick succession, the second & + * subsequent audience lists can be served from cache. In that case, the + * audience list create method can return an audience list is already ACTIVE. + * In this scenario, only one POST request will be sent to the webhook. + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.WebhookNotification webhook_notification = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $webhook_notification = null; /** * Constructor. @@ -142,6 +160,20 @@ class AudienceList extends \Google\Protobuf\Internal\Message * Recurring audience lists create audience lists daily. * If audience lists are created directly, they will have no associated * recurring audience list, and this field will be blank. + * @type \Google\Analytics\Data\V1alpha\WebhookNotification $webhook_notification + * Optional. Configures webhook notifications to be sent from the Google + * Analytics Data API to your webhook server. Use of webhooks is optional. If + * unused, you'll need to poll this API to determine when an audience list is + * ready to be used. Webhooks allow a notification to be sent to your servers + * & avoid the need for polling. + * Either one or two POST requests will be sent to the webhook. The first POST + * request will be sent immediately showing the newly created audience list in + * its CREATING state. The second POST request will be sent after the audience + * list completes creation (either the ACTIVE or FAILED state). + * If identical audience lists are requested in quick succession, the second & + * subsequent audience lists can be served from cache. In that case, the + * audience list create method can return an audience list is already ACTIVE. + * In this scenario, only one POST request will be sent to the webhook. * } */ public function __construct($data = NULL) { @@ -525,5 +557,65 @@ public function setRecurringAudienceList($var) return $this; } + /** + * Optional. Configures webhook notifications to be sent from the Google + * Analytics Data API to your webhook server. Use of webhooks is optional. If + * unused, you'll need to poll this API to determine when an audience list is + * ready to be used. Webhooks allow a notification to be sent to your servers + * & avoid the need for polling. + * Either one or two POST requests will be sent to the webhook. The first POST + * request will be sent immediately showing the newly created audience list in + * its CREATING state. The second POST request will be sent after the audience + * list completes creation (either the ACTIVE or FAILED state). + * If identical audience lists are requested in quick succession, the second & + * subsequent audience lists can be served from cache. In that case, the + * audience list create method can return an audience list is already ACTIVE. + * In this scenario, only one POST request will be sent to the webhook. + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.WebhookNotification webhook_notification = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Analytics\Data\V1alpha\WebhookNotification|null + */ + public function getWebhookNotification() + { + return $this->webhook_notification; + } + + public function hasWebhookNotification() + { + return isset($this->webhook_notification); + } + + public function clearWebhookNotification() + { + unset($this->webhook_notification); + } + + /** + * Optional. Configures webhook notifications to be sent from the Google + * Analytics Data API to your webhook server. Use of webhooks is optional. If + * unused, you'll need to poll this API to determine when an audience list is + * ready to be used. Webhooks allow a notification to be sent to your servers + * & avoid the need for polling. + * Either one or two POST requests will be sent to the webhook. The first POST + * request will be sent immediately showing the newly created audience list in + * its CREATING state. The second POST request will be sent after the audience + * list completes creation (either the ACTIVE or FAILED state). + * If identical audience lists are requested in quick succession, the second & + * subsequent audience lists can be served from cache. In that case, the + * audience list create method can return an audience list is already ACTIVE. + * In this scenario, only one POST request will be sent to the webhook. + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.WebhookNotification webhook_notification = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Analytics\Data\V1alpha\WebhookNotification $var + * @return $this + */ + public function setWebhookNotification($var) + { + GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\WebhookNotification::class); + $this->webhook_notification = $var; + + return $this; + } + } diff --git a/AnalyticsData/src/V1alpha/Client/AlphaAnalyticsDataClient.php b/AnalyticsData/src/V1alpha/Client/AlphaAnalyticsDataClient.php index efc7de1835b1..0d6549f6af1f 100644 --- a/AnalyticsData/src/V1alpha/Client/AlphaAnalyticsDataClient.php +++ b/AnalyticsData/src/V1alpha/Client/AlphaAnalyticsDataClient.php @@ -343,11 +343,10 @@ public function __call($method, $args) * https://support.google.com/analytics/answer/9267572. Audience lists contain * the users in each audience. * - * This method is introduced at alpha stability with the intention of - * gathering feedback on syntax and capabilities before entering beta. To give - * your feedback on this API, complete the - * [Google Analytics Audience Export API - * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. + * This method is available at beta stability at + * [audienceExports.create](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/create). + * To give your feedback on this API, complete the [Google Analytics Audience + * Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. * * The async variant is {@see AlphaAnalyticsDataClient::createAudienceListAsync()} * . @@ -429,9 +428,9 @@ public function createRecurringAudienceList(CreateRecurringAudienceListRequest $ * List](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) * for an introduction to Audience Lists with examples. * - * This method is introduced at alpha stability with the intention of - * gathering feedback on syntax and capabilities before entering beta. To give - * your feedback on this API, complete the + * This method is available at beta stability at + * [audienceExports.get](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/get). + * To give your feedback on this API, complete the * [Google Analytics Audience Export API * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. * @@ -509,9 +508,9 @@ public function getRecurringAudienceList(GetRecurringAudienceListRequest $reques * List](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) * for an introduction to Audience Lists with examples. * - * This method is introduced at alpha stability with the intention of - * gathering feedback on syntax and capabilities before entering beta. To give - * your feedback on this API, complete the + * This method is available at beta stability at + * [audienceExports.list](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/list). + * To give your feedback on this API, complete the * [Google Analytics Audience Export API * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. * @@ -595,11 +594,10 @@ public function listRecurringAudienceLists(ListRecurringAudienceListsRequest $re * that are important to your business. To learn more, see * https://support.google.com/analytics/answer/9267572. * - * This method is introduced at alpha stability with the intention of - * gathering feedback on syntax and capabilities before entering beta. To give - * your feedback on this API, complete the - * [Google Analytics Audience Export API - * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. + * This method is available at beta stability at + * [audienceExports.query](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/query). + * To give your feedback on this API, complete the [Google Analytics Audience + * Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. * * The async variant is {@see AlphaAnalyticsDataClient::queryAudienceListAsync()} . * diff --git a/AnalyticsData/src/V1alpha/Gapic/AlphaAnalyticsDataGapicClient.php b/AnalyticsData/src/V1alpha/Gapic/AlphaAnalyticsDataGapicClient.php index a80216407c0e..0ea1632b5629 100644 --- a/AnalyticsData/src/V1alpha/Gapic/AlphaAnalyticsDataGapicClient.php +++ b/AnalyticsData/src/V1alpha/Gapic/AlphaAnalyticsDataGapicClient.php @@ -456,11 +456,10 @@ public function __construct(array $options = []) * https://support.google.com/analytics/answer/9267572. Audience lists contain * the users in each audience. * - * This method is introduced at alpha stability with the intention of - * gathering feedback on syntax and capabilities before entering beta. To give - * your feedback on this API, complete the - * [Google Analytics Audience Export API - * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. + * This method is available at beta stability at + * [audienceExports.create](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/create). + * To give your feedback on this API, complete the [Google Analytics Audience + * Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. * * Sample code: * ``` @@ -623,9 +622,9 @@ public function createRecurringAudienceList( * List](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) * for an introduction to Audience Lists with examples. * - * This method is introduced at alpha stability with the intention of - * gathering feedback on syntax and capabilities before entering beta. To give - * your feedback on this API, complete the + * This method is available at beta stability at + * [audienceExports.get](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/get). + * To give your feedback on this API, complete the * [Google Analytics Audience Export API * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. * @@ -749,9 +748,9 @@ public function getRecurringAudienceList($name, array $optionalArgs = []) * List](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) * for an introduction to Audience Lists with examples. * - * This method is introduced at alpha stability with the intention of - * gathering feedback on syntax and capabilities before entering beta. To give - * your feedback on this API, complete the + * This method is available at beta stability at + * [audienceExports.list](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/list). + * To give your feedback on this API, complete the * [Google Analytics Audience Export API * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. * @@ -940,11 +939,10 @@ public function listRecurringAudienceLists( * that are important to your business. To learn more, see * https://support.google.com/analytics/answer/9267572. * - * This method is introduced at alpha stability with the intention of - * gathering feedback on syntax and capabilities before entering beta. To give - * your feedback on this API, complete the - * [Google Analytics Audience Export API - * Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. + * This method is available at beta stability at + * [audienceExports.query](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/query). + * To give your feedback on this API, complete the [Google Analytics Audience + * Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form. * * Sample code: * ``` diff --git a/AnalyticsData/src/V1alpha/RecurringAudienceList.php b/AnalyticsData/src/V1alpha/RecurringAudienceList.php index 46481ac62a57..f36c7324d305 100644 --- a/AnalyticsData/src/V1alpha/RecurringAudienceList.php +++ b/AnalyticsData/src/V1alpha/RecurringAudienceList.php @@ -73,6 +73,22 @@ class RecurringAudienceList extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated string audience_lists = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $audience_lists; + /** + * Optional. Configures webhook notifications to be sent from the Google + * Analytics Data API to your webhook server. Use of webhooks is optional. If + * unused, you'll need to poll this API to determine when a recurring audience + * list creates new audience lists. Webhooks allow a notification to be sent + * to your servers & avoid the need for polling. + * Two POST requests will be sent each time a recurring audience list creates + * an audience list. This happens once per day until a recurring audience list + * reaches 0 active days remaining. The first request will be sent showing a + * newly created audience list in its CREATING state. The second request will + * be sent after the audience list completes creation (either the ACTIVE or + * FAILED state). + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.WebhookNotification webhook_notification = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $webhook_notification = null; /** * Constructor. @@ -111,6 +127,18 @@ class RecurringAudienceList extends \Google\Protobuf\Internal\Message * created for this recurring audience list. One audience list is created for * each day, and the audience list will be listed here. * This list is ordered with the most recently created audience list first. + * @type \Google\Analytics\Data\V1alpha\WebhookNotification $webhook_notification + * Optional. Configures webhook notifications to be sent from the Google + * Analytics Data API to your webhook server. Use of webhooks is optional. If + * unused, you'll need to poll this API to determine when a recurring audience + * list creates new audience lists. Webhooks allow a notification to be sent + * to your servers & avoid the need for polling. + * Two POST requests will be sent each time a recurring audience list creates + * an audience list. This happens once per day until a recurring audience list + * reaches 0 active days remaining. The first request will be sent showing a + * newly created audience list in its CREATING state. The second request will + * be sent after the audience list completes creation (either the ACTIVE or + * FAILED state). * } */ public function __construct($data = NULL) { @@ -322,5 +350,61 @@ public function setAudienceLists($var) return $this; } + /** + * Optional. Configures webhook notifications to be sent from the Google + * Analytics Data API to your webhook server. Use of webhooks is optional. If + * unused, you'll need to poll this API to determine when a recurring audience + * list creates new audience lists. Webhooks allow a notification to be sent + * to your servers & avoid the need for polling. + * Two POST requests will be sent each time a recurring audience list creates + * an audience list. This happens once per day until a recurring audience list + * reaches 0 active days remaining. The first request will be sent showing a + * newly created audience list in its CREATING state. The second request will + * be sent after the audience list completes creation (either the ACTIVE or + * FAILED state). + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.WebhookNotification webhook_notification = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Analytics\Data\V1alpha\WebhookNotification|null + */ + public function getWebhookNotification() + { + return $this->webhook_notification; + } + + public function hasWebhookNotification() + { + return isset($this->webhook_notification); + } + + public function clearWebhookNotification() + { + unset($this->webhook_notification); + } + + /** + * Optional. Configures webhook notifications to be sent from the Google + * Analytics Data API to your webhook server. Use of webhooks is optional. If + * unused, you'll need to poll this API to determine when a recurring audience + * list creates new audience lists. Webhooks allow a notification to be sent + * to your servers & avoid the need for polling. + * Two POST requests will be sent each time a recurring audience list creates + * an audience list. This happens once per day until a recurring audience list + * reaches 0 active days remaining. The first request will be sent showing a + * newly created audience list in its CREATING state. The second request will + * be sent after the audience list completes creation (either the ACTIVE or + * FAILED state). + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.WebhookNotification webhook_notification = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Analytics\Data\V1alpha\WebhookNotification $var + * @return $this + */ + public function setWebhookNotification($var) + { + GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\WebhookNotification::class); + $this->webhook_notification = $var; + + return $this; + } + } diff --git a/AnalyticsData/src/V1alpha/WebhookNotification.php b/AnalyticsData/src/V1alpha/WebhookNotification.php new file mode 100644 index 000000000000..0a4b5af88720 --- /dev/null +++ b/AnalyticsData/src/V1alpha/WebhookNotification.php @@ -0,0 +1,258 @@ +google.analytics.data.v1alpha.WebhookNotification + */ +class WebhookNotification extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The web address that will receive the webhook notification. This + * address will receive POST requests as the state of the long running + * operation resource changes. The POST request will contain both a JSON + * version of the long running operation resource in the body and a + * `sentTimestamp` field. The sent timestamp will specify the unix + * microseconds since the epoch that the request was sent; this lets you + * identify replayed notifications. + * An example URI is + * `https://us-central1-example-project-id.cloudfunctions.net/example-function-1`. + * The URI must use HTTPS and point to a site with a valid SSL certificate on + * the web server. The URI must have a maximum string length of 128 characters + * & use only the allowlisted characters from [RFC + * 1738](https://www.rfc-editor.org/rfc/rfc1738). + * When your webhook server receives a notification, it is expected to reply + * with an HTTP response status code of 200 within 5 seconds. + * A URI is required to use webhook notifications. + * Requests to this webhook server will contain an ID token authenticating the + * service account + * `google-analytics-audience-export@system.gserviceaccount.com`. To learn + * more about ID tokens, see + * https://cloud.google.com/docs/authentication/token-types#id. For Google + * Cloud Functions, this lets you configure your function to require + * authentication. In Cloud IAM, you will need to grant the service account + * permissions to the Cloud Run Invoker (`roles/run.invoker`) & Cloud + * Functions Invoker (`roles/cloudfunctions.invoker`) roles for the webhook + * post request to pass Google Cloud Functions authentication. This API can + * send webhook notifications to arbitrary URIs; for webhook servers other + * than Google Cloud Functions, this ID token in the authorization bearer + * header should be ignored if it is not needed. + * + * Generated from protobuf field optional string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $uri = null; + /** + * Optional. The channel token is an arbitrary string value and must have a + * maximum string length of 64 characters. Channel tokens allow you to verify + * the source of a webhook notification. This guards against the message being + * spoofed. The channel token will be specified in the `X-Goog-Channel-Token` + * HTTP header of the webhook POST request. + * A channel token is not required to use webhook notifications. + * + * Generated from protobuf field optional string channel_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $channel_token = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Optional. The web address that will receive the webhook notification. This + * address will receive POST requests as the state of the long running + * operation resource changes. The POST request will contain both a JSON + * version of the long running operation resource in the body and a + * `sentTimestamp` field. The sent timestamp will specify the unix + * microseconds since the epoch that the request was sent; this lets you + * identify replayed notifications. + * An example URI is + * `https://us-central1-example-project-id.cloudfunctions.net/example-function-1`. + * The URI must use HTTPS and point to a site with a valid SSL certificate on + * the web server. The URI must have a maximum string length of 128 characters + * & use only the allowlisted characters from [RFC + * 1738](https://www.rfc-editor.org/rfc/rfc1738). + * When your webhook server receives a notification, it is expected to reply + * with an HTTP response status code of 200 within 5 seconds. + * A URI is required to use webhook notifications. + * Requests to this webhook server will contain an ID token authenticating the + * service account + * `google-analytics-audience-export@system.gserviceaccount.com`. To learn + * more about ID tokens, see + * https://cloud.google.com/docs/authentication/token-types#id. For Google + * Cloud Functions, this lets you configure your function to require + * authentication. In Cloud IAM, you will need to grant the service account + * permissions to the Cloud Run Invoker (`roles/run.invoker`) & Cloud + * Functions Invoker (`roles/cloudfunctions.invoker`) roles for the webhook + * post request to pass Google Cloud Functions authentication. This API can + * send webhook notifications to arbitrary URIs; for webhook servers other + * than Google Cloud Functions, this ID token in the authorization bearer + * header should be ignored if it is not needed. + * @type string $channel_token + * Optional. The channel token is an arbitrary string value and must have a + * maximum string length of 64 characters. Channel tokens allow you to verify + * the source of a webhook notification. This guards against the message being + * spoofed. The channel token will be specified in the `X-Goog-Channel-Token` + * HTTP header of the webhook POST request. + * A channel token is not required to use webhook notifications. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The web address that will receive the webhook notification. This + * address will receive POST requests as the state of the long running + * operation resource changes. The POST request will contain both a JSON + * version of the long running operation resource in the body and a + * `sentTimestamp` field. The sent timestamp will specify the unix + * microseconds since the epoch that the request was sent; this lets you + * identify replayed notifications. + * An example URI is + * `https://us-central1-example-project-id.cloudfunctions.net/example-function-1`. + * The URI must use HTTPS and point to a site with a valid SSL certificate on + * the web server. The URI must have a maximum string length of 128 characters + * & use only the allowlisted characters from [RFC + * 1738](https://www.rfc-editor.org/rfc/rfc1738). + * When your webhook server receives a notification, it is expected to reply + * with an HTTP response status code of 200 within 5 seconds. + * A URI is required to use webhook notifications. + * Requests to this webhook server will contain an ID token authenticating the + * service account + * `google-analytics-audience-export@system.gserviceaccount.com`. To learn + * more about ID tokens, see + * https://cloud.google.com/docs/authentication/token-types#id. For Google + * Cloud Functions, this lets you configure your function to require + * authentication. In Cloud IAM, you will need to grant the service account + * permissions to the Cloud Run Invoker (`roles/run.invoker`) & Cloud + * Functions Invoker (`roles/cloudfunctions.invoker`) roles for the webhook + * post request to pass Google Cloud Functions authentication. This API can + * send webhook notifications to arbitrary URIs; for webhook servers other + * than Google Cloud Functions, this ID token in the authorization bearer + * header should be ignored if it is not needed. + * + * Generated from protobuf field optional string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getUri() + { + return isset($this->uri) ? $this->uri : ''; + } + + public function hasUri() + { + return isset($this->uri); + } + + public function clearUri() + { + unset($this->uri); + } + + /** + * Optional. The web address that will receive the webhook notification. This + * address will receive POST requests as the state of the long running + * operation resource changes. The POST request will contain both a JSON + * version of the long running operation resource in the body and a + * `sentTimestamp` field. The sent timestamp will specify the unix + * microseconds since the epoch that the request was sent; this lets you + * identify replayed notifications. + * An example URI is + * `https://us-central1-example-project-id.cloudfunctions.net/example-function-1`. + * The URI must use HTTPS and point to a site with a valid SSL certificate on + * the web server. The URI must have a maximum string length of 128 characters + * & use only the allowlisted characters from [RFC + * 1738](https://www.rfc-editor.org/rfc/rfc1738). + * When your webhook server receives a notification, it is expected to reply + * with an HTTP response status code of 200 within 5 seconds. + * A URI is required to use webhook notifications. + * Requests to this webhook server will contain an ID token authenticating the + * service account + * `google-analytics-audience-export@system.gserviceaccount.com`. To learn + * more about ID tokens, see + * https://cloud.google.com/docs/authentication/token-types#id. For Google + * Cloud Functions, this lets you configure your function to require + * authentication. In Cloud IAM, you will need to grant the service account + * permissions to the Cloud Run Invoker (`roles/run.invoker`) & Cloud + * Functions Invoker (`roles/cloudfunctions.invoker`) roles for the webhook + * post request to pass Google Cloud Functions authentication. This API can + * send webhook notifications to arbitrary URIs; for webhook servers other + * than Google Cloud Functions, this ID token in the authorization bearer + * header should be ignored if it is not needed. + * + * Generated from protobuf field optional string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Optional. The channel token is an arbitrary string value and must have a + * maximum string length of 64 characters. Channel tokens allow you to verify + * the source of a webhook notification. This guards against the message being + * spoofed. The channel token will be specified in the `X-Goog-Channel-Token` + * HTTP header of the webhook POST request. + * A channel token is not required to use webhook notifications. + * + * Generated from protobuf field optional string channel_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getChannelToken() + { + return isset($this->channel_token) ? $this->channel_token : ''; + } + + public function hasChannelToken() + { + return isset($this->channel_token); + } + + public function clearChannelToken() + { + unset($this->channel_token); + } + + /** + * Optional. The channel token is an arbitrary string value and must have a + * maximum string length of 64 characters. Channel tokens allow you to verify + * the source of a webhook notification. This guards against the message being + * spoofed. The channel token will be specified in the `X-Goog-Channel-Token` + * HTTP header of the webhook POST request. + * A channel token is not required to use webhook notifications. + * + * Generated from protobuf field optional string channel_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setChannelToken($var) + { + GPBUtil::checkString($var, True); + $this->channel_token = $var; + + return $this; + } + +} +