Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Google Cloud Monitoring client #329

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ members = [
"bigquery",
"spanner-derive",
"artifact-registry",
"kms"
"kms",
"monitoring"
]
1 change: 1 addition & 0 deletions googleapis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ storage = []
artifact-registry = []
kms = []
bigquery = []
monitoring = []
generate = ["dep:tonic-build", "dep:prost-build"]
bytes = []
3 changes: 3 additions & 0 deletions googleapis/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ fn generate(config: prost_build::Config, out_dir: impl AsRef<std::path::Path>) {
"googleapis/google/cloud/kms/v1/service.proto",
"googleapis/google/cloud/kms/v1/resources.proto",
"googleapis/google/cloud/kms/v1/ekm_service.proto",
"googleapis/google/monitoring/v3/metric_service.proto",
"googleapis/google/monitoring/v3/metric.proto",
"googleapis/google/monitoring/v3/common.proto",
],
&["googleapis"], // specify the root location to search proto dependencies
)
Expand Down
786 changes: 727 additions & 59 deletions googleapis/src/bytes/google.api.rs

Large diffs are not rendered by default.

221 changes: 87 additions & 134 deletions googleapis/src/bytes/google.cloud.bigquery.storage.v1.rs

Large diffs are not rendered by default.

437 changes: 144 additions & 293 deletions googleapis/src/bytes/google.cloud.kms.v1.rs

Large diffs are not rendered by default.

345 changes: 106 additions & 239 deletions googleapis/src/bytes/google.devtools.artifactregistry.v1.rs

Large diffs are not rendered by default.

