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 an api-version header to all requests #856

Draft
wants to merge 1 commit 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
8 changes: 8 additions & 0 deletions progenitor-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,14 @@ impl Generator {
let dur = std::time::Duration::from_secs(15);

reqwest::ClientBuilder::new()
.default_headers(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this won't cover the new_with_client() case, right?

Copy link
Collaborator Author

@ahl ahl Aug 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof. Good point! And 1. new_with_client() is actually the case that matter and 2. we can't modify a reqwest::Client nor can we convert it into a builder.

[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static(#version_str),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/buildomat_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2111,6 +2111,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("1.0"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/buildomat_builder_tagged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2111,6 +2111,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("1.0"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/buildomat_positional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("1.0"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/keeper_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("1.0"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/keeper_builder_tagged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("1.0"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/keeper_positional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("1.0"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/nexus_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24991,6 +24991,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("0.0.1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/nexus_builder_tagged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24624,6 +24624,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("0.0.1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/nexus_positional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13381,6 +13381,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("0.0.1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/param_collision_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("v1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("v1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("v1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/param_overrides_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("v1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("v1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("v1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/propolis_server_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2847,6 +2847,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("0.0.1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2811,6 +2811,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("0.0.1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("0.0.1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("9000"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("9000"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/test_freeform_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("9000"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
8 changes: 8 additions & 0 deletions progenitor-impl/tests/output/src/test_renamed_parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("9000"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ impl Client {
let client = {
let dur = std::time::Duration::from_secs(15);
reqwest::ClientBuilder::new()
.default_headers(
[(
reqwest::header::HeaderName::from_static("api-version"),
reqwest::header::HeaderValue::from_static("1"),
)]
.into_iter()
.collect(),
)
.connect_timeout(dur)
.timeout(dur)
};
Expand Down
Loading