From 3a253c9c57574b0984da59c0c603744b3f059f78 Mon Sep 17 00:00:00 2001 From: scalarbot Date: Mon, 22 Jun 2026 23:46:58 +0000 Subject: [PATCH] feat: scalar-typescript-sdk-rust@0.2.6 --- .gitignore | 5 + Cargo.toml | 24 + README.md | 141 +- api.md | 259 + examples/smoke-test.rs | 1202 ++++ openapi.augmented.json | 7841 +++++++++++++++++++++++++ reference.md | 428 ++ rustfmt.toml | 2 + scalar-sdk.manifest.json | 9662 +++++++++++++++++++++++++++++++ src/client.rs | 300 + src/error.rs | 101 + src/http.rs | 319 + src/lib.rs | 84 + src/models.rs | 279 + src/resources/access_group.rs | 84 + src/resources/authentication.rs | 74 + src/resources/login_portals.rs | 169 + src/resources/mod.rs | 52 + src/resources/namespaces.rs | 43 + src/resources/registry.rs | 422 ++ src/resources/rules.rs | 249 + src/resources/scalar_docs.rs | 105 + src/resources/schemas.rs | 154 + src/resources/teams.rs | 43 + src/resources/themes.rs | 202 + src/resources/version.rs | 119 + tests/smoke.rs | 592 ++ 27 files changed, 22954 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 api.md create mode 100644 examples/smoke-test.rs create mode 100644 openapi.augmented.json create mode 100644 reference.md create mode 100644 rustfmt.toml create mode 100644 scalar-sdk.manifest.json create mode 100644 src/client.rs create mode 100644 src/error.rs create mode 100644 src/http.rs create mode 100644 src/lib.rs create mode 100644 src/models.rs create mode 100644 src/resources/access_group.rs create mode 100644 src/resources/authentication.rs create mode 100644 src/resources/login_portals.rs create mode 100644 src/resources/mod.rs create mode 100644 src/resources/namespaces.rs create mode 100644 src/resources/registry.rs create mode 100644 src/resources/rules.rs create mode 100644 src/resources/scalar_docs.rs create mode 100644 src/resources/schemas.rs create mode 100644 src/resources/teams.rs create mode 100644 src/resources/themes.rs create mode 100644 src/resources/version.rs create mode 100644 tests/smoke.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..10c3e4b --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/target +Cargo.lock +**/*.rs.bk +.idea/ +.vscode/ diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..344454e --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "scalar-api" +version = "0.2.6" +edition = "2021" +rust-version = "1.75" +description = "API for managing Scalar platform resources." + +[dependencies] +reqwest = { version = "0.12", default-features = false, features = ["json", "stream", "rustls-tls"] } +serde = { version = "1", features = ["derive"] } +serde_json = "1" +thiserror = "2" +futures = "0.3" +bytes = "1" +url = "2" +tokio = { version = "1", features = ["time"] } + +[dev-dependencies] +tokio = { version = "1", features = ["macros", "rt-multi-thread"] } + +[features] +default = ["rustls"] +rustls = ["reqwest/rustls-tls"] +native-tls = ["reqwest/native-tls"] diff --git a/README.md b/README.md index 2cc763f..6af4eee 100644 --- a/README.md +++ b/README.md @@ -1 +1,140 @@ -# scalar-rust \ No newline at end of file +# Scalar API + +API for managing Scalar platform resources. + +## TypeScript SDK + +For TypeScript, we provide a SDK that makes using our API even easier. + +### Install + +```bash +npm add @scalar/sdk +``` + +### Get a Scalar API key + +Create an API key in your Scalar account: + +- Dashboard: https://dashboard.scalar.com/account +- Store it in `.env`, for example: + +```bash +SCALAR_API_KEY=your_personal_token +``` + +### Exchange your API key for an access token + +The personal token is not an access token. Exchange it first with `postv1AuthExchange`. + +If you use the personal token directly for authenticated API calls, the API returns `401 Invalid authentication token`. + +```ts +import { Scalar } from '@scalar/sdk' + +const scalar = new Scalar() + +const exchange = await scalar.auth.postv1AuthExchange({ + personalToken: process.env.SCALAR_API_KEY!, +}) + +const accessToken = exchange.accessToken +``` + +### Use the access token + +Construct a second client with bearer auth. Use this authenticated client for API calls. + +```ts +import { Scalar } from '@scalar/sdk' + +const scalar = new Scalar() + +const exchange = await scalar.auth.postv1AuthExchange({ + personalToken: process.env.SCALAR_API_KEY!, +}) + +const authedScalar = new Scalar({ + bearerAuth: exchange.accessToken, +}) +``` + +### Notes + +- The exchange request itself can be made from a client constructed with no arguments (`new Scalar()`). +- The exchanged access token is valid for 12 hours. +- Timestamps are Unix seconds. + +### Read more + +- [@scalar/sdk on npm](https://www.npmjs.com/package/@scalar/sdk) + +## Installation + +```toml +[dependencies] +scalar-api = "0.2.6" +tokio = { version = "1", features = ["full"] } +``` + +## Usage + +The client is asynchronous and built on `tokio` + `reqwest`. Construct it +with the builder, or read credentials from the environment: + +```rust,no_run +use scalar_api::Scalar; + +async fn run() -> Result<(), Box> { + let client = Scalar::builder() + .bearer_token("…") + .build()?; + + // Or, reading credentials from the environment: + let client = Scalar::from_env()?; + let _ = client; + Ok(()) +} +``` + +Every operation returns a request builder; set optional parameters fluently +and finish with `.send().await`: + +```rust,ignore +let response = client.registry().list_all_api_documents().send().await?; +``` + +## Authentication + +Credentials can be set on the builder or read from the environment by +`from_env`: + +- `bearer_token` — environment variable `SCALAR_BEARER_TOKEN` + +## Error handling + +Fallible operations return [`scalar_api::Error`]. Match on the +result of `send().await` to distinguish API errors (with status and decoded +body) from transport and decoding failures: + +```rust,ignore +use scalar_api::Error; + +match result { + Ok(value) => { /* … */ } + Err(Error::Api(api)) => eprintln!("status {}: {:?}", api.status, api.body), + Err(other) => eprintln!("request failed: {other}"), +} +``` + +## API reference + +See [`api.md`](./api.md) for the full list of resources and operations. + + +## Contributions + +This SDK is generated programmatically. Manual edits to generated files will be +overwritten on the next build. + +### SDK created by [Scalar](https://www.scalar.com/?utm_source=scalar-typescript-sdk-rust&utm_campaign=sdk) diff --git a/api.md b/api.md new file mode 100644 index 0000000..e8d827d --- /dev/null +++ b/api.md @@ -0,0 +1,259 @@ +# ScalarApi Rust API + +## Types + +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 +- AccessGroup +- ActiveDeployment +- ApiDocument +- Email +- GithubProject +- GithubProjectRepository +- LoginPortal +- LoginPortalEmail +- LoginPortalPage +- ManagedDocVersion +- ManagedSchemaVersion +- Method +- Namespace +- Nanoid +- Rule +- Schema +- Slug +- Team +- TeamImage +- TeamName +- TeamSummary +- Theme +- Timestamp +- Uid +- User +- Version + +## Registry + +Types: + +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 +- AccessGroup +- ApiDocument +- ManagedDocVersion +- Version + +Methods: + +- client.registry.listAllApiDocuments(...) +- client.registry.listApiDocuments(...) +- client.registry.createApiDocument(...) +- client.registry.updateApiDocument(...) +- client.registry.deleteApiDocument(...) +- client.registry.retrieveApiDocumentVersion(...) +- client.registry.updateApiDocumentVersion(...) +- client.registry.deleteApiDocumentVersion(...) +- client.registry.listApiDocumentVersionMetadata(...) -> ManagedDocVersion +- client.registry.createApiDocumentVersion(...) -> ManagedDocVersion +- client.registry.createApiDocumentAccessGroup(...) +- client.registry.deleteApiDocumentAccessGroup(...) + +## Schemas + +Types: + +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 +- Schema +- Uid +- Version + +Methods: + +- client.schemas.list(...) +- client.schemas.create(...) -> Uid +- client.schemas.update(...) +- client.schemas.delete(...) + +### Version + +Types: + +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 +- Uid +- Version + +Methods: + +- client.schemas.version.retrieveSchema(...) +- client.schemas.version.deleteSchema(...) +- client.schemas.version.createSchema(...) -> Uid + +### AccessGroup + +Types: + +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 +- AccessGroup + +Methods: + +- client.schemas.accessGroup.createSchema(...) +- client.schemas.accessGroup.deleteSchema(...) + +## LoginPortals + +Types: + +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 +- LoginPortal +- LoginPortalEmail +- LoginPortalPage +- Uid + +Methods: + +- client.loginPortals.retrieve(...) +- client.loginPortals.update(...) +- client.loginPortals.delete(...) +- client.loginPortals.create(...) -> Uid +- client.loginPortals.list(...) + +## Rules + +Types: + +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 +- AccessGroup +- Rule +- Uid + +Methods: + +- client.rules.listRulesets(...) +- client.rules.createRuleset(...) -> Uid +- client.rules.updateRuleset(...) +- client.rules.deleteRuleset(...) +- client.rules.retrieveRulesetDocument(...) +- client.rules.createRulesetAccessGroup(...) +- client.rules.deleteRulesetAccessGroup(...) + +## Themes + +Types: + +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 +- Theme +- Uid + +Methods: + +- client.themes.list(...) +- client.themes.create(...) -> Uid +- client.themes.update(...) +- client.themes.replaceDocument(...) +- client.themes.delete(...) +- client.themes.retrieve(...) + +## Teams + +Types: + +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 +- Team + +Methods: + +- client.teams.list(...) + +## ScalarDocs + +Types: + +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 +- GithubProject +- Slug + +Methods: + +- client.scalarDocs.listGuides(...) +- client.scalarDocs.createGuide(...) +- client.scalarDocs.publishGuide(...) + +## Namespaces + +Types: + +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 + +Methods: + +- client.namespaces.list(...) + +## Authentication + +Types: + +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 +- User + +Methods: + +- client.authentication.exchangePersonalToken(...) +- client.authentication.listCurrentUser(...) -> User diff --git a/examples/smoke-test.rs b/examples/smoke-test.rs new file mode 100644 index 0000000..ebeb979 --- /dev/null +++ b/examples/smoke-test.rs @@ -0,0 +1,1202 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! Report-writing smoke harness: drives every synthesizable operation once +//! and writes a per-operation JSON report. +//! +//! Run it with `cargo run --example smoke-test`. The generator runs this +//! example against a mock server and reads the JSON report written to the +//! path named by `SCALAR_SMOKE_REPORT`, honoring an optional +//! `SCALAR_SMOKE_FILTER` of comma-separated operation/path substrings. +#![allow(unused)] + +use scalar_api::*; + +#[derive(serde::Serialize)] +struct SmokeResult { + operation: String, + method: String, + path: String, + status: String, + #[serde(rename = "durationMs")] + duration_ms: i64, + #[serde(skip_serializing_if = "String::is_empty")] + error: String, +} + +#[derive(serde::Serialize)] +struct SmokeReport { + total: usize, + failed: usize, + results: Vec, +} + +/// Whether an operation/path is selected by the optional comma-separated +/// `SCALAR_SMOKE_FILTER`; with no filter every operation runs. +fn selected(filter: &Option>, operation: &str, path: &str) -> bool { + match filter { + None => true, + Some(needles) => needles + .iter() + .any(|needle| operation.contains(needle.as_str()) || path.contains(needle.as_str())), + } +} + +#[tokio::main] +async fn main() { + let report_path = std::env::var("SCALAR_SMOKE_REPORT").ok(); + let filter = std::env::var("SCALAR_SMOKE_FILTER").ok().map(|raw| { + raw.split(',') + .map(|needle| needle.trim().to_string()) + .filter(|needle| !needle.is_empty()) + .collect::>() + }); + let client = Scalar::from_env().expect("client builds from environment"); + let mut results: Vec = Vec::new(); + if selected(&filter, "listAllApiDocuments", "/v1/apis") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.registry().list_all_api_documents().send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "listAllApiDocuments".to_string(), + method: "GET".to_string(), + path: "/v1/apis".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "listApiDocuments", "/v1/apis/{namespace}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.registry().list_api_documents("example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "listApiDocuments".to_string(), + method: "GET".to_string(), + path: "/v1/apis/{namespace}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "createApiDocument", "/v1/apis/{namespace}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.registry().create_api_document("example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "createApiDocument".to_string(), + method: "POST".to_string(), + path: "/v1/apis/{namespace}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "updateApiDocument", "/v1/apis/{namespace}/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.registry().update_api_document("example", "example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "updateApiDocument".to_string(), + method: "PATCH".to_string(), + path: "/v1/apis/{namespace}/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "deleteApiDocument", "/v1/apis/{namespace}/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.registry().delete_api_document("example", "example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "deleteApiDocument".to_string(), + method: "DELETE".to_string(), + path: "/v1/apis/{namespace}/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "retrieveApiDocumentVersion", "/v1/apis/{namespace}/{slug}/version/{semver}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.registry().retrieve_api_document_version("example", "example", "example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "retrieveApiDocumentVersion".to_string(), + method: "GET".to_string(), + path: "/v1/apis/{namespace}/{slug}/version/{semver}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "updateApiDocumentVersion", "/v1/apis/{namespace}/{slug}/version/{semver}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.registry().update_api_document_version("example", "example", "example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "updateApiDocumentVersion".to_string(), + method: "PATCH".to_string(), + path: "/v1/apis/{namespace}/{slug}/version/{semver}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "deleteApiDocumentVersion", "/v1/apis/{namespace}/{slug}/version/{semver}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.registry().delete_api_document_version("example", "example", "example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "deleteApiDocumentVersion".to_string(), + method: "DELETE".to_string(), + path: "/v1/apis/{namespace}/{slug}/version/{semver}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "listApiDocumentVersionMetadata", "/v1/apis/{namespace}/{slug}/version/{semver}/metadata") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.registry().list_api_document_version_metadata("example", "example", "example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "listApiDocumentVersionMetadata".to_string(), + method: "GET".to_string(), + path: "/v1/apis/{namespace}/{slug}/version/{semver}/metadata".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "createApiDocumentVersion", "/v1/apis/{namespace}/{slug}/version") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.registry().create_api_document_version("example", "example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "createApiDocumentVersion".to_string(), + method: "POST".to_string(), + path: "/v1/apis/{namespace}/{slug}/version".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "createApiDocumentAccessGroup", "/v1/apis/{namespace}/{slug}/access-group") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.registry().create_api_document_access_group("example", "example", AccessGroup { + access_group_slug: "example".to_string(), + }).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "createApiDocumentAccessGroup".to_string(), + method: "POST".to_string(), + path: "/v1/apis/{namespace}/{slug}/access-group".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "deleteApiDocumentAccessGroup", "/v1/apis/{namespace}/{slug}/access-group") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.registry().delete_api_document_access_group("example", "example", AccessGroup { + access_group_slug: "example".to_string(), + }).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "deleteApiDocumentAccessGroup".to_string(), + method: "DELETE".to_string(), + path: "/v1/apis/{namespace}/{slug}/access-group".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "list", "/v1/schemas/{namespace}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().list("example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "list".to_string(), + method: "GET".to_string(), + path: "/v1/schemas/{namespace}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "create", "/v1/schemas/{namespace}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().create("example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "create".to_string(), + method: "POST".to_string(), + path: "/v1/schemas/{namespace}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "update", "/v1/schemas/{namespace}/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().update("example", "example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "update".to_string(), + method: "PATCH".to_string(), + path: "/v1/schemas/{namespace}/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "delete", "/v1/schemas/{namespace}/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().delete("example", "example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "delete".to_string(), + method: "DELETE".to_string(), + path: "/v1/schemas/{namespace}/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "retrieveSchema", "/v1/schemas/{namespace}/{slug}/version/{semver}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().version().retrieve_schema("example", "example", "example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "retrieveSchema".to_string(), + method: "GET".to_string(), + path: "/v1/schemas/{namespace}/{slug}/version/{semver}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "deleteSchema", "/v1/schemas/{namespace}/{slug}/version/{semver}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().version().delete_schema("example", "example", "example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "deleteSchema".to_string(), + method: "DELETE".to_string(), + path: "/v1/schemas/{namespace}/{slug}/version/{semver}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "createSchema", "/v1/schemas/{namespace}/{slug}/version") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().version().create_schema("example", "example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "createSchema".to_string(), + method: "POST".to_string(), + path: "/v1/schemas/{namespace}/{slug}/version".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "createSchema", "/v1/schemas/{namespace}/{slug}/access-group") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().access_group().create_schema("example", "example", AccessGroup { + access_group_slug: "example".to_string(), + }).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "createSchema".to_string(), + method: "POST".to_string(), + path: "/v1/schemas/{namespace}/{slug}/access-group".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "deleteSchema", "/v1/schemas/{namespace}/{slug}/access-group") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().access_group().delete_schema("example", "example", AccessGroup { + access_group_slug: "example".to_string(), + }).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "deleteSchema".to_string(), + method: "DELETE".to_string(), + path: "/v1/schemas/{namespace}/{slug}/access-group".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "retrieve", "/v1/login-portals/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.login_portals().retrieve("example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "retrieve".to_string(), + method: "GET".to_string(), + path: "/v1/login-portals/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "update", "/v1/login-portals/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.login_portals().update("example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "update".to_string(), + method: "PATCH".to_string(), + path: "/v1/login-portals/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "delete", "/v1/login-portals/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.login_portals().delete("example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "delete".to_string(), + method: "DELETE".to_string(), + path: "/v1/login-portals/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "create", "/v1/login-portals") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.login_portals().create(serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "create".to_string(), + method: "POST".to_string(), + path: "/v1/login-portals".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "list", "/v1/login-portals") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.login_portals().list().send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "list".to_string(), + method: "GET".to_string(), + path: "/v1/login-portals".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "listRulesets", "/v1/rulesets/{namespace}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.rules().list_rulesets("example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "listRulesets".to_string(), + method: "GET".to_string(), + path: "/v1/rulesets/{namespace}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "createRuleset", "/v1/rulesets/{namespace}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.rules().create_ruleset("example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "createRuleset".to_string(), + method: "POST".to_string(), + path: "/v1/rulesets/{namespace}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "updateRuleset", "/v1/rulesets/{namespace}/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.rules().update_ruleset("example", "example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "updateRuleset".to_string(), + method: "PATCH".to_string(), + path: "/v1/rulesets/{namespace}/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "deleteRuleset", "/v1/rulesets/{namespace}/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.rules().delete_ruleset("example", "example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "deleteRuleset".to_string(), + method: "DELETE".to_string(), + path: "/v1/rulesets/{namespace}/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "retrieveRulesetDocument", "/v1/rulesets/{namespace}/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.rules().retrieve_ruleset_document("example", "example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "retrieveRulesetDocument".to_string(), + method: "GET".to_string(), + path: "/v1/rulesets/{namespace}/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "createRulesetAccessGroup", "/v1/rulesets/{namespace}/{slug}/access-group") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.rules().create_ruleset_access_group("example", "example", AccessGroup { + access_group_slug: "example".to_string(), + }).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "createRulesetAccessGroup".to_string(), + method: "POST".to_string(), + path: "/v1/rulesets/{namespace}/{slug}/access-group".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "deleteRulesetAccessGroup", "/v1/rulesets/{namespace}/{slug}/access-group") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.rules().delete_ruleset_access_group("example", "example", AccessGroup { + access_group_slug: "example".to_string(), + }).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "deleteRulesetAccessGroup".to_string(), + method: "DELETE".to_string(), + path: "/v1/rulesets/{namespace}/{slug}/access-group".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "list", "/v1/themes") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.themes().list().send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "list".to_string(), + method: "GET".to_string(), + path: "/v1/themes".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "create", "/v1/themes") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.themes().create(serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "create".to_string(), + method: "POST".to_string(), + path: "/v1/themes".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "update", "/v1/themes/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.themes().update("example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "update".to_string(), + method: "PATCH".to_string(), + path: "/v1/themes/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "replaceDocument", "/v1/themes/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.themes().replace_document("example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "replaceDocument".to_string(), + method: "PUT".to_string(), + path: "/v1/themes/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "delete", "/v1/themes/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.themes().delete("example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "delete".to_string(), + method: "DELETE".to_string(), + path: "/v1/themes/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "retrieve", "/v1/themes/{slug}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.themes().retrieve("example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "retrieve".to_string(), + method: "GET".to_string(), + path: "/v1/themes/{slug}".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "list", "/v1/teams") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.teams().list().send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "list".to_string(), + method: "GET".to_string(), + path: "/v1/teams".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "listGuides", "/v1/guides") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.scalar_docs().list_guides().send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "listGuides".to_string(), + method: "GET".to_string(), + path: "/v1/guides".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "createGuide", "/v1/guides") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.scalar_docs().create_guide(serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "createGuide".to_string(), + method: "POST".to_string(), + path: "/v1/guides".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "publishGuide", "/v1/guides/{slug}/publish") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.scalar_docs().publish_guide("example").send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "publishGuide".to_string(), + method: "POST".to_string(), + path: "/v1/guides/{slug}/publish".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "list", "/v1/namespaces") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.namespaces().list().send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "list".to_string(), + method: "GET".to_string(), + path: "/v1/namespaces".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "exchangePersonalToken", "/v1/auth/exchange") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.authentication().exchange_personal_token(serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "exchangePersonalToken".to_string(), + method: "POST".to_string(), + path: "/v1/auth/exchange".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "listCurrentUser", "/v1/auth/me") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.authentication().list_current_user().send().await?; + Ok(()) + } + .await; + let duration_ms = started.elapsed().as_millis() as i64; + let (status, error) = match result { + Ok(()) => ("passed", String::new()), + Err(error) if is_smoke_failure(&error) => ("failed", format!("{error}")), + // A response came back (API error or decode mismatch): the request + // reached the server, which is what this smoke verifies. + Err(_) => ("passed", String::new()), + }; + results.push(SmokeResult { + operation: "listCurrentUser".to_string(), + method: "GET".to_string(), + path: "/v1/auth/me".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + + let passed = results.iter().filter(|result| result.status == "passed").count(); + let failed = results.iter().filter(|result| result.status == "failed").count(); + let report = SmokeReport { total: results.len(), failed, results }; + + if let Some(path) = report_path { + let json = serde_json::to_string(&report).expect("serialize smoke report"); + std::fs::write(&path, json).expect("write smoke report"); + } else { + for result in &report.results { + match result.status.as_str() { + "passed" => println!("PASS {} ({} {})", result.operation, result.method, result.path), + "skipped" => println!("SKIP {} ({} {}): {}", result.operation, result.method, result.path, result.error), + _ => eprintln!("FAIL {} ({} {})\n{}", result.operation, result.method, result.path, result.error), + } + } + } + + // A vacuous run (nothing passed: empty SDK or every operation skipped) fails, like the + // shared runner. Skipped operations on their own never fail the run. + if report.failed > 0 || passed == 0 { + std::process::exit(1); + } +} + +/// A smoke failure is a plumbing problem — the request could not be sent or +/// the client was misconfigured. An API error (a response with a non-success +/// status) or a decode error means the request reached the server and came +/// back, which is what this smoke verifies; the synthetic response body the +/// mock returns is not the SDK's concern. +fn is_smoke_failure(error: &Error) -> bool { + matches!(error, Error::Transport(_) | Error::Config(_) | Error::MissingParameter(_)) +} diff --git a/openapi.augmented.json b/openapi.augmented.json new file mode 100644 index 0000000..937203f --- /dev/null +++ b/openapi.augmented.json @@ -0,0 +1,7841 @@ +{ + "openapi": "3.1.1", + "info": { + "title": "Scalar API", + "description": "API for managing Scalar platform resources.\n\n## TypeScript SDK\n\nFor TypeScript, we provide a SDK that makes using our API even easier.\n\n### Install\n\n```bash\nnpm add @scalar/sdk\n```\n\n### Get a Scalar API key\n\nCreate an API key in your Scalar account:\n\n- Dashboard: https://dashboard.scalar.com/account\n- Store it in `.env`, for example:\n\n```bash\nSCALAR_API_KEY=your_personal_token\n```\n\n### Exchange your API key for an access token\n\nThe personal token is not an access token. Exchange it first with `postv1AuthExchange`.\n\nIf you use the personal token directly for authenticated API calls, the API returns `401 Invalid authentication token`.\n\n```ts\nimport { Scalar } from '@scalar/sdk'\n\nconst scalar = new Scalar()\n\nconst exchange = await scalar.auth.postv1AuthExchange({\n personalToken: process.env.SCALAR_API_KEY!,\n})\n\nconst accessToken = exchange.accessToken\n```\n\n### Use the access token\n\nConstruct a second client with bearer auth. Use this authenticated client for API calls.\n\n```ts\nimport { Scalar } from '@scalar/sdk'\n\nconst scalar = new Scalar()\n\nconst exchange = await scalar.auth.postv1AuthExchange({\n personalToken: process.env.SCALAR_API_KEY!,\n})\n\nconst authedScalar = new Scalar({\n bearerAuth: exchange.accessToken,\n})\n```\n\n### Notes\n\n- The exchange request itself can be made from a client constructed with no arguments (`new Scalar()`).\n- The exchanged access token is valid for 12 hours.\n- Timestamps are Unix seconds.\n\n### Read more\n\n- [@scalar/sdk on npm](https://www.npmjs.com/package/@scalar/sdk)", + "version": "0.2.0", + "contact": { + "name": "Marc from Scalar", + "url": "https://scalar.com", + "email": "support@scalar.com" + }, + "x-scalar-sdk-installation": [ + { + "lang": "TypeScript", + "description": "```sh\nnpm install @scalar/sdk\n```" + }, + { + "lang": "Python", + "description": "```sh\npip install scalarApi\n```" + }, + { + "lang": "Go", + "description": "```sh\ngo get scalar-api\n```" + } + ] + }, + "servers": [ + { + "url": "https://access.scalar.com" + } + ], + "tags": [ + { + "name": "Registry", + "description": "Registry" + }, + { + "name": "Schemas", + "description": "Schemas" + }, + { + "name": "Login Portals", + "description": "Login Portals" + }, + { + "name": "Rules", + "description": "Rules" + }, + { + "name": "Themes", + "description": "Themes" + }, + { + "name": "Teams", + "description": "Teams" + }, + { + "name": "Scalar Docs", + "description": "Scalar Docs" + }, + { + "name": "Namespaces", + "description": "Namespaces" + }, + { + "name": "Authentication", + "description": "Authentication" + } + ], + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + }, + "schemas": { + "400": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "message", + "code" + ] + }, + "401": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "message", + "code" + ] + }, + "403": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "message", + "code" + ] + }, + "404": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "message", + "code" + ] + }, + "422": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "message", + "code" + ] + }, + "500": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "message", + "code" + ] + }, + "api-document": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" + }, + "version": { + "$ref": "#/components/schemas/version" + }, + "title": { + "default": "", + "type": "string", + "maxLength": 100 + }, + "slug": { + "default": "randomManagedDocSlug()", + "$ref": "#/components/schemas/slug" + }, + "description": { + "default": "", + "type": "string" + }, + "namespace": { + "$ref": "#/components/schemas/namespace" + }, + "isPrivate": { + "default": false, + "type": "boolean" + }, + "tags": { + "default": [] + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/managed-doc-version" + } + } + }, + "required": [ + "uid", + "version", + "title", + "slug", + "description", + "namespace", + "isPrivate", + "tags", + "versions" + ], + "additionalProperties": false + }, + "nanoid": { + "type": "string", + "minLength": 5 + }, + "version": { + "type": "string", + "minLength": 1 + }, + "slug": { + "type": "string", + "minLength": 3, + "maxLength": 60, + "pattern": "^[a-z](?:[a-z0-9-]*[a-z0-9])?$" + }, + "namespace": { + "type": "string", + "minLength": 3, + "maxLength": 50, + "pattern": "^[a-zA-Z0-9-_]+$" + }, + "managed-doc-version": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" + }, + "createdAt": { + "type": "number" + }, + "version": { + "$ref": "#/components/schemas/version" + }, + "upgraded": { + "default": false, + "type": "boolean" + }, + "embedStatus": { + "default": null, + "anyOf": [ + { + "type": "string", + "enum": [ + "complete", + "failed" + ] + }, + { + "type": "null" + } + ] + }, + "tags": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "tools": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "method": { + "$ref": "#/components/schemas/method" + }, + "enabledTools": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "execute-request", + "get-mini-openapi-spec" + ] + } + } + }, + "required": [ + "path", + "method", + "enabledTools" + ], + "additionalProperties": false + } + }, + "yamlSha": { + "type": "string" + }, + "jsonSha": { + "type": "string" + }, + "versionSha": { + "type": "string" + } + }, + "required": [ + "uid", + "createdAt", + "version", + "upgraded", + "embedStatus", + "tags" + ], + "additionalProperties": false + }, + "method": { + "type": "string", + "enum": [ + "delete", + "get", + "head", + "options", + "patch", + "post", + "put", + "trace" + ] + }, + "access-group": { + "type": "object", + "properties": { + "accessGroupSlug": { + "$ref": "#/components/schemas/slug" + } + }, + "required": [ + "accessGroupSlug" + ], + "additionalProperties": false + }, + "schema": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" + }, + "title": { + "default": "", + "type": "string", + "maxLength": 100 + }, + "description": { + "default": "", + "type": "string" + }, + "slug": { + "default": "randomManagedDocSlug()", + "$ref": "#/components/schemas/slug" + }, + "namespace": { + "$ref": "#/components/schemas/namespace" + }, + "isPrivate": { + "default": false, + "type": "boolean" + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/managed-schema-version" + } + } + }, + "required": [ + "uid", + "title", + "description", + "slug", + "namespace", + "isPrivate", + "versions" + ], + "additionalProperties": false + }, + "managed-schema-version": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" + }, + "createdAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" + }, + "updatedAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" + }, + "version": { + "default": "0.0.1", + "$ref": "#/components/schemas/version" + } + }, + "required": [ + "uid", + "createdAt", + "updatedAt", + "version" + ], + "additionalProperties": false + }, + "timestamp": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "uid": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" + } + }, + "required": [ + "uid" + ], + "additionalProperties": false + }, + "login-portal-email": { + "type": "object", + "properties": { + "logo": { + "default": "", + "type": "string" + }, + "logoSize": { + "default": "100", + "type": "string" + }, + "buttonText": { + "default": "Login", + "type": "string", + "maxLength": 50 + }, + "message": { + "default": "Click to access private documentation hosted by scalar.com", + "type": "string", + "maxLength": 1000 + }, + "title": { + "default": "Private Docs", + "type": "string", + "maxLength": 100 + }, + "mainColor": { + "default": "#2a2f45", + "type": "string", + "maxLength": 100 + }, + "mainBackground": { + "default": "#f6f6f6", + "type": "string", + "maxLength": 100 + }, + "cardColor": { + "default": "2a2f45", + "type": "string", + "maxLength": 100 + }, + "cardBackground": { + "default": "#fff", + "type": "string", + "maxLength": 100 + }, + "buttonColor": { + "default": "#fff", + "type": "string", + "maxLength": 100 + }, + "buttonBackground": { + "default": "#0f0f0f", + "type": "string", + "maxLength": 100 + } + }, + "required": [ + "logo", + "logoSize", + "buttonText", + "message", + "title", + "mainColor", + "mainBackground", + "cardColor", + "cardBackground", + "buttonColor", + "buttonBackground" + ], + "additionalProperties": false + }, + "login-portal-page": { + "type": "object", + "properties": { + "title": { + "default": "Scalar Private Docs", + "type": "string", + "maxLength": 100 + }, + "description": { + "default": "Login to access your documentation", + "type": "string", + "maxLength": 500 + }, + "head": { + "default": "", + "type": "string" + }, + "script": { + "default": "", + "type": "string" + }, + "theme": { + "default": "", + "type": "string" + }, + "companyName": { + "default": "", + "type": "string", + "maxLength": 100 + }, + "logo": { + "default": "", + "type": "string" + }, + "logoURL": { + "default": "", + "type": "string" + }, + "favicon": { + "default": "", + "type": "string" + }, + "termsLink": { + "default": "", + "type": "string" + }, + "privacyLink": { + "default": "", + "type": "string" + }, + "formTitle": { + "default": "Scalar Private Docs", + "type": "string", + "maxLength": 100 + }, + "formDescription": { + "default": "Login to access your documentation", + "type": "string", + "maxLength": 500 + }, + "formImage": { + "default": "", + "type": "string" + } + }, + "required": [ + "title", + "description", + "head", + "script", + "theme", + "companyName", + "logo", + "logoURL", + "favicon", + "termsLink", + "privacyLink", + "formTitle", + "formDescription", + "formImage" + ], + "additionalProperties": false + }, + "login-portal": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" + }, + "title": { + "type": "string", + "maxLength": 200 + }, + "slug": { + "$ref": "#/components/schemas/slug" + } + }, + "required": [ + "uid", + "title", + "slug" + ], + "additionalProperties": false + }, + "rule": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" + }, + "title": { + "default": "", + "type": "string", + "maxLength": 100 + }, + "description": { + "default": "", + "type": "string" + }, + "slug": { + "default": "randomManagedDocSlug()", + "$ref": "#/components/schemas/slug" + }, + "namespace": { + "$ref": "#/components/schemas/namespace" + }, + "isPrivate": { + "default": false, + "type": "boolean" + } + }, + "required": [ + "uid", + "title", + "description", + "slug", + "namespace", + "isPrivate" + ], + "additionalProperties": false + }, + "theme": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "slug": { + "$ref": "#/components/schemas/slug" + } + }, + "required": [ + "uid", + "name", + "description", + "slug" + ], + "additionalProperties": false + }, + "team": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" + }, + "name": { + "$ref": "#/components/schemas/team-name" + }, + "imageUri": { + "$ref": "#/components/schemas/team-image" + }, + "slug": { + "$ref": "#/components/schemas/slug" + }, + "theme": { + "type": "string" + } + }, + "required": [ + "uid", + "name", + "slug", + "theme" + ], + "additionalProperties": false + }, + "team-name": { + "type": "string" + }, + "team-image": { + "type": "string" + }, + "github-project": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" + }, + "createdAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" + }, + "updatedAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" + }, + "name": { + "type": "string" + }, + "activeDeployment": { + "default": null, + "anyOf": [ + { + "$ref": "#/components/schemas/active-deployment" + }, + { + "type": "null" + } + ] + }, + "lastPublished": { + "default": null, + "anyOf": [ + { + "$ref": "#/components/schemas/timestamp" + }, + { + "type": "null" + } + ] + }, + "lastPublishedUid": { + "default": null, + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "loginPortalUid": { + "default": "", + "type": "string" + }, + "activeThemeId": { + "default": "", + "type": "string" + }, + "typesenseId": { + "type": "number" + }, + "isPrivate": { + "default": false, + "type": "boolean" + }, + "agentEnabled": { + "default": false, + "type": "boolean" + }, + "accessGroups": { + "default": [] + }, + "slug": { + "$ref": "#/components/schemas/slug" + }, + "publishStatus": { + "default": "", + "type": "string" + }, + "publishMessage": { + "default": "", + "type": "string" + }, + "repository": { + "anyOf": [ + { + "$ref": "#/components/schemas/github-project-repository" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "uid", + "createdAt", + "updatedAt", + "name", + "activeDeployment", + "lastPublished", + "lastPublishedUid", + "loginPortalUid", + "activeThemeId", + "isPrivate", + "agentEnabled", + "accessGroups", + "slug", + "publishStatus", + "publishMessage" + ], + "additionalProperties": false + }, + "active-deployment": { + "type": "object", + "properties": { + "uid": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "publishedAt": { + "$ref": "#/components/schemas/timestamp" + } + }, + "required": [ + "uid", + "domain", + "publishedAt" + ], + "additionalProperties": false + }, + "github-project-repository": { + "type": "object", + "properties": { + "linkedBy": { + "type": "string" + }, + "id": { + "type": "number" + }, + "name": { + "type": "string", + "minLength": 2 + }, + "configPath": { + "default": "", + "type": "string" + }, + "branch": { + "default": "", + "type": "string" + }, + "publishOnMerge": { + "default": false, + "type": "boolean" + }, + "publishPreviews": { + "default": false, + "type": "boolean" + }, + "prComments": { + "default": false, + "type": "boolean" + }, + "expired": { + "default": false, + "type": "boolean" + } + }, + "required": [ + "linkedBy", + "id", + "name", + "configPath", + "branch", + "publishOnMerge", + "publishPreviews", + "prComments", + "expired" + ], + "additionalProperties": false + }, + "email": { + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + "team-summary": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" + }, + "name": { + "$ref": "#/components/schemas/team-name" + }, + "imageUri": { + "$ref": "#/components/schemas/team-image" + } + }, + "required": [ + "uid", + "name" + ], + "additionalProperties": false + }, + "user": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" + }, + "createdAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" + }, + "updatedAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" + }, + "email": { + "$ref": "#/components/schemas/email" + }, + "theme": { + "type": "string" + }, + "activeTeamId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "hasGithub": { + "default": false, + "type": "boolean" + }, + "teams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/team-summary" + } + } + }, + "required": [ + "uid", + "createdAt", + "updatedAt", + "email", + "activeTeamId", + "hasGithub", + "teams" + ], + "additionalProperties": false + } + } + }, + "security": [ + { + "BearerAuth": [] + } + ], + "paths": { + "/v1/apis": { + "get": { + "tags": [ + "Registry" + ], + "description": "List all API documents across every namespace the caller can access.", + "summary": "List all API Documents", + "operationId": "listAllApiDocuments", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/api-document" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst listAllAPIDocuments = await client.registry.listAllAPIDocuments();\nconsole.log(listAllAPIDocuments);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry list-all-api-documents --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.list_all_api_documents()\nprint(registry)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.ListAllAPIDocuments(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.registry.RegistryListAllApiDocumentsParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar registry = client.registry().listAllApiDocuments();\nSystem.out.println(registry);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.registry.RegistryListAllApiDocumentsParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval registry = client.registry().listAllApiDocuments(RegistryListAllApiDocumentsParams.none())\nprintln(registry)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.list_all_api_documents\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi registry list-all-api-documents --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/apis/{namespace}": { + "get": { + "tags": [ + "Registry" + ], + "description": "List API documents in a namespace.", + "summary": "List API Documents in a namespace", + "operationId": "listApiDocuments", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/api-document" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst listAPIDocuments = await client.registry.listAPIDocuments(\"namespace\");\nconsole.log(listAPIDocuments);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry list-api-documents 'namespace' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.list_api_documents(\n namespace=\"namespace\",\n)\nprint(registry)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.ListAPIDocuments(context.Background(), \"namespace\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.registry.RegistryListApiDocumentsParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryListApiDocumentsParams params = RegistryListApiDocumentsParams.builder()\n .namespace(\"namespace\")\n .build();\nvar registry = client.registry().listApiDocuments(params);\nSystem.out.println(registry);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.registry.RegistryListApiDocumentsParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryListApiDocumentsParams.builder()\n .namespace(\"namespace\")\n .build()\nval registry = client.registry().listApiDocuments(params)\nprintln(registry)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.list_api_documents(\"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi registry list-api-documents 'namespace' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "post": { + "tags": [ + "Registry" + ], + "description": "Create an API document.", + "summary": "Create API Document", + "operationId": "createApiDocument", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "uid": { + "type": "string" + }, + "versionUid": { + "type": "string" + }, + "title": { + "type": "string" + }, + "jsonSha": { + "type": "string" + }, + "yamlSha": { + "type": "string" + }, + "versionSha": { + "type": "string" + } + }, + "required": [ + "uid", + "versionUid", + "title", + "jsonSha", + "yamlSha", + "versionSha" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "version": { + "$ref": "#/components/schemas/version" + }, + "slug": { + "type": "string" + }, + "ruleset": { + "type": "string" + }, + "isPrivate": { + "type": "boolean" + }, + "document": { + "type": "string" + } + }, + "required": [ + "title", + "version", + "slug", + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst createAPIDocument = await client.registry.createAPIDocument(\"namespace\", {\n title: \"\",\n version: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(createAPIDocument);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry create-api-document 'namespace' --bearer-auth \"$BEARER_AUTH\" --title 'title' --version-command 'version' --slug 'slug' --document 'document'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.create_api_document(\n namespace=\"namespace\",\n title=\"\",\n version=\"\",\n slug=\"\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(registry)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.NewAPIDocument(context.Background(), \"namespace\", sdk.RegistryNewAPIDocumentParams{\n\t\tDocument: \"\",\n\t\tSlug: \"\",\n\t\tTitle: \"\",\n\t\tVersion: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.registry.RegistryCreateApiDocumentParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryCreateApiDocumentParams params = RegistryCreateApiDocumentParams.builder()\n .namespace(\"namespace\")\n .title(\"title\")\n .version(\"version\")\n .slug(\"slug\")\n .document(\"document\")\n .build();\nvar registry = client.registry().createApiDocument(params);\nSystem.out.println(registry);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.registry.RegistryCreateApiDocumentParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryCreateApiDocumentParams.builder()\n .namespace(\"namespace\")\n .title(\"title\")\n .version(\"version\")\n .slug(\"slug\")\n .document(\"document\")\n .build()\nval registry = client.registry().createApiDocument(params)\nprintln(registry)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.create_api_document(\"smoke-test\", { title: \"title\", description: \"description\", version: \"version\", slug: \"slug\", ruleset: \"ruleset\", is_private: \"is_private\", document: \"document\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi registry create-api-document 'namespace' --bearer-auth \"$BEARER_AUTH\" --title 'title' --version-command 'version' --slug 'slug' --document 'document'" + } + ] + } + }, + "/v1/apis/{namespace}/{slug}": { + "patch": { + "tags": [ + "Registry" + ], + "description": "Update metadata for an API document.", + "summary": "Update API Document metadata", + "operationId": "updateApiDocument", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "isPrivate": { + "type": "boolean" + }, + "ruleset": { + "type": "string" + } + }, + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.registry.updateAPIDocument(\"namespace\", \"slug\", {});" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry update-api-document 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.update_api_document(\n namespace=\"namespace\",\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(registry)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.UpdateAPIDocument(context.Background(), \"namespace\", \"slug\", sdk.RegistryUpdateAPIDocumentParams{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.registry.RegistryUpdateApiDocumentParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryUpdateApiDocumentParams params = RegistryUpdateApiDocumentParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar registry = client.registry().updateApiDocument(params);\nSystem.out.println(registry);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.registry.RegistryUpdateApiDocumentParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryUpdateApiDocumentParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval registry = client.registry().updateApiDocument(params)\nprintln(registry)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.update_api_document(\"smoke-test\", \"smoke-test\", { title: \"title\", description: \"description\", is_private: \"is_private\", ruleset: \"ruleset\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi registry update-api-document 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "delete": { + "tags": [ + "Registry" + ], + "description": "Delete an API document and all versions.", + "summary": "Delete API Document", + "operationId": "deleteApiDocument", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.registry.deleteAPIDocument(\"namespace\", \"slug\");" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry delete-api-document 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.delete_api_document(\n namespace=\"namespace\",\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(registry)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.DeleteAPIDocument(context.Background(), \"namespace\", \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.registry.RegistryDeleteApiDocumentParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryDeleteApiDocumentParams params = RegistryDeleteApiDocumentParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar registry = client.registry().deleteApiDocument(params);\nSystem.out.println(registry);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.registry.RegistryDeleteApiDocumentParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryDeleteApiDocumentParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval registry = client.registry().deleteApiDocument(params)\nprintln(registry)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.delete_api_document(\"smoke-test\", \"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi registry delete-api-document 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/apis/{namespace}/{slug}/version/{semver}": { + "get": { + "tags": [ + "Registry" + ], + "description": "Get a specific API document version.", + "summary": "Get API Document", + "operationId": "getApiDocumentVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst string_ = await client.registry.retrieveAPIDocumentVersion(\"namespace\", \"slug\", \"semver\");\nconsole.log(string_);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry retrieve-api-document-version 'namespace' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.retrieve_api_document_version(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n)\nprint(registry)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.GetAPIDocumentVersion(context.Background(), \"namespace\", \"slug\", \"semver\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.registry.RegistryRetrieveApiDocumentVersionParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryRetrieveApiDocumentVersionParams params = RegistryRetrieveApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build();\nvar registry = client.registry().retrieveApiDocumentVersion(params);\nSystem.out.println(registry);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.registry.RegistryRetrieveApiDocumentVersionParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryRetrieveApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build()\nval registry = client.registry().retrieveApiDocumentVersion(params)\nprintln(registry)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.retrieve_api_document_version(\"smoke-test\", \"smoke-test\", \"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi registry retrieve-api-document-version 'namespace' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "patch": { + "tags": [ + "Registry" + ], + "description": "Update the registry file content for an API document version.", + "summary": "Update API Document version", + "operationId": "updateApiDocumentVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "jsonSha": { + "type": "string" + }, + "yamlSha": { + "type": "string" + }, + "versionSha": { + "type": "string" + } + }, + "required": [ + "jsonSha", + "yamlSha", + "versionSha" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "document": { + "type": "string" + }, + "lastKnownVersionSha": { + "type": "string" + } + }, + "required": [ + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst updateAPIDocumentVersion = await client.registry.updateAPIDocumentVersion(\"namespace\", \"slug\", \"semver\", {\n document: \"\",\n});\nconsole.log(updateAPIDocumentVersion);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry update-api-document-version 'namespace' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\" --document 'document'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.update_api_document_version(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(registry)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.UpdateAPIDocumentVersion(context.Background(), \"namespace\", \"slug\", \"semver\", sdk.RegistryUpdateAPIDocumentVersionParams{\n\t\tDocument: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.registry.RegistryUpdateApiDocumentVersionParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryUpdateApiDocumentVersionParams params = RegistryUpdateApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .document(\"document\")\n .build();\nvar registry = client.registry().updateApiDocumentVersion(params);\nSystem.out.println(registry);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.registry.RegistryUpdateApiDocumentVersionParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryUpdateApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .document(\"document\")\n .build()\nval registry = client.registry().updateApiDocumentVersion(params)\nprintln(registry)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.update_api_document_version(\"smoke-test\", \"smoke-test\", \"smoke-test\", { document: \"document\", last_known_version_sha: \"last_known_version_sha\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi registry update-api-document-version 'namespace' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\" --document 'document'" + } + ] + }, + "delete": { + "tags": [ + "Registry" + ], + "description": "Delete a specific API document version.", + "summary": "Delete API Document version", + "operationId": "deleteApiDocumentVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.registry.deleteAPIDocumentVersion(\"namespace\", \"slug\", \"semver\");" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry delete-api-document-version 'namespace' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.delete_api_document_version(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n idempotency_key=\"\",\n)\nprint(registry)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.DeleteAPIDocumentVersion(context.Background(), \"namespace\", \"slug\", \"semver\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.registry.RegistryDeleteApiDocumentVersionParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryDeleteApiDocumentVersionParams params = RegistryDeleteApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build();\nvar registry = client.registry().deleteApiDocumentVersion(params);\nSystem.out.println(registry);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.registry.RegistryDeleteApiDocumentVersionParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryDeleteApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build()\nval registry = client.registry().deleteApiDocumentVersion(params)\nprintln(registry)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.delete_api_document_version(\"smoke-test\", \"smoke-test\", \"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi registry delete-api-document-version 'namespace' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/apis/{namespace}/{slug}/version/{semver}/metadata": { + "get": { + "tags": [ + "Registry" + ], + "description": "Get metadata (uid, content shas, version sha, tags) for a specific API document version.", + "summary": "Get API Document version metadata", + "operationId": "getApiDocumentVersionMetadata", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/managed-doc-version" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst managedDocVersion = await client.registry.listAPIDocumentVersionMetadata(\"namespace\", \"slug\", \"semver\");\nconsole.log(managedDocVersion);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry list-api-document-version-metadata 'namespace' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.list_api_document_version_metadata(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n)\nprint(registry)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.ListAPIDocumentVersionMetadata(context.Background(), \"namespace\", \"slug\", \"semver\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.registry.RegistryListApiDocumentVersionMetadataParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryListApiDocumentVersionMetadataParams params = RegistryListApiDocumentVersionMetadataParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build();\nvar registry = client.registry().listApiDocumentVersionMetadata(params);\nSystem.out.println(registry);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.registry.RegistryListApiDocumentVersionMetadataParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryListApiDocumentVersionMetadataParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build()\nval registry = client.registry().listApiDocumentVersionMetadata(params)\nprintln(registry)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.list_api_document_version_metadata(\"smoke-test\", \"smoke-test\", \"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi registry list-api-document-version-metadata 'namespace' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/apis/{namespace}/{slug}/version": { + "post": { + "tags": [ + "Registry" + ], + "description": "Create a new API document version.", + "summary": "Create API Document version", + "operationId": "createApiDocumentVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/managed-doc-version" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "version": { + "$ref": "#/components/schemas/version" + }, + "document": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "lastKnownVersionSha": { + "type": "string" + } + }, + "required": [ + "version", + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst managedDocVersion = await client.registry.createAPIDocumentVersion(\"namespace\", \"slug\", {\n version: \"\",\n document: \"\",\n});\nconsole.log(managedDocVersion);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry create-api-document-version 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --version-command 'version' --document 'document'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.create_api_document_version(\n namespace=\"namespace\",\n slug=\"slug\",\n version=\"\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(registry)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.NewAPIDocumentVersion(context.Background(), \"namespace\", \"slug\", sdk.RegistryNewAPIDocumentVersionParams{\n\t\tDocument: \"\",\n\t\tVersion: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.registry.RegistryCreateApiDocumentVersionParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryCreateApiDocumentVersionParams params = RegistryCreateApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .version(\"version\")\n .document(\"document\")\n .build();\nvar registry = client.registry().createApiDocumentVersion(params);\nSystem.out.println(registry);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.registry.RegistryCreateApiDocumentVersionParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryCreateApiDocumentVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .version(\"version\")\n .document(\"document\")\n .build()\nval registry = client.registry().createApiDocumentVersion(params)\nprintln(registry)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.create_api_document_version(\"smoke-test\", \"smoke-test\", { version: \"version\", document: \"document\", force: \"force\", last_known_version_sha: \"last_known_version_sha\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi registry create-api-document-version 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --version-command 'version' --document 'document'" + } + ] + } + }, + "/v1/apis/{namespace}/{slug}/access-group": { + "post": { + "tags": [ + "Registry" + ], + "description": "Add an access group to an API document.", + "summary": "Add access group", + "operationId": "addApiDocumentAccessGroup", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/access-group" + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.registry.createAPIDocumentAccessGroup(\"namespace\", \"slug\", {\n accessGroupSlug: \"\",\n});" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry create-api-document-access-group 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.create_api_document_access_group(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"\",\n idempotency_key=\"\",\n)\nprint(registry)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.NewAPIDocumentAccessGroup(context.Background(), \"namespace\", \"slug\", sdk.RegistryNewAPIDocumentAccessGroupParams{\n\t\tAccessGroup: sdk.AccessGroup{\n\t\tAccessGroupSlug: \"\",\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.registry.RegistryCreateApiDocumentAccessGroupParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryCreateApiDocumentAccessGroupParams params = RegistryCreateApiDocumentAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar registry = client.registry().createApiDocumentAccessGroup(params);\nSystem.out.println(registry);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.registry.RegistryCreateApiDocumentAccessGroupParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryCreateApiDocumentAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval registry = client.registry().createApiDocumentAccessGroup(params)\nprintln(registry)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.create_api_document_access_group(\"smoke-test\", \"smoke-test\", { access_group_slug: \"access_group_slug\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi registry create-api-document-access-group 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" + } + ] + }, + "delete": { + "tags": [ + "Registry" + ], + "description": "Remove an access group from an API document.", + "summary": "Remove access group", + "operationId": "removeApiDocumentAccessGroup", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/access-group" + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.registry.deleteAPIDocumentAccessGroup(\"namespace\", \"slug\", {\n accessGroupSlug: \"\",\n});" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry delete-api-document-access-group 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nregistry = client.registry.delete_api_document_access_group(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"\",\n idempotency_key=\"\",\n)\nprint(registry)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tregistry, err := client.Registry.DeleteAPIDocumentAccessGroup(context.Background(), \"namespace\", \"slug\", sdk.RegistryDeleteAPIDocumentAccessGroupParams{\n\t\tAccessGroup: sdk.AccessGroup{\n\t\tAccessGroupSlug: \"\",\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.registry.RegistryDeleteApiDocumentAccessGroupParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRegistryDeleteApiDocumentAccessGroupParams params = RegistryDeleteApiDocumentAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar registry = client.registry().deleteApiDocumentAccessGroup(params);\nSystem.out.println(registry);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.registry.RegistryDeleteApiDocumentAccessGroupParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RegistryDeleteApiDocumentAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval registry = client.registry().deleteApiDocumentAccessGroup(params)\nprintln(registry)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.registry.delete_api_document_access_group(\"smoke-test\", \"smoke-test\", { access_group_slug: \"access_group_slug\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi registry delete-api-document-access-group 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" + } + ] + } + }, + "/v1/schemas/{namespace}": { + "get": { + "tags": [ + "Schemas" + ], + "description": "List schemas in a namespace.", + "summary": "List all shared components", + "operationId": "listSchemas", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/schema" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst list = await client.schemas.list(\"namespace\");\nconsole.log(list);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas list 'namespace' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nschema = client.schemas.list(\n namespace=\"namespace\",\n)\nprint(schema)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tschema, err := client.Schemas.List(context.Background(), \"namespace\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.SchemaListParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaListParams params = SchemaListParams.builder()\n .namespace(\"namespace\")\n .build();\nvar schema = client.schemas().list(params);\nSystem.out.println(schema);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.SchemaListParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaListParams.builder()\n .namespace(\"namespace\")\n .build()\nval schema = client.schemas().list(params)\nprintln(schema)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.list(\"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi schemas list 'namespace' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "post": { + "tags": [ + "Schemas" + ], + "description": "Create a schema in a namespace.", + "summary": "Create a shared component", + "operationId": "createSchema", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uid" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "version": { + "$ref": "#/components/schemas/version" + }, + "slug": { + "type": "string" + }, + "isPrivate": { + "type": "boolean" + }, + "document": { + "type": "string" + } + }, + "required": [ + "title", + "version", + "slug", + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst uID = await client.schemas.create(\"namespace\", {\n title: \"\",\n version: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(uID);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas create 'namespace' --bearer-auth \"$BEARER_AUTH\" --title 'title' --version-command 'version' --slug 'slug' --document 'document'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nschema = client.schemas.create(\n namespace=\"namespace\",\n title=\"\",\n version=\"\",\n slug=\"\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(schema)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tschema, err := client.Schemas.New(context.Background(), \"namespace\", sdk.SchemaNewParams{\n\t\tDocument: \"\",\n\t\tSlug: \"\",\n\t\tTitle: \"\",\n\t\tVersion: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.SchemaCreateParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaCreateParams params = SchemaCreateParams.builder()\n .namespace(\"namespace\")\n .title(\"title\")\n .version(\"version\")\n .slug(\"slug\")\n .document(\"document\")\n .build();\nvar schema = client.schemas().create(params);\nSystem.out.println(schema);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.SchemaCreateParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaCreateParams.builder()\n .namespace(\"namespace\")\n .title(\"title\")\n .version(\"version\")\n .slug(\"slug\")\n .document(\"document\")\n .build()\nval schema = client.schemas().create(params)\nprintln(schema)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.create(\"smoke-test\", { title: \"title\", description: \"description\", version: \"version\", slug: \"slug\", is_private: \"is_private\", document: \"document\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi schemas create 'namespace' --bearer-auth \"$BEARER_AUTH\" --title 'title' --version-command 'version' --slug 'slug' --document 'document'" + } + ] + } + }, + "/v1/schemas/{namespace}/{slug}": { + "patch": { + "tags": [ + "Schemas" + ], + "description": "Update schema metadata.", + "summary": "Update shared component metadata", + "operationId": "updateSchema", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "isPrivate": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.schemas.update(\"namespace\", \"slug\", {});" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas update 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nschema = client.schemas.update(\n namespace=\"namespace\",\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(schema)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tschema, err := client.Schemas.Update(context.Background(), \"namespace\", \"slug\", sdk.SchemaUpdateParams{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.SchemaUpdateParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaUpdateParams params = SchemaUpdateParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar schema = client.schemas().update(params);\nSystem.out.println(schema);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.SchemaUpdateParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaUpdateParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval schema = client.schemas().update(params)\nprintln(schema)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.update(\"smoke-test\", \"smoke-test\", { title: \"title\", description: \"description\", is_private: \"is_private\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi schemas update 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "delete": { + "tags": [ + "Schemas" + ], + "description": "Delete a schema and all related versions.", + "summary": "Delete a shared component", + "operationId": "deleteSchema", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.schemas.delete(\"namespace\", \"slug\");" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas delete 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nschema = client.schemas.delete(\n namespace=\"namespace\",\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(schema)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tschema, err := client.Schemas.Delete(context.Background(), \"namespace\", \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.SchemaDeleteParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaDeleteParams params = SchemaDeleteParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar schema = client.schemas().delete(params);\nSystem.out.println(schema);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.SchemaDeleteParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaDeleteParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval schema = client.schemas().delete(params)\nprintln(schema)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.delete(\"smoke-test\", \"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi schemas delete 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/schemas/{namespace}/{slug}/version/{semver}": { + "get": { + "tags": [ + "Schemas" + ], + "description": "Get a specific schema version document.", + "summary": "Get a shared component document", + "operationId": "getSchemaVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst string_ = await client.schemas.version.retrieveSchema(\"namespace\", \"slug\", \"semver\");\nconsole.log(string_);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas:version-command retrieve-schema 'namespace' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nversion = client.schemas.version.retrieve_schema(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n)\nprint(version)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tversion, err := client.Schemas.Version.GetSchema(context.Background(), \"namespace\", \"slug\", \"semver\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(version)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.version.VersionRetrieveSchemaParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nVersionRetrieveSchemaParams params = VersionRetrieveSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build();\nvar version = client.schemas().version().retrieveSchema(params);\nSystem.out.println(version);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.version.VersionRetrieveSchemaParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = VersionRetrieveSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build()\nval version = client.schemas().version().retrieveSchema(params)\nprintln(version)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.version.retrieve_schema(\"smoke-test\", \"smoke-test\", \"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi schemas:version-command retrieve-schema 'namespace' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "delete": { + "tags": [ + "Schemas" + ], + "description": "Delete a schema version.", + "summary": "Delete a shared component version", + "operationId": "deleteSchemaVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.schemas.version.deleteSchema(\"namespace\", \"slug\", \"semver\");" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas:version-command delete-schema 'namespace' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nversion = client.schemas.version.delete_schema(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n idempotency_key=\"\",\n)\nprint(version)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tversion, err := client.Schemas.Version.DeleteSchema(context.Background(), \"namespace\", \"slug\", \"semver\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(version)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.version.VersionDeleteSchemaParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nVersionDeleteSchemaParams params = VersionDeleteSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build();\nvar version = client.schemas().version().deleteSchema(params);\nSystem.out.println(version);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.version.VersionDeleteSchemaParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = VersionDeleteSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build()\nval version = client.schemas().version().deleteSchema(params)\nprintln(version)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.version.delete_schema(\"smoke-test\", \"smoke-test\", \"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi schemas:version-command delete-schema 'namespace' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/schemas/{namespace}/{slug}/version": { + "post": { + "tags": [ + "Schemas" + ], + "description": "Create a schema version.", + "summary": "Create a shared component version", + "operationId": "createSchemaVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uid" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "version": { + "$ref": "#/components/schemas/version" + }, + "document": { + "type": "string" + } + }, + "required": [ + "version", + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst uID = await client.schemas.version.createSchema(\"namespace\", \"slug\", {\n version: \"\",\n document: \"\",\n});\nconsole.log(uID);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas:version-command create-schema 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --version-command 'version' --document 'document'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nversion = client.schemas.version.create_schema(\n namespace=\"namespace\",\n slug=\"slug\",\n version=\"\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(version)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tversion, err := client.Schemas.Version.NewSchema(context.Background(), \"namespace\", \"slug\", sdk.SchemaVersionNewSchemaParams{\n\t\tDocument: \"\",\n\t\tVersion: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(version)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.version.VersionCreateSchemaParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nVersionCreateSchemaParams params = VersionCreateSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .version(\"version\")\n .document(\"document\")\n .build();\nvar version = client.schemas().version().createSchema(params);\nSystem.out.println(version);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.version.VersionCreateSchemaParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = VersionCreateSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .version(\"version\")\n .document(\"document\")\n .build()\nval version = client.schemas().version().createSchema(params)\nprintln(version)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.version.create_schema(\"smoke-test\", \"smoke-test\", { version: \"version\", document: \"document\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi schemas:version-command create-schema 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --version-command 'version' --document 'document'" + } + ] + } + }, + "/v1/schemas/{namespace}/{slug}/access-group": { + "post": { + "tags": [ + "Schemas" + ], + "description": "Add an access group to a schema.", + "summary": "Add shared component access group", + "operationId": "addSchemaAccessGroup", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/access-group" + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.schemas.accessGroup.createSchema(\"namespace\", \"slug\", {\n accessGroupSlug: \"\",\n});" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas:access-group create-schema 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\naccess_group = client.schemas.access_group.create_schema(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"\",\n idempotency_key=\"\",\n)\nprint(access_group)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\taccessGroup, err := client.Schemas.AccessGroup.NewSchema(context.Background(), \"namespace\", \"slug\", sdk.SchemaAccessGroupNewSchemaParams{\n\t\tAccessGroup: sdk.AccessGroup{\n\t\tAccessGroupSlug: \"\",\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(accessGroup)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.accessgroup.AccessGroupCreateSchemaParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nAccessGroupCreateSchemaParams params = AccessGroupCreateSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar accessGroup = client.schemas().accessGroup().createSchema(params);\nSystem.out.println(accessGroup);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.accessgroup.AccessGroupCreateSchemaParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = AccessGroupCreateSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval accessGroup = client.schemas().accessGroup().createSchema(params)\nprintln(accessGroup)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.accessGroup.create_schema(\"smoke-test\", \"smoke-test\", { access_group_slug: \"access_group_slug\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi schemas:access-group create-schema 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" + } + ] + }, + "delete": { + "tags": [ + "Schemas" + ], + "description": "Remove an access group from a schema.", + "summary": "Remove shared component access group", + "operationId": "removeSchemaAccessGroup", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/access-group" + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.schemas.accessGroup.deleteSchema(\"namespace\", \"slug\", {\n accessGroupSlug: \"\",\n});" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas:access-group delete-schema 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\naccess_group = client.schemas.access_group.delete_schema(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"\",\n idempotency_key=\"\",\n)\nprint(access_group)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\taccessGroup, err := client.Schemas.AccessGroup.DeleteSchema(context.Background(), \"namespace\", \"slug\", sdk.SchemaAccessGroupDeleteSchemaParams{\n\t\tAccessGroup: sdk.AccessGroup{\n\t\tAccessGroupSlug: \"\",\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(accessGroup)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.accessgroup.AccessGroupDeleteSchemaParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nAccessGroupDeleteSchemaParams params = AccessGroupDeleteSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar accessGroup = client.schemas().accessGroup().deleteSchema(params);\nSystem.out.println(accessGroup);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.accessgroup.AccessGroupDeleteSchemaParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = AccessGroupDeleteSchemaParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval accessGroup = client.schemas().accessGroup().deleteSchema(params)\nprintln(accessGroup)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.schemas.accessGroup.delete_schema(\"smoke-test\", \"smoke-test\", { access_group_slug: \"access_group_slug\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi schemas:access-group delete-schema 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" + } + ] + } + }, + "/v1/login-portals/{slug}": { + "get": { + "tags": [ + "Login Portals" + ], + "description": "Get a login portal by slug.", + "summary": "Get a login portal", + "operationId": "getLoginPortal", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "uid": { + "type": "string" + }, + "title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "email": { + "$ref": "#/components/schemas/login-portal-email" + }, + "page": { + "$ref": "#/components/schemas/login-portal-page" + } + }, + "required": [ + "uid", + "title", + "slug", + "email", + "page" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst retrieve = await client.loginPortals.retrieve(\"slug\");\nconsole.log(retrieve);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi login-portals retrieve 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nlogin_portal = client.login_portals.retrieve(\n slug=\"slug\",\n)\nprint(login_portal)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tloginPortal, err := client.LoginPortals.Get(context.Background(), \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(loginPortal)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.loginportals.LoginPortalRetrieveParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nLoginPortalRetrieveParams params = LoginPortalRetrieveParams.builder()\n .slug(\"slug\")\n .build();\nvar loginPortal = client.loginPortals().retrieve(params);\nSystem.out.println(loginPortal);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.loginportals.LoginPortalRetrieveParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = LoginPortalRetrieveParams.builder()\n .slug(\"slug\")\n .build()\nval loginPortal = client.loginPortals().retrieve(params)\nprintln(loginPortal)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.loginPortals.retrieve(\"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi login-portals retrieve 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "patch": { + "tags": [ + "Login Portals" + ], + "description": "Update metadata for a login portal.", + "summary": "Update portal metadata", + "operationId": "updateLoginPortal", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + } + }, + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.loginPortals.update(\"slug\", {});" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi login-portals update 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nlogin_portal = client.login_portals.update(\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(login_portal)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tloginPortal, err := client.LoginPortals.Update(context.Background(), \"slug\", sdk.LoginPortalUpdateParams{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(loginPortal)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.loginportals.LoginPortalUpdateParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nLoginPortalUpdateParams params = LoginPortalUpdateParams.builder()\n .slug(\"slug\")\n .build();\nvar loginPortal = client.loginPortals().update(params);\nSystem.out.println(loginPortal);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.loginportals.LoginPortalUpdateParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = LoginPortalUpdateParams.builder()\n .slug(\"slug\")\n .build()\nval loginPortal = client.loginPortals().update(params)\nprintln(loginPortal)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.loginPortals.update(\"smoke-test\", { title: \"title\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi login-portals update 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "delete": { + "tags": [ + "Login Portals" + ], + "description": "Delete a login portal.", + "summary": "Delete a login portal", + "operationId": "deleteLoginPortal", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.loginPortals.delete(\"slug\");" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi login-portals delete 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nlogin_portal = client.login_portals.delete(\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(login_portal)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tloginPortal, err := client.LoginPortals.Delete(context.Background(), \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(loginPortal)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.loginportals.LoginPortalDeleteParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nLoginPortalDeleteParams params = LoginPortalDeleteParams.builder()\n .slug(\"slug\")\n .build();\nvar loginPortal = client.loginPortals().delete(params);\nSystem.out.println(loginPortal);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.loginportals.LoginPortalDeleteParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = LoginPortalDeleteParams.builder()\n .slug(\"slug\")\n .build()\nval loginPortal = client.loginPortals().delete(params)\nprintln(loginPortal)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.loginPortals.delete(\"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi login-portals delete 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/login-portals": { + "post": { + "tags": [ + "Login Portals" + ], + "description": "Create a login portal for the current team.", + "summary": "Create a portal", + "operationId": "createLoginPortal", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uid" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "email": { + "$ref": "#/components/schemas/login-portal-email" + }, + "page": { + "$ref": "#/components/schemas/login-portal-page" + } + }, + "required": [ + "title", + "slug", + "email", + "page" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst uID = await client.loginPortals.create({\n title: \"\",\n slug: \"\",\n email: {\n logo: \"\",\n logoSize: \"100\",\n buttonText: \"Login\",\n message: \"Click to access private documentation hosted by scalar.com\",\n title: \"Private Docs\",\n mainColor: \"#2a2f45\",\n mainBackground: \"#f6f6f6\",\n cardColor: \"2a2f45\",\n cardBackground: \"#fff\",\n buttonColor: \"#fff\",\n buttonBackground: \"#0f0f0f\",\n },\n page: {\n title: \"Scalar Private Docs\",\n description: \"Login to access your documentation\",\n head: \"\",\n script: \"\",\n theme: \"\",\n companyName: \"\",\n logo: \"\",\n logoURL: \"\",\n favicon: \"\",\n termsLink: \"\",\n privacyLink: \"\",\n formTitle: \"Scalar Private Docs\",\n formDescription: \"Login to access your documentation\",\n formImage: \"\",\n },\n});\nconsole.log(uID);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi login-portals create --bearer-auth \"$BEARER_AUTH\" --title 'title' --slug 'slug' --email '{\"logo\":\"\",\"logoSize\":\"100\",\"buttonText\":\"Login\",\"message\":\"Click to access private documentation hosted by scalar.com\",\"title\":\"Private Docs\",\"mainColor\":\"#2a2f45\",\"mainBackground\":\"#f6f6f6\",\"cardColor\":\"2a2f45\",\"cardBackground\":\"#fff\",\"buttonColor\":\"#fff\",\"buttonBackground\":\"#0f0f0f\"}' --page '{\"title\":\"Scalar Private Docs\",\"description\":\"Login to access your documentation\",\"head\":\"\",\"script\":\"\",\"theme\":\"\",\"companyName\":\"\",\"logo\":\"\",\"logoURL\":\"\",\"favicon\":\"\",\"termsLink\":\"\",\"privacyLink\":\"\",\"formTitle\":\"Scalar Private Docs\",\"formDescription\":\"Login to access your documentation\",\"formImage\":\"\"}'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nlogin_portal = client.login_portals.create(\n title=\"\",\n slug=\"\",\n email={\"logo\": \"\", \"logo_size\": \"100\", \"button_text\": \"Login\", \"message\": \"Click to access private documentation hosted by scalar.com\", \"title\": \"Private Docs\", \"main_color\": \"#2a2f45\", \"main_background\": \"#f6f6f6\", \"card_color\": \"2a2f45\", \"card_background\": \"#fff\", \"button_color\": \"#fff\", \"button_background\": \"#0f0f0f\"},\n page={\"title\": \"Scalar Private Docs\", \"description\": \"Login to access your documentation\", \"head\": \"\", \"script\": \"\", \"theme\": \"\", \"company_name\": \"\", \"logo\": \"\", \"logo_url\": \"\", \"favicon\": \"\", \"terms_link\": \"\", \"privacy_link\": \"\", \"form_title\": \"Scalar Private Docs\", \"form_description\": \"Login to access your documentation\", \"form_image\": \"\"},\n idempotency_key=\"\",\n)\nprint(login_portal)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tloginPortal, err := client.LoginPortals.New(context.Background(), sdk.LoginPortalNewParams{\n\t\tEmail: sdk.LoginPortalEmail{\n\t\t\tLogo: \"\",\n\t\t\tLogoSize: \"100\",\n\t\t\tButtonText: \"Login\",\n\t\t\tMessage: \"Click to access private documentation hosted by scalar.com\",\n\t\t\tTitle: \"Private Docs\",\n\t\t\tMainColor: \"#2a2f45\",\n\t\t\tMainBackground: \"#f6f6f6\",\n\t\t\tCardColor: \"2a2f45\",\n\t\t\tCardBackground: \"#fff\",\n\t\t\tButtonColor: \"#fff\",\n\t\t\tButtonBackground: \"#0f0f0f\",\n\t\t},\n\t\tPage: sdk.LoginPortalPage{\n\t\t\tTitle: \"Scalar Private Docs\",\n\t\t\tDescription: \"Login to access your documentation\",\n\t\t\tHead: \"\",\n\t\t\tScript: \"\",\n\t\t\tTheme: \"\",\n\t\t\tCompanyName: \"\",\n\t\t\tLogo: \"\",\n\t\t\tLogoURL: \"\",\n\t\t\tFavicon: \"\",\n\t\t\tTermsLink: \"\",\n\t\t\tPrivacyLink: \"\",\n\t\t\tFormTitle: \"Scalar Private Docs\",\n\t\t\tFormDescription: \"Login to access your documentation\",\n\t\t\tFormImage: \"\",\n\t\t},\n\t\tSlug: \"\",\n\t\tTitle: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(loginPortal)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.loginportals.LoginPortalCreateParams;\nimport com.scalar.api.models.loginportals.LoginPortalEmail;\nimport com.scalar.api.models.loginportals.LoginPortalPage;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nLoginPortalCreateParams params = LoginPortalCreateParams.builder()\n .title(\"title\")\n .slug(\"slug\")\n .email(LoginPortalEmail.builder()\n .logo(\"\")\n .logoSize(\"100\")\n .buttonText(\"Login\")\n .message(\"Click to access private documentation hosted by scalar.com\")\n .title(\"Private Docs\")\n .mainColor(\"#2a2f45\")\n .mainBackground(\"#f6f6f6\")\n .cardColor(\"2a2f45\")\n .cardBackground(\"#fff\")\n .buttonColor(\"#fff\")\n .buttonBackground(\"#0f0f0f\")\n .build())\n .page(LoginPortalPage.builder()\n .title(\"Scalar Private Docs\")\n .description(\"Login to access your documentation\")\n .head(\"\")\n .script(\"\")\n .theme(\"\")\n .companyName(\"\")\n .logo(\"\")\n .logoUrl(\"\")\n .favicon(\"\")\n .termsLink(\"\")\n .privacyLink(\"\")\n .formTitle(\"Scalar Private Docs\")\n .formDescription(\"Login to access your documentation\")\n .formImage(\"\")\n .build())\n .build();\nvar loginPortal = client.loginPortals().create(params);\nSystem.out.println(loginPortal);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.loginportals.LoginPortalCreateParams\nimport com.scalar.api.models.loginportals.LoginPortalEmail\nimport com.scalar.api.models.loginportals.LoginPortalPage\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = LoginPortalCreateParams.builder()\n .title(\"title\")\n .slug(\"slug\")\n .email(LoginPortalEmail.builder()\n .logo(\"\")\n .logoSize(\"100\")\n .buttonText(\"Login\")\n .message(\"Click to access private documentation hosted by scalar.com\")\n .title(\"Private Docs\")\n .mainColor(\"#2a2f45\")\n .mainBackground(\"#f6f6f6\")\n .cardColor(\"2a2f45\")\n .cardBackground(\"#fff\")\n .buttonColor(\"#fff\")\n .buttonBackground(\"#0f0f0f\")\n .build())\n .page(LoginPortalPage.builder()\n .title(\"Scalar Private Docs\")\n .description(\"Login to access your documentation\")\n .head(\"\")\n .script(\"\")\n .theme(\"\")\n .companyName(\"\")\n .logo(\"\")\n .logoUrl(\"\")\n .favicon(\"\")\n .termsLink(\"\")\n .privacyLink(\"\")\n .formTitle(\"Scalar Private Docs\")\n .formDescription(\"Login to access your documentation\")\n .formImage(\"\")\n .build())\n .build()\nval loginPortal = client.loginPortals().create(params)\nprintln(loginPortal)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.loginPortals.create({ title: \"title\", slug: \"slug\", email: \"email\", page: \"page\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi login-portals create --bearer-auth \"$BEARER_AUTH\" --title 'title' --slug 'slug' --email '{\"logo\":\"\",\"logoSize\":\"100\",\"buttonText\":\"Login\",\"message\":\"Click to access private documentation hosted by scalar.com\",\"title\":\"Private Docs\",\"mainColor\":\"#2a2f45\",\"mainBackground\":\"#f6f6f6\",\"cardColor\":\"2a2f45\",\"cardBackground\":\"#fff\",\"buttonColor\":\"#fff\",\"buttonBackground\":\"#0f0f0f\"}' --page '{\"title\":\"Scalar Private Docs\",\"description\":\"Login to access your documentation\",\"head\":\"\",\"script\":\"\",\"theme\":\"\",\"companyName\":\"\",\"logo\":\"\",\"logoURL\":\"\",\"favicon\":\"\",\"termsLink\":\"\",\"privacyLink\":\"\",\"formTitle\":\"Scalar Private Docs\",\"formDescription\":\"Login to access your documentation\",\"formImage\":\"\"}'" + } + ] + }, + "get": { + "tags": [ + "Login Portals" + ], + "description": "List all login portals for the current team.", + "summary": "List all portals", + "operationId": "listLoginPortals", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/login-portal" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst list = await client.loginPortals.list();\nconsole.log(list);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi login-portals list --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nlogin_portal = client.login_portals.list()\nprint(login_portal)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tloginPortal, err := client.LoginPortals.List(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(loginPortal)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.loginportals.LoginPortalListParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar loginPortal = client.loginPortals().list();\nSystem.out.println(loginPortal);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.loginportals.LoginPortalListParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval loginPortal = client.loginPortals().list(LoginPortalListParams.none())\nprintln(loginPortal)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.loginPortals.list\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi login-portals list --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/rulesets/{namespace}": { + "get": { + "tags": [ + "Rules" + ], + "description": "List all rulesets in a namespace.", + "summary": "List all rules", + "operationId": "listRulesets", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/rule" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst listRulesets = await client.rules.listRulesets(\"namespace\");\nconsole.log(listRulesets);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi rules list-rulesets 'namespace' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.list_rulesets(\n namespace=\"namespace\",\n)\nprint(rule)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.ListRulesets(context.Background(), \"namespace\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.rules.RuleListRulesetsParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleListRulesetsParams params = RuleListRulesetsParams.builder()\n .namespace(\"namespace\")\n .build();\nvar rule = client.rules().listRulesets(params);\nSystem.out.println(rule);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.rules.RuleListRulesetsParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleListRulesetsParams.builder()\n .namespace(\"namespace\")\n .build()\nval rule = client.rules().listRulesets(params)\nprintln(rule)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.list_rulesets(\"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi rules list-rulesets 'namespace' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "post": { + "tags": [ + "Rules" + ], + "description": "Create a rule in a namespace.", + "summary": "Create a rule", + "operationId": "createRuleset", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uid" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "isPrivate": { + "type": "boolean" + }, + "document": { + "type": "string" + } + }, + "required": [ + "title", + "slug", + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst uID = await client.rules.createRuleset(\"namespace\", {\n title: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(uID);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi rules create-ruleset 'namespace' --bearer-auth \"$BEARER_AUTH\" --title 'title' --slug 'slug' --document 'document'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.create_ruleset(\n namespace=\"namespace\",\n title=\"\",\n slug=\"\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(rule)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.NewRuleset(context.Background(), \"namespace\", sdk.RuleNewRulesetParams{\n\t\tDocument: \"\",\n\t\tSlug: \"\",\n\t\tTitle: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.rules.RuleCreateRulesetParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleCreateRulesetParams params = RuleCreateRulesetParams.builder()\n .namespace(\"namespace\")\n .title(\"title\")\n .slug(\"slug\")\n .document(\"document\")\n .build();\nvar rule = client.rules().createRuleset(params);\nSystem.out.println(rule);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.rules.RuleCreateRulesetParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleCreateRulesetParams.builder()\n .namespace(\"namespace\")\n .title(\"title\")\n .slug(\"slug\")\n .document(\"document\")\n .build()\nval rule = client.rules().createRuleset(params)\nprintln(rule)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.create_ruleset(\"smoke-test\", { title: \"title\", description: \"description\", slug: \"slug\", is_private: \"is_private\", document: \"document\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi rules create-ruleset 'namespace' --bearer-auth \"$BEARER_AUTH\" --title 'title' --slug 'slug' --document 'document'" + } + ] + } + }, + "/v1/rulesets/{namespace}/{slug}": { + "patch": { + "tags": [ + "Rules" + ], + "description": "Update rule metadata by slug.", + "summary": "Update rule metadata", + "operationId": "updateRuleset", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "namespace": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "isPrivate": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.rules.updateRuleset(\"namespace\", \"slug\", {});" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi rules update-ruleset 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.update_ruleset(\n namespace=\"namespace\",\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(rule)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.UpdateRuleset(context.Background(), \"namespace\", \"slug\", sdk.RuleUpdateRulesetParams{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.rules.RuleUpdateRulesetParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleUpdateRulesetParams params = RuleUpdateRulesetParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar rule = client.rules().updateRuleset(params);\nSystem.out.println(rule);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.rules.RuleUpdateRulesetParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleUpdateRulesetParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval rule = client.rules().updateRuleset(params)\nprintln(rule)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.update_ruleset(\"smoke-test\", \"smoke-test\", { namespace_2: \"namespace_2\", slug_2: \"slug_2\", title: \"title\", description: \"description\", is_private: \"is_private\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi rules update-ruleset 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "delete": { + "tags": [ + "Rules" + ], + "description": "Delete a rule by slug.", + "summary": "Delete a rule", + "operationId": "deleteRuleset", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.rules.deleteRuleset(\"namespace\", \"slug\");" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi rules delete-ruleset 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.delete_ruleset(\n namespace=\"namespace\",\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(rule)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.DeleteRuleset(context.Background(), \"namespace\", \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.rules.RuleDeleteRulesetParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleDeleteRulesetParams params = RuleDeleteRulesetParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar rule = client.rules().deleteRuleset(params);\nSystem.out.println(rule);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.rules.RuleDeleteRulesetParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleDeleteRulesetParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval rule = client.rules().deleteRuleset(params)\nprintln(rule)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.delete_ruleset(\"smoke-test\", \"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi rules delete-ruleset 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "get": { + "tags": [ + "Rules" + ], + "description": "Get a rule document by slug.", + "summary": "Get a rule", + "operationId": "getRulesetDocument", + "responses": { + "200": { + "description": "Default Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst string_ = await client.rules.retrieveRulesetDocument(\"namespace\", \"slug\");\nconsole.log(string_);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi rules retrieve-ruleset-document 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.retrieve_ruleset_document(\n namespace=\"namespace\",\n slug=\"slug\",\n)\nprint(rule)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.GetRulesetDocument(context.Background(), \"namespace\", \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.rules.RuleRetrieveRulesetDocumentParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleRetrieveRulesetDocumentParams params = RuleRetrieveRulesetDocumentParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build();\nvar rule = client.rules().retrieveRulesetDocument(params);\nSystem.out.println(rule);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.rules.RuleRetrieveRulesetDocumentParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleRetrieveRulesetDocumentParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .build()\nval rule = client.rules().retrieveRulesetDocument(params)\nprintln(rule)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.retrieve_ruleset_document(\"smoke-test\", \"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi rules retrieve-ruleset-document 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/rulesets/{namespace}/{slug}/access-group": { + "post": { + "tags": [ + "Rules" + ], + "description": "Grant an access group to a rule.", + "summary": "Add rule access group", + "operationId": "addRulesetAccessGroup", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/access-group" + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.rules.createRulesetAccessGroup(\"namespace\", \"slug\", {\n accessGroupSlug: \"\",\n});" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi rules create-ruleset-access-group 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.create_ruleset_access_group(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"\",\n idempotency_key=\"\",\n)\nprint(rule)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.NewRulesetAccessGroup(context.Background(), \"namespace\", \"slug\", sdk.RuleNewRulesetAccessGroupParams{\n\t\tAccessGroup: sdk.AccessGroup{\n\t\tAccessGroupSlug: \"\",\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.rules.RuleCreateRulesetAccessGroupParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleCreateRulesetAccessGroupParams params = RuleCreateRulesetAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar rule = client.rules().createRulesetAccessGroup(params);\nSystem.out.println(rule);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.rules.RuleCreateRulesetAccessGroupParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleCreateRulesetAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval rule = client.rules().createRulesetAccessGroup(params)\nprintln(rule)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.create_ruleset_access_group(\"smoke-test\", \"smoke-test\", { access_group_slug: \"access_group_slug\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi rules create-ruleset-access-group 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" + } + ] + }, + "delete": { + "tags": [ + "Rules" + ], + "description": "Remove an access group from a rule.", + "summary": "Remove rule access group", + "operationId": "removeRulesetAccessGroup", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/access-group" + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.rules.deleteRulesetAccessGroup(\"namespace\", \"slug\", {\n accessGroupSlug: \"\",\n});" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi rules delete-ruleset-access-group 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nrule = client.rules.delete_ruleset_access_group(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"\",\n idempotency_key=\"\",\n)\nprint(rule)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\trule, err := client.Rules.DeleteRulesetAccessGroup(context.Background(), \"namespace\", \"slug\", sdk.RuleDeleteRulesetAccessGroupParams{\n\t\tAccessGroup: sdk.AccessGroup{\n\t\tAccessGroupSlug: \"\",\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(rule)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.rules.RuleDeleteRulesetAccessGroupParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nRuleDeleteRulesetAccessGroupParams params = RuleDeleteRulesetAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar rule = client.rules().deleteRulesetAccessGroup(params);\nSystem.out.println(rule);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.rules.RuleDeleteRulesetAccessGroupParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = RuleDeleteRulesetAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval rule = client.rules().deleteRulesetAccessGroup(params)\nprintln(rule)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.rules.delete_ruleset_access_group(\"smoke-test\", \"smoke-test\", { access_group_slug: \"access_group_slug\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi rules delete-ruleset-access-group 'namespace' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" + } + ] + } + }, + "/v1/themes": { + "get": { + "tags": [ + "Themes" + ], + "description": "List all team themes.", + "summary": "List all themes", + "operationId": "listThemes", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/theme" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst list = await client.themes.list();\nconsole.log(list);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi themes list --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\ntheme = client.themes.list()\nprint(theme)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\ttheme, err := client.Themes.List(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(theme)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.themes.ThemeListParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar theme = client.themes().list();\nSystem.out.println(theme);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.themes.ThemeListParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval theme = client.themes().list(ThemeListParams.none())\nprintln(theme)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.themes.list\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi themes list --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "post": { + "tags": [ + "Themes" + ], + "description": "Create a team theme.", + "summary": "Create a theme", + "operationId": "createTheme", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uid" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "document": { + "type": "string" + } + }, + "required": [ + "name", + "slug", + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst uID = await client.themes.create({\n name: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(uID);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi themes create --bearer-auth \"$BEARER_AUTH\" --name 'name' --slug 'slug' --document 'document'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\ntheme = client.themes.create(\n name=\"\",\n slug=\"\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(theme)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\ttheme, err := client.Themes.New(context.Background(), sdk.ThemeNewParams{\n\t\tDocument: \"\",\n\t\tName: \"\",\n\t\tSlug: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(theme)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.themes.ThemeCreateParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nThemeCreateParams params = ThemeCreateParams.builder()\n .name(\"name\")\n .slug(\"slug\")\n .document(\"document\")\n .build();\nvar theme = client.themes().create(params);\nSystem.out.println(theme);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.themes.ThemeCreateParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ThemeCreateParams.builder()\n .name(\"name\")\n .slug(\"slug\")\n .document(\"document\")\n .build()\nval theme = client.themes().create(params)\nprintln(theme)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.themes.create({ name: \"name\", description: \"description\", slug: \"slug\", document: \"document\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi themes create --bearer-auth \"$BEARER_AUTH\" --name 'name' --slug 'slug' --document 'document'" + } + ] + } + }, + "/v1/themes/{slug}": { + "patch": { + "tags": [ + "Themes" + ], + "description": "Update theme metadata.", + "summary": "Update theme metadata", + "operationId": "updateTheme", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.themes.update(\"slug\", {});" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi themes update 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\ntheme = client.themes.update(\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(theme)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\ttheme, err := client.Themes.Update(context.Background(), \"slug\", sdk.ThemeUpdateParams{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(theme)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.themes.ThemeUpdateParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nThemeUpdateParams params = ThemeUpdateParams.builder()\n .slug(\"slug\")\n .build();\nvar theme = client.themes().update(params);\nSystem.out.println(theme);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.themes.ThemeUpdateParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ThemeUpdateParams.builder()\n .slug(\"slug\")\n .build()\nval theme = client.themes().update(params)\nprintln(theme)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.themes.update(\"smoke-test\", { name: \"name\", description: \"description\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi themes update 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "put": { + "tags": [ + "Themes" + ], + "description": "Replace the theme document.", + "summary": "Update theme document", + "operationId": "replaceThemeDocument", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "document": { + "type": "string" + } + }, + "required": [ + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.themes.replaceDocument(\"slug\", {\n document: \"\",\n});" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi themes replace-document 'slug' --bearer-auth \"$BEARER_AUTH\" --document 'document'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\ntheme = client.themes.replace_document(\n slug=\"slug\",\n document=\"\",\n idempotency_key=\"\",\n)\nprint(theme)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\ttheme, err := client.Themes.ReplaceDocument(context.Background(), \"slug\", sdk.ThemeReplaceDocumentParams{\n\t\tDocument: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(theme)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.themes.ThemeReplaceDocumentParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nThemeReplaceDocumentParams params = ThemeReplaceDocumentParams.builder()\n .slug(\"slug\")\n .document(\"document\")\n .build();\nvar theme = client.themes().replaceDocument(params);\nSystem.out.println(theme);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.themes.ThemeReplaceDocumentParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ThemeReplaceDocumentParams.builder()\n .slug(\"slug\")\n .document(\"document\")\n .build()\nval theme = client.themes().replaceDocument(params)\nprintln(theme)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.themes.replace_document(\"smoke-test\", { document: \"document\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi themes replace-document 'slug' --bearer-auth \"$BEARER_AUTH\" --document 'document'" + } + ] + }, + "delete": { + "tags": [ + "Themes" + ], + "description": "Delete a theme by slug.", + "summary": "Delete a theme", + "operationId": "deleteTheme", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nawait client.themes.delete(\"slug\");" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi themes delete 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\ntheme = client.themes.delete(\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(theme)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\ttheme, err := client.Themes.Delete(context.Background(), \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(theme)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.themes.ThemeDeleteParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nThemeDeleteParams params = ThemeDeleteParams.builder()\n .slug(\"slug\")\n .build();\nvar theme = client.themes().delete(params);\nSystem.out.println(theme);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.themes.ThemeDeleteParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ThemeDeleteParams.builder()\n .slug(\"slug\")\n .build()\nval theme = client.themes().delete(params)\nprintln(theme)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.themes.delete(\"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi themes delete 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "get": { + "tags": [ + "Themes" + ], + "description": "Get the theme document by slug.", + "summary": "Get a theme", + "operationId": "getTheme", + "responses": { + "200": { + "description": "Default Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst string_ = await client.themes.retrieve(\"slug\");\nconsole.log(string_);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi themes retrieve 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\ntheme = client.themes.retrieve(\n slug=\"slug\",\n)\nprint(theme)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\ttheme, err := client.Themes.Get(context.Background(), \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(theme)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.themes.ThemeRetrieveParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nThemeRetrieveParams params = ThemeRetrieveParams.builder()\n .slug(\"slug\")\n .build();\nvar theme = client.themes().retrieve(params);\nSystem.out.println(theme);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.themes.ThemeRetrieveParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ThemeRetrieveParams.builder()\n .slug(\"slug\")\n .build()\nval theme = client.themes().retrieve(params)\nprintln(theme)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.themes.retrieve(\"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi themes retrieve 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/teams": { + "get": { + "tags": [ + "Teams" + ], + "description": "List all available teams", + "summary": "List teams", + "operationId": "listTeams", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/team" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst list = await client.teams.list();\nconsole.log(list);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi teams list --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nteam = client.teams.list()\nprint(team)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tteam, err := client.Teams.List(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(team)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.teams.TeamListParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar team = client.teams().list();\nSystem.out.println(team);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.teams.TeamListParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval team = client.teams().list(TeamListParams.none())\nprintln(team)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.teams.list\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi teams list --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/guides": { + "get": { + "tags": [ + "Scalar Docs" + ], + "description": "List all guide projects.", + "summary": "List all projects", + "operationId": "listGuides", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/github-project" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst listGuides = await client.scalarDocs.listGuides();\nconsole.log(listGuides);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi scalar-docs list-guides --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nscalar_doc = client.scalar_docs.list_guides()\nprint(scalar_doc)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tscalarDoc, err := client.ScalarDocs.ListGuides(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(scalarDoc)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.scalardocs.ScalarDocListGuidesParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar scalarDoc = client.scalarDocs().listGuides();\nSystem.out.println(scalarDoc);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.scalardocs.ScalarDocListGuidesParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval scalarDoc = client.scalarDocs().listGuides(ScalarDocListGuidesParams.none())\nprintln(scalarDoc)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.scalarDocs.list_guides\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi scalar-docs list-guides --bearer-auth \"$BEARER_AUTH\"" + } + ] + }, + "post": { + "tags": [ + "Scalar Docs" + ], + "description": "Create a guide project.", + "summary": "Create a project", + "operationId": "createGuide", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "uid": { + "type": "string" + }, + "slug": { + "type": "string" + } + }, + "required": [ + "uid", + "slug" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "slug": { + "$ref": "#/components/schemas/slug" + }, + "isPrivate": { + "default": false, + "type": "boolean" + }, + "allowedUsers": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "allowedDomains": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "isPrivate", + "allowedUsers", + "allowedDomains" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst createGuide = await client.scalarDocs.createGuide({\n name: \"\",\n isPrivate: false,\n allowedUsers: [],\n allowedDomains: [],\n});\nconsole.log(createGuide);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi scalar-docs create-guide --bearer-auth \"$BEARER_AUTH\" --name 'name' --is-private" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nscalar_doc = client.scalar_docs.create_guide(\n name=\"\",\n is_private=False,\n allowed_users=[],\n allowed_domains=[],\n idempotency_key=\"\",\n)\nprint(scalar_doc)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tscalarDoc, err := client.ScalarDocs.NewGuide(context.Background(), sdk.ScalarDocNewGuideParams{\n\t\tAllowedDomains: []string{\"\"},\n\t\tAllowedUsers: []string{\"\"},\n\t\tIsPrivate: false,\n\t\tName: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(scalarDoc)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.scalardocs.ScalarDocCreateGuideParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nScalarDocCreateGuideParams params = ScalarDocCreateGuideParams.builder()\n .name(\"name\")\n .isPrivate(false)\n .allowedUsers(java.util.List.of(\"allowedUser\"))\n .allowedDomains(java.util.List.of(\"allowedDomain\"))\n .build();\nvar scalarDoc = client.scalarDocs().createGuide(params);\nSystem.out.println(scalarDoc);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.scalardocs.ScalarDocCreateGuideParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ScalarDocCreateGuideParams.builder()\n .name(\"name\")\n .isPrivate(false)\n .allowedUsers(listOf(\"allowedUser\"))\n .allowedDomains(listOf(\"allowedDomain\"))\n .build()\nval scalarDoc = client.scalarDocs().createGuide(params)\nprintln(scalarDoc)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.scalarDocs.create_guide({ name: \"name\", slug: \"slug\", is_private: \"is_private\", allowed_users: \"allowed_users\", allowed_domains: \"allowed_domains\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi scalar-docs create-guide --bearer-auth \"$BEARER_AUTH\" --name 'name' --is-private" + } + ] + } + }, + "/v1/guides/{slug}/publish": { + "post": { + "tags": [ + "Scalar Docs" + ], + "description": "Start a new publish process.", + "summary": "Publish a project", + "operationId": "publishGuide", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "publishUid": { + "type": "string" + } + }, + "required": [ + "publishUid" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst publishGuide = await client.scalarDocs.publishGuide(\"slug\");\nconsole.log(publishGuide);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi scalar-docs publish-guide 'slug' --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nscalar_doc = client.scalar_docs.publish_guide(\n slug=\"slug\",\n idempotency_key=\"\",\n)\nprint(scalar_doc)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tscalarDoc, err := client.ScalarDocs.PublishGuide(context.Background(), \"slug\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(scalarDoc)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.scalardocs.ScalarDocPublishGuideParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nScalarDocPublishGuideParams params = ScalarDocPublishGuideParams.builder()\n .slug(\"slug\")\n .build();\nvar scalarDoc = client.scalarDocs().publishGuide(params);\nSystem.out.println(scalarDoc);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.scalardocs.ScalarDocPublishGuideParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = ScalarDocPublishGuideParams.builder()\n .slug(\"slug\")\n .build()\nval scalarDoc = client.scalarDocs().publishGuide(params)\nprintln(scalarDoc)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.scalarDocs.publish_guide(\"smoke-test\")\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi scalar-docs publish-guide 'slug' --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/namespaces": { + "get": { + "tags": [ + "Namespaces" + ], + "description": "Get all namespaces for the current team", + "summary": "List namespaces", + "operationId": "listNamespaces", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst list = await client.namespaces.list();\nconsole.log(list);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi namespaces list --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nnamespace = client.namespaces.list()\nprint(namespace)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tnamespace, err := client.Namespaces.List(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(namespace)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.namespaces.NamespaceListParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar namespace = client.namespaces().list();\nSystem.out.println(namespace);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.namespaces.NamespaceListParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval namespace = client.namespaces().list(NamespaceListParams.none())\nprintln(namespace)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.namespace(\"namespace\").list\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi namespaces list --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + }, + "/v1/auth/exchange": { + "post": { + "tags": [ + "Authentication" + ], + "description": "Exchange an API key for an access token.", + "summary": "Exchange token", + "operationId": "exchangePersonalToken", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "accessToken": { + "type": "string" + } + }, + "required": [ + "accessToken" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "security": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "personalToken": { + "type": "string" + } + }, + "required": [ + "personalToken" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst exchangePersonalToken = await client.authentication.exchangePersonalToken({\n personalToken: \"\",\n});\nconsole.log(exchangePersonalToken);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi authentication exchange-personal-token --bearer-auth \"$BEARER_AUTH\" --personal-token 'personalToken'" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nauthentication = client.authentication.exchange_personal_token(\n personal_token=\"\",\n idempotency_key=\"\",\n)\nprint(authentication)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tauthentication, err := client.Authentication.ExchangePersonalToken(context.Background(), sdk.AuthenticationExchangePersonalTokenParams{\n\t\tPersonalToken: \"\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(authentication)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.authentication.AuthenticationExchangePersonalTokenParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nAuthenticationExchangePersonalTokenParams params = AuthenticationExchangePersonalTokenParams.builder()\n .personalToken(\"personalToken\")\n .build();\nvar authentication = client.authentication().exchangePersonalToken(params);\nSystem.out.println(authentication);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.authentication.AuthenticationExchangePersonalTokenParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = AuthenticationExchangePersonalTokenParams.builder()\n .personalToken(\"personalToken\")\n .build()\nval authentication = client.authentication().exchangePersonalToken(params)\nprintln(authentication)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.authentication.exchange_personal_token({ personal_token: \"personal_token\" })\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi authentication exchange-personal-token --bearer-auth \"$BEARER_AUTH\" --personal-token 'personalToken'" + } + ] + } + }, + "/v1/auth/me": { + "get": { + "tags": [ + "Authentication" + ], + "description": "Get the authenticated user, including their available teams and theme.", + "summary": "Get current user", + "operationId": "getCurrentUser", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "TypeScript", + "lang": "TypeScript", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst user = await client.authentication.listCurrentUser();\nconsole.log(user);" + }, + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi authentication list-current-user --bearer-auth \"$BEARER_AUTH\"" + }, + { + "label": "Python", + "lang": "Python", + "source": "import os\n\nfrom scalar_api import Scalar\n\nclient = Scalar(\n bearer_auth=os.environ.get(\"BEARER_AUTH\"),\n)\n\nauthentication = client.authentication.list_current_user()\nprint(authentication)" + }, + { + "label": "Go", + "lang": "Go", + "source": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tsdk \"scalar-api\"\n\t\"scalar-api/option\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\toption.WithBearerAuth(os.Getenv(\"BEARER_AUTH\")),\n\t)\n\n\tauthentication, err := client.Authentication.ListCurrentUser(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(authentication)\n}" + }, + { + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.authentication.AuthenticationListCurrentUserParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nvar authentication = client.authentication().listCurrentUser();\nSystem.out.println(authentication);" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.authentication.AuthenticationListCurrentUserParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval authentication = client.authentication().listCurrentUser(AuthenticationListCurrentUserParams.none())\nprintln(authentication)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "require \"json\"\nrequire \"scalar-api\"\n\nclient = ScalarApi::Client.new(\n bearer_auth: ENV[\"BEARER_AUTH\"],\n)\n\nresponse = client.authentication.list_current_user\nputs response.inspect" + }, + { + "lang": "Shell", + "label": "CLI", + "source": "scalarapi authentication list-current-user --bearer-auth \"$BEARER_AUTH\"" + } + ] + } + } + } +} diff --git a/reference.md b/reference.md new file mode 100644 index 0000000..22f858d --- /dev/null +++ b/reference.md @@ -0,0 +1,428 @@ +# ScalarApi Rust SDK Reference + +## Operations + +### registry.listAllApiDocuments + +List all API Documents + +- HTTP: `GET /v1/apis` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### registry.listApiDocuments + +List API Documents in a namespace + +- HTTP: `GET /v1/apis/{namespace}` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### registry.createApiDocument + +Create API Document + +- HTTP: `POST /v1/apis/{namespace}` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### registry.updateApiDocument + +Update API Document metadata + +- HTTP: `PATCH /v1/apis/{namespace}/{slug}` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### registry.deleteApiDocument + +Delete API Document + +- HTTP: `DELETE /v1/apis/{namespace}/{slug}` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### registry.retrieveApiDocumentVersion + +Get API Document + +- HTTP: `GET /v1/apis/{namespace}/{slug}/version/{semver}` +- Response body: `text/plain` +- Errors: `400, 401, 403, 404, 422, 500` + +### registry.updateApiDocumentVersion + +Update API Document version + +- HTTP: `PATCH /v1/apis/{namespace}/{slug}/version/{semver}` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### registry.deleteApiDocumentVersion + +Delete API Document version + +- HTTP: `DELETE /v1/apis/{namespace}/{slug}/version/{semver}` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### registry.listApiDocumentVersionMetadata + +Get API Document version metadata + +- HTTP: `GET /v1/apis/{namespace}/{slug}/version/{semver}/metadata` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### registry.createApiDocumentVersion + +Create API Document version + +- HTTP: `POST /v1/apis/{namespace}/{slug}/version` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### registry.createApiDocumentAccessGroup + +Add access group + +- HTTP: `POST /v1/apis/{namespace}/{slug}/access-group` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### registry.deleteApiDocumentAccessGroup + +Remove access group + +- HTTP: `DELETE /v1/apis/{namespace}/{slug}/access-group` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### schemas.list + +List all shared components + +- HTTP: `GET /v1/schemas/{namespace}` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### schemas.create + +Create a shared component + +- HTTP: `POST /v1/schemas/{namespace}` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### schemas.update + +Update shared component metadata + +- HTTP: `PATCH /v1/schemas/{namespace}/{slug}` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### schemas.delete + +Delete a shared component + +- HTTP: `DELETE /v1/schemas/{namespace}/{slug}` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### schemas.version.retrieveSchema + +Get a shared component document + +- HTTP: `GET /v1/schemas/{namespace}/{slug}/version/{semver}` +- Response body: `text/plain` +- Errors: `400, 401, 403, 404, 422, 500` + +### schemas.version.deleteSchema + +Delete a shared component version + +- HTTP: `DELETE /v1/schemas/{namespace}/{slug}/version/{semver}` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### schemas.version.createSchema + +Create a shared component version + +- HTTP: `POST /v1/schemas/{namespace}/{slug}/version` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### schemas.accessGroup.createSchema + +Add shared component access group + +- HTTP: `POST /v1/schemas/{namespace}/{slug}/access-group` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### schemas.accessGroup.deleteSchema + +Remove shared component access group + +- HTTP: `DELETE /v1/schemas/{namespace}/{slug}/access-group` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### loginPortals.retrieve + +Get a login portal + +- HTTP: `GET /v1/login-portals/{slug}` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### loginPortals.update + +Update portal metadata + +- HTTP: `PATCH /v1/login-portals/{slug}` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### loginPortals.delete + +Delete a login portal + +- HTTP: `DELETE /v1/login-portals/{slug}` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### loginPortals.create + +Create a portal + +- HTTP: `POST /v1/login-portals` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### loginPortals.list + +List all portals + +- HTTP: `GET /v1/login-portals` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### rules.listRulesets + +List all rules + +- HTTP: `GET /v1/rulesets/{namespace}` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### rules.createRuleset + +Create a rule + +- HTTP: `POST /v1/rulesets/{namespace}` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### rules.updateRuleset + +Update rule metadata + +- HTTP: `PATCH /v1/rulesets/{namespace}/{slug}` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### rules.deleteRuleset + +Delete a rule + +- HTTP: `DELETE /v1/rulesets/{namespace}/{slug}` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### rules.retrieveRulesetDocument + +Get a rule + +- HTTP: `GET /v1/rulesets/{namespace}/{slug}` +- Response body: `text/plain` +- Errors: `400, 401, 403, 404, 422, 500` + +### rules.createRulesetAccessGroup + +Add rule access group + +- HTTP: `POST /v1/rulesets/{namespace}/{slug}/access-group` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### rules.deleteRulesetAccessGroup + +Remove rule access group + +- HTTP: `DELETE /v1/rulesets/{namespace}/{slug}/access-group` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### themes.list + +List all themes + +- HTTP: `GET /v1/themes` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### themes.create + +Create a theme + +- HTTP: `POST /v1/themes` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### themes.update + +Update theme metadata + +- HTTP: `PATCH /v1/themes/{slug}` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### themes.replaceDocument + +Update theme document + +- HTTP: `PUT /v1/themes/{slug}` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### themes.delete + +Delete a theme + +- HTTP: `DELETE /v1/themes/{slug}` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### themes.retrieve + +Get a theme + +- HTTP: `GET /v1/themes/{slug}` +- Response body: `text/plain` +- Errors: `400, 401, 403, 404, 422, 500` + +### teams.list + +List teams + +- HTTP: `GET /v1/teams` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### scalarDocs.listGuides + +List all projects + +- HTTP: `GET /v1/guides` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### scalarDocs.createGuide + +Create a project + +- HTTP: `POST /v1/guides` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### scalarDocs.publishGuide + +Publish a project + +- HTTP: `POST /v1/guides/{slug}/publish` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### namespaces.list + +List namespaces + +- HTTP: `GET /v1/namespaces` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### authentication.exchangePersonalToken + +Exchange token + +- HTTP: `POST /v1/auth/exchange` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +### authentication.listCurrentUser + +Get current user + +- HTTP: `GET /v1/auth/me` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` + +## Models + +- `_400` +- `_401` +- `_403` +- `_404` +- `_422` +- `_500` +- `ApiDocument` +- `Nanoid` +- `Version` +- `Slug` +- `Namespace` +- `ManagedDocVersion` +- `Method` +- `AccessGroup` +- `Schema` +- `ManagedSchemaVersion` +- `Timestamp` +- `Uid` +- `LoginPortalEmail` +- `LoginPortalPage` +- `LoginPortal` +- `Rule` +- `Theme` +- `Team` +- `TeamName` +- `TeamImage` +- `GithubProject` +- `ActiveDeployment` +- `GithubProjectRepository` +- `Email` +- `TeamSummary` +- `User` diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..b9a537d --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,2 @@ +edition = "2021" +max_width = 120 diff --git a/scalar-sdk.manifest.json b/scalar-sdk.manifest.json new file mode 100644 index 0000000..cb0c1e8 --- /dev/null +++ b/scalar-sdk.manifest.json @@ -0,0 +1,9662 @@ +{ + "name": "ScalarApi", + "slug": "scalarApi", + "version": "0.2.5", + "servers": [ + "https://access.scalar.com" + ], + "environments": { + "production": "https://access.scalar.com", + "local": "http://127.0.0.1:4010" + }, + "environmentOrder": [ + "production", + "local" + ], + "auth": [ + "bearer" + ], + "authDetails": [ + { + "kind": "bearer", + "id": "BearerAuth", + "bearerFormat": "JWT" + } + ], + "clientHeaderParams": [], + "schemas": [ + { + "name": "_400", + "source": "_400", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "_401", + "source": "_401", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "_403", + "source": "_403", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "_404", + "source": "_404", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "_422", + "source": "_422", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "_500", + "source": "_500", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ApiDocument", + "source": "ApiDocument", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "version", + "publicName": "version", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Version" + } + }, + { + "name": "title", + "publicName": "title", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + }, + { + "name": "description", + "publicName": "description", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "namespace", + "publicName": "namespace", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Namespace" + } + }, + { + "name": "isPrivate", + "publicName": "isPrivate", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "tags", + "publicName": "tags", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "versions", + "publicName": "versions", + "required": true, + "deprecated": false, + "type": { + "kind": "array", + "items": { + "kind": "ref", + "name": "ManagedDocVersion" + } + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Nanoid", + "source": "Nanoid", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "minLength": 5 + } + } + }, + { + "name": "Version", + "source": "Version", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "minLength": 1 + } + } + }, + { + "name": "Slug", + "source": "Slug", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "pattern": "^[a-z](?:[a-z0-9-]*[a-z0-9])?$", + "minLength": 3, + "maxLength": 60 + } + } + }, + { + "name": "Namespace", + "source": "Namespace", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "pattern": "^[a-zA-Z0-9-_]+$", + "minLength": 3, + "maxLength": 50 + } + } + }, + { + "name": "ManagedDocVersion", + "source": "ManagedDocVersion", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "createdAt", + "publicName": "createdAt", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "number" + } + }, + { + "name": "version", + "publicName": "version", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Version" + } + }, + { + "name": "upgraded", + "publicName": "upgraded", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "embedStatus", + "publicName": "embedStatus", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "enum", + "values": [ + "complete", + "failed" + ], + "names": [ + "Complete", + "Failed" + ], + "deprecations": [ + false, + false + ] + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "tags", + "publicName": "tags", + "required": true, + "deprecated": false, + "type": { + "kind": "array", + "items": { + "kind": "primitive", + "type": "string" + } + } + }, + { + "name": "tools", + "publicName": "tools", + "required": false, + "deprecated": false, + "type": { + "kind": "array", + "items": { + "kind": "object", + "properties": [ + { + "name": "path", + "publicName": "path", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "method", + "publicName": "method", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Method" + } + }, + { + "name": "enabledTools", + "publicName": "enabledTools", + "required": true, + "deprecated": false, + "type": { + "kind": "array", + "items": { + "kind": "enum", + "values": [ + "execute-request", + "get-mini-openapi-spec" + ], + "names": [ + "ExecuteRequest", + "GetMiniOpenapiSpec" + ], + "deprecations": [ + false, + false + ] + } + } + } + ], + "additionalProperties": false + } + } + }, + { + "name": "yamlSha", + "publicName": "yamlSha", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "jsonSha", + "publicName": "jsonSha", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "versionSha", + "publicName": "versionSha", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Method", + "source": "Method", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "delete", + "get", + "head", + "options", + "patch", + "post", + "put", + "trace" + ], + "names": [ + "Delete", + "Get", + "Head", + "Options", + "Patch", + "Post", + "Put", + "Trace" + ], + "deprecations": [ + false, + false, + false, + false, + false, + false, + false, + false + ] + } + }, + { + "name": "AccessGroup", + "source": "AccessGroup", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "accessGroupSlug", + "publicName": "accessGroupSlug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Schema", + "source": "Schema", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "title", + "publicName": "title", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "description", + "publicName": "description", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + }, + { + "name": "namespace", + "publicName": "namespace", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Namespace" + } + }, + { + "name": "isPrivate", + "publicName": "isPrivate", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "versions", + "publicName": "versions", + "required": true, + "deprecated": false, + "type": { + "kind": "array", + "items": { + "kind": "ref", + "name": "ManagedSchemaVersion" + } + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ManagedSchemaVersion", + "source": "ManagedSchemaVersion", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "createdAt", + "publicName": "createdAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + }, + { + "name": "updatedAt", + "publicName": "updatedAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + }, + { + "name": "version", + "publicName": "version", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Version" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Timestamp", + "source": "Timestamp", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "validation": {} + } + }, + { + "name": "Uid", + "source": "Uid", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "LoginPortalEmail", + "source": "LoginPortalEmail", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "logo", + "publicName": "logo", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "logoSize", + "publicName": "logoSize", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "buttonText", + "publicName": "buttonText", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 50 + } + } + }, + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 1000 + } + } + }, + { + "name": "title", + "publicName": "title", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "mainColor", + "publicName": "mainColor", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "mainBackground", + "publicName": "mainBackground", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "cardColor", + "publicName": "cardColor", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "cardBackground", + "publicName": "cardBackground", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "buttonColor", + "publicName": "buttonColor", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "buttonBackground", + "publicName": "buttonBackground", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + } + ], + "additionalProperties": false + } + }, + { + "name": "LoginPortalPage", + "source": "LoginPortalPage", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "title", + "publicName": "title", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "description", + "publicName": "description", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 500 + } + } + }, + { + "name": "head", + "publicName": "head", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "script", + "publicName": "script", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "theme", + "publicName": "theme", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "companyName", + "publicName": "companyName", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "logo", + "publicName": "logo", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "logoURL", + "publicName": "logoURL", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "favicon", + "publicName": "favicon", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "termsLink", + "publicName": "termsLink", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "privacyLink", + "publicName": "privacyLink", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "formTitle", + "publicName": "formTitle", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "formDescription", + "publicName": "formDescription", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 500 + } + } + }, + { + "name": "formImage", + "publicName": "formImage", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "LoginPortal", + "source": "LoginPortal", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "title", + "publicName": "title", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 200 + } + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Rule", + "source": "Rule", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "title", + "publicName": "title", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "description", + "publicName": "description", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + }, + { + "name": "namespace", + "publicName": "namespace", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Namespace" + } + }, + { + "name": "isPrivate", + "publicName": "isPrivate", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Theme", + "source": "Theme", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "name", + "publicName": "name", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "description", + "publicName": "description", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Team", + "source": "Team", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "name", + "publicName": "name", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "TeamName" + } + }, + { + "name": "imageUri", + "publicName": "imageUri", + "required": false, + "deprecated": false, + "type": { + "kind": "ref", + "name": "TeamImage" + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + }, + { + "name": "theme", + "publicName": "theme", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "TeamName", + "source": "TeamName", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "TeamImage", + "source": "TeamImage", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "GithubProject", + "source": "GithubProject", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "createdAt", + "publicName": "createdAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + }, + { + "name": "updatedAt", + "publicName": "updatedAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + }, + { + "name": "name", + "publicName": "name", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "activeDeployment", + "publicName": "activeDeployment", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "ref", + "name": "ActiveDeployment" + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "lastPublished", + "publicName": "lastPublished", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "ref", + "name": "Timestamp" + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "lastPublishedUid", + "publicName": "lastPublishedUid", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "loginPortalUid", + "publicName": "loginPortalUid", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "activeThemeId", + "publicName": "activeThemeId", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "typesenseId", + "publicName": "typesenseId", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "number" + } + }, + { + "name": "isPrivate", + "publicName": "isPrivate", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "agentEnabled", + "publicName": "agentEnabled", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "accessGroups", + "publicName": "accessGroups", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + }, + { + "name": "publishStatus", + "publicName": "publishStatus", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "publishMessage", + "publicName": "publishMessage", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "repository", + "publicName": "repository", + "required": false, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "ref", + "name": "GithubProjectRepository" + }, + { + "kind": "null" + } + ] + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ActiveDeployment", + "source": "ActiveDeployment", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "domain", + "publicName": "domain", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "publishedAt", + "publicName": "publishedAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "GithubProjectRepository", + "source": "GithubProjectRepository", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "linkedBy", + "publicName": "linkedBy", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "id", + "publicName": "id", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "number" + } + }, + { + "name": "name", + "publicName": "name", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "minLength": 2 + } + } + }, + { + "name": "configPath", + "publicName": "configPath", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "branch", + "publicName": "branch", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "publishOnMerge", + "publicName": "publishOnMerge", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "publishPreviews", + "publicName": "publishPreviews", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "prComments", + "publicName": "prComments", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "expired", + "publicName": "expired", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Email", + "source": "Email", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "email", + "validation": { + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + } + } + }, + { + "name": "TeamSummary", + "source": "TeamSummary", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "name", + "publicName": "name", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "TeamName" + } + }, + { + "name": "imageUri", + "publicName": "imageUri", + "required": false, + "deprecated": false, + "type": { + "kind": "ref", + "name": "TeamImage" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "User", + "source": "User", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "createdAt", + "publicName": "createdAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + }, + { + "name": "updatedAt", + "publicName": "updatedAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + }, + { + "name": "email", + "publicName": "email", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Email" + } + }, + { + "name": "theme", + "publicName": "theme", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "activeTeamId", + "publicName": "activeTeamId", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "hasGithub", + "publicName": "hasGithub", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "teams", + "publicName": "teams", + "required": true, + "deprecated": false, + "type": { + "kind": "array", + "items": { + "kind": "ref", + "name": "TeamSummary" + } + } + } + ], + "additionalProperties": false + } + } + ], + "resources": [ + "registry", + "schemas", + "schemas.version", + "schemas.accessGroup", + "loginPortals", + "rules", + "themes", + "teams", + "scalarDocs", + "namespaces", + "authentication" + ], + "publicResources": [ + "registry", + "schemas", + "schemas.version", + "schemas.accessGroup", + "loginPortals", + "rules", + "themes", + "teams", + "scalarDocs", + "namespaces", + "authentication" + ], + "operations": [ + { + "resource": "registry", + "publicResource": "registry", + "operation": "listAllApiDocuments", + "publicOperation": "listAllApiDocuments", + "deprecated": false, + "method": "GET", + "path": "/v1/apis", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "listApiDocuments", + "publicOperation": "listApiDocuments", + "deprecated": false, + "method": "GET", + "path": "/v1/apis/{namespace}", + "pathParams": [ + "namespace" + ], + "publicPathParams": [ + "namespace" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "namespace" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryListApiDocumentsParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "createApiDocument", + "publicOperation": "createApiDocument", + "deprecated": false, + "method": "POST", + "path": "/v1/apis/{namespace}", + "pathParams": [ + "namespace" + ], + "publicPathParams": [ + "namespace" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title", + "description", + "version", + "slug", + "ruleset", + "isPrivate", + "document" + ], + "publicBodyParams": [ + "title", + "description", + "version", + "slug", + "ruleset", + "isPrivate", + "document" + ], + "publicPositionalParams": [ + "namespace" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryCreateApiDocumentParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "updateApiDocument", + "publicOperation": "updateApiDocument", + "deprecated": false, + "method": "PATCH", + "path": "/v1/apis/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title", + "description", + "isPrivate", + "ruleset" + ], + "publicBodyParams": [ + "title", + "description", + "isPrivate", + "ruleset" + ], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryUpdateApiDocumentParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "deleteApiDocument", + "publicOperation": "deleteApiDocument", + "deprecated": false, + "method": "DELETE", + "path": "/v1/apis/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryDeleteApiDocumentParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "retrieveApiDocumentVersion", + "publicOperation": "retrieveApiDocumentVersion", + "deprecated": false, + "method": "GET", + "path": "/v1/apis/{namespace}/{slug}/version/{semver}", + "pathParams": [ + "namespace", + "slug", + "semver" + ], + "publicPathParams": [ + "namespace", + "slug", + "semver" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "namespace", + "slug", + "semver" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "semver", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryRetrieveApiDocumentVersionParams" + }, + "response": { + "status": "200", + "contentType": "text/plain", + "encoding": "text", + "contents": [ + { + "contentType": "text/plain", + "encoding": "text" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "updateApiDocumentVersion", + "publicOperation": "updateApiDocumentVersion", + "deprecated": false, + "method": "PATCH", + "path": "/v1/apis/{namespace}/{slug}/version/{semver}", + "pathParams": [ + "namespace", + "slug", + "semver" + ], + "publicPathParams": [ + "namespace", + "slug", + "semver" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "document", + "lastKnownVersionSha" + ], + "publicBodyParams": [ + "document", + "lastKnownVersionSha" + ], + "publicPositionalParams": [ + "namespace", + "slug", + "semver" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "semver", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryUpdateApiDocumentVersionParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "deleteApiDocumentVersion", + "publicOperation": "deleteApiDocumentVersion", + "deprecated": false, + "method": "DELETE", + "path": "/v1/apis/{namespace}/{slug}/version/{semver}", + "pathParams": [ + "namespace", + "slug", + "semver" + ], + "publicPathParams": [ + "namespace", + "slug", + "semver" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "namespace", + "slug", + "semver" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "semver", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryDeleteApiDocumentVersionParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "listApiDocumentVersionMetadata", + "publicOperation": "listApiDocumentVersionMetadata", + "deprecated": false, + "method": "GET", + "path": "/v1/apis/{namespace}/{slug}/version/{semver}/metadata", + "pathParams": [ + "namespace", + "slug", + "semver" + ], + "publicPathParams": [ + "namespace", + "slug", + "semver" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "namespace", + "slug", + "semver" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "semver", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryListApiDocumentVersionMetadataParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "ManagedDocVersion", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "createApiDocumentVersion", + "publicOperation": "createApiDocumentVersion", + "deprecated": false, + "method": "POST", + "path": "/v1/apis/{namespace}/{slug}/version", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "version", + "document", + "force", + "lastKnownVersionSha" + ], + "publicBodyParams": [ + "version", + "document", + "force", + "lastKnownVersionSha" + ], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryCreateApiDocumentVersionParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "ManagedDocVersion", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "createApiDocumentAccessGroup", + "publicOperation": "createApiDocumentAccessGroup", + "deprecated": false, + "method": "POST", + "path": "/v1/apis/{namespace}/{slug}/access-group", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "accessGroupSlug" + ], + "publicBodyParams": [ + "accessGroupSlug" + ], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryCreateApiDocumentAccessGroupParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "deleteApiDocumentAccessGroup", + "publicOperation": "deleteApiDocumentAccessGroup", + "deprecated": false, + "method": "DELETE", + "path": "/v1/apis/{namespace}/{slug}/access-group", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "accessGroupSlug" + ], + "publicBodyParams": [ + "accessGroupSlug" + ], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryDeleteApiDocumentAccessGroupParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", + "path": "/v1/schemas/{namespace}", + "pathParams": [ + "namespace" + ], + "publicPathParams": [ + "namespace" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "namespace" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaListParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "create", + "publicOperation": "create", + "deprecated": false, + "method": "POST", + "path": "/v1/schemas/{namespace}", + "pathParams": [ + "namespace" + ], + "publicPathParams": [ + "namespace" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title", + "description", + "version", + "slug", + "isPrivate", + "document" + ], + "publicBodyParams": [ + "title", + "description", + "version", + "slug", + "isPrivate", + "document" + ], + "publicPositionalParams": [ + "namespace" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "Uid", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "update", + "publicOperation": "update", + "deprecated": false, + "method": "PATCH", + "path": "/v1/schemas/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title", + "description", + "isPrivate" + ], + "publicBodyParams": [ + "title", + "description", + "isPrivate" + ], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaUpdateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "delete", + "publicOperation": "delete", + "deprecated": false, + "method": "DELETE", + "path": "/v1/schemas/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaDeleteParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas.version", + "publicResource": "schemas.version", + "operation": "retrieveSchema", + "publicOperation": "retrieveSchema", + "deprecated": false, + "method": "GET", + "path": "/v1/schemas/{namespace}/{slug}/version/{semver}", + "pathParams": [ + "namespace", + "slug", + "semver" + ], + "publicPathParams": [ + "namespace", + "slug", + "semver" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "namespace", + "slug", + "semver" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "semver", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "VersionRetrieveSchemaParams" + }, + "response": { + "status": "200", + "contentType": "text/plain", + "encoding": "text", + "contents": [ + { + "contentType": "text/plain", + "encoding": "text" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas.version", + "publicResource": "schemas.version", + "operation": "deleteSchema", + "publicOperation": "deleteSchema", + "deprecated": false, + "method": "DELETE", + "path": "/v1/schemas/{namespace}/{slug}/version/{semver}", + "pathParams": [ + "namespace", + "slug", + "semver" + ], + "publicPathParams": [ + "namespace", + "slug", + "semver" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "namespace", + "slug", + "semver" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "semver", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "VersionDeleteSchemaParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas.version", + "publicResource": "schemas.version", + "operation": "createSchema", + "publicOperation": "createSchema", + "deprecated": false, + "method": "POST", + "path": "/v1/schemas/{namespace}/{slug}/version", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "version", + "document" + ], + "publicBodyParams": [ + "version", + "document" + ], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "VersionCreateSchemaParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "Uid", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas.accessGroup", + "publicResource": "schemas.accessGroup", + "operation": "createSchema", + "publicOperation": "createSchema", + "deprecated": false, + "method": "POST", + "path": "/v1/schemas/{namespace}/{slug}/access-group", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "accessGroupSlug" + ], + "publicBodyParams": [ + "accessGroupSlug" + ], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "AccessGroupCreateSchemaParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas.accessGroup", + "publicResource": "schemas.accessGroup", + "operation": "deleteSchema", + "publicOperation": "deleteSchema", + "deprecated": false, + "method": "DELETE", + "path": "/v1/schemas/{namespace}/{slug}/access-group", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "accessGroupSlug" + ], + "publicBodyParams": [ + "accessGroupSlug" + ], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "AccessGroupDeleteSchemaParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "loginPortals", + "publicResource": "loginPortals", + "operation": "retrieve", + "publicOperation": "retrieve", + "deprecated": false, + "method": "GET", + "path": "/v1/login-portals/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "slug" + ], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "LoginPortalRetrieveParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "loginPortals", + "publicResource": "loginPortals", + "operation": "update", + "publicOperation": "update", + "deprecated": false, + "method": "PATCH", + "path": "/v1/login-portals/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title" + ], + "publicBodyParams": [ + "title" + ], + "publicPositionalParams": [ + "slug" + ], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "LoginPortalUpdateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "loginPortals", + "publicResource": "loginPortals", + "operation": "delete", + "publicOperation": "delete", + "deprecated": false, + "method": "DELETE", + "path": "/v1/login-portals/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "slug" + ], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "LoginPortalDeleteParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "loginPortals", + "publicResource": "loginPortals", + "operation": "create", + "publicOperation": "create", + "deprecated": false, + "method": "POST", + "path": "/v1/login-portals", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title", + "slug", + "email", + "page" + ], + "publicBodyParams": [ + "title", + "slug", + "email", + "page" + ], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "LoginPortalCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "Uid", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "loginPortals", + "publicResource": "loginPortals", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", + "path": "/v1/login-portals", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "listRulesets", + "publicOperation": "listRulesets", + "deprecated": false, + "method": "GET", + "path": "/v1/rulesets/{namespace}", + "pathParams": [ + "namespace" + ], + "publicPathParams": [ + "namespace" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "namespace" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleListRulesetsParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "createRuleset", + "publicOperation": "createRuleset", + "deprecated": false, + "method": "POST", + "path": "/v1/rulesets/{namespace}", + "pathParams": [ + "namespace" + ], + "publicPathParams": [ + "namespace" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title", + "description", + "slug", + "isPrivate", + "document" + ], + "publicBodyParams": [ + "title", + "description", + "slug", + "isPrivate", + "document" + ], + "publicPositionalParams": [ + "namespace" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleCreateRulesetParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "Uid", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "updateRuleset", + "publicOperation": "updateRuleset", + "deprecated": false, + "method": "PATCH", + "path": "/v1/rulesets/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "namespace", + "slug", + "title", + "description", + "isPrivate" + ], + "publicBodyParams": [ + "namespace", + "slug", + "title", + "description", + "isPrivate" + ], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleUpdateRulesetParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "deleteRuleset", + "publicOperation": "deleteRuleset", + "deprecated": false, + "method": "DELETE", + "path": "/v1/rulesets/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleDeleteRulesetParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "retrieveRulesetDocument", + "publicOperation": "retrieveRulesetDocument", + "deprecated": false, + "method": "GET", + "path": "/v1/rulesets/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleRetrieveRulesetDocumentParams" + }, + "response": { + "status": "200", + "contentType": "text/plain", + "encoding": "text", + "contents": [ + { + "contentType": "text/plain", + "encoding": "text" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "createRulesetAccessGroup", + "publicOperation": "createRulesetAccessGroup", + "deprecated": false, + "method": "POST", + "path": "/v1/rulesets/{namespace}/{slug}/access-group", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "accessGroupSlug" + ], + "publicBodyParams": [ + "accessGroupSlug" + ], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleCreateRulesetAccessGroupParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "deleteRulesetAccessGroup", + "publicOperation": "deleteRulesetAccessGroup", + "deprecated": false, + "method": "DELETE", + "path": "/v1/rulesets/{namespace}/{slug}/access-group", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "accessGroupSlug" + ], + "publicBodyParams": [ + "accessGroupSlug" + ], + "publicPositionalParams": [ + "namespace", + "slug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleDeleteRulesetAccessGroupParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "themes", + "publicResource": "themes", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", + "path": "/v1/themes", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "themes", + "publicResource": "themes", + "operation": "create", + "publicOperation": "create", + "deprecated": false, + "method": "POST", + "path": "/v1/themes", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "name", + "description", + "slug", + "document" + ], + "publicBodyParams": [ + "name", + "description", + "slug", + "document" + ], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ThemeCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "Uid", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "themes", + "publicResource": "themes", + "operation": "update", + "publicOperation": "update", + "deprecated": false, + "method": "PATCH", + "path": "/v1/themes/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "name", + "description" + ], + "publicBodyParams": [ + "name", + "description" + ], + "publicPositionalParams": [ + "slug" + ], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ThemeUpdateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "themes", + "publicResource": "themes", + "operation": "replaceDocument", + "publicOperation": "replaceDocument", + "deprecated": false, + "method": "PUT", + "path": "/v1/themes/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "document" + ], + "publicBodyParams": [ + "document" + ], + "publicPositionalParams": [ + "slug" + ], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ThemeReplaceDocumentParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "themes", + "publicResource": "themes", + "operation": "delete", + "publicOperation": "delete", + "deprecated": false, + "method": "DELETE", + "path": "/v1/themes/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "slug" + ], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ThemeDeleteParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "themes", + "publicResource": "themes", + "operation": "retrieve", + "publicOperation": "retrieve", + "deprecated": false, + "method": "GET", + "path": "/v1/themes/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "slug" + ], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ThemeRetrieveParams" + }, + "response": { + "status": "200", + "contentType": "text/plain", + "encoding": "text", + "contents": [ + { + "contentType": "text/plain", + "encoding": "text" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "teams", + "publicResource": "teams", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", + "path": "/v1/teams", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "scalarDocs", + "publicResource": "scalarDocs", + "operation": "listGuides", + "publicOperation": "listGuides", + "deprecated": false, + "method": "GET", + "path": "/v1/guides", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "scalarDocs", + "publicResource": "scalarDocs", + "operation": "createGuide", + "publicOperation": "createGuide", + "deprecated": false, + "method": "POST", + "path": "/v1/guides", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "name", + "slug", + "isPrivate", + "allowedUsers", + "allowedDomains" + ], + "publicBodyParams": [ + "name", + "slug", + "isPrivate", + "allowedUsers", + "allowedDomains" + ], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ScalarDocCreateGuideParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "scalarDocs", + "publicResource": "scalarDocs", + "operation": "publishGuide", + "publicOperation": "publishGuide", + "deprecated": false, + "method": "POST", + "path": "/v1/guides/{slug}/publish", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [ + "slug" + ], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ScalarDocPublishGuideParams" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "namespaces", + "publicResource": "namespaces", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", + "path": "/v1/namespaces", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "authentication", + "publicResource": "authentication", + "operation": "exchangePersonalToken", + "publicOperation": "exchangePersonalToken", + "deprecated": false, + "method": "POST", + "path": "/v1/auth/exchange", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "personalToken" + ], + "publicBodyParams": [ + "personalToken" + ], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "AuthenticationExchangePersonalTokenParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "authentication", + "publicResource": "authentication", + "operation": "listCurrentUser", + "publicOperation": "listCurrentUser", + "deprecated": false, + "method": "GET", + "path": "/v1/auth/me", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "User", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + } + ], + "webhooks": [] +} diff --git a/src/client.rs b/src/client.rs new file mode 100644 index 0000000..23c3714 --- /dev/null +++ b/src/client.rs @@ -0,0 +1,300 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! The Scalar API client. + +use std::sync::Arc; +use std::time::Duration; + +use reqwest::Method; +use serde::de::DeserializeOwned; + +use crate::error::Error; +use crate::http::{self, RetryPolicy}; + +const DEFAULT_MAX_RETRIES: u32 = 2; +const USER_AGENT: &str = concat!("scalar-api/", env!("CARGO_PKG_VERSION")); + +/// A named API environment with a preset base URL. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[non_exhaustive] +pub enum Environment { + /// The `production` environment. + Production, + /// The `local` environment. + Local, +} + +impl Environment { + /// The base URL for this environment. + pub fn base_url(self) -> &'static str { + match self { + Self::Production => "https://access.scalar.com", + Self::Local => "http://127.0.0.1:4010", + } + } +} + +impl Default for Environment { + fn default() -> Self { + Self::Production + } +} + +/// Credentials applied to every outgoing request. +#[derive(Clone, Default)] +struct Auth { + bearer_token: Option, +} + +impl Auth { + /// Applies the configured credentials to a request builder. + fn apply(&self, mut builder: reqwest::RequestBuilder) -> reqwest::RequestBuilder { + if let Some(value) = &self.bearer_token { + builder = builder.bearer_auth(value); + } + builder + } +} + +/// Shared client state held behind an `Arc` so cloning a client is cheap. +struct Inner { + http: reqwest::Client, + base_url: url::Url, + auth: Auth, + retry: RetryPolicy, + /// Applied per-request so a caller-supplied `http_client` still honors the + /// builder `timeout` (a prebuilt `reqwest::Client` cannot be reconfigured). + timeout: Option, +} + +/// Asynchronous client for the Scalar API. +/// +/// Cloning is cheap: all state is shared behind an `Arc`. Construct one with +/// [`Scalar::builder`] or [`Scalar::from_env`]. +#[derive(Clone)] +pub struct Scalar { + inner: Arc, +} + +impl Scalar { + /// Starts building a client with the fluent builder. + pub fn builder() -> ScalarBuilder { + ScalarBuilder::new() + } + + /// Builds a client, reading credentials from the environment. + /// + /// Each credential is read from its conventional environment variable; + /// missing variables are simply left unset. + pub fn from_env() -> Result { + let mut builder = Self::builder(); + if let Ok(value) = std::env::var("SCALAR_BASE_URL") { + builder = builder.base_url(value); + } + if let Ok(value) = std::env::var("SCALAR_BEARER_TOKEN") { + builder = builder.bearer_token(value); + } + builder.build() + } +} + +impl std::fmt::Debug for Scalar { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Scalar") + .field("base_url", &self.inner.base_url.as_str()) + .field("retry", &self.inner.retry) + .field("timeout", &self.inner.timeout) + .finish_non_exhaustive() + } +} + +#[allow(dead_code)] +impl Scalar { + /// Builds, authenticates, and sends a request, decoding a JSON response. + pub(crate) async fn send( + &self, + method: Method, + path: &str, + query: &[(String, String)], + headers: &[(String, String)], + body: Option<&serde_json::Value>, + apply_auth: bool, + ) -> Result { + let response = self.dispatch(method, path, query, headers, body, apply_auth).await?; + http::decode_json(response).await + } + + /// Like [`send`](Self::send) but for operations that return no content. + pub(crate) async fn send_empty( + &self, + method: Method, + path: &str, + query: &[(String, String)], + headers: &[(String, String)], + body: Option<&serde_json::Value>, + apply_auth: bool, + ) -> Result<(), Error> { + let response = self.dispatch(method, path, query, headers, body, apply_auth).await?; + http::decode_empty(response).await + } + + /// Like [`send`](Self::send) but returns the raw response bytes (binary downloads). + pub(crate) async fn send_bytes( + &self, + method: Method, + path: &str, + query: &[(String, String)], + headers: &[(String, String)], + body: Option<&serde_json::Value>, + apply_auth: bool, + ) -> Result { + let response = self.dispatch(method, path, query, headers, body, apply_auth).await?; + http::decode_bytes(response).await + } + + /// Sends a request and returns the raw response, for streaming operations. + pub(crate) async fn send_raw( + &self, + method: Method, + path: &str, + query: &[(String, String)], + headers: &[(String, String)], + body: Option<&serde_json::Value>, + apply_auth: bool, + ) -> Result { + self.dispatch(method, path, query, headers, body, apply_auth).await + } + + /// Assembles a request (URL, query, headers, body, auth) and sends it with retries. + async fn dispatch( + &self, + method: Method, + path: &str, + query: &[(String, String)], + headers: &[(String, String)], + body: Option<&serde_json::Value>, + apply_auth: bool, + ) -> Result { + let url = self + .inner + .base_url + .join(path.trim_start_matches('/')) + .map_err(|error| Error::Config(error.to_string()))?; + let mut builder = self.inner.http.request(method, url); + if let Some(timeout) = self.inner.timeout { + builder = builder.timeout(timeout); + } + if !query.is_empty() { + builder = builder.query(query); + } + for (name, value) in headers { + builder = builder.header(name, value); + } + if let Some(body) = body { + builder = builder.json(body); + } + if apply_auth { + builder = self.inner.auth.apply(builder); + } + let request = builder.build()?; + http::send_with_retries(&self.inner.http, request, &self.inner.retry, false).await + } +} + +/// Fluent builder for [`Scalar`]. +#[derive(Default)] +pub struct ScalarBuilder { + base_url: Option, + environment: Option, + timeout: Option, + max_retries: Option, + http_client: Option, + bearer_token: Option, +} + +impl ScalarBuilder { + /// Creates an empty builder. + pub fn new() -> Self { + Self::default() + } + + /// Overrides the base URL the client sends requests to. + pub fn base_url(mut self, base_url: impl Into) -> Self { + self.base_url = Some(base_url.into()); + self + } + + /// Selects a named environment, setting the base URL. + pub fn environment(mut self, environment: Environment) -> Self { + self.environment = Some(environment); + self + } + + /// Sets the per-request timeout. + pub fn timeout(mut self, timeout: Duration) -> Self { + self.timeout = Some(timeout); + self + } + + /// Sets the maximum number of retry attempts for transient failures. + pub fn max_retries(mut self, max_retries: u32) -> Self { + self.max_retries = Some(max_retries); + self + } + + /// Supplies a preconfigured `reqwest::Client` (proxies, custom TLS, etc.). + pub fn http_client(mut self, http_client: reqwest::Client) -> Self { + self.http_client = Some(http_client); + self + } + + /// Sets the `bearer_token` credential. + pub fn bearer_token(mut self, value: impl Into) -> Self { + self.bearer_token = Some(value.into()); + self + } + + /// Builds the client, resolving the base URL and HTTP stack. + pub fn build(self) -> Result { + let base_url = self + .base_url + .unwrap_or_else(|| self.environment.unwrap_or_default().base_url().to_string()); + let base_url = normalize_base_url(&base_url)?; + let http = match self.http_client { + Some(http) => http, + None => reqwest::Client::builder().user_agent(USER_AGENT).build()?, + }; + let retry = RetryPolicy::new(self.max_retries.unwrap_or(DEFAULT_MAX_RETRIES)); + Ok(Scalar { + inner: Arc::new(Inner { + http, + base_url, + auth: Auth { + bearer_token: self.bearer_token, + }, + retry, + timeout: self.timeout, + }), + }) + } +} + +impl std::fmt::Debug for ScalarBuilder { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("ScalarBuilder") + .field("base_url", &self.base_url) + .field("environment", &self.environment) + .field("timeout", &self.timeout) + .field("max_retries", &self.max_retries) + .finish_non_exhaustive() + } +} + +/// Parses a base URL, ensuring a trailing slash so relative paths join correctly. +fn normalize_base_url(base_url: &str) -> Result { + let with_slash = if base_url.ends_with('/') { + base_url.to_string() + } else { + format!("{base_url}/") + }; + url::Url::parse(&with_slash).map_err(|error| Error::Config(error.to_string())) +} diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 0000000..778c1fc --- /dev/null +++ b/src/error.rs @@ -0,0 +1,101 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! Error types returned by the generated client. + +use thiserror::Error; + +/// The error type returned by every fallible operation in this crate. +/// +/// Variants distinguish API-level failures (a non-success HTTP status, with the +/// decoded problem details in [`ApiError`]) from transport, decoding, and +/// configuration failures, so callers can match on the failure mode with the +/// `?` operator rather than inspecting strings. +#[derive(Debug, Error)] +#[non_exhaustive] +pub enum Error { + /// The API responded with a non-success HTTP status. + #[error(transparent)] + Api(#[from] ApiError), + + /// The HTTP request could not be completed (DNS, TLS, connection, timeout). + #[error("transport error: {0}")] + Transport(#[from] reqwest::Error), + + /// A request or response body could not be (de)serialized. + #[error("serialization error: {0}")] + Serde(#[from] serde_json::Error), + + /// The client was misconfigured, e.g. an invalid base URL. + #[error("configuration error: {0}")] + Config(String), + + /// A required request parameter was not supplied to a builder. + #[error("missing required parameter: `{0}`")] + MissingParameter(&'static str), +} + +/// Details of a non-success API response. +/// +/// `status` is the raw HTTP status code, `request_id` is the server-assigned id +/// (when present) for support correlation, `body` is the parsed response payload +/// — typically an RFC 7807 problem document — preserved verbatim so callers can +/// extract API-specific error fields, and `raw` keeps the original body text for +/// non-JSON error responses (e.g. an HTML 502 page) that `body` cannot hold. +#[derive(Debug, Clone, Error)] +#[error("API request failed with status {status}{}", request_suffix(request_id.as_deref()))] +#[non_exhaustive] +pub struct ApiError { + /// The HTTP status code of the response. + pub status: u16, + /// The server-assigned request id, when the response carried one. + pub request_id: Option, + /// The decoded response body, when it was valid JSON. + pub body: Option, + /// The raw response body as text, retained when it was not valid JSON so a + /// plain-text or HTML error page is not silently discarded. + pub raw: Option, +} + +impl ApiError { + /// Builds an [`ApiError`] from a status, optional request id, and raw body bytes. + /// + /// The body is parsed as JSON on a best-effort basis; a non-JSON body is kept + /// as text in [`ApiError::raw`] instead, and an empty body leaves both `None`. + /// Either way an error response never masks the original status with a decode + /// error. + pub(crate) fn from_bytes(status: u16, request_id: Option, bytes: &[u8]) -> Self { + let body: Option = serde_json::from_slice(bytes).ok(); + // Preserve the original payload as text only when it is neither empty nor + // already captured as JSON, so `raw` carries exactly what `body` cannot. + let raw = if body.is_none() && !bytes.is_empty() { + Some(String::from_utf8_lossy(bytes).into_owned()) + } else { + None + }; + Self { status, request_id, body, raw } + } + + /// Deserializes the response body into a typed value, when present. + /// + /// The raw body is preserved on [`ApiError::body`]; this is a convenience for + /// pulling out a typed shape — e.g. the API's problem-details model: + /// `if let Some(problem) = err.body_as::() { … }`. Returns `None` + /// when there is no body or it does not match `T`. + pub fn body_as(&self) -> Option { + self.body.as_ref().and_then(|body| serde_json::from_value(body.clone()).ok()) + } + + /// Whether the status is in the 4xx client-error range. + pub fn is_client_error(&self) -> bool { + (400..500).contains(&self.status) + } + + /// Whether the status is in the 5xx server-error range. + pub fn is_server_error(&self) -> bool { + (500..600).contains(&self.status) + } +} + +/// Renders the optional `(request )` suffix for the error `Display`. +fn request_suffix(request_id: Option<&str>) -> String { + request_id.map(|id| format!(" (request {id})")).unwrap_or_default() +} diff --git a/src/http.rs b/src/http.rs new file mode 100644 index 0000000..e70b60f --- /dev/null +++ b/src/http.rs @@ -0,0 +1,319 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! Transport runtime: retry policy, backoff, and response decoding. +//! +//! This module is request-shape agnostic — it never touches authentication or +//! per-operation parameters (the generated client owns those). It exists so +//! retry, backoff, and error-mapping logic lives in one audited place instead +//! of being duplicated across every operation. + +use std::time::Duration; + +use reqwest::header::HeaderMap; +use serde::Serialize; +use serde::de::DeserializeOwned; + +use crate::error::{ApiError, Error}; + +/// Header inspected for a server-assigned request id used in error reports. +const REQUEST_ID_HEADER: &str = "x-request-id"; + +/// Retry policy applied to every request issued by the client. +/// +/// Retries cover transient transport failures and retryable status codes +/// (408, 409, 429, and 5xx). Backoff grows exponentially from +/// `initial_backoff`, capped at `max_backoff`; a `Retry-After` response header +/// overrides the computed delay when present. +#[derive(Debug, Clone)] +pub struct RetryPolicy { + /// Maximum number of retry attempts after the initial request. + pub max_retries: u32, + /// Delay before the first retry. + pub initial_backoff: Duration, + /// Upper bound on any single backoff delay. + pub max_backoff: Duration, +} + +impl RetryPolicy { + /// Creates a policy with sensible exponential-backoff bounds. + pub fn new(max_retries: u32) -> Self { + Self { + max_retries, + initial_backoff: Duration::from_millis(500), + max_backoff: Duration::from_secs(8), + } + } +} + +/// Sends a request, retrying transient failures per `policy`. +/// +/// The request is cloned for each attempt; a non-cloneable body (e.g. a stream) +/// disables retries and is sent once. Returns the final [`reqwest::Response`] +/// regardless of status — status-based error mapping happens in +/// [`decode_json`] so callers that want the raw response can opt out. +/// +/// `keyed` is set by the caller when the request carries an idempotency key, so +/// a non-idempotent method (POST/PATCH) can still be safely replayed — the +/// server deduplicates the retry by that key. +pub async fn send_with_retries( + client: &reqwest::Client, + request: reqwest::Request, + policy: &RetryPolicy, + keyed: bool, +) -> Result { + // Only idempotent methods may be safely replayed: retrying a POST/PATCH that + // the server already processed (but whose response was lost to a 5xx or a + // timeout) would duplicate the side effect — unless an idempotency key lets + // the server dedupe the replay. A failed *connection* never reached the + // server, so it is retried for any method (see is_retryable_transport). + let idempotent = keyed || is_idempotent(request.method()); + let mut attempt: u32 = 0; + loop { + // A streaming body cannot be replayed; send the original once and stop. + let Some(current) = request.try_clone() else { + return client.execute(request).await.map_err(Error::from); + }; + match client.execute(current).await { + Ok(response) => { + if attempt < policy.max_retries && idempotent && should_retry_status(response.status().as_u16()) { + // A server-provided `Retry-After` is honored but clamped to + // `max_backoff` so a hostile or misconfigured header cannot + // stall the caller's future for an unbounded duration. + let delay = retry_after(response.headers()) + .map(|after| after.min(policy.max_backoff)) + .unwrap_or_else(|| backoff(policy, attempt)); + attempt += 1; + tokio::time::sleep(delay).await; + continue; + } + return Ok(response); + } + Err(error) => { + if attempt < policy.max_retries && is_retryable_transport(&error, idempotent) { + tokio::time::sleep(backoff(policy, attempt)).await; + attempt += 1; + continue; + } + return Err(Error::from(error)); + } + } + } +} + +/// Decodes a JSON response, mapping non-success statuses to [`ApiError`]. +/// +/// Success bodies are deserialized into `T`. For operations that return no +/// content, use [`decode_empty`] instead so an empty 2xx body is not fed to a +/// JSON deserializer. +pub async fn decode_json(response: reqwest::Response) -> Result { + let status = response.status(); + let request_id = request_id(response.headers()); + let bytes = response.bytes().await?; + if status.is_success() { + // A successful response with an empty body (a 204, or a 200/202 with no + // content) is not valid JSON; decode it as `null` so `Option` and + // unit-like return types succeed instead of failing with an EOF error. + if bytes.is_empty() { + return serde_json::from_slice(b"null").map_err(Error::from); + } + serde_json::from_slice(&bytes).map_err(Error::from) + } else { + Err(Error::Api(ApiError::from_bytes(status.as_u16(), request_id, &bytes))) + } +} + +/// Decodes a binary response body, mapping non-success statuses to [`ApiError`]. +/// +/// Used for operations whose success response is a non-JSON payload +/// (`application/octet-stream`, `text/csv`, etc.): the bytes are returned +/// verbatim rather than fed to a JSON deserializer. +pub async fn decode_bytes(response: reqwest::Response) -> Result { + let status = response.status(); + let request_id = request_id(response.headers()); + let bytes = response.bytes().await?; + if status.is_success() { + Ok(bytes) + } else { + Err(Error::Api(ApiError::from_bytes(status.as_u16(), request_id, &bytes))) + } +} + +/// Consumes a no-content response, mapping non-success statuses to [`ApiError`]. +pub async fn decode_empty(response: reqwest::Response) -> Result<(), Error> { + let status = response.status(); + let request_id = request_id(response.headers()); + if status.is_success() { + Ok(()) + } else { + let bytes = response.bytes().await?; + Err(Error::Api(ApiError::from_bytes(status.as_u16(), request_id, &bytes))) + } +} + +/// Extracts the request-id header value, if present and valid UTF-8. +fn request_id(headers: &HeaderMap) -> Option { + headers + .get(REQUEST_ID_HEADER) + .and_then(|value| value.to_str().ok()) + .map(str::to_owned) +} + +/// Whether a status code is worth retrying. +fn should_retry_status(status: u16) -> bool { + matches!(status, 408 | 409 | 429) || status >= 500 +} + +/// Whether a request method is safe to replay (RFC 7231 idempotent methods). +fn is_idempotent(method: &reqwest::Method) -> bool { + matches!( + *method, + reqwest::Method::GET + | reqwest::Method::HEAD + | reqwest::Method::PUT + | reqwest::Method::DELETE + | reqwest::Method::OPTIONS + | reqwest::Method::TRACE + ) +} + +/// Whether a transport error is transient enough to retry. +/// +/// A connection error means the request never reached the server, so it is safe +/// to retry for any method. A timeout may have been received and processed by +/// the server, so it is only replayed for idempotent methods. +fn is_retryable_transport(error: &reqwest::Error, idempotent: bool) -> bool { + error.is_connect() || (idempotent && error.is_timeout()) +} + +/// Parses a `Retry-After` header, in either RFC 7231 form. +/// +/// The value is `delta-seconds` (a whole number) or an HTTP-date; the latter is +/// resolved to a delay from now (servers commonly send it on 429/503). The +/// computed delay is still clamped to `max_backoff` by the caller. +fn retry_after(headers: &HeaderMap) -> Option { + let value = headers.get(reqwest::header::RETRY_AFTER)?.to_str().ok()?.trim(); + if let Ok(seconds) = value.parse::() { + return Some(Duration::from_secs(seconds)); + } + retry_after_date(value).map(Duration::from_secs) +} + +/// Resolves an HTTP-date `Retry-After` (IMF-fixdate, e.g. +/// `Wed, 21 Oct 2015 07:28:00 GMT`) into seconds from now, `0` if already past. +/// +/// Parsed without a date dependency so the transport runtime stays +/// zero-dependency regardless of whether the SDK pulls in `chrono`. +fn retry_after_date(value: &str) -> Option { + let parts: Vec<&str> = value.split_whitespace().collect(); + if parts.len() != 6 { + return None; + } + let day: i64 = parts[1].parse().ok()?; + let month = match parts[2] { + "Jan" => 1, + "Feb" => 2, + "Mar" => 3, + "Apr" => 4, + "May" => 5, + "Jun" => 6, + "Jul" => 7, + "Aug" => 8, + "Sep" => 9, + "Oct" => 10, + "Nov" => 11, + "Dec" => 12, + _ => return None, + }; + let year: i64 = parts[3].parse().ok()?; + let time: Vec<&str> = parts[4].split(':').collect(); + if time.len() != 3 { + return None; + } + let hour: i64 = time[0].parse().ok()?; + let minute: i64 = time[1].parse().ok()?; + let second: i64 = time[2].parse().ok()?; + let target = days_from_civil(year, month, day) * 86_400 + hour * 3_600 + minute * 60 + second; + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .ok()? + .as_secs() as i64; + Some((target - now).max(0) as u64) +} + +/// Days since the Unix epoch for a civil (proleptic Gregorian) date. +/// +/// Howard Hinnant's `days_from_civil` algorithm, valid for any year. +fn days_from_civil(year: i64, month: i64, day: i64) -> i64 { + let year = if month <= 2 { year - 1 } else { year }; + let era = (if year >= 0 { year } else { year - 399 }) / 400; + let year_of_era = year - era * 400; + let day_of_year = (153 * (if month > 2 { month - 3 } else { month + 9 }) + 2) / 5 + day - 1; + let day_of_era = year_of_era * 365 + year_of_era / 4 - year_of_era / 100 + day_of_year; + era * 146_097 + day_of_era - 719_468 +} + +/// Computes the exponential backoff delay for a zero-based attempt index. +/// +/// The exponential delay is capped at `max_backoff` and then jittered (see +/// [`jittered`]) so concurrent clients backing off from the same failure do not +/// synchronize their retries into a thundering herd. +fn backoff(policy: &RetryPolicy, attempt: u32) -> Duration { + let factor = 2u32.saturating_pow(attempt); + let capped = policy.initial_backoff.saturating_mul(factor).min(policy.max_backoff); + jittered(capped) +} + +/// Applies "equal jitter" to a delay: half the delay is fixed and half is +/// randomized in `[0, delay/2]`, so the result lands in `[delay/2, delay]`. +/// +/// Entropy comes from the wall clock's sub-second nanos rather than a `rand` +/// dependency, keeping the transport runtime zero-dependency; perfect randomness +/// is unnecessary — the goal is only to desynchronize retries. +fn jittered(delay: Duration) -> Duration { + let half = delay / 2; + let span = half.as_nanos() as u64; + if span == 0 { + return delay; + } + let entropy = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .map(|elapsed| elapsed.subsec_nanos()) + .unwrap_or(0); + half + Duration::from_nanos(u64::from(entropy) % (span + 1)) +} + +/// Renders a parameter value as a query/header/path string via serde. +/// +/// Strings serialize without surrounding quotes, scalars use their JSON form, +/// and enums use their `#[serde(rename)]` wire value — so the same helper works +/// for every parameter type without requiring a `Display` impl. Compound values +/// (arrays/objects) fall back to compact JSON. +pub fn scalar_value(value: &T) -> String { + match serde_json::to_value(value) { + Ok(serde_json::Value::String(text)) => text, + Ok(serde_json::Value::Null) => String::new(), + Ok(other) => other.to_string(), + Err(_) => String::new(), + } +} + +/// Percent-encodes a single path-parameter value. +/// +/// Everything outside the RFC 3986 unreserved set is percent-encoded so a value +/// containing `/`, `?`, or spaces cannot alter the request path structure. +pub fn encode_path_param(value: &str) -> String { + const HEX: &[u8; 16] = b"0123456789ABCDEF"; + let mut encoded = String::with_capacity(value.len()); + for byte in value.bytes() { + match byte { + b'A'..=b'Z' | b'a'..=b'z' | b'0'..=b'9' | b'-' | b'.' | b'_' | b'~' => encoded.push(byte as char), + // Push `%` and the two hex nibbles straight into the buffer; a + // `format!("%{byte:02X}")` would allocate a `String` per escaped byte. + _ => { + encoded.push('%'); + encoded.push(HEX[(byte >> 4) as usize] as char); + encoded.push(HEX[(byte & 0x0f) as usize] as char); + } + } + } + encoded +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..baec057 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,84 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! API for managing Scalar platform resources. +//! +//! ## TypeScript SDK +//! +//! For TypeScript, we provide a SDK that makes using our API even easier. +//! +//! ### Install +//! +//! ```text +//! npm add @scalar/sdk +//! ``` +//! +//! ### Get a Scalar API key +//! +//! Create an API key in your Scalar account: +//! +//! - Dashboard: https://dashboard.scalar.com/account +//! - Store it in `.env`, for example: +//! +//! ```text +//! SCALAR_API_KEY=your_personal_token +//! ``` +//! +//! ### Exchange your API key for an access token +//! +//! The personal token is not an access token. Exchange it first with `postv1AuthExchange`. +//! +//! If you use the personal token directly for authenticated API calls, the API returns `401 Invalid authentication token`. +//! +//! ```text +//! import { Scalar } from '@scalar/sdk' +//! +//! const scalar = new Scalar() +//! +//! const exchange = await scalar.auth.postv1AuthExchange({ +//! personalToken: process.env.SCALAR_API_KEY!, +//! }) +//! +//! const accessToken = exchange.accessToken +//! ``` +//! +//! ### Use the access token +//! +//! Construct a second client with bearer auth. Use this authenticated client for API calls. +//! +//! ```text +//! import { Scalar } from '@scalar/sdk' +//! +//! const scalar = new Scalar() +//! +//! const exchange = await scalar.auth.postv1AuthExchange({ +//! personalToken: process.env.SCALAR_API_KEY!, +//! }) +//! +//! const authedScalar = new Scalar({ +//! bearerAuth: exchange.accessToken, +//! }) +//! ``` +//! +//! ### Notes +//! +//! - The exchange request itself can be made from a client constructed with no arguments (`new Scalar()`). +//! - The exchanged access token is valid for 12 hours. +//! - Timestamps are Unix seconds. +//! +//! ### Read more +//! +//! - [@scalar/sdk on npm](https://www.npmjs.com/package/@scalar/sdk) + +pub mod error; +pub mod http; +pub mod models; +pub mod client; +pub mod resources; + +pub use models::{AccessGroup, ActiveDeployment, ApiDocument, BadRequestError, Email, ForbiddenError, GithubProject, GithubProjectRepository, InternalServerError, LoginPortal, LoginPortalEmail, LoginPortalPage, ManagedDocVersion, ManagedSchemaVersion, Method, Namespace, Nanoid, NotFoundError, Rule, Schema, Slug, Team, TeamImage, TeamName, TeamSummary, Theme, Timestamp, Uid, UnauthorizedError, UnprocessableEntityError, User, Version}; +pub use client::Scalar; +pub use client::ScalarBuilder; +pub use client::Environment; +pub use error::{ApiError, Error}; + +/// The version of this crate, matching the published package version. +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); diff --git a/src/models.rs b/src/models.rs new file mode 100644 index 0000000..a4be2b7 --- /dev/null +++ b/src/models.rs @@ -0,0 +1,279 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! Generated request and response models. +#![allow(clippy::large_enum_variant)] + +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct BadRequestError { + pub message: String, + pub code: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct UnauthorizedError { + pub message: String, + pub code: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ForbiddenError { + pub message: String, + pub code: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct NotFoundError { + pub message: String, + pub code: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct UnprocessableEntityError { + pub message: String, + pub code: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct InternalServerError { + pub message: String, + pub code: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ApiDocument { + pub uid: String, + pub version: String, + pub title: String, + pub slug: String, + pub description: String, + pub namespace: String, + pub is_private: bool, + pub tags: String, + pub versions: Vec, +} + +pub type Nanoid = String; + +pub type Version = String; + +pub type Slug = String; + +pub type Namespace = String; + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ManagedDocVersion { + pub uid: String, + pub created_at: f64, + pub version: String, + pub upgraded: bool, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub embed_status: Option, + pub tags: Vec, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tools: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub yaml_sha: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub json_sha: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version_sha: Option, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum Method { + #[serde(rename = "delete")] + Delete, + #[serde(rename = "get")] + Get, + #[serde(rename = "head")] + Head, + #[serde(rename = "options")] + Options, + #[serde(rename = "patch")] + Patch, + #[serde(rename = "post")] + Post, + #[serde(rename = "put")] + Put, + #[serde(rename = "trace")] + Trace, + /// A value not known to this version of the SDK. + #[serde(other)] + Unknown, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct AccessGroup { + pub access_group_slug: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Schema { + pub uid: String, + pub title: String, + pub description: String, + pub slug: String, + pub namespace: String, + pub is_private: bool, + pub versions: Vec, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ManagedSchemaVersion { + pub uid: String, + pub created_at: i64, + pub updated_at: i64, + pub version: String, +} + +pub type Timestamp = i64; + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Uid { + pub uid: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct LoginPortalEmail { + pub logo: String, + pub logo_size: String, + pub button_text: String, + pub message: String, + pub title: String, + pub main_color: String, + pub main_background: String, + pub card_color: String, + pub card_background: String, + pub button_color: String, + pub button_background: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct LoginPortalPage { + pub title: String, + pub description: String, + pub head: String, + pub script: String, + pub theme: String, + pub company_name: String, + pub logo: String, + #[serde(rename = "logoURL")] + pub logo_url: String, + pub favicon: String, + pub terms_link: String, + pub privacy_link: String, + pub form_title: String, + pub form_description: String, + pub form_image: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct LoginPortal { + pub uid: String, + pub title: String, + pub slug: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Rule { + pub uid: String, + pub title: String, + pub description: String, + pub slug: String, + pub namespace: String, + pub is_private: bool, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Theme { + pub uid: String, + pub name: String, + pub description: String, + pub slug: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Team { + pub uid: String, + pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub image_uri: Option, + pub slug: String, + pub theme: String, +} + +pub type TeamName = String; + +pub type TeamImage = String; + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct GithubProject { + pub uid: String, + pub created_at: i64, + pub updated_at: i64, + pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub active_deployment: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_published: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_published_uid: Option, + pub login_portal_uid: String, + pub active_theme_id: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub typesense_id: Option, + pub is_private: bool, + pub agent_enabled: bool, + pub access_groups: String, + pub slug: String, + pub publish_status: String, + pub publish_message: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repository: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ActiveDeployment { + pub uid: String, + pub domain: String, + pub published_at: i64, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct GithubProjectRepository { + pub linked_by: String, + pub id: f64, + pub name: String, + pub config_path: String, + pub branch: String, + pub publish_on_merge: bool, + pub publish_previews: bool, + pub pr_comments: bool, + pub expired: bool, +} + +pub type Email = String; + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct TeamSummary { + pub uid: String, + pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub image_uri: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct User { + pub uid: String, + pub created_at: i64, + pub updated_at: i64, + pub email: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub theme: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub active_team_id: Option, + pub has_github: bool, + pub teams: Vec, +} diff --git a/src/resources/access_group.rs b/src/resources/access_group.rs new file mode 100644 index 0000000..fe11783 --- /dev/null +++ b/src/resources/access_group.rs @@ -0,0 +1,84 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! The `accessGroup` resource. + +#[derive(Clone)] +pub struct AccessGroup { + client: crate::client::Scalar, +} + +impl AccessGroup { + pub(crate) fn new(client: crate::client::Scalar) -> Self { + Self { client } + } + + /// Add shared component access group + pub fn create_schema(&self, namespace: impl Into, slug: impl Into, body: crate::models::AccessGroup) -> CreateSchemaRequest { + CreateSchemaRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } + + /// Remove shared component access group + pub fn delete_schema(&self, namespace: impl Into, slug: impl Into, body: crate::models::AccessGroup) -> DeleteSchemaRequest { + DeleteSchemaRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } +} + +/// Add an access group to a schema. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateSchemaRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: crate::models::AccessGroup, +} + +impl CreateSchemaRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::AccessGroup) -> Self { + Self { + client, + namespace, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/schemas/{}/{}/access-group", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Remove an access group from a schema. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct DeleteSchemaRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: crate::models::AccessGroup, +} + +impl DeleteSchemaRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::AccessGroup) -> Self { + Self { + client, + namespace, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/schemas/{}/{}/access-group", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body.as_ref(), true) + .await + } +} diff --git a/src/resources/authentication.rs b/src/resources/authentication.rs new file mode 100644 index 0000000..8a7c579 --- /dev/null +++ b/src/resources/authentication.rs @@ -0,0 +1,74 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! The `authentication` resource. + +#[derive(Clone)] +pub struct Authentication { + client: crate::client::Scalar, +} + +impl Authentication { + pub(crate) fn new(client: crate::client::Scalar) -> Self { + Self { client } + } + + /// Exchange token + pub fn exchange_personal_token(&self, body: serde_json::Value) -> ExchangePersonalTokenRequest { + ExchangePersonalTokenRequest::new(self.client.clone(), body) + } + + /// Get current user + pub fn list_current_user(&self) -> ListCurrentUserRequest { + ListCurrentUserRequest::new(self.client.clone()) + } +} + +/// Exchange an API key for an access token. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ExchangePersonalTokenRequest { + client: crate::client::Scalar, + body: serde_json::Value, +} + +impl ExchangePersonalTokenRequest { + fn new(client: crate::client::Scalar, body: serde_json::Value) -> Self { + Self { + client, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = "/v1/auth/exchange".to_string(); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Get the authenticated user, including their available teams and theme. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ListCurrentUserRequest { + client: crate::client::Scalar, +} + +impl ListCurrentUserRequest { + fn new(client: crate::client::Scalar) -> Self { + Self { + client, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = "/v1/auth/me".to_string(); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} diff --git a/src/resources/login_portals.rs b/src/resources/login_portals.rs new file mode 100644 index 0000000..d4c6e6a --- /dev/null +++ b/src/resources/login_portals.rs @@ -0,0 +1,169 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! The `loginPortals` resource. + +#[derive(Clone)] +pub struct LoginPortals { + client: crate::client::Scalar, +} + +impl LoginPortals { + pub(crate) fn new(client: crate::client::Scalar) -> Self { + Self { client } + } + + /// Get a login portal + pub fn retrieve(&self, slug: impl Into) -> RetrieveRequest { + RetrieveRequest::new(self.client.clone(), slug.into()) + } + + /// Update portal metadata + pub fn update(&self, slug: impl Into, body: serde_json::Value) -> UpdateRequest { + UpdateRequest::new(self.client.clone(), slug.into(), body) + } + + /// Delete a login portal + pub fn delete(&self, slug: impl Into) -> DeleteRequest { + DeleteRequest::new(self.client.clone(), slug.into()) + } + + /// Create a portal + pub fn create(&self, body: serde_json::Value) -> CreateRequest { + CreateRequest::new(self.client.clone(), body) + } + + /// List all portals + pub fn list(&self) -> ListRequest { + ListRequest::new(self.client.clone()) + } +} + +/// Get a login portal by slug. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct RetrieveRequest { + client: crate::client::Scalar, + slug: String, +} + +impl RetrieveRequest { + fn new(client: crate::client::Scalar, slug: String) -> Self { + Self { + client, + slug, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/login-portals/{}", crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Update metadata for a login portal. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct UpdateRequest { + client: crate::client::Scalar, + slug: String, + body: serde_json::Value, +} + +impl UpdateRequest { + fn new(client: crate::client::Scalar, slug: String, body: serde_json::Value) -> Self { + Self { + client, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/login-portals/{}", crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::PATCH, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Delete a login portal. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct DeleteRequest { + client: crate::client::Scalar, + slug: String, +} + +impl DeleteRequest { + fn new(client: crate::client::Scalar, slug: String) -> Self { + Self { + client, + slug, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/login-portals/{}", crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Create a login portal for the current team. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateRequest { + client: crate::client::Scalar, + body: serde_json::Value, +} + +impl CreateRequest { + fn new(client: crate::client::Scalar, body: serde_json::Value) -> Self { + Self { + client, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = "/v1/login-portals".to_string(); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// List all login portals for the current team. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ListRequest { + client: crate::client::Scalar, +} + +impl ListRequest { + fn new(client: crate::client::Scalar) -> Self { + Self { + client, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result, crate::error::Error> { + let path = "/v1/login-portals".to_string(); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::>(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} diff --git a/src/resources/mod.rs b/src/resources/mod.rs new file mode 100644 index 0000000..60ffba7 --- /dev/null +++ b/src/resources/mod.rs @@ -0,0 +1,52 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! Resource sub-clients and root accessors. + +pub mod registry; +pub mod schemas; +pub mod version; +pub mod access_group; +pub mod login_portals; +pub mod rules; +pub mod themes; +pub mod teams; +pub mod scalar_docs; +pub mod namespaces; +pub mod authentication; + +impl crate::client::Scalar { + pub fn registry(&self) -> crate::resources::registry::Registry { + crate::resources::registry::Registry::new(self.clone()) + } + + pub fn schemas(&self) -> crate::resources::schemas::Schemas { + crate::resources::schemas::Schemas::new(self.clone()) + } + + pub fn login_portals(&self) -> crate::resources::login_portals::LoginPortals { + crate::resources::login_portals::LoginPortals::new(self.clone()) + } + + pub fn rules(&self) -> crate::resources::rules::Rules { + crate::resources::rules::Rules::new(self.clone()) + } + + pub fn themes(&self) -> crate::resources::themes::Themes { + crate::resources::themes::Themes::new(self.clone()) + } + + pub fn teams(&self) -> crate::resources::teams::Teams { + crate::resources::teams::Teams::new(self.clone()) + } + + pub fn scalar_docs(&self) -> crate::resources::scalar_docs::ScalarDocs { + crate::resources::scalar_docs::ScalarDocs::new(self.clone()) + } + + pub fn namespaces(&self) -> crate::resources::namespaces::Namespaces { + crate::resources::namespaces::Namespaces::new(self.clone()) + } + + pub fn authentication(&self) -> crate::resources::authentication::Authentication { + crate::resources::authentication::Authentication::new(self.clone()) + } +} diff --git a/src/resources/namespaces.rs b/src/resources/namespaces.rs new file mode 100644 index 0000000..0019017 --- /dev/null +++ b/src/resources/namespaces.rs @@ -0,0 +1,43 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! The `namespaces` resource. + +#[derive(Clone)] +pub struct Namespaces { + client: crate::client::Scalar, +} + +impl Namespaces { + pub(crate) fn new(client: crate::client::Scalar) -> Self { + Self { client } + } + + /// List namespaces + pub fn list(&self) -> ListRequest { + ListRequest::new(self.client.clone()) + } +} + +/// Get all namespaces for the current team +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ListRequest { + client: crate::client::Scalar, +} + +impl ListRequest { + fn new(client: crate::client::Scalar) -> Self { + Self { + client, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result, crate::error::Error> { + let path = "/v1/namespaces".to_string(); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::>(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} diff --git a/src/resources/registry.rs b/src/resources/registry.rs new file mode 100644 index 0000000..aaab3b1 --- /dev/null +++ b/src/resources/registry.rs @@ -0,0 +1,422 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! The `registry` resource. + +#[derive(Clone)] +pub struct Registry { + client: crate::client::Scalar, +} + +impl Registry { + pub(crate) fn new(client: crate::client::Scalar) -> Self { + Self { client } + } + + /// List all API Documents + pub fn list_all_api_documents(&self) -> ListAllApiDocumentsRequest { + ListAllApiDocumentsRequest::new(self.client.clone()) + } + + /// List API Documents in a namespace + pub fn list_api_documents(&self, namespace: impl Into) -> ListApiDocumentsRequest { + ListApiDocumentsRequest::new(self.client.clone(), namespace.into()) + } + + /// Create API Document + pub fn create_api_document(&self, namespace: impl Into, body: serde_json::Value) -> CreateApiDocumentRequest { + CreateApiDocumentRequest::new(self.client.clone(), namespace.into(), body) + } + + /// Update API Document metadata + pub fn update_api_document(&self, namespace: impl Into, slug: impl Into, body: serde_json::Value) -> UpdateApiDocumentRequest { + UpdateApiDocumentRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } + + /// Delete API Document + pub fn delete_api_document(&self, namespace: impl Into, slug: impl Into) -> DeleteApiDocumentRequest { + DeleteApiDocumentRequest::new(self.client.clone(), namespace.into(), slug.into()) + } + + /// Get API Document + pub fn retrieve_api_document_version(&self, namespace: impl Into, slug: impl Into, semver: impl Into) -> RetrieveApiDocumentVersionRequest { + RetrieveApiDocumentVersionRequest::new(self.client.clone(), namespace.into(), slug.into(), semver.into()) + } + + /// Update API Document version + pub fn update_api_document_version(&self, namespace: impl Into, slug: impl Into, semver: impl Into, body: serde_json::Value) -> UpdateApiDocumentVersionRequest { + UpdateApiDocumentVersionRequest::new(self.client.clone(), namespace.into(), slug.into(), semver.into(), body) + } + + /// Delete API Document version + pub fn delete_api_document_version(&self, namespace: impl Into, slug: impl Into, semver: impl Into) -> DeleteApiDocumentVersionRequest { + DeleteApiDocumentVersionRequest::new(self.client.clone(), namespace.into(), slug.into(), semver.into()) + } + + /// Get API Document version metadata + pub fn list_api_document_version_metadata(&self, namespace: impl Into, slug: impl Into, semver: impl Into) -> ListApiDocumentVersionMetadataRequest { + ListApiDocumentVersionMetadataRequest::new(self.client.clone(), namespace.into(), slug.into(), semver.into()) + } + + /// Create API Document version + pub fn create_api_document_version(&self, namespace: impl Into, slug: impl Into, body: serde_json::Value) -> CreateApiDocumentVersionRequest { + CreateApiDocumentVersionRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } + + /// Add access group + pub fn create_api_document_access_group(&self, namespace: impl Into, slug: impl Into, body: crate::models::AccessGroup) -> CreateApiDocumentAccessGroupRequest { + CreateApiDocumentAccessGroupRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } + + /// Remove access group + pub fn delete_api_document_access_group(&self, namespace: impl Into, slug: impl Into, body: crate::models::AccessGroup) -> DeleteApiDocumentAccessGroupRequest { + DeleteApiDocumentAccessGroupRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } +} + +/// List all API documents across every namespace the caller can access. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ListAllApiDocumentsRequest { + client: crate::client::Scalar, +} + +impl ListAllApiDocumentsRequest { + fn new(client: crate::client::Scalar) -> Self { + Self { + client, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result, crate::error::Error> { + let path = "/v1/apis".to_string(); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::>(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// List API documents in a namespace. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ListApiDocumentsRequest { + client: crate::client::Scalar, + namespace: String, +} + +impl ListApiDocumentsRequest { + fn new(client: crate::client::Scalar, namespace: String) -> Self { + Self { + client, + namespace, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result, crate::error::Error> { + let path = format!("/v1/apis/{}", crate::http::encode_path_param(&self.namespace)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::>(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Create an API document. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateApiDocumentRequest { + client: crate::client::Scalar, + namespace: String, + body: serde_json::Value, +} + +impl CreateApiDocumentRequest { + fn new(client: crate::client::Scalar, namespace: String, body: serde_json::Value) -> Self { + Self { + client, + namespace, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/apis/{}", crate::http::encode_path_param(&self.namespace)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Update metadata for an API document. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct UpdateApiDocumentRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: serde_json::Value, +} + +impl UpdateApiDocumentRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: serde_json::Value) -> Self { + Self { + client, + namespace, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/apis/{}/{}", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::PATCH, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Delete an API document and all versions. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct DeleteApiDocumentRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, +} + +impl DeleteApiDocumentRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String) -> Self { + Self { + client, + namespace, + slug, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/apis/{}/{}", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Get a specific API document version. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct RetrieveApiDocumentVersionRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + semver: String, +} + +impl RetrieveApiDocumentVersionRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, semver: String) -> Self { + Self { + client, + namespace, + slug, + semver, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/apis/{}/{}/version/{}", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug), crate::http::encode_path_param(&self.semver)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send_bytes(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Update the registry file content for an API document version. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct UpdateApiDocumentVersionRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + semver: String, + body: serde_json::Value, +} + +impl UpdateApiDocumentVersionRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, semver: String, body: serde_json::Value) -> Self { + Self { + client, + namespace, + slug, + semver, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/apis/{}/{}/version/{}", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug), crate::http::encode_path_param(&self.semver)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::PATCH, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Delete a specific API document version. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct DeleteApiDocumentVersionRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + semver: String, +} + +impl DeleteApiDocumentVersionRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, semver: String) -> Self { + Self { + client, + namespace, + slug, + semver, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/apis/{}/{}/version/{}", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug), crate::http::encode_path_param(&self.semver)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Get metadata (uid, content shas, version sha, tags) for a specific API document version. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ListApiDocumentVersionMetadataRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + semver: String, +} + +impl ListApiDocumentVersionMetadataRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, semver: String) -> Self { + Self { + client, + namespace, + slug, + semver, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/apis/{}/{}/version/{}/metadata", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug), crate::http::encode_path_param(&self.semver)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Create a new API document version. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateApiDocumentVersionRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: serde_json::Value, +} + +impl CreateApiDocumentVersionRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: serde_json::Value) -> Self { + Self { + client, + namespace, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/apis/{}/{}/version", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Add an access group to an API document. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateApiDocumentAccessGroupRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: crate::models::AccessGroup, +} + +impl CreateApiDocumentAccessGroupRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::AccessGroup) -> Self { + Self { + client, + namespace, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/apis/{}/{}/access-group", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Remove an access group from an API document. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct DeleteApiDocumentAccessGroupRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: crate::models::AccessGroup, +} + +impl DeleteApiDocumentAccessGroupRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::AccessGroup) -> Self { + Self { + client, + namespace, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/apis/{}/{}/access-group", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body.as_ref(), true) + .await + } +} diff --git a/src/resources/rules.rs b/src/resources/rules.rs new file mode 100644 index 0000000..170943b --- /dev/null +++ b/src/resources/rules.rs @@ -0,0 +1,249 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! The `rules` resource. + +#[derive(Clone)] +pub struct Rules { + client: crate::client::Scalar, +} + +impl Rules { + pub(crate) fn new(client: crate::client::Scalar) -> Self { + Self { client } + } + + /// List all rules + pub fn list_rulesets(&self, namespace: impl Into) -> ListRulesetsRequest { + ListRulesetsRequest::new(self.client.clone(), namespace.into()) + } + + /// Create a rule + pub fn create_ruleset(&self, namespace: impl Into, body: serde_json::Value) -> CreateRulesetRequest { + CreateRulesetRequest::new(self.client.clone(), namespace.into(), body) + } + + /// Update rule metadata + pub fn update_ruleset(&self, namespace: impl Into, slug: impl Into, body: serde_json::Value) -> UpdateRulesetRequest { + UpdateRulesetRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } + + /// Delete a rule + pub fn delete_ruleset(&self, namespace: impl Into, slug: impl Into) -> DeleteRulesetRequest { + DeleteRulesetRequest::new(self.client.clone(), namespace.into(), slug.into()) + } + + /// Get a rule + pub fn retrieve_ruleset_document(&self, namespace: impl Into, slug: impl Into) -> RetrieveRulesetDocumentRequest { + RetrieveRulesetDocumentRequest::new(self.client.clone(), namespace.into(), slug.into()) + } + + /// Add rule access group + pub fn create_ruleset_access_group(&self, namespace: impl Into, slug: impl Into, body: crate::models::AccessGroup) -> CreateRulesetAccessGroupRequest { + CreateRulesetAccessGroupRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } + + /// Remove rule access group + pub fn delete_ruleset_access_group(&self, namespace: impl Into, slug: impl Into, body: crate::models::AccessGroup) -> DeleteRulesetAccessGroupRequest { + DeleteRulesetAccessGroupRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } +} + +/// List all rulesets in a namespace. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ListRulesetsRequest { + client: crate::client::Scalar, + namespace: String, +} + +impl ListRulesetsRequest { + fn new(client: crate::client::Scalar, namespace: String) -> Self { + Self { + client, + namespace, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result, crate::error::Error> { + let path = format!("/v1/rulesets/{}", crate::http::encode_path_param(&self.namespace)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::>(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Create a rule in a namespace. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateRulesetRequest { + client: crate::client::Scalar, + namespace: String, + body: serde_json::Value, +} + +impl CreateRulesetRequest { + fn new(client: crate::client::Scalar, namespace: String, body: serde_json::Value) -> Self { + Self { + client, + namespace, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/rulesets/{}", crate::http::encode_path_param(&self.namespace)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Update rule metadata by slug. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct UpdateRulesetRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: serde_json::Value, +} + +impl UpdateRulesetRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: serde_json::Value) -> Self { + Self { + client, + namespace, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/rulesets/{}/{}", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::PATCH, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Delete a rule by slug. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct DeleteRulesetRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, +} + +impl DeleteRulesetRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String) -> Self { + Self { + client, + namespace, + slug, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/rulesets/{}/{}", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Get a rule document by slug. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct RetrieveRulesetDocumentRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, +} + +impl RetrieveRulesetDocumentRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String) -> Self { + Self { + client, + namespace, + slug, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/rulesets/{}/{}", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send_bytes(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Grant an access group to a rule. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateRulesetAccessGroupRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: crate::models::AccessGroup, +} + +impl CreateRulesetAccessGroupRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::AccessGroup) -> Self { + Self { + client, + namespace, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/rulesets/{}/{}/access-group", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Remove an access group from a rule. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct DeleteRulesetAccessGroupRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: crate::models::AccessGroup, +} + +impl DeleteRulesetAccessGroupRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::AccessGroup) -> Self { + Self { + client, + namespace, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/rulesets/{}/{}/access-group", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body.as_ref(), true) + .await + } +} diff --git a/src/resources/scalar_docs.rs b/src/resources/scalar_docs.rs new file mode 100644 index 0000000..d0fcee2 --- /dev/null +++ b/src/resources/scalar_docs.rs @@ -0,0 +1,105 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! The `scalarDocs` resource. + +#[derive(Clone)] +pub struct ScalarDocs { + client: crate::client::Scalar, +} + +impl ScalarDocs { + pub(crate) fn new(client: crate::client::Scalar) -> Self { + Self { client } + } + + /// List all projects + pub fn list_guides(&self) -> ListGuidesRequest { + ListGuidesRequest::new(self.client.clone()) + } + + /// Create a project + pub fn create_guide(&self, body: serde_json::Value) -> CreateGuideRequest { + CreateGuideRequest::new(self.client.clone(), body) + } + + /// Publish a project + pub fn publish_guide(&self, slug: impl Into) -> PublishGuideRequest { + PublishGuideRequest::new(self.client.clone(), slug.into()) + } +} + +/// List all guide projects. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ListGuidesRequest { + client: crate::client::Scalar, +} + +impl ListGuidesRequest { + fn new(client: crate::client::Scalar) -> Self { + Self { + client, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result, crate::error::Error> { + let path = "/v1/guides".to_string(); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::>(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Create a guide project. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateGuideRequest { + client: crate::client::Scalar, + body: serde_json::Value, +} + +impl CreateGuideRequest { + fn new(client: crate::client::Scalar, body: serde_json::Value) -> Self { + Self { + client, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = "/v1/guides".to_string(); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Start a new publish process. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct PublishGuideRequest { + client: crate::client::Scalar, + slug: String, +} + +impl PublishGuideRequest { + fn new(client: crate::client::Scalar, slug: String) -> Self { + Self { + client, + slug, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/guides/{}/publish", crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} diff --git a/src/resources/schemas.rs b/src/resources/schemas.rs new file mode 100644 index 0000000..f8588ce --- /dev/null +++ b/src/resources/schemas.rs @@ -0,0 +1,154 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! The `schemas` resource. + +#[derive(Clone)] +pub struct Schemas { + client: crate::client::Scalar, +} + +impl Schemas { + pub(crate) fn new(client: crate::client::Scalar) -> Self { + Self { client } + } + + /// List all shared components + pub fn list(&self, namespace: impl Into) -> ListRequest { + ListRequest::new(self.client.clone(), namespace.into()) + } + + /// Create a shared component + pub fn create(&self, namespace: impl Into, body: serde_json::Value) -> CreateRequest { + CreateRequest::new(self.client.clone(), namespace.into(), body) + } + + /// Update shared component metadata + pub fn update(&self, namespace: impl Into, slug: impl Into, body: serde_json::Value) -> UpdateRequest { + UpdateRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } + + /// Delete a shared component + pub fn delete(&self, namespace: impl Into, slug: impl Into) -> DeleteRequest { + DeleteRequest::new(self.client.clone(), namespace.into(), slug.into()) + } + + pub fn version(&self) -> crate::resources::version::Version { + crate::resources::version::Version::new(self.client.clone()) + } + + pub fn access_group(&self) -> crate::resources::access_group::AccessGroup { + crate::resources::access_group::AccessGroup::new(self.client.clone()) + } +} + +/// List schemas in a namespace. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ListRequest { + client: crate::client::Scalar, + namespace: String, +} + +impl ListRequest { + fn new(client: crate::client::Scalar, namespace: String) -> Self { + Self { + client, + namespace, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result, crate::error::Error> { + let path = format!("/v1/schemas/{}", crate::http::encode_path_param(&self.namespace)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::>(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Create a schema in a namespace. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateRequest { + client: crate::client::Scalar, + namespace: String, + body: serde_json::Value, +} + +impl CreateRequest { + fn new(client: crate::client::Scalar, namespace: String, body: serde_json::Value) -> Self { + Self { + client, + namespace, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/schemas/{}", crate::http::encode_path_param(&self.namespace)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Update schema metadata. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct UpdateRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: serde_json::Value, +} + +impl UpdateRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: serde_json::Value) -> Self { + Self { + client, + namespace, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/schemas/{}/{}", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::PATCH, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Delete a schema and all related versions. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct DeleteRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, +} + +impl DeleteRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String) -> Self { + Self { + client, + namespace, + slug, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/schemas/{}/{}", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body.as_ref(), true) + .await + } +} diff --git a/src/resources/teams.rs b/src/resources/teams.rs new file mode 100644 index 0000000..3b53b5e --- /dev/null +++ b/src/resources/teams.rs @@ -0,0 +1,43 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! The `teams` resource. + +#[derive(Clone)] +pub struct Teams { + client: crate::client::Scalar, +} + +impl Teams { + pub(crate) fn new(client: crate::client::Scalar) -> Self { + Self { client } + } + + /// List teams + pub fn list(&self) -> ListRequest { + ListRequest::new(self.client.clone()) + } +} + +/// List all available teams +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ListRequest { + client: crate::client::Scalar, +} + +impl ListRequest { + fn new(client: crate::client::Scalar) -> Self { + Self { + client, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result, crate::error::Error> { + let path = "/v1/teams".to_string(); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::>(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} diff --git a/src/resources/themes.rs b/src/resources/themes.rs new file mode 100644 index 0000000..dff7cdd --- /dev/null +++ b/src/resources/themes.rs @@ -0,0 +1,202 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! The `themes` resource. + +#[derive(Clone)] +pub struct Themes { + client: crate::client::Scalar, +} + +impl Themes { + pub(crate) fn new(client: crate::client::Scalar) -> Self { + Self { client } + } + + /// List all themes + pub fn list(&self) -> ListRequest { + ListRequest::new(self.client.clone()) + } + + /// Create a theme + pub fn create(&self, body: serde_json::Value) -> CreateRequest { + CreateRequest::new(self.client.clone(), body) + } + + /// Update theme metadata + pub fn update(&self, slug: impl Into, body: serde_json::Value) -> UpdateRequest { + UpdateRequest::new(self.client.clone(), slug.into(), body) + } + + /// Update theme document + pub fn replace_document(&self, slug: impl Into, body: serde_json::Value) -> ReplaceDocumentRequest { + ReplaceDocumentRequest::new(self.client.clone(), slug.into(), body) + } + + /// Delete a theme + pub fn delete(&self, slug: impl Into) -> DeleteRequest { + DeleteRequest::new(self.client.clone(), slug.into()) + } + + /// Get a theme + pub fn retrieve(&self, slug: impl Into) -> RetrieveRequest { + RetrieveRequest::new(self.client.clone(), slug.into()) + } +} + +/// List all team themes. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ListRequest { + client: crate::client::Scalar, +} + +impl ListRequest { + fn new(client: crate::client::Scalar) -> Self { + Self { + client, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result, crate::error::Error> { + let path = "/v1/themes".to_string(); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::>(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Create a team theme. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateRequest { + client: crate::client::Scalar, + body: serde_json::Value, +} + +impl CreateRequest { + fn new(client: crate::client::Scalar, body: serde_json::Value) -> Self { + Self { + client, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = "/v1/themes".to_string(); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Update theme metadata. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct UpdateRequest { + client: crate::client::Scalar, + slug: String, + body: serde_json::Value, +} + +impl UpdateRequest { + fn new(client: crate::client::Scalar, slug: String, body: serde_json::Value) -> Self { + Self { + client, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/themes/{}", crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::PATCH, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Replace the theme document. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct ReplaceDocumentRequest { + client: crate::client::Scalar, + slug: String, + body: serde_json::Value, +} + +impl ReplaceDocumentRequest { + fn new(client: crate::client::Scalar, slug: String, body: serde_json::Value) -> Self { + Self { + client, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/themes/{}", crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::PUT, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Delete a theme by slug. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct DeleteRequest { + client: crate::client::Scalar, + slug: String, +} + +impl DeleteRequest { + fn new(client: crate::client::Scalar, slug: String) -> Self { + Self { + client, + slug, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/themes/{}", crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Get the theme document by slug. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct RetrieveRequest { + client: crate::client::Scalar, + slug: String, +} + +impl RetrieveRequest { + fn new(client: crate::client::Scalar, slug: String) -> Self { + Self { + client, + slug, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/themes/{}", crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send_bytes(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} diff --git a/src/resources/version.rs b/src/resources/version.rs new file mode 100644 index 0000000..b834b85 --- /dev/null +++ b/src/resources/version.rs @@ -0,0 +1,119 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! The `version` resource. + +#[derive(Clone)] +pub struct Version { + client: crate::client::Scalar, +} + +impl Version { + pub(crate) fn new(client: crate::client::Scalar) -> Self { + Self { client } + } + + /// Get a shared component document + pub fn retrieve_schema(&self, namespace: impl Into, slug: impl Into, semver: impl Into) -> RetrieveSchemaRequest { + RetrieveSchemaRequest::new(self.client.clone(), namespace.into(), slug.into(), semver.into()) + } + + /// Delete a shared component version + pub fn delete_schema(&self, namespace: impl Into, slug: impl Into, semver: impl Into) -> DeleteSchemaRequest { + DeleteSchemaRequest::new(self.client.clone(), namespace.into(), slug.into(), semver.into()) + } + + /// Create a shared component version + pub fn create_schema(&self, namespace: impl Into, slug: impl Into, body: serde_json::Value) -> CreateSchemaRequest { + CreateSchemaRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } +} + +/// Get a specific schema version document. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct RetrieveSchemaRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + semver: String, +} + +impl RetrieveSchemaRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, semver: String) -> Self { + Self { + client, + namespace, + slug, + semver, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/schemas/{}/{}/version/{}", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug), crate::http::encode_path_param(&self.semver)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send_bytes(reqwest::Method::GET, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Delete a schema version. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct DeleteSchemaRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + semver: String, +} + +impl DeleteSchemaRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, semver: String) -> Self { + Self { + client, + namespace, + slug, + semver, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/schemas/{}/{}/version/{}", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug), crate::http::encode_path_param(&self.semver)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body: Option = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body.as_ref(), true) + .await + } +} +/// Create a schema version. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateSchemaRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: serde_json::Value, +} + +impl CreateSchemaRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: serde_json::Value) -> Self { + Self { + client, + namespace, + slug, + body, + } + } + + /// Sends the request and returns the decoded response. + pub async fn send(self) -> Result { + let path = format!("/v1/schemas/{}/{}/version", crate::http::encode_path_param(&self.namespace), crate::http::encode_path_param(&self.slug)); + let query: Vec<(String, String)> = Vec::new(); + let headers: Vec<(String, String)> = Vec::new(); + let body = Some(serde_json::to_value(&self.body)?); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body.as_ref(), true) + .await + } +} diff --git a/tests/smoke.rs b/tests/smoke.rs new file mode 100644 index 0000000..d7cfdff --- /dev/null +++ b/tests/smoke.rs @@ -0,0 +1,592 @@ +// Code generated by Scalar SDK Generator. DO NOT EDIT. +//! Runtime smoke test: drives every synthesizable operation once. +//! +//! Set `SCALAR_BASE_URL` (and any credential env vars) to point the client at a +//! server and actually send requests; with it unset the test is a no-op, so a +//! bare `cargo test` just confirms the generated surface compiles. +#![allow(unused)] + +use scalar_api::*; + +#[tokio::test] +async fn smoke() { + if std::env::var("SCALAR_BASE_URL").is_err() { + return; + } + let client = Scalar::from_env().expect("client builds from environment"); + let mut failures: Vec = Vec::new(); + { + let result: Result<(), Error> = async { + let _ = client.registry().list_all_api_documents().send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/apis")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.registry().list_api_documents("example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/apis/{namespace}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.registry().create_api_document("example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/apis/{namespace}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.registry().update_api_document("example", "example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "PATCH /v1/apis/{namespace}/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.registry().delete_api_document("example", "example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "DELETE /v1/apis/{namespace}/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.registry().retrieve_api_document_version("example", "example", "example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/apis/{namespace}/{slug}/version/{semver}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.registry().update_api_document_version("example", "example", "example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "PATCH /v1/apis/{namespace}/{slug}/version/{semver}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.registry().delete_api_document_version("example", "example", "example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "DELETE /v1/apis/{namespace}/{slug}/version/{semver}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.registry().list_api_document_version_metadata("example", "example", "example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/apis/{namespace}/{slug}/version/{semver}/metadata")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.registry().create_api_document_version("example", "example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/apis/{namespace}/{slug}/version")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.registry().create_api_document_access_group("example", "example", AccessGroup { + access_group_slug: "example".to_string(), + }).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/apis/{namespace}/{slug}/access-group")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.registry().delete_api_document_access_group("example", "example", AccessGroup { + access_group_slug: "example".to_string(), + }).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "DELETE /v1/apis/{namespace}/{slug}/access-group")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.schemas().list("example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/schemas/{namespace}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.schemas().create("example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/schemas/{namespace}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.schemas().update("example", "example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "PATCH /v1/schemas/{namespace}/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.schemas().delete("example", "example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "DELETE /v1/schemas/{namespace}/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.schemas().version().retrieve_schema("example", "example", "example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/schemas/{namespace}/{slug}/version/{semver}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.schemas().version().delete_schema("example", "example", "example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "DELETE /v1/schemas/{namespace}/{slug}/version/{semver}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.schemas().version().create_schema("example", "example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/schemas/{namespace}/{slug}/version")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.schemas().access_group().create_schema("example", "example", AccessGroup { + access_group_slug: "example".to_string(), + }).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/schemas/{namespace}/{slug}/access-group")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.schemas().access_group().delete_schema("example", "example", AccessGroup { + access_group_slug: "example".to_string(), + }).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "DELETE /v1/schemas/{namespace}/{slug}/access-group")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.login_portals().retrieve("example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/login-portals/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.login_portals().update("example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "PATCH /v1/login-portals/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.login_portals().delete("example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "DELETE /v1/login-portals/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.login_portals().create(serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/login-portals")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.login_portals().list().send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/login-portals")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.rules().list_rulesets("example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/rulesets/{namespace}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.rules().create_ruleset("example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/rulesets/{namespace}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.rules().update_ruleset("example", "example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "PATCH /v1/rulesets/{namespace}/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.rules().delete_ruleset("example", "example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "DELETE /v1/rulesets/{namespace}/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.rules().retrieve_ruleset_document("example", "example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/rulesets/{namespace}/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.rules().create_ruleset_access_group("example", "example", AccessGroup { + access_group_slug: "example".to_string(), + }).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/rulesets/{namespace}/{slug}/access-group")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.rules().delete_ruleset_access_group("example", "example", AccessGroup { + access_group_slug: "example".to_string(), + }).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "DELETE /v1/rulesets/{namespace}/{slug}/access-group")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.themes().list().send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/themes")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.themes().create(serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/themes")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.themes().update("example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "PATCH /v1/themes/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.themes().replace_document("example", serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "PUT /v1/themes/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.themes().delete("example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "DELETE /v1/themes/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.themes().retrieve("example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/themes/{slug}")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.teams().list().send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/teams")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.scalar_docs().list_guides().send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/guides")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.scalar_docs().create_guide(serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/guides")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.scalar_docs().publish_guide("example").send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/guides/{slug}/publish")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.namespaces().list().send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/namespaces")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.authentication().exchange_personal_token(serde_json::json!(null)).send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "POST /v1/auth/exchange")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.authentication().list_current_user().send().await?; + Ok(()) + } + .await; + if let Err(error) = result { + if is_smoke_failure(&error) { + failures.push(format!("{}: {error}", "GET /v1/auth/me")); + } + } + } + assert!(failures.is_empty(), "smoke failures:\n{}", failures.join("\n")); +} + +/// A smoke failure is a plumbing problem — the request could not be sent or +/// the client was misconfigured. An API error (a response with a non-success +/// status) or a decode error means the request reached the server and came +/// back, which is what this smoke verifies; the response body itself is the +/// server's concern, not the SDK's. +fn is_smoke_failure(error: &Error) -> bool { + matches!(error, Error::Transport(_) | Error::Config(_) | Error::MissingParameter(_)) +}