Skip to content

Commit da84ed0

Browse files
committed
updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
1 parent a90ce95 commit da84ed0

File tree

6 files changed

+23
-15
lines changed

6 files changed

+23
-15
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ gusto: openapitor
4545
hubspot-contacts: openapitor
4646
$(openapitor_exe) \
4747
--input specs/hubspot-contacts.json \
48-
--target-version 0.1.1 \
48+
--target-version 0.1.2 \
4949
--output ./hubspot-contacts \
5050
--name hubspot-contacts \
5151
--base-url https://api.hubapi.com \

hubspot-contacts/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-contacts"
33
description = "A fully generated & opinionated API client for the Hubspot Contacts API."
4-
version = "0.1.1"
4+
version = "0.1.2"
55
documentation = "https://docs.rs/hubspot-contacts"
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-contacts/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-contacts = "0.1.1"
28+
hubspot-contacts = "0.1.2"
2929
```
3030

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

4747
- `HUBSPOT_CONTACTS_API_TOKEN`
4848

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

5152
```rust,no_run

hubspot-contacts/hubspot-contacts.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-contacts::Client::new(\"$TOKEN\");\n\n// - OR -\n\n// Authenticate with your token and host parsed from the environment variables:\n// `HUBSPOT_CONTACTS_API_TOKEN`.\nlet client = hubspot_contacts::Client::new_from_env();",
7-
"install": "[dependencies]\nhubspot-contacts = \"0.1.1\""
7+
"install": "[dependencies]\nhubspot-contacts = \"0.1.2\""
88
}
99
},
1010
{

hubspot-contacts/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-contacts = "0.1.1"
26+
//! hubspot-contacts = "0.1.2"
2727
//! ```
2828
//!
2929
//! ## Basic example
@@ -42,14 +42,17 @@
4242
//!
4343
//! - `HUBSPOT_CONTACTS_API_TOKEN`
4444
//!
45+
//!
4546
//! And then you can create a client from the environment.
4647
//!
4748
//! ```rust,no_run
4849
//! use hubspot_contacts::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))]
@@ -259,13 +262,17 @@ impl Client {
259262
self.base_url = base_url.to_string().trim_end_matches('/').to_string();
260263
}
261264

262-
/// Create a new Client struct from the environment variable: `HUBSPOT_CONTACTS_API_TOKEN`.
265+
/// Create a new Client struct from the environment variable: `ENV_VARIABLE_PREFIX_API_TOKEN`.
263266
#[tracing::instrument]
264267
pub fn new_from_env() -> Self {
265268
let token =
266269
env::var("HUBSPOT_CONTACTS_API_TOKEN").expect("must set HUBSPOT_CONTACTS_API_TOKEN");
270+
let base_url =
271+
env::var("HUBSPOT_CONTACTS_HOST").unwrap_or("https://api.hubapi.com".to_string());
267272

268-
Client::new(token)
273+
let mut c = Client::new(token);
274+
c.set_base_url(base_url);
275+
c
269276
}
270277

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

kittycad.rs

0 commit comments

Comments
 (0)