Skip to content

Commit

Permalink
feat: added overrides_by_request_protocol to backend.proto
Browse files Browse the repository at this point in the history
feat: added field proto_reference_documentation_uri to proto reference documentation.
feat: added SERVICE_NOT_VISIBLE and GCP_SUSPENDED into error reason

PiperOrigin-RevId: 517437454
  • Loading branch information
Google APIs authored and copybara-github committed Mar 17, 2023
1 parent 8c36220 commit ecb1cf0
Show file tree
Hide file tree
Showing 30 changed files with 158 additions and 88 deletions.
5 changes: 3 additions & 2 deletions google/api/auth.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,7 +62,8 @@ message Authentication {
message AuthenticationRule {
// Selects the methods to which this rule applies.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
// Refer to [selector][google.api.DocumentationRule.selector] for syntax
// details.
string selector = 1;

// The requirements for OAuth credentials.
Expand Down
8 changes: 6 additions & 2 deletions google/api/backend.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -91,7 +91,8 @@ message BackendRule {

// Selects the methods to which this rule applies.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
// Refer to [selector][google.api.DocumentationRule.selector] for syntax
// details.
string selector = 1;

// The address of the API backend.
Expand Down Expand Up @@ -178,4 +179,7 @@ message BackendRule {
// https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
// for more details on the supported values.
string protocol = 9;

// The map between request protocol and the backend address.
map<string, BackendRule> overrides_by_request_protocol = 10;
}
8 changes: 5 additions & 3 deletions google/api/billing.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -59,11 +59,13 @@ message Billing {
// bill against consumer project).
message BillingDestination {
// The monitored resource type. The type must be defined in
// [Service.monitored_resources][google.api.Service.monitored_resources] section.
// [Service.monitored_resources][google.api.Service.monitored_resources]
// section.
string monitored_resource = 1;

// Names of the metrics to report to this billing destination.
// Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
// Each name must be defined in
// [Service.metrics][google.api.Service.metrics] section.
repeated string metrics = 2;
}

Expand Down
14 changes: 10 additions & 4 deletions google/api/client.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -112,7 +112,9 @@ message CommonLanguageSettings {

// Details about how and where to publish client libraries.
message ClientLibrarySettings {
// Version of the API to apply these settings to.
// Version of the API to apply these settings to. This is the full protobuf
// package for the API, ending in the version element.
// Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
string version = 1;

// Launch stage of this version of the API.
Expand Down Expand Up @@ -186,6 +188,10 @@ message Publishing {
// times in this list, then the last one wins. Settings from earlier
// settings with the same version string are discarded.
repeated ClientLibrarySettings library_settings = 109;

// Optional link to proto reference documentation. Example:
// https://cloud.google.com/pubsub/lite/docs/reference/rpc
string proto_reference_documentation_uri = 110;
}

// Settings for Java client libraries.
Expand Down Expand Up @@ -302,8 +308,8 @@ message MethodSettings {
// Example of a YAML configuration::
//
// publishing:
// method_behavior:
// - selector: CreateAdDomain
// method_settings:
// - selector: google.cloud.speech.v2.Speech.BatchRecognize
// long_running:
// initial_poll_delay:
// seconds: 60 # 1 minute
Expand Down
2 changes: 1 addition & 1 deletion google/api/config_change.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
5 changes: 3 additions & 2 deletions google/api/context.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -70,7 +70,8 @@ message Context {
message ContextRule {
// Selects the methods to which this rule applies.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
// Refer to [selector][google.api.DocumentationRule.selector] for syntax
// details.
string selector = 1;

// A list of full type names of requested contexts.
Expand Down
2 changes: 1 addition & 1 deletion google/api/control.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion google/api/distribution.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion google/api/documentation.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion google/api/endpoint.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
37 changes: 36 additions & 1 deletion google/api/error_reason.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -532,4 +532,39 @@ enum ErrorReason {
// }
// }
ORG_RESTRICTION_HEADER_INVALID = 28;

// Unimplemented. Do not use.
//
// The request is calling a service that is not visible to the consumer.
//
// Example of an ErrorInfo when the consumer "projects/123" contacting
// "pubsub.googleapis.com" service which is not visible to the consumer.
//
// { "reason": "SERVICE_NOT_VISIBLE",
// "domain": "googleapis.com",
// "metadata": {
// "consumer": "projects/123",
// "service": "pubsub.googleapis.com"
// }
// }
//
// This response indicates the "pubsub.googleapis.com" is not visible to
// "projects/123" (or it may not exist).
SERVICE_NOT_VISIBLE = 29;

// The request is related to a project for which GCP access is suspended.
//
// Example of an ErrorInfo when the consumer "projects/123" fails to contact
// "pubsub.googleapis.com" service because GCP access is suspended:
//
// { "reason": "GCP_SUSPENDED",
// "domain": "googleapis.com",
// "metadata": {
// "consumer": "projects/123",
// "service": "pubsub.googleapis.com"
// }
// }
//
// This response indicates the associated GCP account has been suspended.
GCP_SUSPENDED = 30;
}
2 changes: 1 addition & 1 deletion google/api/field_behavior.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
14 changes: 9 additions & 5 deletions google/api/http.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -210,15 +210,18 @@ message Http {
// 1. Leaf request fields (recursive expansion nested messages in the request
// message) are classified into three categories:
// - Fields referred by the path template. They are passed via the URL path.
// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP
// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
// are passed via the HTTP
// request body.
// - All other fields are passed via the URL query parameters, and the
// parameter name is the field path in the request message. A repeated
// field can be represented as multiple query parameters under the same
// name.
// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields
// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
// query parameter, all fields
// are passed via URL path and HTTP request body.
// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all
// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
// request body, all
// fields are passed via URL path and URL query parameters.
//
// ### Path template syntax
Expand Down Expand Up @@ -313,7 +316,8 @@ message Http {
message HttpRule {
// Selects a method to which this rule applies.
//
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
// Refer to [selector][google.api.DocumentationRule.selector] for syntax
// details.
string selector = 1;

// Determines the URL pattern is matched by this rules. This pattern can be
Expand Down
2 changes: 1 addition & 1 deletion google/api/httpbody.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion google/api/label.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion google/api/launch_stage.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion google/api/log.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
11 changes: 6 additions & 5 deletions google/api/logging.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -56,13 +56,14 @@ message Logging {
// or the consumer project).
message LoggingDestination {
// The monitored resource type. The type must be defined in the
// [Service.monitored_resources][google.api.Service.monitored_resources] section.
// [Service.monitored_resources][google.api.Service.monitored_resources]
// section.
string monitored_resource = 3;

// Names of the logs to be sent to this destination. Each name must
// be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
// not a domain scoped name, it will be automatically prefixed with
// the service name followed by "/".
// be defined in the [Service.logs][google.api.Service.logs] section. If the
// log name is not a domain scoped name, it will be automatically prefixed
// with the service name followed by "/".
repeated string logs = 1;
}

Expand Down
18 changes: 11 additions & 7 deletions google/api/metric.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -80,7 +80,9 @@ message MetricDescriptor {

// Additional annotations that can be used to guide the usage of a metric.
message MetricDescriptorMetadata {
// Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
// Deprecated. Must use the
// [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
// instead.
LaunchStage launch_stage = 1 [deprecated = true];

// The sampling period of metric data points. For metrics which are written
Expand Down Expand Up @@ -245,17 +247,19 @@ message MetricDescriptor {

// Read-only. If present, then a [time
// series][google.monitoring.v3.TimeSeries], which is identified partially by
// a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
// with this metric type can only be associated with one of the monitored
// resource types listed here.
// a metric type and a
// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
// is associated with this metric type can only be associated with one of the
// monitored resource types listed here.
repeated string monitored_resource_types = 13;
}

// A specific metric, identified by specifying values for all of the
// labels of a [`MetricDescriptor`][google.api.MetricDescriptor].
message Metric {
// An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor].
// For example, `custom.googleapis.com/invoice/paid/amount`.
// An existing metric type, see
// [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example,
// `custom.googleapis.com/invoice/paid/amount`.
string type = 3;

// The set of label values that uniquely identify this metric. All
Expand Down
Loading

0 comments on commit ecb1cf0

Please sign in to comment.