feat: added GetMetadata method for metadata including custom dimensions and metrics.
PiperOrigin-RevId: 338118656
This commit is contained in:
parent
34c5a5c513
commit
7e400b0d3a
|
|
@ -1,84 +0,0 @@
|
|||
// Copyright 2020 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.gapic.metadata;
|
||||
|
||||
// Metadata about a GAPIC library for a specific combination of API, version, and
|
||||
// computer language.
|
||||
message GapicMetadata {
|
||||
// Schema version of this proto. Current value: 1.0
|
||||
string schema = 1;
|
||||
|
||||
// Any human-readable comments to be included in this file.
|
||||
string comment = 2;
|
||||
|
||||
// Computer language of this generated language. This must be
|
||||
// spelled out as it spoken in English, with no capitalization or
|
||||
// separators (e.g. "csharp", "nodejs").
|
||||
string language = 3;
|
||||
|
||||
// The proto package containing the API definition for which this
|
||||
// GAPIC library was generated.
|
||||
string proto_package = 4;
|
||||
|
||||
// The language-specific library package for this GAPIC library.
|
||||
string library_package = 5;
|
||||
|
||||
// A map from each proto-defined service to ServiceForTransports,
|
||||
// which allows listing information about transport-specific
|
||||
// implementations of the service.
|
||||
//
|
||||
// The key is the name of the service as it appears in the .proto
|
||||
// file.
|
||||
map<string, ServiceForTransport> services = 6;
|
||||
|
||||
// A map from a transport name to ServiceAsClient, which allows
|
||||
// listing information about the client objects that implement the
|
||||
// parent RPC service for the specified transport.
|
||||
//
|
||||
// The key name is the transport, lower-cased with no separators
|
||||
// (e.g. "grpc", "rest").
|
||||
message ServiceForTransport {
|
||||
map<string, ServiceAsClient> clients = 1;
|
||||
}
|
||||
|
||||
// Information about a specific client implementing a proto-defined service.
|
||||
message ServiceAsClient {
|
||||
// The name of the library client formatted as it appears in the source code
|
||||
string library_client = 1;
|
||||
|
||||
// A mapping from each proto-defined RPC name to the the list of
|
||||
// methods in library_client that implement it. There can be more
|
||||
// than one library_client method for each RPC. RPCs with no
|
||||
// library_client methods need not be included.
|
||||
//
|
||||
// The key name is the name of the RPC as defined and formated in
|
||||
// the proto file.
|
||||
map<string, MethodList> rpcs = 2;
|
||||
}
|
||||
|
||||
// List of GAPIC client methods implementing the proto-defined RPC
|
||||
// for the transport and service specified in the containing
|
||||
// structures.
|
||||
message MethodList {
|
||||
// List of methods for a specific proto-service client in the
|
||||
// GAPIC. These names should be formatted as they appear in the
|
||||
// source code.
|
||||
repeated string methods = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ proto_library(
|
|||
"//google/api:annotations_proto",
|
||||
"//google/api:client_proto",
|
||||
"//google/api:field_behavior_proto",
|
||||
"//google/api:resource_proto",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
@ -164,6 +165,7 @@ moved_proto_library(
|
|||
"//google/api:annotations_proto",
|
||||
"//google/api:client_proto",
|
||||
"//google/api:field_behavior_proto",
|
||||
"//google/api:resource_proto",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import "google/analytics/data/v1alpha/data.proto";
|
|||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
import "google/api/resource.proto";
|
||||
|
||||
option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data";
|
||||
option java_multiple_files = true;
|
||||
|
|
@ -88,6 +89,40 @@ service AlphaAnalyticsData {
|
|||
get: "/v1alpha/universalMetadata"
|
||||
};
|
||||
}
|
||||
|
||||
// Returns metadata for dimensions and metrics available in reporting methods.
|
||||
// Used to explore the dimensions and metrics. In this method, a Google
|
||||
// Analytics App + Web Property Identifier is specified in the request, and
|
||||
// the metadata response includes Custom dimensions and metrics as well as
|
||||
// Universal metadata.
|
||||
//
|
||||
// For example if a custom metric with parameter name `levels_unlocked` is
|
||||
// registered to a property, the Metadata response will contain
|
||||
// `customEvent:levels_unlocked`. Universal metadata are dimensions and
|
||||
// metrics applicable to any property such as `country` and `totalUsers`.
|
||||
rpc GetMetadata(GetMetadataRequest) returns (Metadata) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1alpha/{name=properties/*/metadata}"
|
||||
};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
}
|
||||
|
||||
// The dimensions and metrics currently accepted in reporting methods.
|
||||
message Metadata {
|
||||
option (google.api.resource) = {
|
||||
type: "analyticsdata.googleapis.com/Metadata"
|
||||
pattern: "properties/{property}/metadata"
|
||||
};
|
||||
|
||||
// Resource name of this metadata.
|
||||
string name = 3;
|
||||
|
||||
// The dimensions descriptions.
|
||||
repeated DimensionMetadata dimensions = 1;
|
||||
|
||||
// The metric descriptions.
|
||||
repeated MetricMetadata metrics = 2;
|
||||
}
|
||||
|
||||
// The request to generate a report.
|
||||
|
|
@ -353,3 +388,18 @@ message UniversalMetadata {
|
|||
// The metric descriptions.
|
||||
repeated MetricMetadata metrics = 2;
|
||||
}
|
||||
|
||||
// Request for a property's dimension and metric metadata.
|
||||
message GetMetadataRequest {
|
||||
// Required. The resource name of the metadata to retrieve. This name field is
|
||||
// specified in the URL path and not URL parameters. Property is a numeric
|
||||
// Google Analytics App + Web Property identifier.
|
||||
//
|
||||
// Example: properties/1234/metadata
|
||||
string name = 1 [
|
||||
(google.api.field_behavior) = REQUIRED,
|
||||
(google.api.resource_reference) = {
|
||||
type: "analyticsdata.googleapis.com/Metadata"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -674,6 +674,30 @@ enum MetricType {
|
|||
// A duration of seconds; a special floating point type.
|
||||
TYPE_SECONDS = 4;
|
||||
|
||||
// A duration in milliseconds; a special floating point type.
|
||||
TYPE_MILLISECONDS = 5;
|
||||
|
||||
// A duration in minutes; a special floating point type.
|
||||
TYPE_MINUTES = 6;
|
||||
|
||||
// A duration in hours; a special floating point type.
|
||||
TYPE_HOURS = 7;
|
||||
|
||||
// A custom metric of standard type; a special floating point type.
|
||||
TYPE_STANDARD = 8;
|
||||
|
||||
// An amount of money; a special floating point type.
|
||||
TYPE_CURRENCY = 9;
|
||||
|
||||
// A length in feet; a special floating point type.
|
||||
TYPE_FEET = 10;
|
||||
|
||||
// A length in miles; a special floating point type.
|
||||
TYPE_MILES = 11;
|
||||
|
||||
// A length in meters; a special floating point type.
|
||||
TYPE_METERS = 12;
|
||||
|
||||
// A length in kilometers; a special floating point type.
|
||||
TYPE_KILOMETERS = 13;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue