diff --git a/packages/googleapis-common-protos/.github/.OwlBot.lock.yaml b/packages/googleapis-common-protos/.github/.OwlBot.lock.yaml index fccaa8e84449..889f77dfa25d 100644 --- a/packages/googleapis-common-protos/.github/.OwlBot.lock.yaml +++ b/packages/googleapis-common-protos/.github/.OwlBot.lock.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 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. @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:3bf87e47c2173d7eed42714589dc4da2c07c3268610f1e47f8e1a30decbfc7f1 + digest: sha256:c43f1d918bcf817d337aa29ff833439494a158a0831508fda4ec75dc4c0d0320 diff --git a/packages/googleapis-common-protos/.kokoro/samples/python3.11/common.cfg b/packages/googleapis-common-protos/.kokoro/samples/python3.11/common.cfg new file mode 100644 index 000000000000..d65e7403ab9a --- /dev/null +++ b/packages/googleapis-common-protos/.kokoro/samples/python3.11/common.cfg @@ -0,0 +1,40 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.11" +} + +# Declare build specific Cloud project. +env_vars: { + key: "BUILD_SPECIFIC_GCLOUD_PROJECT" + value: "python-docs-samples-tests-311" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-api-common-protos/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-api-common-protos/.kokoro/trampoline_v2.sh" \ No newline at end of file diff --git a/packages/googleapis-common-protos/.kokoro/samples/python3.11/continuous.cfg b/packages/googleapis-common-protos/.kokoro/samples/python3.11/continuous.cfg new file mode 100644 index 000000000000..a1c8d9759c88 --- /dev/null +++ b/packages/googleapis-common-protos/.kokoro/samples/python3.11/continuous.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/packages/googleapis-common-protos/.kokoro/samples/python3.11/periodic-head.cfg b/packages/googleapis-common-protos/.kokoro/samples/python3.11/periodic-head.cfg new file mode 100644 index 000000000000..4b0b0711955f --- /dev/null +++ b/packages/googleapis-common-protos/.kokoro/samples/python3.11/periodic-head.cfg @@ -0,0 +1,11 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-api-common-protos/.kokoro/test-samples-against-head.sh" +} diff --git a/packages/googleapis-common-protos/.kokoro/samples/python3.11/periodic.cfg b/packages/googleapis-common-protos/.kokoro/samples/python3.11/periodic.cfg new file mode 100644 index 000000000000..71cd1e597e38 --- /dev/null +++ b/packages/googleapis-common-protos/.kokoro/samples/python3.11/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} diff --git a/packages/googleapis-common-protos/.kokoro/samples/python3.11/presubmit.cfg b/packages/googleapis-common-protos/.kokoro/samples/python3.11/presubmit.cfg new file mode 100644 index 000000000000..a1c8d9759c88 --- /dev/null +++ b/packages/googleapis-common-protos/.kokoro/samples/python3.11/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/packages/googleapis-common-protos/google/rpc/code.proto b/packages/googleapis-common-protos/google/rpc/code.proto index 98ae0ac18fbf..7c810af40f08 100644 --- a/packages/googleapis-common-protos/google/rpc/code.proto +++ b/packages/googleapis-common-protos/google/rpc/code.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ option objc_class_prefix = "RPC"; // `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. // Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. enum Code { - // Not an error; returned on success + // Not an error; returned on success. // // HTTP Mapping: 200 OK OK = 0; @@ -69,7 +69,7 @@ enum Code { // Some requested entity (e.g., file or directory) was not found. // // Note to server developers: if a request is denied for an entire class - // of users, such as gradual feature rollout or undocumented whitelist, + // of users, such as gradual feature rollout or undocumented allowlist, // `NOT_FOUND` may be used. If a request is denied for some users within // a class of users, such as user-based access control, `PERMISSION_DENIED` // must be used. @@ -115,11 +115,11 @@ enum Code { // Service implementors can use the following guidelines to decide // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: // (a) Use `UNAVAILABLE` if the client can retry just the failing call. - // (b) Use `ABORTED` if the client should retry at a higher level - // (e.g., when a client-specified test-and-set fails, indicating the - // client should restart a read-modify-write sequence). + // (b) Use `ABORTED` if the client should retry at a higher level. For + // example, when a client-specified test-and-set fails, indicating the + // client should restart a read-modify-write sequence. // (c) Use `FAILED_PRECONDITION` if the client should not retry until - // the system state has been explicitly fixed. E.g., if an "rmdir" + // the system state has been explicitly fixed. For example, if an "rmdir" // fails because the directory is non-empty, `FAILED_PRECONDITION` // should be returned since the client should not retry unless // the files are deleted from the directory. diff --git a/packages/googleapis-common-protos/google/rpc/context/attribute_context.proto b/packages/googleapis-common-protos/google/rpc/context/attribute_context.proto index 30fe6f25ab1d..ef9242e40064 100644 --- a/packages/googleapis-common-protos/google/rpc/context/attribute_context.proto +++ b/packages/googleapis-common-protos/google/rpc/context/attribute_context.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -61,7 +61,7 @@ message AttributeContext { // The identity of this peer. Similar to `Request.auth.principal`, but // relative to the peer instead of the request. For example, the - // idenity associated with a load balancer that forwared the request. + // identity associated with a load balancer that forwarded the request. string principal = 7; // The CLDR country/region code associated with the above IP address. @@ -170,7 +170,7 @@ message AttributeContext { // lowercased, because HTTP header keys are case-insensitive. map headers = 3; - // The HTTP URL path. + // The HTTP URL path, excluding the query parameters. string path = 4; // The HTTP request `Host` header value. @@ -223,7 +223,7 @@ message AttributeContext { // the response. google.protobuf.Timestamp time = 4; - // The length of time it takes the backend service to fully respond to a + // The amount of time it takes the backend service to fully respond to a // request. Measured from when the destination service starts to send the // request to the backend until when the destination service receives the // complete response from the backend. @@ -256,7 +256,8 @@ message AttributeContext { // The type of the resource. The syntax is platform-specific because // different platforms define their resources differently. // - // For Google APIs, the type format must be "{service}/{kind}". + // For Google APIs, the type format must be "{service}/{kind}", such as + // "pubsub.googleapis.com/Topic". string type = 3; // The labels or tags on the resource, such as AWS resource tags and diff --git a/packages/googleapis-common-protos/google/rpc/context/audit_context.proto b/packages/googleapis-common-protos/google/rpc/context/audit_context.proto new file mode 100644 index 000000000000..7b8b7051f4c1 --- /dev/null +++ b/packages/googleapis-common-protos/google/rpc/context/audit_context.proto @@ -0,0 +1,49 @@ +// Copyright 2022 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.rpc.context; + +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/rpc/context;context"; +option java_multiple_files = true; +option java_outer_classname = "AuditContextProto"; +option java_package = "com.google.rpc.context"; + +// `AuditContext` provides information that is needed for audit logging. +message AuditContext { + // Serialized audit log. + bytes audit_log = 1; + + // An API request message that is scrubbed based on the method annotation. + // This field should only be filled if audit_log field is present. + // Service Control will use this to assemble a complete log for Cloud Audit + // Logs and Google internal audit logs. + google.protobuf.Struct scrubbed_request = 2; + + // An API response message that is scrubbed based on the method annotation. + // This field should only be filled if audit_log field is present. + // Service Control will use this to assemble a complete log for Cloud Audit + // Logs and Google internal audit logs. + google.protobuf.Struct scrubbed_response = 3; + + // Number of scrubbed response items. + int32 scrubbed_response_item_count = 4; + + // Audit resource name which is scrubbed. + string target_resource = 5; +} diff --git a/packages/googleapis-common-protos/google/rpc/context/audit_context_pb2.py b/packages/googleapis-common-protos/google/rpc/context/audit_context_pb2.py new file mode 100644 index 000000000000..96ba00f70db0 --- /dev/null +++ b/packages/googleapis-common-protos/google/rpc/context/audit_context_pb2.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- + +# 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. + +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/rpc/context/audit_context.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\n&google/rpc/context/audit_context.proto\x12\x12google.rpc.context\x1a\x1cgoogle/protobuf/struct.proto"\xc7\x01\n\x0c\x41uditContext\x12\x11\n\taudit_log\x18\x01 \x01(\x0c\x12\x31\n\x10scrubbed_request\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x32\n\x11scrubbed_response\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12$\n\x1cscrubbed_response_item_count\x18\x04 \x01(\x05\x12\x17\n\x0ftarget_resource\x18\x05 \x01(\tBk\n\x16\x63om.google.rpc.contextB\x11\x41uditContextProtoP\x01Z9google.golang.org/genproto/googleapis/rpc/context;context\xf8\x01\x01\x62\x06proto3' +) + + +_AUDITCONTEXT = DESCRIPTOR.message_types_by_name["AuditContext"] +AuditContext = _reflection.GeneratedProtocolMessageType( + "AuditContext", + (_message.Message,), + { + "DESCRIPTOR": _AUDITCONTEXT, + "__module__": "google.rpc.context.audit_context_pb2" + # @@protoc_insertion_point(class_scope:google.rpc.context.AuditContext) + }, +) +_sym_db.RegisterMessage(AuditContext) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b"\n\026com.google.rpc.contextB\021AuditContextProtoP\001Z9google.golang.org/genproto/googleapis/rpc/context;context\370\001\001" + _AUDITCONTEXT._serialized_start = 93 + _AUDITCONTEXT._serialized_end = 292 +# @@protoc_insertion_point(module_scope) diff --git a/packages/googleapis-common-protos/google/rpc/error_details.proto b/packages/googleapis-common-protos/google/rpc/error_details.proto index c4d6c4b78c60..c489e83142ab 100644 --- a/packages/googleapis-common-protos/google/rpc/error_details.proto +++ b/packages/googleapis-common-protos/google/rpc/error_details.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,6 +24,57 @@ option java_outer_classname = "ErrorDetailsProto"; option java_package = "com.google.rpc"; option objc_class_prefix = "RPC"; +// Describes the cause of the error with structured details. +// +// Example of an error when contacting the "pubsub.googleapis.com" API when it +// is not enabled: +// +// { "reason": "API_DISABLED" +// "domain": "googleapis.com" +// "metadata": { +// "resource": "projects/123", +// "service": "pubsub.googleapis.com" +// } +// } +// +// This response indicates that the pubsub.googleapis.com API is not enabled. +// +// Example of an error that is returned when attempting to create a Spanner +// instance in a region that is out of stock: +// +// { "reason": "STOCKOUT" +// "domain": "spanner.googleapis.com", +// "metadata": { +// "availableRegions": "us-central1,us-east2" +// } +// } +message ErrorInfo { + // The reason of the error. This is a constant value that identifies the + // proximate cause of the error. Error reasons are unique within a particular + // domain of errors. This should be at most 63 characters and match a + // regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents + // UPPER_SNAKE_CASE. + string reason = 1; + + // The logical grouping to which the "reason" belongs. The error domain + // is typically the registered service name of the tool or product that + // generates the error. Example: "pubsub.googleapis.com". If the error is + // generated by some common infrastructure, the error domain must be a + // globally unique value that identifies the infrastructure. For Google API + // infrastructure, the error domain is "googleapis.com". + string domain = 2; + + // Additional structured details about this error. + // + // Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in + // length. When identifying the current value of an exceeded limit, the units + // should be contained in the key, not the value. For example, rather than + // {"instanceLimit": "100/request"}, should be returned as, + // {"instanceLimitPerRequest": "100"}, if the client exceeds the number of + // instances that can be created in a single (batch) request. + map metadata = 3; +} + // Describes when the clients can retry a failed request. Clients could ignore // the recommendation here or retry when this information is missing from error // responses. @@ -85,56 +136,6 @@ message QuotaFailure { repeated Violation violations = 1; } -// Describes the cause of the error with structured details. -// -// Example of an error when contacting the "pubsub.googleapis.com" API when it -// is not enabled: -// -// { "reason": "API_DISABLED" -// "domain": "googleapis.com" -// "metadata": { -// "resource": "projects/123", -// "service": "pubsub.googleapis.com" -// } -// } -// -// This response indicates that the pubsub.googleapis.com API is not enabled. -// -// Example of an error that is returned when attempting to create a Spanner -// instance in a region that is out of stock: -// -// { "reason": "STOCKOUT" -// "domain": "spanner.googleapis.com", -// "metadata": { -// "availableRegions": "us-central1,us-east2" -// } -// } -message ErrorInfo { - // The reason of the error. This is a constant value that identifies the - // proximate cause of the error. Error reasons are unique within a particular - // domain of errors. This should be at most 63 characters and match - // /[A-Z0-9_]+/. - string reason = 1; - - // The logical grouping to which the "reason" belongs. The error domain - // is typically the registered service name of the tool or product that - // generates the error. Example: "pubsub.googleapis.com". If the error is - // generated by some common infrastructure, the error domain must be a - // globally unique value that identifies the infrastructure. For Google API - // infrastructure, the error domain is "googleapis.com". - string domain = 2; - - // Additional structured details about this error. - // - // Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in - // length. When identifying the current value of an exceeded limit, the units - // should be contained in the key, not the value. For example, rather than - // {"instanceLimit": "100/request"}, should be returned as, - // {"instanceLimitPerRequest": "100"}, if the client exceeds the number of - // instances that can be created in a single (batch) request. - map metadata = 3; -} - // Describes what preconditions have failed. // // For example, if an RPC failed because it required the Terms of Service to be @@ -169,9 +170,43 @@ message PreconditionFailure { message BadRequest { // A message type used to describe a single bad request field. message FieldViolation { - // A path leading to a field in the request body. The value will be a + // A path that leads to a field in the request body. The value will be a // sequence of dot-separated identifiers that identify a protocol buffer - // field. E.g., "field_violations.field" would identify this field. + // field. + // + // Consider the following: + // + // message CreateContactRequest { + // message EmailAddress { + // enum Type { + // TYPE_UNSPECIFIED = 0; + // HOME = 1; + // WORK = 2; + // } + // + // optional string email = 1; + // repeated EmailType type = 2; + // } + // + // string full_name = 1; + // repeated EmailAddress email_addresses = 2; + // } + // + // In this example, in proto `field` could take one of the following values: + // + // * `full_name` for a violation in the `full_name` value + // * `email_addresses[1].email` for a violation in the `email` field of the + // first `email_addresses` message + // * `email_addresses[3].type[2]` for a violation in the second `type` + // value in the third `email_addresses` message. + // + // In JSON, the same values are represented as: + // + // * `fullName` for a violation in the `fullName` value + // * `emailAddresses[1].email` for a violation in the `email` field of the + // first `emailAddresses` message + // * `emailAddresses[3].type[2]` for a violation in the second `type` + // value in the third `emailAddresses` message. string field = 1; // A description of why the request element is bad. @@ -203,7 +238,8 @@ message ResourceInfo { // The name of the resource being accessed. For example, a shared calendar // name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current - // error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. + // error is + // [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. string resource_name = 2; // The owner of the resource (optional). @@ -240,7 +276,7 @@ message Help { // which can be attached to an RPC error. message LocalizedMessage { // The locale used following the specification defined at - // http://www.rfc-editor.org/rfc/bcp/bcp47.txt. + // https://www.rfc-editor.org/rfc/bcp/bcp47.txt. // Examples are: "en-US", "fr-CH", "es-MX" string locale = 1; diff --git a/packages/googleapis-common-protos/google/rpc/error_details_pb2.py b/packages/googleapis-common-protos/google/rpc/error_details_pb2.py index d6f5d8092f56..e9f26f5a6242 100644 --- a/packages/googleapis-common-protos/google/rpc/error_details_pb2.py +++ b/packages/googleapis-common-protos/google/rpc/error_details_pb2.py @@ -32,16 +32,16 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x1egoogle/rpc/error_details.proto\x12\ngoogle.rpc\x1a\x1egoogle/protobuf/duration.proto";\n\tRetryInfo\x12.\n\x0bretry_delay\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration"2\n\tDebugInfo\x12\x15\n\rstack_entries\x18\x01 \x03(\t\x12\x0e\n\x06\x64\x65tail\x18\x02 \x01(\t"y\n\x0cQuotaFailure\x12\x36\n\nviolations\x18\x01 \x03(\x0b\x32".google.rpc.QuotaFailure.Violation\x1a\x31\n\tViolation\x12\x0f\n\x07subject\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t"\x93\x01\n\tErrorInfo\x12\x0e\n\x06reason\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\x35\n\x08metadata\x18\x03 \x03(\x0b\x32#.google.rpc.ErrorInfo.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\x95\x01\n\x13PreconditionFailure\x12=\n\nviolations\x18\x01 \x03(\x0b\x32).google.rpc.PreconditionFailure.Violation\x1a?\n\tViolation\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07subject\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t"\x83\x01\n\nBadRequest\x12?\n\x10\x66ield_violations\x18\x01 \x03(\x0b\x32%.google.rpc.BadRequest.FieldViolation\x1a\x34\n\x0e\x46ieldViolation\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t"7\n\x0bRequestInfo\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x14\n\x0cserving_data\x18\x02 \x01(\t"`\n\x0cResourceInfo\x12\x15\n\rresource_type\x18\x01 \x01(\t\x12\x15\n\rresource_name\x18\x02 \x01(\t\x12\r\n\x05owner\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t"V\n\x04Help\x12$\n\x05links\x18\x01 \x03(\x0b\x32\x15.google.rpc.Help.Link\x1a(\n\x04Link\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t"3\n\x10LocalizedMessage\x12\x0e\n\x06locale\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\tBl\n\x0e\x63om.google.rpcB\x11\x45rrorDetailsProtoP\x01Z?google.golang.org/genproto/googleapis/rpc/errdetails;errdetails\xa2\x02\x03RPCb\x06proto3' + b'\n\x1egoogle/rpc/error_details.proto\x12\ngoogle.rpc\x1a\x1egoogle/protobuf/duration.proto"\x93\x01\n\tErrorInfo\x12\x0e\n\x06reason\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\x35\n\x08metadata\x18\x03 \x03(\x0b\x32#.google.rpc.ErrorInfo.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01";\n\tRetryInfo\x12.\n\x0bretry_delay\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration"2\n\tDebugInfo\x12\x15\n\rstack_entries\x18\x01 \x03(\t\x12\x0e\n\x06\x64\x65tail\x18\x02 \x01(\t"y\n\x0cQuotaFailure\x12\x36\n\nviolations\x18\x01 \x03(\x0b\x32".google.rpc.QuotaFailure.Violation\x1a\x31\n\tViolation\x12\x0f\n\x07subject\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t"\x95\x01\n\x13PreconditionFailure\x12=\n\nviolations\x18\x01 \x03(\x0b\x32).google.rpc.PreconditionFailure.Violation\x1a?\n\tViolation\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07subject\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t"\x83\x01\n\nBadRequest\x12?\n\x10\x66ield_violations\x18\x01 \x03(\x0b\x32%.google.rpc.BadRequest.FieldViolation\x1a\x34\n\x0e\x46ieldViolation\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t"7\n\x0bRequestInfo\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x14\n\x0cserving_data\x18\x02 \x01(\t"`\n\x0cResourceInfo\x12\x15\n\rresource_type\x18\x01 \x01(\t\x12\x15\n\rresource_name\x18\x02 \x01(\t\x12\r\n\x05owner\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t"V\n\x04Help\x12$\n\x05links\x18\x01 \x03(\x0b\x32\x15.google.rpc.Help.Link\x1a(\n\x04Link\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t"3\n\x10LocalizedMessage\x12\x0e\n\x06locale\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\tBl\n\x0e\x63om.google.rpcB\x11\x45rrorDetailsProtoP\x01Z?google.golang.org/genproto/googleapis/rpc/errdetails;errdetails\xa2\x02\x03RPCb\x06proto3' ) +_ERRORINFO = DESCRIPTOR.message_types_by_name["ErrorInfo"] +_ERRORINFO_METADATAENTRY = _ERRORINFO.nested_types_by_name["MetadataEntry"] _RETRYINFO = DESCRIPTOR.message_types_by_name["RetryInfo"] _DEBUGINFO = DESCRIPTOR.message_types_by_name["DebugInfo"] _QUOTAFAILURE = DESCRIPTOR.message_types_by_name["QuotaFailure"] _QUOTAFAILURE_VIOLATION = _QUOTAFAILURE.nested_types_by_name["Violation"] -_ERRORINFO = DESCRIPTOR.message_types_by_name["ErrorInfo"] -_ERRORINFO_METADATAENTRY = _ERRORINFO.nested_types_by_name["MetadataEntry"] _PRECONDITIONFAILURE = DESCRIPTOR.message_types_by_name["PreconditionFailure"] _PRECONDITIONFAILURE_VIOLATION = _PRECONDITIONFAILURE.nested_types_by_name["Violation"] _BADREQUEST = DESCRIPTOR.message_types_by_name["BadRequest"] @@ -51,6 +51,27 @@ _HELP = DESCRIPTOR.message_types_by_name["Help"] _HELP_LINK = _HELP.nested_types_by_name["Link"] _LOCALIZEDMESSAGE = DESCRIPTOR.message_types_by_name["LocalizedMessage"] +ErrorInfo = _reflection.GeneratedProtocolMessageType( + "ErrorInfo", + (_message.Message,), + { + "MetadataEntry": _reflection.GeneratedProtocolMessageType( + "MetadataEntry", + (_message.Message,), + { + "DESCRIPTOR": _ERRORINFO_METADATAENTRY, + "__module__": "google.rpc.error_details_pb2" + # @@protoc_insertion_point(class_scope:google.rpc.ErrorInfo.MetadataEntry) + }, + ), + "DESCRIPTOR": _ERRORINFO, + "__module__": "google.rpc.error_details_pb2" + # @@protoc_insertion_point(class_scope:google.rpc.ErrorInfo) + }, +) +_sym_db.RegisterMessage(ErrorInfo) +_sym_db.RegisterMessage(ErrorInfo.MetadataEntry) + RetryInfo = _reflection.GeneratedProtocolMessageType( "RetryInfo", (_message.Message,), @@ -94,27 +115,6 @@ _sym_db.RegisterMessage(QuotaFailure) _sym_db.RegisterMessage(QuotaFailure.Violation) -ErrorInfo = _reflection.GeneratedProtocolMessageType( - "ErrorInfo", - (_message.Message,), - { - "MetadataEntry": _reflection.GeneratedProtocolMessageType( - "MetadataEntry", - (_message.Message,), - { - "DESCRIPTOR": _ERRORINFO_METADATAENTRY, - "__module__": "google.rpc.error_details_pb2" - # @@protoc_insertion_point(class_scope:google.rpc.ErrorInfo.MetadataEntry) - }, - ), - "DESCRIPTOR": _ERRORINFO, - "__module__": "google.rpc.error_details_pb2" - # @@protoc_insertion_point(class_scope:google.rpc.ErrorInfo) - }, -) -_sym_db.RegisterMessage(ErrorInfo) -_sym_db.RegisterMessage(ErrorInfo.MetadataEntry) - PreconditionFailure = _reflection.GeneratedProtocolMessageType( "PreconditionFailure", (_message.Message,), @@ -217,18 +217,18 @@ DESCRIPTOR._serialized_options = b"\n\016com.google.rpcB\021ErrorDetailsProtoP\001Z?google.golang.org/genproto/googleapis/rpc/errdetails;errdetails\242\002\003RPC" _ERRORINFO_METADATAENTRY._options = None _ERRORINFO_METADATAENTRY._serialized_options = b"8\001" - _RETRYINFO._serialized_start = 78 - _RETRYINFO._serialized_end = 137 - _DEBUGINFO._serialized_start = 139 - _DEBUGINFO._serialized_end = 189 - _QUOTAFAILURE._serialized_start = 191 - _QUOTAFAILURE._serialized_end = 312 - _QUOTAFAILURE_VIOLATION._serialized_start = 263 - _QUOTAFAILURE_VIOLATION._serialized_end = 312 - _ERRORINFO._serialized_start = 315 - _ERRORINFO._serialized_end = 462 - _ERRORINFO_METADATAENTRY._serialized_start = 415 - _ERRORINFO_METADATAENTRY._serialized_end = 462 + _ERRORINFO._serialized_start = 79 + _ERRORINFO._serialized_end = 226 + _ERRORINFO_METADATAENTRY._serialized_start = 179 + _ERRORINFO_METADATAENTRY._serialized_end = 226 + _RETRYINFO._serialized_start = 228 + _RETRYINFO._serialized_end = 287 + _DEBUGINFO._serialized_start = 289 + _DEBUGINFO._serialized_end = 339 + _QUOTAFAILURE._serialized_start = 341 + _QUOTAFAILURE._serialized_end = 462 + _QUOTAFAILURE_VIOLATION._serialized_start = 413 + _QUOTAFAILURE_VIOLATION._serialized_end = 462 _PRECONDITIONFAILURE._serialized_start = 465 _PRECONDITIONFAILURE._serialized_end = 614 _PRECONDITIONFAILURE_VIOLATION._serialized_start = 551 diff --git a/packages/googleapis-common-protos/google/rpc/http.proto b/packages/googleapis-common-protos/google/rpc/http.proto new file mode 100644 index 000000000000..299a71fd0908 --- /dev/null +++ b/packages/googleapis-common-protos/google/rpc/http.proto @@ -0,0 +1,64 @@ +// Copyright 2022 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.rpc; + +option go_package = "google.golang.org/genproto/googleapis/rpc/http;http"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.rpc"; +option objc_class_prefix = "RPC"; + +// Represents an HTTP request. +message HttpRequest { + // The HTTP request method. + string method = 1; + + // The HTTP request URI. + string uri = 2; + + // The HTTP request headers. The ordering of the headers is significant. + // Multiple headers with the same key may present for the request. + repeated HttpHeader headers = 3; + + // The HTTP request body. If the body is not expected, it should be empty. + bytes body = 4; +} + +// Represents an HTTP response. +message HttpResponse { + // The HTTP status code, such as 200 or 404. + int32 status = 1; + + // The HTTP reason phrase, such as "OK" or "Not Found". + string reason = 2; + + // The HTTP response headers. The ordering of the headers is significant. + // Multiple headers with the same key may present for the response. + repeated HttpHeader headers = 3; + + // The HTTP response body. If the body is not expected, it should be empty. + bytes body = 4; +} + +// Represents an HTTP header. +message HttpHeader { + // The HTTP header key. It is case insensitive. + string key = 1; + + // The HTTP header value. + string value = 2; +} diff --git a/packages/googleapis-common-protos/google/rpc/http_pb2.py b/packages/googleapis-common-protos/google/rpc/http_pb2.py new file mode 100644 index 000000000000..71be9b7e4f10 --- /dev/null +++ b/packages/googleapis-common-protos/google/rpc/http_pb2.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +# 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. + +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/rpc/http.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\n\x15google/rpc/http.proto\x12\ngoogle.rpc"a\n\x0bHttpRequest\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\'\n\x07headers\x18\x03 \x03(\x0b\x32\x16.google.rpc.HttpHeader\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c"e\n\x0cHttpResponse\x12\x0e\n\x06status\x18\x01 \x01(\x05\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\'\n\x07headers\x18\x03 \x03(\x0b\x32\x16.google.rpc.HttpHeader\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c"(\n\nHttpHeader\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\tBX\n\x0e\x63om.google.rpcB\tHttpProtoP\x01Z3google.golang.org/genproto/googleapis/rpc/http;http\xa2\x02\x03RPCb\x06proto3' +) + + +_HTTPREQUEST = DESCRIPTOR.message_types_by_name["HttpRequest"] +_HTTPRESPONSE = DESCRIPTOR.message_types_by_name["HttpResponse"] +_HTTPHEADER = DESCRIPTOR.message_types_by_name["HttpHeader"] +HttpRequest = _reflection.GeneratedProtocolMessageType( + "HttpRequest", + (_message.Message,), + { + "DESCRIPTOR": _HTTPREQUEST, + "__module__": "google.rpc.http_pb2" + # @@protoc_insertion_point(class_scope:google.rpc.HttpRequest) + }, +) +_sym_db.RegisterMessage(HttpRequest) + +HttpResponse = _reflection.GeneratedProtocolMessageType( + "HttpResponse", + (_message.Message,), + { + "DESCRIPTOR": _HTTPRESPONSE, + "__module__": "google.rpc.http_pb2" + # @@protoc_insertion_point(class_scope:google.rpc.HttpResponse) + }, +) +_sym_db.RegisterMessage(HttpResponse) + +HttpHeader = _reflection.GeneratedProtocolMessageType( + "HttpHeader", + (_message.Message,), + { + "DESCRIPTOR": _HTTPHEADER, + "__module__": "google.rpc.http_pb2" + # @@protoc_insertion_point(class_scope:google.rpc.HttpHeader) + }, +) +_sym_db.RegisterMessage(HttpHeader) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b"\n\016com.google.rpcB\tHttpProtoP\001Z3google.golang.org/genproto/googleapis/rpc/http;http\242\002\003RPC" + _HTTPREQUEST._serialized_start = 37 + _HTTPREQUEST._serialized_end = 134 + _HTTPRESPONSE._serialized_start = 136 + _HTTPRESPONSE._serialized_end = 237 + _HTTPHEADER._serialized_start = 239 + _HTTPHEADER._serialized_end = 279 +# @@protoc_insertion_point(module_scope) diff --git a/packages/googleapis-common-protos/google/rpc/status.proto b/packages/googleapis-common-protos/google/rpc/status.proto index 3b1f7a932f20..923e169381a7 100644 --- a/packages/googleapis-common-protos/google/rpc/status.proto +++ b/packages/googleapis-common-protos/google/rpc/status.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,12 +33,14 @@ option objc_class_prefix = "RPC"; // You can find out more about this error model and how to work with it in the // [API Design Guide](https://cloud.google.com/apis/design/errors). message Status { - // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + // The status code, which should be an enum value of + // [google.rpc.Code][google.rpc.Code]. int32 code = 1; // A developer-facing error message, which should be in English. Any // user-facing error message should be localized and sent in the - // [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + // [google.rpc.Status.details][google.rpc.Status.details] field, or localized + // by the client. string message = 2; // A list of messages that carry the error details. There is a common set of