Skip to content

Commit

Permalink
feat: add FetchConnectedGa4Property method to the Admin API v1alpha
Browse files Browse the repository at this point in the history
feat: add `GetChannelGroup`, `ListChannelGroups`, `CreateChannelGroup`, `UpdateChannelGroup` methods to the Admin API v1alpha
feat: add `ChannelGroupFilter`, `ChannelGroupFilterExpression`, `ChannelGroupFilterExpressionList`, `GroupingRule`, `ChannelGroup` types to the Admin API v1alpha

PiperOrigin-RevId: 526740438
  • Loading branch information
Google APIs authored and copybara-github committed Apr 24, 2023
1 parent 24f5ec0 commit 893a25b
Show file tree
Hide file tree
Showing 6 changed files with 351 additions and 14 deletions.
3 changes: 2 additions & 1 deletion google/analytics/admin/v1alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ proto_library(
"access_report.proto",
"analytics_admin.proto",
"audience.proto",
"channel_group.proto",
"expanded_data_set.proto",
"resources.proto",
],
Expand Down Expand Up @@ -135,7 +136,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 Down
171 changes: 170 additions & 1 deletion google/analytics/admin/v1alpha/analytics_admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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/expanded_data_set.proto";
import "google/analytics/admin/v1alpha/resources.proto";
import "google/api/annotations.proto";
Expand Down Expand Up @@ -1087,6 +1088,50 @@ service AnalyticsAdminService {
option (google.api.method_signature) = "name";
}

// Lookup for a single ChannelGroup.
rpc GetChannelGroup(GetChannelGroupRequest) returns (ChannelGroup) {
option (google.api.http) = {
get: "/v1alpha/{name=properties/*/channelGroups/*}"
};
option (google.api.method_signature) = "name";
}

// Lists ChannelGroups on a property.
rpc ListChannelGroups(ListChannelGroupsRequest)
returns (ListChannelGroupsResponse) {
option (google.api.http) = {
get: "/v1alpha/{parent=properties/*}/channelGroups"
};
option (google.api.method_signature) = "parent";
}

// Creates a ChannelGroup.
rpc CreateChannelGroup(CreateChannelGroupRequest) returns (ChannelGroup) {
option (google.api.http) = {
post: "/v1alpha/{parent=properties/*}/channelGroups"
body: "channel_group"
};
option (google.api.method_signature) = "parent,channel_group";
}

// Updates a ChannelGroup.
rpc UpdateChannelGroup(UpdateChannelGroupRequest) returns (ChannelGroup) {
option (google.api.http) = {
patch: "/v1alpha/{channel_group.name=properties/*/channelGroups/*}"
body: "channel_group"
};
option (google.api.method_signature) = "channel_group,update_mask";
}

