data-plane-api 0.1.1

Envoy xDS protobuf and gRPC definitions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License 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.

syntax = "proto3";

package google.analytics.admin.v1alpha;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";

option go_package = "google.golang.org/genproto/googleapis/analytics/admin/v1alpha;admin";
option java_multiple_files = true;
option java_outer_classname = "AudienceProto";
option java_package = "com.google.analytics.admin.v1alpha";

// Specifies how to evaluate users for joining an Audience.
enum AudienceFilterScope {
  // Scope is not specified.
  AUDIENCE_FILTER_SCOPE_UNSPECIFIED = 0;

  // User joins the Audience if the filter condition is met within one
  // event.
  AUDIENCE_FILTER_SCOPE_WITHIN_SAME_EVENT = 1;

  // User joins the Audience if the filter condition is met within one
  // session.
  AUDIENCE_FILTER_SCOPE_WITHIN_SAME_SESSION = 2;

  // User joins the Audience if the filter condition is met by any event
  // across any session.
  AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS = 3;
}

// A specific filter for a single dimension or metric.
message AudienceDimensionOrMetricFilter {
  // A filter for a string-type dimension that matches a particular pattern.
  message StringFilter {
    // The match type for the string filter.
    enum MatchType {
      // Unspecified
      MATCH_TYPE_UNSPECIFIED = 0;

      // Exact match of the string value.
      EXACT = 1;

      // Begins with the string value.
      BEGINS_WITH = 2;

      // Ends with the string value.
      ENDS_WITH = 3;

      // Contains the string value.
      CONTAINS = 4;

      // Full regular expression matches with the string value.
      FULL_REGEXP = 5;

      // Partial regular expression matches with the string value.
      PARTIAL_REGEXP = 6;
    }

    // Required. The match type for the string filter.
    MatchType match_type = 1 [(google.api.field_behavior) = REQUIRED];

    // Required. The string value to be matched against.
    string value = 2 [(google.api.field_behavior) = REQUIRED];

    // Optional. If true, the match is case-sensitive. If false, the match is
    // case-insensitive.
    bool case_sensitive = 3 [(google.api.field_behavior) = OPTIONAL];
  }

  // A filter for a string dimension that matches a particular list of options.
  message InListFilter {
    // Required. The list of possible string values to match against. Must be non-empty.
    repeated string values = 1 [(google.api.field_behavior) = REQUIRED];

    // Optional. If true, the match is case-sensitive. If false, the match is
    // case-insensitive.
    bool case_sensitive = 2 [(google.api.field_behavior) = OPTIONAL];
  }

  // To represent a number.
  message NumericValue {
    // One of a numeric value.
    oneof one_value {
      // Integer value.
      int64 int64_value = 1;

      // Double value.
      double double_value = 2;
    }
  }

  // A filter for numeric or date values on a dimension or metric.
  message NumericFilter {
    // The operation applied to a numeric filter.
    enum Operation {
      // Unspecified.
      OPERATION_UNSPECIFIED = 0;

      // Equal.
      EQUAL = 1;

      // Less than.
      LESS_THAN = 2;

      // Less than or equal.
      LESS_THAN_OR_EQUAL = 3;

      // Greater than.
      GREATER_THAN = 4;

      // Greater than or equal.
      GREATER_THAN_OR_EQUAL = 5;
    }

    // Required. The operation applied to a numeric filter.
    Operation operation = 1 [(google.api.field_behavior) = REQUIRED];

    // Required. The numeric or date value to match against.
    NumericValue value = 2 [(google.api.field_behavior) = REQUIRED];
  }

  // A filter for numeric or date values between certain values on a dimension
  // or metric.
  message BetweenFilter {
    // Required. Begins with this number, inclusive.
    NumericValue from_value = 1 [(google.api.field_behavior) = REQUIRED];

    // Required. Ends with this number, inclusive.
    NumericValue to_value = 2 [(google.api.field_behavior) = REQUIRED];
  }

  // One of the above filters.
  oneof one_filter {
    // A filter for a string-type dimension that matches a particular pattern.
    StringFilter string_filter = 2;

    // A filter for a string dimension that matches a particular list of
    // options.
    InListFilter in_list_filter = 3;

    // A filter for numeric or date values on a dimension or metric.
    NumericFilter numeric_filter = 4;

    // A filter for numeric or date values between certain values on a dimension
    // or metric.
    BetweenFilter between_filter = 5;
  }

  // Required. Immutable. The dimension name or metric name to filter.
  string field_name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.field_behavior) = IMMUTABLE
  ];

  // Optional. Indicates whether this filter needs dynamic evaluation or not. If set to
  // true, users join the Audience if they ever met the condition (static
  // evaluation). If unset or set to false, user evaluation for an Audience is
  // dynamic; users are added to an Audience when they meet the conditions and
  // then removed when they no longer meet them.
  //
  // This can only be set when Audience scope is ACROSS_ALL_SESSIONS.
  bool at_any_point_in_time = 6 [(google.api.field_behavior) = OPTIONAL];

  // Optional. If set, specifies the time window for which to evaluate data in number of
  // days. If not set, then audience data is evaluated against lifetime data
  // (i.e., infinite time window).
  //
  // For example, if set to 1 day, only the current day's data is evaluated. The
  // reference point is the current day when at_any_point_in_time is unset or
  // false.
  //
  // It can only be set when Audience scope is ACROSS_ALL_SESSIONS and cannot be
  // greater than 60 days.
  int32 in_any_n_day_period = 7 [(google.api.field_behavior) = OPTIONAL];
}

