Skip to content

Commit 596c2e6

Browse files
committed
updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
1 parent 455fa89 commit 596c2e6

File tree

15 files changed

+74
-3849
lines changed

15 files changed

+74
-3849
lines changed

Cargo.lock

Lines changed: 0 additions & 3804 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ hubspot-contacts: openapitor
6060
hubspot-users: openapitor
6161
$(openapitor_exe) \
6262
--input specs/hubspot-users.json \
63-
--target-version 0.1.1 \
63+
--target-version 0.1.2 \
6464
--output ./hubspot-users \
6565
--name hubspot-users \
6666
--base-url https://api.hubspot.com \

gusto/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version = "2.1.17"
55
documentation = "https://docs.rs/gusto-api"
66
readme = "README.md"
77

8-
edition = "2018"
8+
edition = "2021"
99
license = "MIT"
1010

1111
[dependencies]
@@ -27,17 +27,17 @@ parse-display = "0.10.0"
2727
phonenumber = "0.3.5"
2828
rand = { version = "0.8", optional = true }
2929
reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "rustls-tls"], optional = true }
30-
reqwest-conditional-middleware = { version = "0.3", optional = true }
31-
reqwest-middleware = { version = "0.3", optional = true, features = ["json", "multipart", "http2", "rustls-tls"] }
32-
reqwest-retry = { version = "0.6", optional = true }
33-
reqwest-tracing = { version = "0.5", features = ["opentelemetry_0_24"], optional = true }
30+
reqwest-conditional-middleware = { version = "0.4", optional = true }
31+
reqwest-middleware = { version = "0.4", optional = true, features = ["json", "multipart", "http2", "rustls-tls"] }
32+
reqwest-retry = { version = "0.7", optional = true }
33+
reqwest-tracing = { version = "0.5.4", features = ["opentelemetry_0_24"], optional = true }
3434
schemars = { version = "0.8.17", features = ["bigdecimal04", "bytes", "chrono", "url", "uuid1"] }
3535
serde = { version = "1", features = ["derive"] }
3636
serde_bytes = "0.11"
3737
serde_json = "1"
3838
serde_urlencoded = { version = "^0.7", optional = true }
39-
tabled = { version = "0.16.0", features = ["ansi"], optional = true }
40-
thiserror = "1"
39+
tabled = { version = "0.17.0", features = ["ansi"], optional = true }
40+
thiserror = "2"
4141
tracing = { version = "^0.1", optional = true }
4242
url = { version = "2", features = ["serde"] }
4343
uuid = { version = "1", features = ["serde", "v4", "v7"] }

gusto/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ the client in the environment:
5858
- `GUSTO_CLIENT_SECRET`
5959
- `GUSTO_REDIRECT_URI`
6060

61+
6162
And then you can create a client from the environment.
6263

6364
```rust,no_run

gusto/src/lib.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,17 @@
5656
//! - `GUSTO_CLIENT_SECRET`
5757
//! - `GUSTO_REDIRECT_URI`
5858
//!
59+
//!
5960
//! And then you can create a client from the environment.
6061
//!
6162
//! ```rust,no_run
6263
//! use gusto_api::Client;
6364
//!
6465
//! let client = Client::new_from_env(String::from("token"), String::from("refresh-token"));
6566
//! ```
67+
#![allow(elided_named_lifetimes)]
6668
#![allow(missing_docs)]
69+
#![allow(unused_imports)]
6770
#![allow(clippy::needless_lifetimes)]
6871
#![allow(clippy::too_many_arguments)]
6972
#![cfg_attr(docsrs, feature(doc_cfg))]
@@ -336,9 +339,9 @@ impl Client {
336339
}
337340