// Deletes a ChannelGroup on a property.
rpc DeleteChannelGroup(DeleteChannelGroupRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1alpha/{name=properties/*/channelGroups/*}"
};
option (google.api.method_signature) = "name";
}

// Sets the opt out status for the automated GA4 setup process for a UA
// property.
// Note: this has no effect on GA4 property.
Expand Down Expand Up @@ -1184,6 +1229,15 @@ service AnalyticsAdminService {
body: "*"
};
}

// Given a specified UA property, looks up the GA4 property connected to it.
// Note: this cannot be used with GA4 properties.
rpc FetchConnectedGa4Property(FetchConnectedGa4PropertyRequest)
returns (FetchConnectedGa4PropertyResponse) {
option (google.api.http) = {
get: "/v1alpha/properties:fetchConnectedGa4Property"
};
}
}

// The request for a Data Access Record Report.
Expand Down Expand Up @@ -3065,7 +3119,7 @@ message DeleteExpandedDataSetRequest {

// Request message for GetExpandedDataSet RPC.
message GetExpandedDataSetRequest {
// Required. The name of the Audience to get.
// Required. The name of the ExpandedDataSet to get.
// Example format: properties/1234/expandedDataSets/5678
string name = 1 [
(google.api.field_behavior) = REQUIRED,
Expand Down Expand Up @@ -3109,6 +3163,95 @@ message ListExpandedDataSetsResponse {
string next_page_token = 2;
}

// Request message for CreateChannelGroup RPC.
message CreateChannelGroupRequest {
// Required. The property for which to create a ChannelGroup.
// Example format: properties/1234
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "analyticsadmin.googleapis.com/ChannelGroup"
}
];

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

// Request message for UpdateChannelGroup RPC.
message UpdateChannelGroupRequest {
// Required. The ChannelGroup to update.
// The resource's `name` field is used to identify the ChannelGroup to be
// updated.
ChannelGroup channel_group = 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 DeleteChannelGroup RPC.
message DeleteChannelGroupRequest {
// Required. The ChannelGroup to delete.
// Example format: properties/1234/channelGroups/5678
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "analyticsadmin.googleapis.com/ChannelGroup"
}
];
}

// Request message for GetChannelGroup RPC.
message GetChannelGroupRequest {
// Required. The ChannelGroup to get.
// Example format: properties/1234/channelGroups/5678
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "analyticsadmin.googleapis.com/ChannelGroup"
}
];
}

// Request message for ListChannelGroups RPC.
message ListChannelGroupsRequest {
// Required. The property for which to list ChannelGroups.
// Example format: properties/1234
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "analyticsadmin.googleapis.com/ChannelGroup"
}
];

// 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 `ListChannelGroups` call. Provide
// this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `ListChannelGroups`
// must match the call that provided the page token.
string page_token = 3;
}

// Response message for ListChannelGroups RPC.
message ListChannelGroupsResponse {
// List of ChannelGroup. These will be ordered stably, but in an arbitrary
// order.
repeated ChannelGroup channel_groups = 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 setting the opt out status for the automated GA4 setup process.
message SetAutomatedGa4ConfigurationOptOutRequest {
// Required. The UA property to set the opt out status. Note this request uses
Expand Down Expand Up @@ -3262,3 +3405,29 @@ message ListConnectedSiteTagsResponse {
// connected site tags will be returned.
repeated ConnectedSiteTag connected_site_tags = 1;
}

// 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.
// Note this request uses the
// internal property ID, not the tracking ID of the form UA-XXXXXX-YY.
// Format: properties/{internal_web_property_id}
// Example: properties/1234
string property = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "analyticsadmin.googleapis.com/Property"
}
];
}

// Response for looking up GA4 property connected to a UA property.
message FetchConnectedGa4PropertyResponse {
// The GA4 property connected to the UA property. An empty string is returned
// when there is no connected GA4 property.
// Format: properties/{property_id}
// Example: properties/1234
string property = 1 [(google.api.resource_reference) = {
type: "analyticsadmin.googleapis.com/Property"
}];
}
25 changes: 15 additions & 10 deletions google/analytics/admin/v1alpha/analyticsadmin_v1alpha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ authentication:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.FetchConnectedGa4Property
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.GetAccessBinding
oauth:
canonical_scopes: |-
Expand All @@ -97,6 +102,11 @@ authentication:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.GetChannelGroup
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.GetConversionEvent
oauth:
canonical_scopes: |-
Expand Down Expand Up @@ -202,6 +212,11 @@ authentication:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.ListChannelGroups
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.edit,
https://www.googleapis.com/auth/analytics.readonly
- selector: google.analytics.admin.v1alpha.AnalyticsAdminService.ListConnectedSiteTags
oauth:
canonical_scopes: |-
Expand Down Expand Up @@ -285,13 +300,3 @@ authentication:
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics.manage.users
publishing:
organization: CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED
new_issue_uri: ''
documentation_uri: ''
api_short_name: ''
github_label: ''
doc_tag_prefix: ''
codeowner_github_teams:
library_settings:
Loading

0 comments on commit 893a25b

Please sign in to comment.