-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(googletest/rust): generate the type golden crate
- Loading branch information
Showing
7 changed files
with
157 additions
and
25 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "type-golden-gclient" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
serde = { version = "1.0.214", features = ["serde_derive"] } | ||
serde_with = "3.11.0" | ||
serde_json = "1.0.132" | ||
time = { version = "0.3.36", features = ["formatting", "parsing"] } | ||
reqwest = { version = "0.12.9", features = ["json"] } | ||
bytes = { version = "1.8.0", features = ["serde"] } | ||
gax = { path = "../../../../../../gax", package = "gax" } | ||
gax_placeholder = { path = "../../../../../../types", package = "types" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# - Rust Client Library | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#![allow(dead_code)] | ||
|
||
use std::sync::Arc; | ||
|
||
pub mod model; | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct Client { | ||
inner: Arc<ClientRef>, | ||
} | ||
|
||
#[derive(Debug)] | ||
struct ClientRef { | ||
http_client: reqwest::Client, | ||
token: String, | ||
} | ||
|
||
impl Client { | ||
pub fn new(tok: String) -> Self { | ||
let client = reqwest::Client::builder().build().unwrap(); | ||
let inner = ClientRef { | ||
http_client: client, | ||
token: tok, | ||
}; | ||
Self { | ||
inner: Arc::new(inner), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#![allow(dead_code)] | ||
|
||
/// Represents a textual expression in the Common Expression Language (CEL) | ||
/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL | ||
/// are documented at https://github.com/google/cel-spec. | ||
/// | ||
/// Example (Comparison): | ||
/// | ||
/// title: "Summary size limit" | ||
/// description: "Determines if a summary is less than 100 chars" | ||
/// expression: "document.summary.size() < 100" | ||
/// | ||
/// Example (Equality): | ||
/// | ||
/// title: "Requestor is owner" | ||
/// description: "Determines if requestor is the document owner" | ||
/// expression: "document.owner == request.auth.claims.email" | ||
/// | ||
/// Example (Logic): | ||
/// | ||
/// title: "Public documents" | ||
/// description: "Determine whether the document should be publicly visible" | ||
/// expression: "document.type != 'private' && document.type != 'internal'" | ||
/// | ||
/// Example (Data Manipulation): | ||
/// | ||
/// title: "Notification string" | ||
/// description: "Create a notification string with a timestamp." | ||
/// expression: "'New message received at ' + string(document.create_time)" | ||
/// | ||
/// The exact variables and functions that may be referenced within an expression | ||
/// are determined by the service that evaluates it. See the service | ||
/// documentation for additional information. | ||
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
#[non_exhaustive] | ||
pub struct Expr { | ||
/// Textual representation of an expression in Common Expression Language | ||
/// syntax. | ||
pub expression: String, | ||
|
||
/// Optional. Title for the expression, i.e. a short string describing | ||
/// its purpose. This can be used e.g. in UIs which allow to enter the | ||
/// expression. | ||
pub title: String, | ||
|
||
/// Optional. Description of the expression. This is a longer text which | ||
/// describes the expression, e.g. when hovered over it in a UI. | ||
pub description: String, | ||
|
||
/// Optional. String indicating the location of the expression for error | ||
/// reporting, e.g. a file name and a position in the file. | ||
pub location: String, | ||
} |