1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.analytics.admin.v1alpha; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21 22option go_package = "cloud.google.com/go/analytics/admin/apiv1alpha/adminpb;adminpb"; 23option java_multiple_files = true; 24option java_outer_classname = "ChannelGroupProto"; 25option java_package = "com.google.analytics.admin.v1alpha"; 26 27// A specific filter for a single dimension. 28message ChannelGroupFilter { 29 // Filter where the field value is a String. The match is case insensitive. 30 message StringFilter { 31 // How the filter will be used to determine a match. 32 enum MatchType { 33 // Default match type. 34 MATCH_TYPE_UNSPECIFIED = 0; 35 36 // Exact match of the string value. 37 EXACT = 1; 38 39 // Begins with the string value. 40 BEGINS_WITH = 2; 41 42 // Ends with the string value. 43 ENDS_WITH = 3; 44 45 // Contains the string value. 46 CONTAINS = 4; 47 48 // Full regular expression match with the string value. 49 FULL_REGEXP = 5; 50 51 // Partial regular expression match with the string value. 52 PARTIAL_REGEXP = 6; 53 } 54 55 // Required. The match type for the string filter. 56 MatchType match_type = 1 [(google.api.field_behavior) = REQUIRED]; 57 58 // Required. The string value to be matched against. 59 string value = 2 [(google.api.field_behavior) = REQUIRED]; 60 } 61 62 // A filter for a string dimension that matches a particular list of options. 63 // The match is case insensitive. 64 message InListFilter { 65 // Required. The list of possible string values to match against. Must be 66 // non-empty. 67 repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; 68 } 69 70 // A StringFilter or InListFilter that defines this filters behavior. 71 oneof value_filter { 72 // A filter for a string-type dimension that matches a particular pattern. 73 StringFilter string_filter = 2; 74 75 // A filter for a string dimension that matches a particular list of 76 // options. 77 InListFilter in_list_filter = 3; 78 } 79 80 // Required. Immutable. The dimension name to filter. 81 string field_name = 1 [ 82 (google.api.field_behavior) = REQUIRED, 83 (google.api.field_behavior) = IMMUTABLE 84 ]; 85} 86 87// A logical expression of Channel Group dimension filters. 88message ChannelGroupFilterExpression { 89 // The expression applied to a filter. 90 oneof expr { 91 // A list of expressions to be AND’ed together. It can only contain 92 // ChannelGroupFilterExpressions with or_group. This must be set for the 93 // top level ChannelGroupFilterExpression. 94 ChannelGroupFilterExpressionList and_group = 1; 95 96 // A list of expressions to OR’ed together. It cannot contain 97 // ChannelGroupFilterExpressions with and_group or or_group. 98 ChannelGroupFilterExpressionList or_group = 2; 99 100 // A filter expression to be NOT'ed (that is inverted, complemented). It 101 // can only include a dimension_or_metric_filter. This cannot be set on the 102 // top level ChannelGroupFilterExpression. 103 ChannelGroupFilterExpression not_expression = 3; 104 105 // A filter on a single dimension. This cannot be set on the top 106 // level ChannelGroupFilterExpression. 107 ChannelGroupFilter filter = 4; 108 } 109} 110 111// A list of Channel Group filter expressions. 112message ChannelGroupFilterExpressionList { 113 // A list of Channel Group filter expressions. 114 repeated ChannelGroupFilterExpression filter_expressions = 1; 115} 116 117// The rules that govern how traffic is grouped into one channel. 118message GroupingRule { 119 // Required. Customer defined display name for the channel. 120 string display_name = 1 [(google.api.field_behavior) = REQUIRED]; 121 122 // Required. The Filter Expression that defines the Grouping Rule. 123 ChannelGroupFilterExpression expression = 2 124 [(google.api.field_behavior) = REQUIRED]; 125} 126 127// A resource message representing a Channel Group. 128message ChannelGroup { 129 option (google.api.resource) = { 130 type: "analyticsadmin.googleapis.com/ChannelGroup" 131 pattern: "properties/{property}/channelGroups/{channel_group}" 132 }; 133 134 // Output only. The resource name for this Channel Group resource. 135 // Format: properties/{property}/channelGroups/{channel_group} 136 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 137 138 // Required. The display name of the Channel Group. Max length of 80 139 // characters. 140 string display_name = 2 [(google.api.field_behavior) = REQUIRED]; 141 142 // The description of the Channel Group. Max length of 256 characters. 143 string description = 3; 144 145 // Required. The grouping rules of channels. Maximum number of rules is 50. 146 repeated GroupingRule grouping_rule = 4 147 [(google.api.field_behavior) = REQUIRED]; 148 149 // Output only. If true, then this channel group is the Default Channel Group 150 // predefined by Google Analytics. Display name and grouping rules cannot be 151 // updated for this channel group. 152 bool system_defined = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; 153} 154