Sebastian Thiel
6e0caa3b22
replace a few unwraps() with ? where possible
2023-02-22 09:21:23 +01:00
Sebastian Thiel
ad51cb96a5
fix clippy
2023-02-22 09:20:25 +01:00
Gary Coady
c6039c085d
Update yup-oauth2 to 8.0.0.
2022-11-29 19:10:51 +01:00
philippeitis
4bdd77a52f
cargo fmt
2022-10-19 20:42:56 -07:00
philippeitis
9285942f3d
impl std::fmt::Display for FieldMask
2022-10-19 20:42:47 -07:00
philippeitis
f4317a2968
cargo clippy --fix google-clis-common
2022-10-19 20:39:45 -07:00
philippeitis
4cca633f92
Apply cargo clippy --fix
2022-10-19 20:31:31 -07:00
philippeitis
63793b55a6
Add FromStr impl for FieldMask
...
This improves compatibility with the CLI crates
2022-10-19 20:29:39 -07:00
philippeitis
0ad3b1258f
Refactor Params into external struct
...
Reduces file size of generated library:
```
cargo build --release
Compiling google-compute1 v5.0.1+20220224 (/home/philippe/PycharmProjects/google-apis-rs/gen/compute1)
Finished release [optimized] target(s) in 35.15s
```
164 MB resulting lib (4MB reduction)
2022-10-19 17:10:24 -07:00
philippeitis
cfa6958aa0
Add UploadProtocol enum to remove string types
2022-10-19 15:13:20 -07:00
philippeitis
f6b195df4f
Make MultiPartReader::mime_type associated fn
2022-10-18 16:58:26 -07:00
philippeitis
616b324a77
Update mime
2022-10-18 16:25:08 -07:00
philippeitis
7a114a6d1c
Update documentation
2022-10-16 21:57:25 -07:00
philippeitis
4d30072c91
docs: min 1 try + retries in example
2022-10-16 21:29:10 -07:00
philippeitis
a375b710b1
Use Result<Option<_>, _>
2022-10-16 21:26:21 -07:00
philippeitis
1132b542d2
More correct GetToken docs
2022-10-16 17:28:29 -07:00
philippeitis
7ca7f1cafd
Make yup-oauth2 optional
2022-10-16 17:19:10 -07:00
philippeitis
50dd53a877
Document auth.rs
2022-10-16 17:04:20 -07:00
philippeitis
32110d6970
Return Option<String> from GetToken::get_token instead of Result<...>
2022-10-16 16:35:34 -07:00
philippeitis
1c04f662d1
Use correct string impls for http headers
2022-10-09 00:04:30 -07:00
philippeitis
f6cced9605
Support serde for arbitrary field types
...
This introduces the `serde_with` dependency and `rust_type.py`, to allow supporting arbitrary types for serialization.
Since fields may have arbitrary types (eg. `HashMap<_, chrono::Duration>`) which need deserialization, it is necessary to
use type-based serialization to avoid implementing (de)serialization for every permutation of types that require special serialization.
However, `serde` does not let you (de)serialize one type as another (eg. `chrono::Duration` as `Wrapper`) - thus necessitating `serde_with`, which does. `rust_type.py` introduces the `RustType` class, which makes it easy to describe the (de)serialization type used by `serde_with`
2022-10-08 23:01:30 -07:00
philippeitis
8cc2707563
Fix cargo check w.r.t. FieldMask
...
The serde traits are now directly implemented for FieldMask - this helps address potential serde issues with wrapper types, and simplifies the serde process somewhat.
2022-10-08 19:59:23 -07:00
philippeitis
ddac761e06
Add #[serde(default)] for Option parsing
...
If using #[serde(with = ...)] with an Option type, serde will expect all marked fields to be present. Adding #[serde(default)] restores expected behaviour - if no Option value is present, None will be used.
2022-10-08 15:50:47 -07:00
philippeitis
8809ec4807
Add base64 round trip test
2022-10-08 12:56:30 -07:00
philippeitis
afb96bd264
Add FieldMask and serde impl
2022-10-08 03:22:08 -07:00
philippeitis
928c6027e6
Add serde test cases
2022-10-08 02:03:39 -07:00
philippeitis
76627413a3
serde cleanup
2022-10-08 00:58:37 -07:00
philippeitis
5398dc6f79
refactor serde functionality into separate module
2022-10-08 00:51:59 -07:00
philippeitis
477be5d76c
Fix type signatures
2022-10-07 20:40:47 -07:00
philippeitis
05df68de32
Use chrono::Duration directly with serde attributes
2022-10-07 20:34:40 -07:00
philippeitis
444b610ddc
Add proper error handling for parsing Duration
2022-10-07 14:06:04 -07:00
philippeitis
fc780014d4
Clean up duration parsing code
2022-10-07 13:49:22 -07:00
philippeitis
29aa8df15b
Use appropriate types for date-time, duration, bytes
2022-10-07 13:36:03 -07:00
philippeitis
66c535e4d6
Add support for duration and base64 serde
2022-10-07 02:14:26 -07:00
Sebastian Thiel
fe1e97299f
Merge branch 'patch-2'
2022-10-01 09:43:31 +08:00
philippeitis
811ed3d016
Replace std: 🧵 :sleep with tokio: 🧵 :sleep
2022-09-30 07:42:11 +00:00
philippeitis
276324ae09
Make remove_json_null_values O(n) instead of O(n^2)
2022-09-30 07:35:55 +00:00
philippeitis
dad761d3f8
Add additional send/sync bounds
2022-09-29 21:33:57 -07:00
philippeitis
5a5d476317
Update lib.rs
2022-09-29 06:39:11 +00:00
philippeitis
b10bddab08
Add Send bound to GetToken
2022-09-29 06:34:47 +00:00
Sebastian Thiel
3b4fae994e
fix compile warnings
2022-09-29 09:06:56 +08:00
philippeitis
9142859612
Move client.rs to common dependency
2022-09-27 21:48:31 -07:00
Sebastian Thiel
8d7309b78c
rename google-api-client to google-apis-common
2022-09-25 19:43:56 +08:00