338341
/// Create a new Client struct from the environment variables:
339-
/// - `GUSTO_CLIENT_ID`
340-
/// - `GUSTO_CLIENT_SECRET`
341-
/// - `GUSTO_REDIRECT_URI`
342+
/// - `ENV_VARIABLE_PREFIX_CLIENT_ID`
343+
/// - `ENV_VARIABLE_PREFIX_CLIENT_SECRET`
344+
/// - `ENV_VARIABLE_PREFIX_REDIRECT_URI`
342345
#[tracing::instrument]
343346
pub fn new_from_env<T, R>(token: T, refresh_token: R) -> Self
344347
where
@@ -348,8 +351,11 @@ impl Client {
348351
let client_id = env::var("GUSTO_CLIENT_ID").expect("must set GUSTO_CLIENT_ID");
349352
let client_secret = env::var("GUSTO_CLIENT_SECRET").expect("must set GUSTO_CLIENT_SECRET");
350353
let redirect_uri = env::var("GUSTO_REDIRECT_URI").expect("must set GUSTO_REDIRECT_URI");
354+
let base_url = env::var("GUSTO_HOST").unwrap_or("https://api.gusto.com".to_string());
351355

352-
Client::new(client_id, client_secret, redirect_uri, token, refresh_token)
356+
let mut c = Client::new(client_id, client_secret, redirect_uri, token, refresh_token);
357+
c.set_base_url(base_url);
358+
c
353359
}
354360

355361
/// Return a user consent url with an optional set of scopes.

hubspot-users/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
22
name = "hubspot-users"
33
description = "A fully generated & opinionated API client for the Hubspot Users API."
4-
version = "0.1.1"
4+
version = "0.1.2"
55
documentation = "https://docs.rs/hubspot-users"
66
readme = "README.md"
77

8-
edition = "2018"
8+
edition = "2021"
99
license = "MIT"
1010

1111
[dependencies]
@@ -27,17 +27,17 @@ parse-display = "0.10.0"
2727
phonenumber = "0.3.5"
2828
rand = { version = "0.8", optional = true }
2929
reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "rustls-tls"], optional = true }
30-
reqwest-conditional-middleware = { version = "0.3", optional = true }
31-
reqwest-middleware = { version = "0.3", optional = true, features = ["json", "multipart", "http2", "rustls-tls"] }
32-
reqwest-retry = { version = "0.6", optional = true }
33-
reqwest-tracing = { version = "0.5", features = ["opentelemetry_0_24"], optional = true }
30+
reqwest-conditional-middleware = { version = "0.4", optional = true }
31+
reqwest-middleware = { version = "0.4", optional = true, features = ["json", "multipart", "http2", "rustls-tls"] }
32+
reqwest-retry = { version = "0.7", optional = true }
33+
reqwest-tracing = { version = "0.5.4", features = ["opentelemetry_0_24"], optional = true }
3434
schemars = { version = "0.8.17", features = ["bigdecimal04", "bytes", "chrono", "url", "uuid1"] }
3535
serde = { version = "1", features = ["derive"] }
3636
serde_bytes = "0.11"
3737
serde_json = "1"
3838
serde_urlencoded = { version = "^0.7", optional = true }
39-
tabled = { version = "0.16.0", features = ["ansi"], optional = true }
40-
thiserror = "1"
39+
tabled = { version = "0.17.0", features = ["ansi"], optional = true }
40+
thiserror = "2"
4141
tracing = { version = "^0.1", optional = true }
4242
url = { version = "2", features = ["serde"] }
4343
uuid = { version = "1", features = ["serde", "v4", "v7"] }

hubspot-users/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To install the library, add the following to your `Cargo.toml` file.
2525

2626
```toml
2727
[dependencies]
28-
hubspot-users = "0.1.1"
28+
hubspot-users = "0.1.2"
2929
```
3030

3131
## Basic example
@@ -46,6 +46,7 @@ the client in the environment:
4646

4747
- `HUBSPOT_USERS_API_TOKEN`
4848

49+
4950
And then you can create a client from the environment.
5051