55 changes: 23 additions & 32 deletions googleapis/src/bytes/google.iam.v1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This file is @generated by prost-build.
/// Encapsulates settings provided to GetIamPolicy.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetPolicyOptions {
/// Optional. The maximum policy version that will be used to format the
Expand Down Expand Up @@ -97,7 +96,6 @@ pub struct GetPolicyOptions {
///
/// For a description of IAM and its features, see the
/// [IAM documentation](<https://cloud.google.com/iam/docs/>).
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Policy {
/// Specifies the format of the policy.
Expand Down Expand Up @@ -158,7 +156,6 @@ pub struct Policy {
pub etag: ::prost::bytes::Bytes,
}
/// Associates `members`, or principals, with a `role`.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Binding {
/// Role that is assigned to the list of `members`, or principals.
Expand Down Expand Up @@ -277,7 +274,6 @@ pub struct Binding {
/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
/// logging. It also exempts `[email protected]` from DATA_READ logging, and
/// `[email protected]` from DATA_WRITE logging.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuditConfig {
/// Specifies a service that will be enabled for audit logging.
Expand Down Expand Up @@ -308,7 +304,6 @@ pub struct AuditConfig {
///
/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
/// [email protected] from DATA_READ logging.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuditLogConfig {
/// The log type that this config enables.
Expand Down Expand Up @@ -354,10 +349,10 @@ pub mod audit_log_config {
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
LogType::Unspecified => "LOG_TYPE_UNSPECIFIED",
LogType::AdminRead => "ADMIN_READ",
LogType::DataWrite => "DATA_WRITE",
LogType::DataRead => "DATA_READ",
Self::Unspecified => "LOG_TYPE_UNSPECIFIED",
Self::AdminRead => "ADMIN_READ",
Self::DataWrite => "DATA_WRITE",
Self::DataRead => "DATA_READ",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand All @@ -373,7 +368,6 @@ pub mod audit_log_config {
}
}
/// The difference delta between two policies.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PolicyDelta {
/// The delta for Bindings between two policies.
Expand All @@ -385,7 +379,6 @@ pub struct PolicyDelta {
}
/// One delta entry for Binding. Each individual change (only one member in each
/// entry) to a binding will be a separate entry.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BindingDelta {
/// The action that was performed on a Binding.
Expand Down Expand Up @@ -436,9 +429,9 @@ pub mod binding_delta {
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Action::Unspecified => "ACTION_UNSPECIFIED",
Action::Add => "ADD",
Action::Remove => "REMOVE",
Self::Unspecified => "ACTION_UNSPECIFIED",
Self::Add => "ADD",
Self::Remove => "REMOVE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand All @@ -454,7 +447,6 @@ pub mod binding_delta {
}
/// One delta entry for AuditConfig. Each individual change (only one
/// exempted_member in each entry) to a AuditConfig will be a separate entry.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuditConfigDelta {
/// The action that was performed on an audit configuration in a policy.
Expand Down Expand Up @@ -508,9 +500,9 @@ pub mod audit_config_delta {
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Action::Unspecified => "ACTION_UNSPECIFIED",
Action::Add => "ADD",
Action::Remove => "REMOVE",
Self::Unspecified => "ACTION_UNSPECIFIED",
Self::Add => "ADD",
Self::Remove => "REMOVE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand All @@ -525,7 +517,6 @@ pub mod audit_config_delta {
}
}
/// Request message for `SetIamPolicy` method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetIamPolicyRequest {
/// REQUIRED: The resource for which the policy is being specified.
Expand All @@ -547,7 +538,6 @@ pub struct SetIamPolicyRequest {
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Request message for `GetIamPolicy` method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetIamPolicyRequest {
/// REQUIRED: The resource for which the policy is being requested.
Expand All @@ -560,7 +550,6 @@ pub struct GetIamPolicyRequest {
pub options: ::core::option::Option<GetPolicyOptions>,
}
/// Request message for `TestIamPermissions` method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TestIamPermissionsRequest {
/// REQUIRED: The resource for which the policy detail is being requested.
Expand All @@ -575,7 +564,6 @@ pub struct TestIamPermissionsRequest {
pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Response message for `TestIamPermissions` method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TestIamPermissionsResponse {
/// A subset of `TestPermissionsRequest.permissions` that the caller is
Expand All @@ -585,7 +573,13 @@ pub struct TestIamPermissionsResponse {
}
/// Generated client implementations.
pub mod iam_policy_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// API Overview
Expand Down Expand Up @@ -633,8 +627,8 @@ pub mod iam_policy_client {
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Expand All @@ -659,7 +653,7 @@ pub mod iam_policy_client {
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
IamPolicyClient::new(InterceptedService::new(inner, interceptor))
}
Expand Down Expand Up @@ -706,8 +700,7 @@ pub mod iam_policy_client {
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
Expand All @@ -731,8 +724,7 @@ pub mod iam_policy_client {
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
Expand Down Expand Up @@ -763,8 +755,7 @@ pub mod iam_policy_client {
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
Expand Down
38 changes: 15 additions & 23 deletions googleapis/src/bytes/google.longrunning.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file is @generated by prost-build.
/// This resource represents a long-running operation that is the result of a
/// network API call.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Operation {
/// The server-assigned name, which is only unique within the same service that
Expand Down Expand Up @@ -31,7 +30,6 @@ pub mod operation {
/// The operation result, which can be either an `error` or a valid `response`.
/// If `done` == `false`, neither `error` nor `response` is set.
/// If `done` == `true`, exactly one of `error` or `response` is set.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Result {
/// The error result of the operation in case of failure or cancellation.
Expand All @@ -50,15 +48,13 @@ pub mod operation {
}
}
/// The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOperationRequest {
/// The name of the operation resource.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOperationsRequest {
/// The name of the operation's parent resource.
Expand All @@ -75,7 +71,6 @@ pub struct ListOperationsRequest {
pub page_token: ::prost::alloc::string::String,
}
/// The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOperationsResponse {
/// A list of operations that matches the specified filter in the request.
Expand All @@ -86,23 +81,20 @@ pub struct ListOperationsResponse {
pub next_page_token: ::prost::alloc::string::String,
}
/// The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelOperationRequest {
/// The name of the operation resource to be cancelled.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteOperationRequest {
/// The name of the operation resource to be deleted.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WaitOperationRequest {
/// The name of the operation resource to wait on.
Expand All @@ -125,7 +117,6 @@ pub struct WaitOperationRequest {
/// metadata_type: "LongRunningRecognizeMetadata"
/// };
/// }
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationInfo {
/// Required. The message name of the primary return type for this
Expand All @@ -150,7 +141,13 @@ pub struct OperationInfo {
}
/// Generated client implementations.
pub mod operations_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Manages long-running operations with an API service.
Expand Down Expand Up @@ -181,8 +178,8 @@ pub mod operations_client {
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Expand All @@ -207,7 +204,7 @@ pub mod operations_client {
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
OperationsClient::new(InterceptedService::new(inner, interceptor))
}
Expand Down Expand Up @@ -263,8 +260,7 @@ pub mod operations_client {
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
Expand All @@ -290,8 +286,7 @@ pub mod operations_client {
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
Expand All @@ -318,8 +313,7 @@ pub mod operations_client {
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
Expand Down Expand Up @@ -352,8 +346,7 @@ pub mod operations_client {
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
Expand Down Expand Up @@ -385,8 +378,7 @@ pub mod operations_client {
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
Expand Down
Loading