// A filter that matches events of a single event name. If an event parameter
// is specified, only the subset of events that match both the single event name
// and the parameter filter expressions match this event filter.
message AudienceEventFilter {
  // Required. Immutable. The name of the event to match against.
  string event_name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.field_behavior) = IMMUTABLE
  ];

  // Optional. If specified, this filter matches events that match both the single
  // event name and the parameter filter expressions. AudienceEventFilter
  // inside the parameter filter expression cannot be set (i.e., nested
  // event filters are not supported). This should be a single and_group of
  // dimension_or_metric_filter or not_expression; ANDs of ORs are not
  // supported. Also, if it includes a filter for "eventCount", only that one
  // will be considered; all the other filters will be ignored.
  AudienceFilterExpression event_parameter_filter_expression = 2 [(google.api.field_behavior) = OPTIONAL];
}

// A logical expression of Audience dimension, metric, or event filters.
message AudienceFilterExpression {
  // The expression applied to a filter.
  oneof expr {
    // A list of expressions to be AND’ed together. It can only contain
    // AudienceFilterExpressions with or_group. This must be set for the top
    // level AudienceFilterExpression.
    AudienceFilterExpressionList and_group = 1;

    // A list of expressions to OR’ed together. It cannot contain
    // AudienceFilterExpressions with and_group or or_group.
    AudienceFilterExpressionList or_group = 2;

    // A filter expression to be NOT'ed (i.e., inverted, complemented). It
    // can only include a dimension_or_metric_filter. This cannot be set on the
    // top level AudienceFilterExpression.
    AudienceFilterExpression not_expression = 3;

    // A filter on a single dimension or metric. This cannot be set on the top
    // level AudienceFilterExpression.
    AudienceDimensionOrMetricFilter dimension_or_metric_filter = 4;

    // Creates a filter that matches a specific event. This cannot be set on the
    // top level AudienceFilterExpression.
    AudienceEventFilter event_filter = 5;
  }
}

// A list of Audience filter expressions.
message AudienceFilterExpressionList {
  // A list of Audience filter expressions.
  repeated AudienceFilterExpression filter_expressions = 1;
}

// Defines a simple filter that a user must satisfy to be a member of the
// Audience.
message AudienceSimpleFilter {
  // Required. Immutable. Specifies the scope for this filter.
  AudienceFilterScope scope = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.field_behavior) = IMMUTABLE
  ];

  // Required. Immutable. A logical expression of Audience dimension, metric, or event filters.
  AudienceFilterExpression filter_expression = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.field_behavior) = IMMUTABLE
  ];
}

// Defines filters that must occur in a specific order for the user to be a
// member of the Audience.
message AudienceSequenceFilter {
  // A condition that must occur in the specified step order for this user
  // to match the sequence.
  message AudienceSequenceStep {
    // Required. Immutable. Specifies the scope for this step.
    AudienceFilterScope scope = 1 [
      (google.api.field_behavior) = REQUIRED,
      (google.api.field_behavior) = IMMUTABLE
    ];

    // Optional. If true, the event satisfying this step must be the very next event
    // after the event satisfying the last step. If unset or false, this
    // step indirectly follows the prior step; for example, there may be
    // events between the prior step and this step. It is ignored for the
    // first step.
    bool immediately_follows = 2 [(google.api.field_behavior) = OPTIONAL];

    // Optional. When set, this step must be satisfied within the constraint_duration of
    // the previous step (i.e., t[i] - t[i-1] <= constraint_duration). If not
    // set, there is no duration requirement (the duration is effectively
    // unlimited). It is ignored for the first step.
    google.protobuf.Duration constraint_duration = 3 [(google.api.field_behavior) = OPTIONAL];

    // Required. Immutable. A logical expression of Audience dimension, metric, or event filters in
    // each step.
    AudienceFilterExpression filter_expression = 4 [
      (google.api.field_behavior) = REQUIRED,
      (google.api.field_behavior) = IMMUTABLE
    ];
  }

  // Required. Immutable. Specifies the scope for this filter.
  AudienceFilterScope scope = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.field_behavior) = IMMUTABLE
  ];

  // Optional. Defines the time period in which the whole sequence must occur.
  google.protobuf.Duration sequence_maximum_duration = 2 [(google.api.field_behavior) = OPTIONAL];

  // Required. An ordered sequence of steps. A user must complete each step in order to
  // join the sequence filter.
  repeated AudienceSequenceStep sequence_steps = 3 [(google.api.field_behavior) = REQUIRED];
}

