Skip to content

Commit

Permalink
feat: add GetAdSenseLink, CreateAdSenseLink, DeleteAdSenseLink,…
Browse files Browse the repository at this point in the history
… `ListAdSenseLinks` methods to the Admin API v1alpha

feat: add `FetchConnectedGa4Property` method to the Admin API v1alpha
feat: add `CreateEventCreateRule`, `UpdateEventCreateRule`,`DeleteEventCreateRule`, `ListEventCreateRules` methods to the Admin API v1alpha
feat: add `EventCreateRule`, `MatchingCondition` types to the Admin API v1alpha
feat: add `AdSenseLink` type to the Admin API v1alpha
feat: add `AUDIENCE`, `EVENT_CREATE_RULE` options to the `ChangeHistoryResourceType` enum
feat: add `audience`, `event_create_rule` fields to the `ChangeHistoryResource.resource` oneof field

PiperOrigin-RevId: 531601348
  • Loading branch information
Google APIs authored and Copybara-Service committed May 12, 2023
1 parent 2407c56 commit ef2e2ea
Show file tree
Hide file tree
Showing 6 changed files with 476 additions and 12 deletions.
6 changes: 4 additions & 2 deletions google/analytics/admin/v1alpha/BUILD.bazel
Expand Up @@ -25,6 +25,7 @@ proto_library(
"analytics_admin.proto",
"audience.proto",
"channel_group.proto",
"event_create_and_edit.proto",
"expanded_data_set.proto",
"resources.proto",
],
Expand Down Expand Up @@ -136,7 +137,7 @@ go_gapic_library(
name = "admin_go_gapic",
srcs = [":admin_proto_with_info"],
grpc_service_config = "admin_grpc_service_config.json",
importpath = "cloud.google.com/go/analytics/admin/apiv1alpha;admin",
importpath = "google.golang.org/google/analytics/admin/v1alpha;adminpb",
metadata = True,
release_level = "alpha",
rest_numeric_enums = True,
Expand All @@ -152,7 +153,7 @@ go_test(
name = "admin_go_gapic_test",
srcs = [":admin_go_gapic_srcjar_test"],
embed = [":admin_go_gapic"],
importpath = "cloud.google.com/go/analytics/admin/apiv1alpha",
importpath = "google.golang.org/google/analytics/admin/v1alpha",
)

# Open Source Packages
Expand Down Expand Up @@ -232,6 +233,7 @@ php_gapic_library(
name = "admin_php_gapic",
srcs = [":admin_proto_with_info"],
grpc_service_config = "admin_grpc_service_config.json",
migration_mode = "PRE_MIGRATION_SURFACE_ONLY",
rest_numeric_enums = True,
service_yaml = "analyticsadmin_v1alpha.yaml",
transport = "grpc+rest",
Expand Down
248 changes: 248 additions & 0 deletions google/analytics/admin/v1alpha/analytics_admin.proto
Expand Up @@ -19,6 +19,7 @@ package google.analytics.admin.v1alpha;
import "google/analytics/admin/v1alpha/access_report.proto";
import "google/analytics/admin/v1alpha/audience.proto";
import "google/analytics/admin/v1alpha/channel_group.proto";
import "google/analytics/admin/v1alpha/event_create_and_edit.proto";
import "google/analytics/admin/v1alpha/expanded_data_set.proto";
import "google/analytics/admin/v1alpha/resources.proto";
import "google/api/annotations.proto";
Expand Down Expand Up @@ -1238,6 +1239,87 @@ service AnalyticsAdminService {
get: "/v1alpha/properties:fetchConnectedGa4Property"
};
}

// Looks up a single AdSenseLink.
rpc GetAdSenseLink(GetAdSenseLinkRequest) returns (AdSenseLink) {
option (google.api.http) = {
get: "/v1alpha/{name=properties/*/adSenseLinks/*}"
};
option (google.api.method_signature) = "name";
}

// Creates an AdSenseLink.
rpc CreateAdSenseLink(CreateAdSenseLinkRequest) returns (AdSenseLink) {
option (google.api.http) = {
post: "/v1alpha/{parent=properties/*}/adSenseLinks"
body: "adsense_link"
};
option (google.api.method_signature) = "parent,adsense_link";
}

// Deletes an AdSenseLink.
rpc DeleteAdSenseLink(DeleteAdSenseLinkRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1alpha/{name=properties/*/adSenseLinks/*}"
};
option (google.api.method_signature) = "name";
}

// Lists AdSenseLinks on a property.
rpc ListAdSenseLinks(ListAdSenseLinksRequest)
returns (ListAdSenseLinksResponse) {
option (google.api.http) = {
get: "/v1alpha/{parent=properties/*}/adSenseLinks"
};
option (google.api.method_signature) = "parent";
}

// Lookup for a single EventCreateRule.
rpc GetEventCreateRule(GetEventCreateRuleRequest) returns (EventCreateRule) {
option (google.api.http) = {
get: "/v1alpha/{name=properties/*/dataStreams/*/eventCreateRules/*}"
};
option (google.api.method_signature) = "name";
}

// Lists EventCreateRules on a web data stream.
rpc ListEventCreateRules(ListEventCreateRulesRequest)
returns (ListEventCreateRulesResponse) {
option (google.api.http) = {
get: "/v1alpha/{parent=properties/*/dataStreams/*}/eventCreateRules"
};
option (google.api.method_signature) = "parent";
}

// Creates an EventCreateRule.
rpc CreateEventCreateRule(CreateEventCreateRuleRequest)
returns (EventCreateRule) {
option (google.api.http) = {
post: "/v1alpha/{parent=properties/*/dataStreams/*}/eventCreateRules"
body: "event_create_rule"
};
option (google.api.method_signature) = "parent,event_create_rule";
}

// Updates an EventCreateRule.
rpc UpdateEventCreateRule(UpdateEventCreateRuleRequest)
returns (EventCreateRule) {
option (google.api.http) = {
patch: "/v1alpha/{event_create_rule.name=properties/*/dataStreams/*/eventCreateRules/*}"
body: "event_create_rule"
};
option (google.api.method_signature) = "event_create_rule,update_mask";
}

// Deletes an EventCreateRule.
rpc DeleteEventCreateRule(DeleteEventCreateRuleRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1alpha/{name=properties/*/dataStreams/*/eventCreateRules/*}"
};
option (google.api.method_signature) = "name";
}
}

// The request for a Data Access Record Report.
Expand Down Expand Up @@ -3406,6 +3488,83 @@ message ListConnectedSiteTagsResponse {
repeated ConnectedSiteTag connected_site_tags = 1;
}

// Request message to be passed to CreateAdSenseLink method.
message CreateAdSenseLinkRequest {
// Required. The property for which to create an AdSense Link.
// Format: properties/{propertyId}
// Example: properties/1234
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "analyticsadmin.googleapis.com/AdSenseLink"
}
];

// Required. The AdSense Link to create
AdSenseLink adsense_link = 2 [(google.api.field_behavior) = REQUIRED];
}

// Request message to be passed to GetAdSenseLink method.
message GetAdSenseLinkRequest {
// Required. Unique identifier for the AdSense Link requested.
// Format: properties/{propertyId}/adSenseLinks/{linkId}
// Example: properties/1234/adSenseLinks/5678
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "analyticsadmin.googleapis.com/AdSenseLink"
}
];
}

// Request message to be passed to DeleteAdSenseLink method.
message DeleteAdSenseLinkRequest {
// Required. Unique identifier for the AdSense Link to be deleted.
// Format: properties/{propertyId}/adSenseLinks/{linkId}
// Example: properties/1234/adSenseLinks/5678
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "analyticsadmin.googleapis.com/AdSenseLink"
}
];
}

// Request message to be passed to ListAdSenseLinks method.
message ListAdSenseLinksRequest {
// Required. Resource name of the parent property.
// Format: properties/{propertyId}
// Example: properties/1234
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "analyticsadmin.googleapis.com/AdSenseLink"
}
];

// The maximum number of resources to return.
// If unspecified, at most 50 resources will be returned.
// The maximum value is 200 (higher values will be coerced to the maximum).
int32 page_size = 2;

// A page token received from a previous `ListAdSenseLinks` call.
// Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `ListAdSenseLinks` must
// match the call that provided the page token.
string page_token = 3;
}

// Response message for ListAdSenseLinks method.
message ListAdSenseLinksResponse {
// List of AdSenseLinks.
repeated AdSenseLink adsense_links = 1;

// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}

// Request for looking up GA4 property connected to a UA property.
message FetchConnectedGa4PropertyRequest {
// Required. The UA property for which to look up the connected GA4 property.
Expand All @@ -3431,3 +3590,92 @@ message FetchConnectedGa4PropertyResponse {
type: "analyticsadmin.googleapis.com/Property"
}];
}

// Request message for CreateEventCreateRule RPC.
message CreateEventCreateRuleRequest {
// Required. Example format: properties/123/dataStreams/456
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "analyticsadmin.googleapis.com/EventCreateRule"
}
];

// Required. The EventCreateRule to create.
EventCreateRule event_create_rule = 2
[(google.api.field_behavior) = REQUIRED];
}

// Request message for UpdateEventCreateRule RPC.
message UpdateEventCreateRuleRequest {
// Required. The EventCreateRule to update.
// The resource's `name` field is used to identify the EventCreateRule to be
// updated.
EventCreateRule event_create_rule = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The list of fields to be updated. Field names must be in snake
// case (e.g., "field_to_update"). Omitted fields will not be updated. To
// replace the entire entity, use one path with the string "*" to match all
// fields.
google.protobuf.FieldMask update_mask = 2
[(google.api.field_behavior) = REQUIRED];
}

// Request message for DeleteEventCreateRule RPC.
message DeleteEventCreateRuleRequest {
// Required. Example format:
// properties/123/dataStreams/456/eventCreateRules/789
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "analyticsadmin.googleapis.com/EventCreateRule"
}
];
}

// Request message for GetEventCreateRule RPC.
message GetEventCreateRuleRequest {
// Required. The name of the EventCreateRule to get.
// Example format: properties/123/dataStreams/456/eventCreateRules/789
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "analyticsadmin.googleapis.com/EventCreateRule"
}
];
}

// Request message for ListEventCreateRules RPC.
message ListEventCreateRulesRequest {
// Required. Example format: properties/123/dataStreams/456
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "analyticsadmin.googleapis.com/EventCreateRule"
}
];

// The maximum number of resources to return.
// If unspecified, at most 50 resources will be returned.
// The maximum value is 200 (higher values will be coerced to the maximum).
int32 page_size = 2;

// A page token, received from a previous `ListEventCreateRules` call. Provide
// this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `ListEventCreateRules`
// must match the call that provided the page token.
string page_token = 3;
}

// Response message for ListEventCreateRules RPC.
message ListEventCreateRulesResponse {
// List of EventCreateRules. These will be ordered stably, but in an arbitrary
// order.
repeated EventCreateRule event_create_rules = 1;

// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}
10 changes: 10 additions & 0 deletions google/analytics/admin/v1alpha/analyticsadmin_v1alpha.yaml
Expand Up @@ -152,6 +152,11 @@ authentication:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.GetEventCreateRule
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.GetExpandedDataSet
oauth:
canonical_scopes: |-
Expand Down Expand Up @@ -252,6 +257,11 @@ authentication:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.ListEventCreateRules
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.ListExpandedDataSets
oauth:
canonical_scopes: |-
Expand Down
25 changes: 15 additions & 10 deletions google/analytics/admin/v1alpha/audience.proto
Expand Up @@ -153,7 +153,12 @@ message AudienceDimensionOrMetricFilter {
BetweenFilter between_filter = 5;
}

// Required. Immutable. The dimension name or metric name to filter.
// Required. Immutable. The dimension name or metric name to filter. If the
// field name refers to a custom dimension or metric, a scope prefix will be
// added to the front of the custom dimensions or metric name. For more on
// scope prefixes or custom dimensions/metrics, reference the [Google
// Analytics Data API documentation]
// (https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#custom_dimensions).
string field_name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
Expand All @@ -170,7 +175,7 @@ message AudienceDimensionOrMetricFilter {

// 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).
// lifetime data (For example, 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
Expand All @@ -193,7 +198,7 @@ message AudienceEventFilter {

// 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
// inside the parameter filter expression cannot be set (For example, 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
Expand All @@ -215,9 +220,9 @@ message AudienceFilterExpression {
// 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.
// A filter expression to be NOT'ed (For example, 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
Expand Down Expand Up @@ -273,7 +278,7 @@ message AudienceSequenceFilter {
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 of the previous step (For example, 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
Expand Down Expand Up @@ -304,9 +309,9 @@ message AudienceSequenceFilter {
}

// 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).
// inclusive (For example, users satisfying the filter clause are included in
// the Audience) or exclusive (For example, users satisfying the filter clause
// are excluded from the Audience).
message AudienceFilterClause {
// Specifies whether this is an include or exclude filter clause.
enum AudienceClauseType {
Expand Down

0 comments on commit ef2e2ea

Please sign in to comment.