feat(build): Add build_transport builder option (#1130)

This commit is contained in:
Lucio Franco
2022-11-04 11:04:23 -04:00
committed by GitHub
parent 6667ace032
commit 1f5bc9b9d5
9 changed files with 130 additions and 74 deletions
+34 -31
View File
@@ -8,16 +8,16 @@
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Status {
/// The status code, which should be an enum value of \\[google.rpc.Code\]\[google.rpc.Code\\].
#[prost(int32, tag="1")]
#[prost(int32, tag = "1")]
pub code: i32,
/// 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.
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
/// A list of messages that carry the error details. There is a common set of
/// message types for APIs to use.
#[prost(message, repeated, tag="3")]
#[prost(message, repeated, tag = "3")]
pub details: ::prost::alloc::vec::Vec<::prost_types::Any>,
}
/// Describes when the clients can retry a failed request. Clients could ignore
@@ -36,17 +36,17 @@ pub struct Status {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RetryInfo {
/// Clients should wait at least this long between retrying the same request.
#[prost(message, optional, tag="1")]
#[prost(message, optional, tag = "1")]
pub retry_delay: ::core::option::Option<::prost_types::Duration>,
}
/// Describes additional debugging info.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DebugInfo {
/// The stack trace entries indicating where the error occurred.
#[prost(string, repeated, tag="1")]
#[prost(string, repeated, tag = "1")]
pub stack_entries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Additional debugging information provided by the server.
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub detail: ::prost::alloc::string::String,
}
/// Describes how a quota check failed.
@@ -63,7 +63,7 @@ pub struct DebugInfo {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuotaFailure {
/// Describes all quota violations.
#[prost(message, repeated, tag="1")]
#[prost(message, repeated, tag = "1")]
pub violations: ::prost::alloc::vec::Vec<quota_failure::Violation>,
}
/// Nested message and enum types in `QuotaFailure`.
@@ -75,7 +75,7 @@ pub mod quota_failure {
/// The subject on which the quota check failed.
/// For example, "clientip:<ip address of client>" or "project:<Google
/// developer project id>".
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub subject: ::prost::alloc::string::String,
/// A description of how the quota check failed. Clients can use this
/// description to find more about the quota configuration in the service's
@@ -84,7 +84,7 @@ pub mod quota_failure {
///
/// For example: "Service disabled" or "Daily Limit for read operations
/// exceeded".
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
}
}
@@ -122,7 +122,7 @@ pub struct ErrorInfo {
/// 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\_\\]+/.
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub reason: ::prost::alloc::string::String,
/// The logical grouping to which the "reason" belongs. The error domain
/// is typically the registered service name of the tool or product that
@@ -130,7 +130,7 @@ pub struct ErrorInfo {
/// 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".
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub domain: ::prost::alloc::string::String,
/// Additional structured details about this error.
///
@@ -140,8 +140,11 @@ pub struct ErrorInfo {
/// {"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.
#[prost(map="string, string", tag="3")]
pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "3")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
/// Describes what preconditions have failed.
///
@@ -151,7 +154,7 @@ pub struct ErrorInfo {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PreconditionFailure {
/// Describes all precondition violations.
#[prost(message, repeated, tag="1")]
#[prost(message, repeated, tag = "1")]
pub violations: ::prost::alloc::vec::Vec<precondition_failure::Violation>,
}
/// Nested message and enum types in `PreconditionFailure`.
@@ -162,18 +165,18 @@ pub mod precondition_failure {
/// The type of PreconditionFailure. We recommend using a service-specific
/// enum type to define the supported precondition violation subjects. For
/// example, "TOS" for "Terms of Service violation".
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
/// The subject, relative to the type, that failed.
/// For example, "google.com/cloud" relative to the "TOS" type would indicate
/// which terms of service is being referenced.
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub subject: ::prost::alloc::string::String,
/// A description of how the precondition failed. Developers can use this
/// description to understand how to fix the failure.
///
/// For example: "Terms of service not accepted".
#[prost(string, tag="3")]
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
}
}
@@ -182,7 +185,7 @@ pub mod precondition_failure {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BadRequest {
/// Describes all violations in a client request.
#[prost(message, repeated, tag="1")]
#[prost(message, repeated, tag = "1")]
pub field_violations: ::prost::alloc::vec::Vec<bad_request::FieldViolation>,
}
/// Nested message and enum types in `BadRequest`.
@@ -193,10 +196,10 @@ pub mod bad_request {
/// A path leading 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.
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub field: ::prost::alloc::string::String,
/// A description of why the request element is bad.
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
}
}
@@ -206,11 +209,11 @@ pub mod bad_request {
pub struct RequestInfo {
/// An opaque string that should only be interpreted by the service generating
/// it. For example, it can be used to identify requests in the service's logs.
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub request_id: ::prost::alloc::string::String,
/// Any data that was used to serve this request. For example, an encrypted
/// stack trace that can be sent back to the service provider for debugging.
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub serving_data: ::prost::alloc::string::String,
}
/// Describes the resource that is being accessed.
@@ -219,22 +222,22 @@ pub struct ResourceInfo {
/// A name for the type of resource being accessed, e.g. "sql table",
/// "cloud storage bucket", "file", "Google calendar"; or the type URL
/// of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub resource_type: ::prost::alloc::string::String,
/// The name of the resource being accessed. For example, a shared calendar
/// name: "[email protected]", if the current
/// error is \\[google.rpc.Code.PERMISSION_DENIED\]\[google.rpc.Code.PERMISSION_DENIED\\].
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub resource_name: ::prost::alloc::string::String,
/// The owner of the resource (optional).
/// For example, "user:<owner email>" or "project:<Google developer project
/// id>".
#[prost(string, tag="3")]
#[prost(string, tag = "3")]
pub owner: ::prost::alloc::string::String,
/// Describes what error is encountered when accessing this resource.
/// For example, updating a cloud project may require the `writer` permission
/// on the developer console project.
#[prost(string, tag="4")]
#[prost(string, tag = "4")]
pub description: ::prost::alloc::string::String,
}
/// Provides links to documentation or for performing an out of band action.
@@ -245,7 +248,7 @@ pub struct ResourceInfo {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Help {
/// URL(s) pointing to additional information on handling the current error.
#[prost(message, repeated, tag="1")]
#[prost(message, repeated, tag = "1")]
pub links: ::prost::alloc::vec::Vec<help::Link>,
}
/// Nested message and enum types in `Help`.
@@ -254,10 +257,10 @@ pub mod help {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Link {
/// Describes what the link offers.
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub description: ::prost::alloc::string::String,
/// The URL of the link.
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub url: ::prost::alloc::string::String,
}
}
@@ -268,9 +271,9 @@ pub struct LocalizedMessage {
/// The locale used following the specification defined at
/// <http://www.rfc-editor.org/rfc/bcp/bcp47.txt.>
/// Examples are: "en-US", "fr-CH", "es-MX"
#[prost(string, tag="1")]
#[prost(string, tag = "1")]
pub locale: ::prost::alloc::string::String,
/// The localized error message in the above locale.
#[prost(string, tag="2")]
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}