// A clause for defining either a simple or sequence filter. A filter can be
// inclusive (i.e., users satisfying the filter clause are included in the
// Audience) or exclusive (i.e., users satisfying the filter clause are
// excluded from the Audience).
message AudienceFilterClause {
  // Specifies whether this is an include or exclude filter clause.
  enum AudienceClauseType {
    // Unspecified clause type.
    AUDIENCE_CLAUSE_TYPE_UNSPECIFIED = 0;

    // Users will be included in the Audience if the filter clause is met.
    INCLUDE = 1;

    // Users will be excluded from the Audience if the filter clause is met.
    EXCLUDE = 2;
  }

  oneof filter {
    // A simple filter that a user must satisfy to be a member of the Audience.
    AudienceSimpleFilter simple_filter = 2;

    // Filters that must occur in a specific order for the user to be a member
    // of the Audience.
    AudienceSequenceFilter sequence_filter = 3;
  }

  // Required. Specifies whether this is an include or exclude filter clause.
  AudienceClauseType clause_type = 1 [(google.api.field_behavior) = REQUIRED];
}

// Specifies an event to log when a user joins the Audience.
message AudienceEventTrigger {
  // Determines when to log the event.
  enum LogCondition {
    // Log condition is not specified.
    LOG_CONDITION_UNSPECIFIED = 0;

    // The event should be logged only when a user is joined.
    AUDIENCE_JOINED = 1;

    // The event should be logged whenever the Audience condition is met, even
    // if the user is already a member of the Audience.
    AUDIENCE_MEMBERSHIP_RENEWED = 2;
  }

  // Required. The event name that will be logged.
  string event_name = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. When to log the event.
  LogCondition log_condition = 2 [(google.api.field_behavior) = REQUIRED];
}

// A resource message representing a GA4 Audience.
message Audience {
  option (google.api.resource) = {
    type: "analyticsadmin.googleapis.com/Audience"
    pattern: "properties/{property}/audiences/{audience}"
  };

  // Specifies how long an exclusion lasts for users that meet the exclusion
  // filter.
  enum AudienceExclusionDurationMode {
    // Not specified.
    AUDIENCE_EXCLUSION_DURATION_MODE_UNSPECIFIED = 0;

    // Exclude users from the Audience during periods when they meet the
    // filter clause.
    EXCLUDE_TEMPORARILY = 1;

    // Exclude users from the Audience if they've ever met the filter clause.
    EXCLUDE_PERMANENTLY = 2;
  }

  // Output only. The resource name for this Audience resource.
  // Format: properties/{propertyId}/audiences/{audienceId}
  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Required. The display name of the Audience.
  string display_name = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The description of the Audience.
  string description = 3 [(google.api.field_behavior) = REQUIRED];

  // Required. Immutable. The duration a user should stay in an Audience. It cannot be set to more
  // than 540 days.
  int32 membership_duration_days = 4 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.field_behavior) = IMMUTABLE
  ];

  // Output only. It is automatically set by GA to false if this is an NPA Audience and is
  // excluded from ads personalization.
  bool ads_personalization_enabled = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. Specifies an event to log when a user joins the Audience. If not set, no
  // event is logged when a user joins the Audience.
  AudienceEventTrigger event_trigger = 6 [(google.api.field_behavior) = OPTIONAL];

  // Immutable. Specifies how long an exclusion lasts for users that meet the exclusion
  // filter. It is applied to all EXCLUDE filter clauses and is ignored when
  // there is no EXCLUDE filter clause in the Audience.
  AudienceExclusionDurationMode exclusion_duration_mode = 7 [(google.api.field_behavior) = IMMUTABLE];

  // Required. Immutable. null Filter clauses that define the Audience. All clauses will be AND’ed
  // together.
  repeated AudienceFilterClause filter_clauses = 8 [
    (google.api.field_behavior) = IMMUTABLE,
    (google.api.field_behavior) = REQUIRED,
    (google.api.field_behavior) = UNORDERED_LIST
  ];
}