5152
```rust,no_run

hubspot-users/hubspot-users.rs.patch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"path": "/info/x-rust",
55
"value": {
66
"client": "// Authenticate via an API token.\nlet client = hubspot-users::Client::new(\"$TOKEN\");\n\n// - OR -\n\n// Authenticate with your token and host parsed from the environment variables:\n// `HUBSPOT_USERS_API_TOKEN`.\nlet client = hubspot_users::Client::new_from_env();",
7-
"install": "[dependencies]\nhubspot-users = \"0.1.1\""
7+
"install": "[dependencies]\nhubspot-users = \"0.1.2\""
88
}
99
},
1010
{

hubspot-users/src/lib.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//!
2424
//! ```toml
2525
//! [dependencies]
26-
//! hubspot-users = "0.1.1"
26+
//! hubspot-users = "0.1.2"
2727
//! ```
2828
//!
2929
//! ## Basic example
@@ -42,14 +42,17 @@
4242
//!
4343
//! - `HUBSPOT_USERS_API_TOKEN`
4444
//!
45+
//!
4546
//! And then you can create a client from the environment.
4647
//!
4748
//! ```rust,no_run
4849
//! use hubspot_users::Client;
4950
//!
5051
//! let client = Client::new_from_env();
5152
//! ```
53+
#![allow(elided_named_lifetimes)]
5254
#![allow(missing_docs)]
55+
#![allow(unused_imports)]
5356
#![allow(clippy::needless_lifetimes)]
5457
#![allow(clippy::too_many_arguments)]
5558
#![cfg_attr(docsrs, feature(doc_cfg))]
@@ -255,12 +258,16 @@ impl Client {
255258
self.base_url = base_url.to_string().trim_end_matches('/').to_string();
256259
}
257260

258-
/// Create a new Client struct from the environment variable: `HUBSPOT_USERS_API_TOKEN`.
261+
/// Create a new Client struct from the environment variable: `ENV_VARIABLE_PREFIX_API_TOKEN`.
259262
#[tracing::instrument]
260263
pub fn new_from_env() -> Self {
261264
let token = env::var("HUBSPOT_USERS_API_TOKEN").expect("must set HUBSPOT_USERS_API_TOKEN");
265+
let base_url =
266+
env::var("HUBSPOT_USERS_HOST").unwrap_or("https://api.hubspot.com".to_string());
262267

263-
Client::new(token)
268+
let mut c = Client::new(token);
269+
c.set_base_url(base_url);
270+
c
264271
}
265272

266273
/// Create a raw request to our API.

ramp/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version = "0.0.2"
55
documentation = "https://docs.rs/ramp-api"
66
readme = "README.md"
77

8-
edition = "2018"
8+
edition = "2021"
99
license = "MIT"
1010

1111
[dependencies]
@@ -27,17 +27,17 @@ parse-display = "0.10.0"
2727
phonenumber = "0.3.5"
2828
rand = { version = "0.8", optional = true }
2929
reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "rustls-tls"], optional = true }
30-
reqwest-conditional-middleware = { version = "0.3", optional = true }
31-
reqwest-middleware = { version = "0.3", optional = true, features = ["json", "multipart", "http2", "rustls-tls"] }
32-
reqwest-retry = { version = "0.6", optional = true }
33-
reqwest-tracing = { version = "0.5", features = ["opentelemetry_0_24"], optional = true }
30+
reqwest-conditional-middleware = { version = "0.4", optional = true }
31+
reqwest-middleware = { version = "0.4", optional = true, features = ["json", "multipart", "http2", "rustls-tls"] }
32+
reqwest-retry = { version = "0.7", optional = true }
33+
reqwest-tracing = { version = "0.5.4", features = ["opentelemetry_0_24"], optional = true }
3434
schemars = { version = "0.8.17", features = ["bigdecimal04", "bytes", "chrono", "url", "uuid1"] }
3535
serde = { version = "1", features = ["derive"] }
3636
serde_bytes = "0.11"
3737
serde_json = "1"
3838
serde_urlencoded = { version = "^0.7", optional = true }
39-
tabled = { version = "0.16.0", features = ["ansi"], optional = true }
40-
thiserror = "1"
39+
tabled = { version = "0.17.0", features = ["ansi"], optional = true }
40+
thiserror = "2"
4141
tracing = { version = "^0.1", optional = true }
4242
url = { version = "2", features = ["serde"] }
4343
uuid = { version = "1", features = ["serde", "v4", "v7"] }

0 commit comments

Comments
 (0)