From c4fcf91636ce0a996dd806a7ac7ab03d9a617b4e Mon Sep 17 00:00:00 2001 From: scalarbot Date: Fri, 17 Jul 2026 23:17:53 +0000 Subject: [PATCH 1/3] feat(api)!: update SDK name (+117 more changes) - Renamed SDK from `ScalarGalaxy` to `ScalarApi`. - Added server `https://access.scalar.com`. - Removed server `https://galaxy.scalar.com`. - Removed server `{protocol}://void.scalar.com/{path}`. - URL of environment `production` changed from `https://galaxy.scalar.com` to `https://access.scalar.com`. - Added environment `local` (`http://127.0.0.1:4010`). - Removed environment `responds_with_your_request_data`. - Added `bearer` auth scheme `BearerAuth`. - Removed `bearer` auth scheme `bearerAuth`. - Removed `basic` auth scheme `basicAuth`. - Removed `apiKey` auth scheme `apiKeyHeader`. - Removed `apiKey` auth scheme `apiKeyQuery`. - Removed `apiKey` auth scheme `apiKeyCookie`. - Removed `oauth2` auth scheme `oAuth2`. - Removed `oauth2` auth scheme `openIdConnect`. - Added operation `registry.listAllApiDocuments` (`GET /v1/apis`). - Added operation `registry.listApiDocuments` (`GET /v1/apis/{namespace}`). - Added operation `registry.createApiDocument` (`POST /v1/apis/{namespace}`). - Added operation `registry.updateApiDocument` (`PATCH /v1/apis/{namespace}/{slug}`). - Added operation `registry.deleteApiDocument` (`DELETE /v1/apis/{namespace}/{slug}`). - Added operation `registry.retrieveApiDocumentVersion` (`GET /v1/apis/{namespace}/{slug}/version/{semver}`). - Added operation `registry.updateApiDocumentVersion` (`PATCH /v1/apis/{namespace}/{slug}/version/{semver}`). - Added operation `registry.deleteApiDocumentVersion` (`DELETE /v1/apis/{namespace}/{slug}/version/{semver}`). - Added operation `registry.listApiDocumentVersionMetadata` (`GET /v1/apis/{namespace}/{slug}/version/{semver}/metadata`). - Added operation `registry.createApiDocumentVersion` (`POST /v1/apis/{namespace}/{slug}/version`). - Added operation `registry.createApiDocumentAccessGroup` (`POST /v1/apis/{namespace}/{slug}/access-group`). - Added operation `registry.deleteApiDocumentAccessGroup` (`DELETE /v1/apis/{namespace}/{slug}/access-group`). - Added operation `schemas.list` (`GET /v1/schemas/{namespace}`). - Added operation `schemas.create` (`POST /v1/schemas/{namespace}`). - Added operation `schemas.update` (`PATCH /v1/schemas/{namespace}/{slug}`). - Added operation `schemas.delete` (`DELETE /v1/schemas/{namespace}/{slug}`). - Added operation `schemas.retrieveVersion` (`GET /v1/schemas/{namespace}/{slug}/version/{semver}`). - Added operation `schemas.deleteVersion` (`DELETE /v1/schemas/{namespace}/{slug}/version/{semver}`). - Added operation `schemas.createVersion` (`POST /v1/schemas/{namespace}/{slug}/version`). - Added operation `schemas.createAccessGroup` (`POST /v1/schemas/{namespace}/{slug}/access-group`). - Added operation `schemas.deleteAccessGroup` (`DELETE /v1/schemas/{namespace}/{slug}/access-group`). - Added operation `loginPortals.retrieve` (`GET /v1/login-portals/{slug}`). - Added operation `loginPortals.update` (`PATCH /v1/login-portals/{slug}`). - Added operation `loginPortals.delete` (`DELETE /v1/login-portals/{slug}`). - Added operation `loginPortals.create` (`POST /v1/login-portals`). - Added operation `loginPortals.list` (`GET /v1/login-portals`). - Added operation `rules.listRulesets` (`GET /v1/rulesets/{namespace}`). - Added operation `rules.createRuleset` (`POST /v1/rulesets/{namespace}`). - Added operation `rules.updateRuleset` (`PATCH /v1/rulesets/{namespace}/{slug}`). - Added operation `rules.deleteRuleset` (`DELETE /v1/rulesets/{namespace}/{slug}`). - Added operation `rules.retrieveRulesetDocument` (`GET /v1/rulesets/{namespace}/{slug}`). - Added operation `rules.createRulesetAccessGroup` (`POST /v1/rulesets/{namespace}/{slug}/access-group`). - Added operation `rules.deleteRulesetAccessGroup` (`DELETE /v1/rulesets/{namespace}/{slug}/access-group`). - Added operation `themes.list` (`GET /v1/themes`). - Added operation `themes.create` (`POST /v1/themes`). - Added operation `themes.update` (`PATCH /v1/themes/{slug}`). - Added operation `themes.replaceDocument` (`PUT /v1/themes/{slug}`). - Added operation `themes.delete` (`DELETE /v1/themes/{slug}`). - Added operation `themes.retrieve` (`GET /v1/themes/{slug}`). - Added operation `teams.list` (`GET /v1/teams`). - Added operation `scalarDocs.listGuides` (`GET /v1/guides`). - Added operation `scalarDocs.createGuide` (`POST /v1/guides`). - Added operation `scalarDocs.publishGuide` (`POST /v1/guides/{slug}/publish`). - Added operation `namespaces.list` (`GET /v1/namespaces`). - Added operation `authentication.exchangePersonalToken` (`POST /v1/auth/exchange`). - Added operation `authentication.listCurrentUser` (`GET /v1/auth/me`). - Removed operation `planets.listAllData` (`GET /planets`). - Removed operation `planets.create` (`POST /planets`). - Removed operation `planets.retrieve` (`GET /planets/{planetId}`). - Removed operation `planets.update` (`PUT /planets/{planetId}`). - Removed operation `planets.delete` (`DELETE /planets/{planetId}`). - Removed operation `planets.uploadImage` (`POST /planets/{planetId}/image`). - Removed operation `authentication.createUser` (`POST /user/signup`). - Removed operation `authentication.createToken` (`POST /auth/token`). - Removed operation `authentication.listMe` (`GET /me`). - Added schema `_400`. - Added schema `_401`. - Added schema `_403`. - Added schema `_404`. - Added schema `_422`. - Added schema `_500`. - Added schema `ApiDocument`. - Added schema `Nanoid`. - Added schema `Version`. - Added schema `Slug`. - Added schema `Namespace`. - Added schema `ManagedDocVersion`. - Added schema `Method`. - Added schema `AccessGroup`. - Added schema `Schema`. - Added schema `ManagedSchemaVersion`. - Added schema `Timestamp`. - Added schema `Uid`. - Added schema `LoginPortalEmail`. - Added schema `LoginPortalPage`. - Added schema `LoginPortal`. - Added schema `Rule`. - Added schema `Theme`. - Added schema `Team`. - Added schema `TeamName`. - Added schema `TeamImage`. - Added schema `GithubProject`. - Added schema `ActiveDeployment`. - Added schema `GithubProjectRepository`. - Added schema `Email`. - Added schema `TeamSummary`. - Added required property `User.uid`. - Added required property `User.createdAt`. - Added required property `User.updatedAt`. - Added required property `User.email`. - Added optional property `User.theme`. - Added required property `User.activeTeamId`. - Added required property `User.hasGithub`. - Added required property `User.teams`. - Removed optional property `User.id`. - Removed optional property `User.name`. - Removed schema `Credentials`. - Removed schema `Token`. - Removed schema `Planet`. - Removed schema `PaginatedResource`. - Removed schema `Satellite`. - Removed webhook `NewPlanet` (`newPlanet`). - Removed webhook `RequestBodyCallbackUrl` (`{$request.body#/callbackUrl}`). BREAKING CHANGE: 37 breaking changes to the SDK surface. - Renamed SDK from `ScalarGalaxy` to `ScalarApi`. - Removed server `https://galaxy.scalar.com`. - Removed server `{protocol}://void.scalar.com/{path}`. - URL of environment `production` changed from `https://galaxy.scalar.com` to `https://access.scalar.com`. - Removed environment `responds_with_your_request_data`. - Removed `bearer` auth scheme `bearerAuth`. - Removed `basic` auth scheme `basicAuth`. - Removed `apiKey` auth scheme `apiKeyHeader`. - Removed `apiKey` auth scheme `apiKeyQuery`. - Removed `apiKey` auth scheme `apiKeyCookie`. - Removed `oauth2` auth scheme `oAuth2`. - Removed `oauth2` auth scheme `openIdConnect`. - Removed operation `planets.listAllData` (`GET /planets`). - Removed operation `planets.create` (`POST /planets`). - Removed operation `planets.retrieve` (`GET /planets/{planetId}`). - Removed operation `planets.update` (`PUT /planets/{planetId}`). - Removed operation `planets.delete` (`DELETE /planets/{planetId}`). - Removed operation `planets.uploadImage` (`POST /planets/{planetId}/image`). - Removed operation `authentication.createUser` (`POST /user/signup`). - Removed operation `authentication.createToken` (`POST /auth/token`). - Removed operation `authentication.listMe` (`GET /me`). - Added required property `User.uid`. - Added required property `User.createdAt`. - Added required property `User.updatedAt`. - Added required property `User.email`. - Added required property `User.activeTeamId`. - Added required property `User.hasGithub`. - Added required property `User.teams`. - Removed optional property `User.id`. - Removed optional property `User.name`. - Removed schema `Credentials`. - Removed schema `Token`. - Removed schema `Planet`. - Removed schema `PaginatedResource`. - Removed schema `Satellite`. - Removed webhook `NewPlanet` (`newPlanet`). - Removed webhook `RequestBodyCallbackUrl` (`{$request.body#/callbackUrl}`). Build: Dk4B0mNaWrKmSoLcQbRUa --- Cargo.toml | 7 +- README.md | 109 +- api.md | 228 +- examples/smoke-test.rs | 1069 ++- openapi.augmented.json | 9803 +++++++++++++++++++--------- reference.md | 425 +- scalar-sdk.manifest.json | 10424 ++++++++++++++++++++++++++---- src/client.rs | 206 +- src/lib.rs | 87 +- src/models.rs | 478 +- src/resources/authentication.rs | 104 +- src/resources/login_portals.rs | 202 + src/resources/mod.rs | 43 +- src/resources/namespaces.rs | 43 + src/resources/planets.rs | 286 - src/resources/registry.rs | 510 ++ src/resources/rules.rs | 304 + src/resources/scalar_docs.rs | 127 + src/resources/schemas.rs | 398 ++ src/resources/teams.rs | 43 + src/resources/themes.rs | 246 + src/webhooks.rs | 25 - tests/smoke.rs | 599 +- 23 files changed, 20667 insertions(+), 5099 deletions(-) create mode 100644 src/resources/login_portals.rs create mode 100644 src/resources/namespaces.rs delete mode 100644 src/resources/planets.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 delete mode 100644 src/webhooks.rs diff --git a/Cargo.toml b/Cargo.toml index f00157f..3dc5736 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [package] -name = "scalargalaxy-rust" +name = "scalar-api" version = "0.1.0" # x-release-please-version edition = "2024" rust-version = "1.85" -description = "The Scalar Galaxy is an example OpenAPI specification to test OpenAPI tools and libraries. It’s a fictional universe with fictional planets and fictional data. Get all the data for [all planets](#tag/planets/GET/planets)." +description = "API for managing Scalar platform resources." license = "Apache-2.0" [dependencies] -reqwest = { version = "0.12", default-features = false, features = ["json", "stream", "rustls-tls", "multipart"] } +reqwest = { version = "0.12", default-features = false, features = ["json", "stream", "rustls-tls"] } serde = { version = "1.0.181", features = ["derive"] } serde_json = "1" thiserror = "2" @@ -15,7 +15,6 @@ futures = "0.3" bytes = "1" url = "2" tokio = { version = "1", features = ["time"] } -chrono = { version = "0.4", features = ["serde"] } [dev-dependencies] tokio = { version = "1", features = ["macros", "rt-multi-thread"] } diff --git a/README.md b/README.md index dff7a1a..15757c5 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,78 @@ -# Scalar Galaxy +# Scalar API -The Scalar Galaxy is an example OpenAPI specification to test OpenAPI tools and libraries. It’s a fictional universe with fictional planets and fictional data. Get all the data for [all planets](#tag/planets/GET/planets). +API for managing Scalar platform resources. -## Resources +## TypeScript SDK -* https://github.com/scalar/scalar -* https://github.com/OAI/OpenAPI-Specification -* https://scalar.com +For TypeScript, we provide a SDK that makes using our API even easier. -## Markdown Support +### Install -All descriptions *can* contain ~~tons of text~~ **Markdown**. [If GitHub supports the syntax](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax), chances are we’re supporting it, too. You can even create [internal links to reference endpoints](#tag/authentication/POST/user/signup). +```bash +npm add @scalar/sdk +``` + +### Get a Scalar API key + +Create an API key in your Scalar account: -
- Examples +- Dashboard: https://dashboard.scalar.com/account +- Store it in `.env`, for example: - **Blockquotes** +```bash +SCALAR_API_KEY=your_personal_token +``` + +### Exchange your API key for an access token - > I love OpenAPI. <3 +The personal token is not an access token. Exchange it first with `postv1AuthExchange`. - **Tables** +If you use the personal token directly for authenticated API calls, the API returns `401 Invalid authentication token`. - | Feature | Availability | - | ---------------- | ------------ | - | Markdown Support | ✓ | +```ts +import { Scalar } from '@scalar/sdk' - **Accordion** +const scalar = new Scalar() - ```html -
- Using Details Tags -

HTML Example

-
- ``` +const exchange = await scalar.auth.postv1AuthExchange({ + personalToken: process.env.SCALAR_API_KEY!, +}) - **Images** +const accessToken = exchange.accessToken +``` - Yes, there’s support for images, too! +### Use the access token - ![Empty placeholder image showing the width/height](https://images.placeholders.dev/?width=1280&height=720) +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, +}) +``` - **Alerts** +### Notes - > [!tip] - > You can now use markdown alerts in your descriptions. +- 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 ```sh -cargo add scalargalaxy-rust +cargo add scalar-api cargo add tokio --features full ``` @@ -61,21 +82,15 @@ The client is asynchronous and built on `tokio` + `reqwest`. Construct it with the builder, or read credentials from the environment: ```rust,no_run -use scalargalaxy_rust::ScalarGalaxyClient; +use scalar_api::Scalar; async fn run() -> Result<(), Box> { - let client = ScalarGalaxyClient::builder() + let client = Scalar::builder() .bearer_token("…") - .username("…") - .password("…") - .api_key_header("…") - .api_key_query("…") - .api_key_cookie("…") - .access_token("…") .build()?; // Or, reading credentials from the environment: - let client = ScalarGalaxyClient::from_env()?; + let client = Scalar::from_env()?; let _ = client; Ok(()) } @@ -85,7 +100,7 @@ Every operation returns a request builder; set optional parameters fluently and finish with `.send().await`: ```rust,ignore -let response = client.planets().list_all_data().send().await?; +let response = client.registry().list_all_api_documents().send().await?; ``` ## Authentication @@ -93,22 +108,16 @@ let response = client.planets().list_all_data().send().await?; Credentials can be set on the builder or read from the environment by `from_env`: -- `bearer_token` — environment variable `HARNESS_BEARER_TOKEN` -- `username` — environment variable `HARNESS_USERNAME` -- `password` — environment variable `HARNESS_PASSWORD` -- `api_key_header` — environment variable `HARNESS_API_KEY_HEADER` -- `api_key_query` — environment variable `HARNESS_API_KEY_QUERY` -- `api_key_cookie` — environment variable `HARNESS_API_KEY_COOKIE` -- `access_token` — environment variable `HARNESS_ACCESS_TOKEN` +- `bearer_token` — environment variable `SCALAR_API_BEARER_TOKEN` ## Error handling -Fallible operations return [`scalargalaxy_rust::Error`]. Match on the +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 scalargalaxy_rust::Error; +use scalar_api::Error; match result { Ok(value) => { /* … */ } diff --git a/api.md b/api.md index f5b3432..c3a62ac 100644 --- a/api.md +++ b/api.md @@ -1,39 +1,229 @@ -# ScalarGalaxy Rust API +# ScalarApi Rust API ## Types -- Credentials -- PaginatedResource -- Planet -- Satellite -- Token +- _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 -## Planets +## Registry Types: -- Planet +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 +- AccessGroup +- ApiDocument +- ManagedDocVersion +- Version Methods: -- client.planets.listAllData(...) -- client.planets.create(...) -> Planet -- client.planets.retrieve(...) -> Planet -- client.planets.update(...) -> Planet -- client.planets.delete(...) -- client.planets.uploadImage(...) +- 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 +- AccessGroup +- Schema +- Uid +- Version + +Methods: + +- client.schemas.list(...) +- client.schemas.create(...) -> Uid +- client.schemas.update(...) +- client.schemas.delete(...) +- client.schemas.retrieveVersion(...) +- client.schemas.deleteVersion(...) +- client.schemas.createVersion(...) -> Uid +- client.schemas.createAccessGroup(...) +- client.schemas.deleteAccessGroup(...) + +## 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: -- Credentials -- Token +- _400 +- _401 +- _403 +- _404 +- _422 +- _500 - User Methods: -- client.authentication.createUser(...) -> User -- client.authentication.createToken(...) -> Token -- client.authentication.listMe(...) -> User +- client.authentication.exchangePersonalToken(...) +- client.authentication.listCurrentUser(...) -> User diff --git a/examples/smoke-test.rs b/examples/smoke-test.rs index 63c9fca..f53a416 100644 --- a/examples/smoke-test.rs +++ b/examples/smoke-test.rs @@ -8,7 +8,7 @@ //! `SCALAR_SMOKE_FILTER` of comma-separated operation/path substrings. #![allow(unused)] -use scalargalaxy_rust::*; +use scalar_api::*; #[derive(serde::Serialize)] struct SmokeResult { @@ -49,12 +49,12 @@ async fn main() { .filter(|needle| !needle.is_empty()) .collect::>() }); - let client = ScalarGalaxyClient::from_env().expect("client builds from environment"); + let client = Scalar::from_env().expect("client builds from environment"); let mut results: Vec = Vec::new(); - if selected(&filter, "listAllData", "/planets") { + if selected(&filter, "listAllApiDocuments", "/v1/apis") { let started = std::time::Instant::now(); let result: Result<(), Error> = async { - let _ = client.planets().list_all_data().send().await?; + let _ = client.registry().list_all_api_documents().send().await?; Ok(()) } .await; @@ -67,18 +67,338 @@ async fn main() { Err(_) => ("passed", String::new()), }; results.push(SmokeResult { - operation: "listAllData".to_string(), + operation: "listAllApiDocuments".to_string(), method: "GET".to_string(), - path: "/planets".to_string(), + path: "/v1/apis".to_string(), status: status.to_string(), duration_ms, error, }); } - if selected(&filter, "create", "/planets") { + if selected(&filter, "listApiDocuments", "/v1/apis/{namespace}") { let started = std::time::Instant::now(); let result: Result<(), Error> = async { - let _ = client.planets().create().send().await?; + 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", RegistryCreateApiDocumentBody { + title: "".to_string(), + description: None, + version: "x".to_string(), + slug: "".to_string(), + ruleset: None, + is_private: None, + document: "".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: "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", RegistryUpdateApiDocumentBody { + title: None, + description: None, + is_private: None, + ruleset: None, + }).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", RegistryUpdateApiDocumentVersionBody { + document: "".to_string(), + last_known_version_sha: None, + }).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", RegistryCreateApiDocumentVersionBody { + version: "x".to_string(), + document: "".to_string(), + force: None, + last_known_version_sha: None, + }).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: "xxx".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: "xxx".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", SchemasCreateBody { + title: "".to_string(), + description: None, + version: "x".to_string(), + slug: "".to_string(), + is_private: None, + document: "".to_string(), + }).send().await?; Ok(()) } .await; @@ -93,16 +413,409 @@ async fn main() { results.push(SmokeResult { operation: "create".to_string(), method: "POST".to_string(), - path: "/planets".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", SchemasUpdateBody { + title: None, + description: None, + is_private: None, + }).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, "retrieveVersion", "/v1/schemas/{namespace}/{slug}/version/{semver}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().retrieve_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: "retrieveVersion".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, "deleteVersion", "/v1/schemas/{namespace}/{slug}/version/{semver}") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().delete_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: "deleteVersion".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, "createVersion", "/v1/schemas/{namespace}/{slug}/version") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().create_version("example", "example", SchemasCreateVersionBody { + version: "x".to_string(), + document: "".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: "createVersion".to_string(), + method: "POST".to_string(), + path: "/v1/schemas/{namespace}/{slug}/version".to_string(), + status: status.to_string(), + duration_ms, + error, + }); + } + if selected(&filter, "createAccessGroup", "/v1/schemas/{namespace}/{slug}/access-group") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().create_access_group("example", "example", AccessGroup { + access_group_slug: "xxx".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: "createAccessGroup".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, "deleteAccessGroup", "/v1/schemas/{namespace}/{slug}/access-group") { + let started = std::time::Instant::now(); + let result: Result<(), Error> = async { + let _ = client.schemas().delete_access_group("example", "example", AccessGroup { + access_group_slug: "xxx".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: "deleteAccessGroup".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", LoginPortalsUpdateBody { + title: None, + }).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(LoginPortalsCreateBody { + title: "".to_string(), + slug: "".to_string(), + email: LoginPortalEmail { + logo: "".to_string(), + logo_size: "100".to_string(), + button_text: "Login".to_string(), + message: "Click to access private documentation hosted by scalar.com".to_string(), + title: "Private Docs".to_string(), + main_color: "#2a2f45".to_string(), + main_background: "#f6f6f6".to_string(), + card_color: "2a2f45".to_string(), + card_background: "#fff".to_string(), + button_color: "#fff".to_string(), + button_background: "#0f0f0f".to_string(), + }, + page: LoginPortalPage { + title: "Scalar Private Docs".to_string(), + description: "Login to access your documentation".to_string(), + head: "".to_string(), + script: "".to_string(), + theme: "".to_string(), + company_name: "".to_string(), + logo: "".to_string(), + logo_url: "".to_string(), + favicon: "".to_string(), + terms_link: "".to_string(), + privacy_link: "".to_string(), + form_title: "Scalar Private Docs".to_string(), + form_description: "Login to access your documentation".to_string(), + form_image: "".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: "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", RulesCreateRulesetBody { + title: "".to_string(), + description: None, + slug: "".to_string(), + is_private: None, + document: "".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: "createRuleset".to_string(), + method: "POST".to_string(), + path: "/v1/rulesets/{namespace}".to_string(), status: status.to_string(), duration_ms, error, }); } - if selected(&filter, "retrieve", "/planets/{planetId}") { + if selected(&filter, "updateRuleset", "/v1/rulesets/{namespace}/{slug}") { let started = std::time::Instant::now(); let result: Result<(), Error> = async { - let _ = client.planets().retrieve(1).send().await?; + let _ = client.rules().update_ruleset("example", "example", RulesUpdateRulesetBody { + namespace: None, + slug: None, + title: None, + description: None, + is_private: None, + }).send().await?; Ok(()) } .await; @@ -115,18 +828,174 @@ async fn main() { Err(_) => ("passed", String::new()), }; results.push(SmokeResult { - operation: "retrieve".to_string(), + 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: "xxx".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: "xxx".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: "/planets/{planetId}".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(ThemesCreateBody { + name: "".to_string(), + description: None, + slug: "".to_string(), + document: "".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: "create".to_string(), + method: "POST".to_string(), + path: "/v1/themes".to_string(), status: status.to_string(), duration_ms, error, }); } - if selected(&filter, "update", "/planets/{planetId}") { + if selected(&filter, "update", "/v1/themes/{slug}") { let started = std::time::Instant::now(); let result: Result<(), Error> = async { - let _ = client.planets().update(1).send().await?; + let _ = client.themes().update("example", ThemesUpdateBody { + name: None, + description: None, + }).send().await?; Ok(()) } .await; @@ -140,17 +1009,43 @@ async fn main() { }; 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", ThemesReplaceDocumentBody { + document: "".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: "replaceDocument".to_string(), method: "PUT".to_string(), - path: "/planets/{planetId}".to_string(), + path: "/v1/themes/{slug}".to_string(), status: status.to_string(), duration_ms, error, }); } - if selected(&filter, "delete", "/planets/{planetId}") { + if selected(&filter, "delete", "/v1/themes/{slug}") { let started = std::time::Instant::now(); let result: Result<(), Error> = async { - client.planets().delete(1).send().await?; + let _ = client.themes().delete("example").send().await?; Ok(()) } .await; @@ -165,16 +1060,94 @@ async fn main() { results.push(SmokeResult { operation: "delete".to_string(), method: "DELETE".to_string(), - path: "/planets/{planetId}".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, "uploadImage", "/planets/{planetId}/image") { + if selected(&filter, "createGuide", "/v1/guides") { let started = std::time::Instant::now(); let result: Result<(), Error> = async { - let _ = client.planets().upload_image(1).send().await?; + let _ = client.scalar_docs().create_guide(ScalarDocsCreateGuideBody { + name: "".to_string(), + slug: None, + is_private: false, + allowed_users: vec![], + allowed_domains: vec![], + }).send().await?; Ok(()) } .await; @@ -187,18 +1160,18 @@ async fn main() { Err(_) => ("passed", String::new()), }; results.push(SmokeResult { - operation: "uploadImage".to_string(), + operation: "createGuide".to_string(), method: "POST".to_string(), - path: "/planets/{planetId}/image".to_string(), + path: "/v1/guides".to_string(), status: status.to_string(), duration_ms, error, }); } - if selected(&filter, "createUser", "/user/signup") { + if selected(&filter, "publishGuide", "/v1/guides/{slug}/publish") { let started = std::time::Instant::now(); let result: Result<(), Error> = async { - let _ = client.authentication().create_user().send().await?; + let _ = client.scalar_docs().publish_guide("example").send().await?; Ok(()) } .await; @@ -211,18 +1184,44 @@ async fn main() { Err(_) => ("passed", String::new()), }; results.push(SmokeResult { - operation: "createUser".to_string(), + operation: "publishGuide".to_string(), method: "POST".to_string(), - path: "/user/signup".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, "createToken", "/auth/token") { + if selected(&filter, "exchangePersonalToken", "/v1/auth/exchange") { let started = std::time::Instant::now(); let result: Result<(), Error> = async { - let _ = client.authentication().create_token().send().await?; + let _ = client.authentication().exchange_personal_token(AuthenticationExchangePersonalTokenBody { + personal_token: "".to_string(), + }).send().await?; Ok(()) } .await; @@ -235,18 +1234,18 @@ async fn main() { Err(_) => ("passed", String::new()), }; results.push(SmokeResult { - operation: "createToken".to_string(), + operation: "exchangePersonalToken".to_string(), method: "POST".to_string(), - path: "/auth/token".to_string(), + path: "/v1/auth/exchange".to_string(), status: status.to_string(), duration_ms, error, }); } - if selected(&filter, "listMe", "/me") { + if selected(&filter, "listCurrentUser", "/v1/auth/me") { let started = std::time::Instant::now(); let result: Result<(), Error> = async { - let _ = client.authentication().list_me().send().await?; + let _ = client.authentication().list_current_user().send().await?; Ok(()) } .await; @@ -259,9 +1258,9 @@ async fn main() { Err(_) => ("passed", String::new()), }; results.push(SmokeResult { - operation: "listMe".to_string(), + operation: "listCurrentUser".to_string(), method: "GET".to_string(), - path: "/me".to_string(), + path: "/v1/auth/me".to_string(), status: status.to_string(), duration_ms, error, diff --git a/openapi.augmented.json b/openapi.augmented.json index 640e073..1c216d6 100644 --- a/openapi.augmented.json +++ b/openapi.augmented.json @@ -1,3889 +1,7610 @@ { "openapi": "3.1.1", "info": { - "title": "Scalar Galaxy", - "description": "The Scalar Galaxy is an example OpenAPI specification to test OpenAPI tools and libraries. It’s a fictional universe with fictional planets and fictional data. Get all the data for [all planets](#tag/planets/GET/planets).\n\n## Resources\n\n* https://github.com/scalar/scalar\n* https://github.com/OAI/OpenAPI-Specification\n* https://scalar.com\n\n## Markdown Support\n\nAll descriptions *can* contain ~~tons of text~~ **Markdown**. [If GitHub supports the syntax](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax), chances are we’re supporting it, too. You can even create [internal links to reference endpoints](#tag/authentication/POST/user/signup).\n\n
\n Examples\n\n **Blockquotes**\n\n > I love OpenAPI. <3\n\n **Tables**\n\n | Feature | Availability |\n | ---------------- | ------------ |\n | Markdown Support | ✓ |\n\n **Accordion**\n\n ```html\n
\n Using Details Tags\n

HTML Example

\n
\n ```\n\n **Images**\n\n Yes, there’s support for images, too!\n\n ![Empty placeholder image showing the width/height](https://images.placeholders.dev/?width=1280&height=720)\n\n **Alerts**\n\n > [!tip]\n > You can now use markdown alerts in your descriptions.\n\n
\n", - "version": "1.0.0", + "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.1", "contact": { "name": "Marc from Scalar", "url": "https://scalar.com", - "email": "marc@scalar.com" + "email": "support@scalar.com" }, - "license": { - "name": "MIT", - "url": "https://opensource.org/license/MIT" - } - }, - "externalDocs": { - "description": "Documentation", - "url": "https://github.com/scalar/scalar" + "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://galaxy.scalar.com" - }, - { - "url": "{protocol}://void.scalar.com/{path}", - "description": "Responds with your request data", - "variables": { - "protocol": { - "enum": [ - "https" - ], - "default": "https" - }, - "path": { - "default": "" - } - } + "url": "https://access.scalar.com" } ], - "security": [ + "tags": [ { - "bearerAuth": [] + "name": "Registry", + "description": "Registry" }, { - "basicAuth": [] + "name": "Schemas", + "description": "Schemas" }, { - "apiKeyQuery": [] + "name": "Login Portals", + "description": "Login Portals" }, { - "apiKeyHeader": [] + "name": "Rules", + "description": "Rules" }, { - "apiKeyCookie": [] + "name": "Themes", + "description": "Themes" }, { - "oAuth2": [] + "name": "Teams", + "description": "Teams" }, { - "openIdConnect": [] - } - ], - "tags": [ + "name": "Scalar Docs", + "description": "Scalar Docs" + }, { - "name": "Authentication", - "description": "Some endpoints are public, but some require authentication. We provide all the required endpoints to create an account and authorize yourself." + "name": "Namespaces", + "description": "Namespaces" }, { - "name": "Planets", - "description": "Everything about planets" + "name": "Authentication", + "description": "Authentication" } ], - "paths": { - "/planets": { - "get": { - "tags": [ - "Planets" - ], - "summary": "Get all planets", - "description": "It’s easy to say you know them all, but do you really? Retrieve all the planets and check whether you missed one.", - "operationId": "getAllData", - "security": [ - {} - ], - "parameters": [ - { - "$ref": "#/components/parameters/limit" + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + }, + "schemas": { + "400": { + "type": "object", + "properties": { + "message": { + "type": "string" }, - { - "$ref": "#/components/parameters/offset" + "code": { + "type": "string" } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Planet" - } - } - } - }, - { - "$ref": "#/components/schemas/PaginatedResource" - } - ] - } - }, - "application/xml": { - "schema": { - "allOf": [ - { - "type": "object", - "xml": { - "name": "planets" - }, - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Planet" - } - } - } - }, - { - "$ref": "#/components/schemas/PaginatedResource" - } - ] - } - } + }, + "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" } } }, - "x-codeSamples": [ - { - "lang": "csharp", - "label": "getAllData", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.GetAllDataAsync(\n limit: 10,\n offset: 0\n);\n\n// handle response" + "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" + } + ] }, - { - "lang": "go", - "label": "getAllData", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetAllData(ctx, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.TwoHundredApplicationJSONObject != nil {\n // handle response\n }\n}" + "tags": { + "default": [], + "type": "array", + "items": { + "type": "string" + } }, - { - "lang": "php", - "label": "getAllData", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->getAllData(\n limit: 10,\n offset: 0\n\n);\n\nif ($response->twoHundredApplicationJsonObject !== null) {\n // handle response\n}" + "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 + } }, - { - "lang": "python", - "label": "getAllData", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.get_all_data()\n\n # Handle response\n print(res)" + "yamlSha": { + "type": "string" }, - { - "lang": "ruby", - "label": "getAllData", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.get_all_data(limit=10, offset=0)\n\nif ! res.two_hundred_application_json_object.nil?\n # handle response\nend" + "jsonSha": { + "type": "string" }, - { - "lang": "typescript", - "label": "getAllData", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.getAllData({});\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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" }, - { - "lang": "go", - "label": "getAllData", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetAllData(ctx, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.TwoHundredApplicationJSONObject != nil {\n // handle response\n }\n}" + "title": { + "default": "", + "type": "string", + "maxLength": 100 }, - { - "lang": "csharp", - "label": "getAllData", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.GetAllDataAsync(\n limit: 10,\n offset: 0\n);\n\n// handle response" + "description": { + "default": "", + "type": "string" }, - { - "lang": "php", - "label": "getAllData", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->getAllData(\n limit: 10,\n offset: 0\n\n);\n\nif ($response->twoHundredApplicationJsonObject !== null) {\n // handle response\n}" + "slug": { + "default": "randomManagedDocSlug()", + "$ref": "#/components/schemas/slug" }, - { - "lang": "python", - "label": "getAllData", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.get_all_data()\n\n # Handle response\n print(res)" + "namespace": { + "$ref": "#/components/schemas/namespace" }, - { - "lang": "ruby", - "label": "getAllData", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.get_all_data(limit=10, offset=0)\n\nif ! res.two_hundred_application_json_object.nil?\n # handle response\nend" + "isPrivate": { + "default": false, + "type": "boolean" }, - { - "lang": "typescript", - "label": "getAllData", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.getAllData({});\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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" }, - { - "lang": "csharp", - "label": "getAllData", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.GetAllDataAsync(\n limit: 10,\n offset: 0\n);\n\n// handle response" + "createdAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" }, - { - "lang": "go", - "label": "getAllData", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetAllData(ctx, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.TwoHundredApplicationJSONObject != nil {\n // handle response\n }\n}" + "updatedAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" }, - { - "lang": "go", - "label": "getAllData", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetAllData(ctx, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.TwoHundredApplicationJSONObject != nil {\n // handle response\n }\n}" + "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" }, - { - "lang": "php", - "label": "getAllData", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->getAllData(\n limit: 10,\n offset: 0\n\n);\n\nif ($response->twoHundredApplicationJsonObject !== null) {\n // handle response\n}" + "logoSize": { + "default": "100", + "type": "string" }, - { - "lang": "python", - "label": "getAllData", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.get_all_data()\n\n # Handle response\n print(res)" + "buttonText": { + "default": "Login", + "type": "string", + "maxLength": 50 }, - { - "lang": "ruby", - "label": "getAllData", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.get_all_data(limit=10, offset=0)\n\nif ! res.two_hundred_application_json_object.nil?\n # handle response\nend" + "message": { + "default": "Click to access private documentation hosted by scalar.com", + "type": "string", + "maxLength": 1000 }, - { - "lang": "typescript", - "label": "getAllData", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.getAllData({});\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "title": { + "default": "Private Docs", + "type": "string", + "maxLength": 100 }, - { - "lang": "go", - "label": "getAllData", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetAllData(ctx, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.TwoHundredApplicationJSONObject != nil {\n // handle response\n }\n}" + "mainColor": { + "default": "#2a2f45", + "type": "string", + "maxLength": 100 }, - { - "lang": "go", - "label": "getAllData", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetAllData(ctx, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.TwoHundredApplicationJSONObject != nil {\n // handle response\n }\n}" + "mainBackground": { + "default": "#f6f6f6", + "type": "string", + "maxLength": 100 }, - { - "lang": "php", - "label": "getAllData", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->getAllData(\n limit: 10,\n offset: 0\n\n);\n\nif ($response->twoHundredApplicationJsonObject !== null) {\n // handle response\n}" + "cardColor": { + "default": "2a2f45", + "type": "string", + "maxLength": 100 }, - { - "lang": "python", - "label": "getAllData", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.get_all_data()\n\n # Handle response\n print(res)" + "cardBackground": { + "default": "#fff", + "type": "string", + "maxLength": 100 }, - { - "lang": "ruby", - "label": "getAllData", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.get_all_data(limit=10, offset=0)\n\nif ! res.two_hundred_application_json_object.nil?\n # handle response\nend" + "buttonColor": { + "default": "#fff", + "type": "string", + "maxLength": 100 }, - { - "lang": "typescript", - "label": "getAllData", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.getAllData({});\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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 }, - { - "lang": "go", - "label": "getAllData", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetAllData(ctx, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.TwoHundredApplicationJSONObject != nil {\n // handle response\n }\n}" + "description": { + "default": "Login to access your documentation", + "type": "string", + "maxLength": 500 }, - { - "lang": "php", - "label": "getAllData", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->getAllData(\n limit: 10,\n offset: 0\n\n);\n\nif ($response->twoHundredApplicationJsonObject !== null) {\n // handle response\n}" + "head": { + "default": "", + "type": "string" }, - { - "lang": "python", - "label": "getAllData", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.get_all_data()\n\n # Handle response\n print(res)" + "script": { + "default": "", + "type": "string" }, - { - "lang": "ruby", - "label": "getAllData", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.get_all_data(limit=10, offset=0)\n\nif ! res.two_hundred_application_json_object.nil?\n # handle response\nend" + "theme": { + "default": "", + "type": "string" }, - { - "lang": "typescript", - "label": "getAllData", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.getAllData({});\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "companyName": { + "default": "", + "type": "string", + "maxLength": 100 }, - { - "lang": "csharp", - "label": "getAllData", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.GetAllDataAsync(\n limit: 10,\n offset: 0\n);\n\n// handle response" + "logo": { + "default": "", + "type": "string" }, - { - "lang": "go", - "label": "getAllData", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetAllData(ctx, nil, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.TwoHundredApplicationJSONObject != nil {\n // handle response\n }\n}" + "logoURL": { + "default": "", + "type": "string" }, - { - "lang": "php", - "label": "getAllData", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->getAllData(\n limit: 10,\n offset: 0\n\n);\n\nif ($response->twoHundredApplicationJsonObject !== null) {\n // handle response\n}" + "favicon": { + "default": "", + "type": "string" }, - { - "lang": "java", - "label": "getAllData", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.operations.GetAllDataResponse;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n GetAllDataResponse res = sdk.planets().getAllData()\n .call();\n\n if (res.twoHundredApplicationJsonObject().isPresent()) {\n // handle response\n }\n }\n}" + "termsLink": { + "default": "", + "type": "string" }, - { - "lang": "python", - "label": "getAllData", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.get_all_data()\n\n # Handle response\n print(res)" + "privacyLink": { + "default": "", + "type": "string" }, - { - "lang": "ruby", - "label": "getAllData", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.get_all_data(limit=10, offset=0)\n\nif ! res.two_hundred_application_json_object.nil?\n # handle response\nend" + "formTitle": { + "default": "Scalar Private Docs", + "type": "string", + "maxLength": 100 }, - { - "lang": "typescript", - "label": "getAllData", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.getAllData({});\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "formDescription": { + "default": "Login to access your documentation", + "type": "string", + "maxLength": 500 }, - { - "lang": "go", - "label": "getAllData", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetAllData(ctx, gosdk.Int64(10), gosdk.Int64(0))\n if err != nil {\n log.Fatal(err)\n }\n if res.TwoHundredApplicationJSONObject != nil {\n // handle response\n }\n}" + "formImage": { + "default": "", + "type": "string" } - ] + }, + "required": [ + "title", + "description", + "head", + "script", + "theme", + "companyName", + "logo", + "logoURL", + "favicon", + "termsLink", + "privacyLink", + "formTitle", + "formDescription", + "formImage" + ], + "additionalProperties": false }, - "post": { - "tags": [ - "Planets" - ], - "summary": "Create a planet", - "description": "Time to play god and create a new planet. What do you think? Ah, don’t think too much. What could go wrong anyway?", - "operationId": "createPlanet", - "callbacks": { - "planetCreated": { - "{$request.body#/callbackUrl}": { - "post": { - "requestBody": { - "description": "Information about the newly created planet", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Planet" - } - } - } - }, - "responses": { - "200": { - "description": "Your server returns this code if it accepts the callback" - } - } - } - } - } - }, - "requestBody": { - "description": "Planet", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Planet" - } - }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Planet" - } - } - } - }, - "responses": { - "201": { - "description": "Created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Planet" - } - }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Planet" - } - } - } + "login-portal": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" }, - "400": { - "$ref": "#/components/responses/BadRequest" + "title": { + "type": "string", + "maxLength": 200 }, - "403": { - "$ref": "#/components/responses/Forbidden" + "slug": { + "$ref": "#/components/schemas/slug" } }, - "x-codeSamples": [ - { - "lang": "csharp", - "label": "createPlanet_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Components;\nusing System;\nusing System.Collections.Generic;\n\nvar sdk = new ScalarCsharpSDK();\n\nPlanetInput req = new PlanetInput() {\n Name = \"HD 40307g\",\n Description = \"The red planet\",\n Type = Scalar.CsharpSdk.Models.Components.Type.Terrestrial,\n HabitabilityIndex = 0.68F,\n PhysicalProperties = new PhysicalProperties() {\n Mass = 0.107F,\n Radius = 0.532F,\n Gravity = 0.378F,\n Temperature = new Temperature() {\n Min = 130F,\n Max = 308F,\n Average = 210F,\n },\n },\n Atmosphere = new List() {\n new Atmosphere() {\n Compound = \"N2\",\n Percentage = 95.3F,\n },\n },\n DiscoveredAt = System.DateTime.Parse(\"1610-01-07T00:00:00Z\"),\n Image = \"https://cdn.scalar.com/photos/mars.jpg\",\n Satellites = new List() {\n new Satellite() {\n Name = \"Phobos\",\n Diameter = 22.2F,\n },\n },\n Creator = new UserInput() {\n Name = \"Marc\",\n },\n Tags = new List() {\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackUrl = \"https://example.com/webhook\",\n};\n\nvar res = await sdk.Planets.CreatePlanetJsonAsync(req);\n\n// handle response" - }, - { - "lang": "csharp", - "label": "createPlanet_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nbyte[] req = System.Text.Encoding.UTF8.GetBytes(\"0xE7C2E11da9\");\n\nvar res = await sdk.Planets.CreatePlanetRawAsync(req);\n\n// handle response" - }, - { - "lang": "go", - "label": "createPlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetJSON(ctx, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" - }, - { - "lang": "go", - "label": "createPlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetRaw(ctx, bytes.NewBuffer([]byte(\"0xEBb3cd2fdF\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "required": [ + "uid", + "title", + "slug" + ], + "additionalProperties": false + }, + "rule": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" }, - { - "lang": "php", - "label": "createPlanet_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\nuse scalar\\PhpSdk\\Utils;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Components\\PlanetInput(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Components\\Type::Terrestrial,\n habitabilityIndex: 0.68,\n physicalProperties: new Components\\PhysicalProperties(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: new Components\\Temperature(\n min: 130,\n max: 308,\n average: 210,\n ),\n ),\n atmosphere: [\n new Components\\Atmosphere(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discoveredAt: Utils\\Utils::parseDateTime('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n new Components\\Satellite(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: new Components\\UserInput(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callbackUrl: 'https://example.com/webhook',\n);\n\n$response = $sdk->planets->createPlanetJson(\n request: $request\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "title": { + "default": "", + "type": "string", + "maxLength": 100 }, - { - "lang": "php", - "label": "createPlanet_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0xE7C2E11da9';\n\n$response = $sdk->planets->createPlanetRaw(\n request: $request\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "description": { + "default": "", + "type": "string" }, - { - "lang": "python", - "label": "createPlanet_json", - "source": "import scalar_python_sdk\nfrom scalar_python_sdk import ScalarPythonSDK\nfrom scalar_python_sdk.utils import parse_datetime\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.create_planet_json(request={\n \"name\": \"Mars\",\n \"description\": \"The red planet\",\n \"type\": scalar_python_sdk.Type.TERRESTRIAL,\n \"habitability_index\": 0.68,\n \"physical_properties\": {\n \"mass\": 0.107,\n \"radius\": 0.532,\n \"gravity\": 0.378,\n \"temperature\": {\n \"min\": 130,\n \"max\": 308,\n \"average\": 210,\n },\n },\n \"atmosphere\": [\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n ],\n \"discovered_at\": parse_datetime(\"1610-01-07T00:00:00Z\"),\n \"image\": \"https://cdn.scalar.com/photos/mars.jpg\",\n \"satellites\": [\n {\n \"name\": \"Phobos\",\n \"diameter\": 22.2,\n },\n ],\n \"creator\": {\n \"name\": \"Marc\",\n },\n \"tags\": [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n \"callback_url\": \"https://example.com/webhook\",\n })\n\n # Handle response\n print(res)" + "slug": { + "default": "randomManagedDocSlug()", + "$ref": "#/components/schemas/slug" }, - { - "lang": "python", - "label": "createPlanet_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.create_planet_raw(request=io.BytesIO(\"0xE7C2E11da9\".encode()))\n\n # Handle response\n print(res)" + "namespace": { + "$ref": "#/components/schemas/namespace" }, - { - "lang": "ruby", - "label": "createPlanet_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Shared::PlanetInput.new(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Models::Shared::Type::TERRESTRIAL,\n habitability_index: 0.68,\n physical_properties: Models::Shared::PhysicalProperties.new(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: Models::Shared::Temperature.new(\n min: 130.0,\n max: 308.0,\n average: 210.0,\n ),\n ),\n atmosphere: [\n Models::Shared::Atmosphere.new(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discovered_at: DateTime.iso8601('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n Models::Shared::Satellite.new(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: Models::Shared::UserInput.new(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callback_url: 'https://example.com/webhook',\n)\n\nres = s.planets.create_planet_json(req)\n\nif ! res.planet.nil?\n # handle response\nend" + "isPrivate": { + "default": false, + "type": "boolean" + } + }, + "required": [ + "uid", + "title", + "description", + "slug", + "namespace", + "isPrivate" + ], + "additionalProperties": false + }, + "theme": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" }, - { - "lang": "ruby", - "label": "createPlanet_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0xE7C2E11da9\".encode()\n\nres = s.planets.create_planet_raw(req)\n\nif ! res.planet.nil?\n # handle response\nend" + "name": { + "type": "string" }, - { - "lang": "typescript", - "label": "createPlanet_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.createPlanetJson({\n name: \"Mars\",\n description: \"The red planet\",\n type: \"terrestrial\",\n habitabilityIndex: 0.68,\n physicalProperties: {\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: {\n min: 130,\n max: 308,\n average: 210,\n },\n },\n atmosphere: [\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n ],\n discoveredAt: new Date(\"1610-01-07T00:00:00Z\"),\n image: \"https://cdn.scalar.com/photos/mars.jpg\",\n satellites: [\n {\n name: \"Phobos\",\n diameter: 22.2,\n },\n ],\n creator: {\n name: \"Marc\",\n },\n tags: [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n callbackUrl: \"https://example.com/webhook\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "description": { + "type": "string" }, - { - "lang": "typescript", - "label": "createPlanet_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.createPlanetRaw(bytesToStream(new TextEncoder().encode(\"0xE7C2E11da9\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "slug": { + "$ref": "#/components/schemas/slug" + } + }, + "required": [ + "uid", + "name", + "description", + "slug" + ], + "additionalProperties": false + }, + "team": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" }, - { - "lang": "go", - "label": "createPlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetJSON(ctx, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "name": { + "$ref": "#/components/schemas/team-name" }, - { - "lang": "go", - "label": "createPlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetRaw(ctx, bytes.NewBuffer([]byte(\"0xEBb3cd2fdF\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "imageUri": { + "$ref": "#/components/schemas/team-image" }, - { - "lang": "csharp", - "label": "createPlanet_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Components;\nusing System;\nusing System.Collections.Generic;\n\nvar sdk = new ScalarCsharpSDK();\n\nPlanetInput req = new PlanetInput() {\n Name = \"HD 40307g\",\n Description = \"The red planet\",\n Type = Scalar.CsharpSdk.Models.Components.Type.Terrestrial,\n HabitabilityIndex = 0.68F,\n PhysicalProperties = new PhysicalProperties() {\n Mass = 0.107F,\n Radius = 0.532F,\n Gravity = 0.378F,\n Temperature = new Temperature() {\n Min = 130F,\n Max = 308F,\n Average = 210F,\n },\n },\n Atmosphere = new List() {\n new Atmosphere() {\n Compound = \"N2\",\n Percentage = 95.3F,\n },\n },\n DiscoveredAt = System.DateTime.Parse(\"1610-01-07T00:00:00Z\"),\n Image = \"https://cdn.scalar.com/photos/mars.jpg\",\n Satellites = new List() {\n new Satellite() {\n Name = \"Phobos\",\n Diameter = 22.2F,\n },\n },\n Creator = new UserInput() {\n Name = \"Marc\",\n },\n Tags = new List() {\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackUrl = \"https://example.com/webhook\",\n};\n\nvar res = await sdk.Planets.CreatePlanetJsonAsync(req);\n\n// handle response" + "slug": { + "$ref": "#/components/schemas/slug" }, - { - "lang": "csharp", - "label": "createPlanet_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nbyte[] req = System.Text.Encoding.UTF8.GetBytes(\"0xE7C2E11da9\");\n\nvar res = await sdk.Planets.CreatePlanetRawAsync(req);\n\n// handle response" + "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" }, - { - "lang": "php", - "label": "createPlanet_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\nuse scalar\\PhpSdk\\Utils;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Components\\PlanetInput(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Components\\Type::Terrestrial,\n habitabilityIndex: 0.68,\n physicalProperties: new Components\\PhysicalProperties(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: new Components\\Temperature(\n min: 130,\n max: 308,\n average: 210,\n ),\n ),\n atmosphere: [\n new Components\\Atmosphere(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discoveredAt: Utils\\Utils::parseDateTime('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n new Components\\Satellite(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: new Components\\UserInput(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callbackUrl: 'https://example.com/webhook',\n);\n\n$response = $sdk->planets->createPlanetJson(\n request: $request\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "createdAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" }, - { - "lang": "php", - "label": "createPlanet_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0xE7C2E11da9';\n\n$response = $sdk->planets->createPlanetRaw(\n request: $request\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "updatedAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" }, - { - "lang": "python", - "label": "createPlanet_json", - "source": "import scalar_python_sdk\nfrom scalar_python_sdk import ScalarPythonSDK\nfrom scalar_python_sdk.utils import parse_datetime\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.create_planet_json(request={\n \"name\": \"Mars\",\n \"description\": \"The red planet\",\n \"type\": scalar_python_sdk.Type.TERRESTRIAL,\n \"habitability_index\": 0.68,\n \"physical_properties\": {\n \"mass\": 0.107,\n \"radius\": 0.532,\n \"gravity\": 0.378,\n \"temperature\": {\n \"min\": 130,\n \"max\": 308,\n \"average\": 210,\n },\n },\n \"atmosphere\": [\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n ],\n \"discovered_at\": parse_datetime(\"1610-01-07T00:00:00Z\"),\n \"image\": \"https://cdn.scalar.com/photos/mars.jpg\",\n \"satellites\": [\n {\n \"name\": \"Phobos\",\n \"diameter\": 22.2,\n },\n ],\n \"creator\": {\n \"name\": \"Marc\",\n },\n \"tags\": [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n \"callback_url\": \"https://example.com/webhook\",\n })\n\n # Handle response\n print(res)" + "name": { + "type": "string" }, - { - "lang": "python", - "label": "createPlanet_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.create_planet_raw(request=io.BytesIO(\"0xE7C2E11da9\".encode()))\n\n # Handle response\n print(res)" + "activeDeployment": { + "default": null, + "anyOf": [ + { + "$ref": "#/components/schemas/active-deployment" + }, + { + "type": "null" + } + ] }, - { - "lang": "ruby", - "label": "createPlanet_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Shared::PlanetInput.new(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Models::Shared::Type::TERRESTRIAL,\n habitability_index: 0.68,\n physical_properties: Models::Shared::PhysicalProperties.new(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: Models::Shared::Temperature.new(\n min: 130.0,\n max: 308.0,\n average: 210.0,\n ),\n ),\n atmosphere: [\n Models::Shared::Atmosphere.new(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discovered_at: DateTime.iso8601('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n Models::Shared::Satellite.new(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: Models::Shared::UserInput.new(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callback_url: 'https://example.com/webhook',\n)\n\nres = s.planets.create_planet_json(req)\n\nif ! res.planet.nil?\n # handle response\nend" + "lastPublished": { + "default": null, + "anyOf": [ + { + "$ref": "#/components/schemas/timestamp" + }, + { + "type": "null" + } + ] }, - { - "lang": "ruby", - "label": "createPlanet_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0xE7C2E11da9\".encode()\n\nres = s.planets.create_planet_raw(req)\n\nif ! res.planet.nil?\n # handle response\nend" + "lastPublishedUid": { + "default": null, + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - { - "lang": "typescript", - "label": "createPlanet_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.createPlanetJson({\n name: \"Mars\",\n description: \"The red planet\",\n type: \"terrestrial\",\n habitabilityIndex: 0.68,\n physicalProperties: {\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: {\n min: 130,\n max: 308,\n average: 210,\n },\n },\n atmosphere: [\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n ],\n discoveredAt: new Date(\"1610-01-07T00:00:00Z\"),\n image: \"https://cdn.scalar.com/photos/mars.jpg\",\n satellites: [\n {\n name: \"Phobos\",\n diameter: 22.2,\n },\n ],\n creator: {\n name: \"Marc\",\n },\n tags: [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n callbackUrl: \"https://example.com/webhook\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "loginPortalUid": { + "default": "", + "type": "string" }, - { - "lang": "typescript", - "label": "createPlanet_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.createPlanetRaw(bytesToStream(new TextEncoder().encode(\"0xE7C2E11da9\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "activeThemeId": { + "default": "", + "type": "string" }, - { - "lang": "csharp", - "label": "createPlanet_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Components;\nusing System;\nusing System.Collections.Generic;\n\nvar sdk = new ScalarCsharpSDK();\n\nPlanetInput req = new PlanetInput() {\n Name = \"HD 40307g\",\n Description = \"The red planet\",\n Type = Scalar.CsharpSdk.Models.Components.Type.Terrestrial,\n HabitabilityIndex = 0.68F,\n PhysicalProperties = new PhysicalProperties() {\n Mass = 0.107F,\n Radius = 0.532F,\n Gravity = 0.378F,\n Temperature = new Temperature() {\n Min = 130F,\n Max = 308F,\n Average = 210F,\n },\n },\n Atmosphere = new List() {\n new Atmosphere() {\n Compound = \"N2\",\n Percentage = 95.3F,\n },\n },\n DiscoveredAt = System.DateTime.Parse(\"1610-01-07T00:00:00Z\"),\n Image = \"https://cdn.scalar.com/photos/mars.jpg\",\n Satellites = new List() {\n new Satellite() {\n Name = \"Phobos\",\n Diameter = 22.2F,\n },\n },\n Creator = new UserInput() {\n Name = \"Marc\",\n },\n Tags = new List() {\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackUrl = \"https://example.com/webhook\",\n};\n\nvar res = await sdk.Planets.CreatePlanetJsonAsync(req);\n\n// handle response" + "typesenseId": { + "type": "number" }, - { - "lang": "csharp", - "label": "createPlanet_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nbyte[] req = System.Text.Encoding.UTF8.GetBytes(\"0xE7C2E11da9\");\n\nvar res = await sdk.Planets.CreatePlanetRawAsync(req);\n\n// handle response" + "isPrivate": { + "default": false, + "type": "boolean" }, - { - "lang": "go", - "label": "createPlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetJSON(ctx, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "agentEnabled": { + "default": false, + "type": "boolean" }, - { - "lang": "go", - "label": "createPlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetRaw(ctx, bytes.NewBuffer([]byte(\"0xEBb3cd2fdF\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "accessGroups": { + "default": [] }, - { - "lang": "go", - "label": "createPlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetJSON(ctx, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "slug": { + "$ref": "#/components/schemas/slug" }, - { - "lang": "go", - "label": "createPlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetRaw(ctx, bytes.NewBuffer([]byte(\"0xEBb3cd2fdF\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "publishStatus": { + "default": "", + "type": "string" }, - { - "lang": "php", - "label": "createPlanet_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\nuse scalar\\PhpSdk\\Utils;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Components\\PlanetInput(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Components\\Type::Terrestrial,\n habitabilityIndex: 0.68,\n physicalProperties: new Components\\PhysicalProperties(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: new Components\\Temperature(\n min: 130,\n max: 308,\n average: 210,\n ),\n ),\n atmosphere: [\n new Components\\Atmosphere(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discoveredAt: Utils\\Utils::parseDateTime('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n new Components\\Satellite(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: new Components\\UserInput(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callbackUrl: 'https://example.com/webhook',\n);\n\n$response = $sdk->planets->createPlanetJson(\n request: $request\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "publishMessage": { + "default": "", + "type": "string" }, - { - "lang": "php", - "label": "createPlanet_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0xE7C2E11da9';\n\n$response = $sdk->planets->createPlanetRaw(\n request: $request\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "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" }, - { - "lang": "python", - "label": "createPlanet_json", - "source": "import scalar_python_sdk\nfrom scalar_python_sdk import ScalarPythonSDK\nfrom scalar_python_sdk.utils import parse_datetime\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.create_planet_json(request={\n \"name\": \"Mars\",\n \"description\": \"The red planet\",\n \"type\": scalar_python_sdk.Type.TERRESTRIAL,\n \"habitability_index\": 0.68,\n \"physical_properties\": {\n \"mass\": 0.107,\n \"radius\": 0.532,\n \"gravity\": 0.378,\n \"temperature\": {\n \"min\": 130,\n \"max\": 308,\n \"average\": 210,\n },\n },\n \"atmosphere\": [\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n ],\n \"discovered_at\": parse_datetime(\"1610-01-07T00:00:00Z\"),\n \"image\": \"https://cdn.scalar.com/photos/mars.jpg\",\n \"satellites\": [\n {\n \"name\": \"Phobos\",\n \"diameter\": 22.2,\n },\n ],\n \"creator\": {\n \"name\": \"Marc\",\n },\n \"tags\": [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n \"callback_url\": \"https://example.com/webhook\",\n })\n\n # Handle response\n print(res)" + "domain": { + "type": "string" }, - { - "lang": "python", - "label": "createPlanet_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.create_planet_raw(request=io.BytesIO(\"0xE7C2E11da9\".encode()))\n\n # Handle response\n print(res)" + "publishedAt": { + "$ref": "#/components/schemas/timestamp" + } + }, + "required": [ + "uid", + "domain", + "publishedAt" + ], + "additionalProperties": false + }, + "github-project-repository": { + "type": "object", + "properties": { + "linkedBy": { + "type": "string" }, - { - "lang": "ruby", - "label": "createPlanet_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Shared::PlanetInput.new(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Models::Shared::Type::TERRESTRIAL,\n habitability_index: 0.68,\n physical_properties: Models::Shared::PhysicalProperties.new(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: Models::Shared::Temperature.new(\n min: 130.0,\n max: 308.0,\n average: 210.0,\n ),\n ),\n atmosphere: [\n Models::Shared::Atmosphere.new(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discovered_at: DateTime.iso8601('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n Models::Shared::Satellite.new(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: Models::Shared::UserInput.new(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callback_url: 'https://example.com/webhook',\n)\n\nres = s.planets.create_planet_json(req)\n\nif ! res.planet.nil?\n # handle response\nend" + "id": { + "type": "number" }, - { - "lang": "ruby", - "label": "createPlanet_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0xE7C2E11da9\".encode()\n\nres = s.planets.create_planet_raw(req)\n\nif ! res.planet.nil?\n # handle response\nend" + "name": { + "type": "string", + "minLength": 2 }, - { - "lang": "typescript", - "label": "createPlanet_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.createPlanetJson({\n name: \"Mars\",\n description: \"The red planet\",\n type: \"terrestrial\",\n habitabilityIndex: 0.68,\n physicalProperties: {\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: {\n min: 130,\n max: 308,\n average: 210,\n },\n },\n atmosphere: [\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n ],\n discoveredAt: new Date(\"1610-01-07T00:00:00Z\"),\n image: \"https://cdn.scalar.com/photos/mars.jpg\",\n satellites: [\n {\n name: \"Phobos\",\n diameter: 22.2,\n },\n ],\n creator: {\n name: \"Marc\",\n },\n tags: [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n callbackUrl: \"https://example.com/webhook\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "configPath": { + "default": "", + "type": "string" }, - { - "lang": "typescript", - "label": "createPlanet_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.createPlanetRaw(bytesToStream(new TextEncoder().encode(\"0xE7C2E11da9\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "branch": { + "default": "", + "type": "string" }, - { - "lang": "go", - "label": "createPlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetJSON(ctx, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "publishOnMerge": { + "default": false, + "type": "boolean" }, - { - "lang": "go", - "label": "createPlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetRaw(ctx, bytes.NewBuffer([]byte(\"0xEBb3cd2fdF\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "publishPreviews": { + "default": false, + "type": "boolean" }, - { - "lang": "go", - "label": "createPlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetJSON(ctx, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "prComments": { + "default": false, + "type": "boolean" }, - { - "lang": "go", - "label": "createPlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetRaw(ctx, bytes.NewBuffer([]byte(\"0xEBb3cd2fdF\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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" }, - { - "lang": "php", - "label": "createPlanet_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\nuse scalar\\PhpSdk\\Utils;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Components\\PlanetInput(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Components\\Type::Terrestrial,\n habitabilityIndex: 0.68,\n physicalProperties: new Components\\PhysicalProperties(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: new Components\\Temperature(\n min: 130,\n max: 308,\n average: 210,\n ),\n ),\n atmosphere: [\n new Components\\Atmosphere(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discoveredAt: Utils\\Utils::parseDateTime('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n new Components\\Satellite(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: new Components\\UserInput(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callbackUrl: 'https://example.com/webhook',\n);\n\n$response = $sdk->planets->createPlanetJson(\n request: $request\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "name": { + "$ref": "#/components/schemas/team-name" }, - { - "lang": "php", - "label": "createPlanet_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0xE7C2E11da9';\n\n$response = $sdk->planets->createPlanetRaw(\n request: $request\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "imageUri": { + "$ref": "#/components/schemas/team-image" + } + }, + "required": [ + "uid", + "name" + ], + "additionalProperties": false + }, + "user": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" }, - { - "lang": "python", - "label": "createPlanet_json", - "source": "import scalar_python_sdk\nfrom scalar_python_sdk import ScalarPythonSDK\nfrom scalar_python_sdk.utils import parse_datetime\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.create_planet_json(request={\n \"name\": \"Mars\",\n \"description\": \"The red planet\",\n \"type\": scalar_python_sdk.Type.TERRESTRIAL,\n \"habitability_index\": 0.68,\n \"physical_properties\": {\n \"mass\": 0.107,\n \"radius\": 0.532,\n \"gravity\": 0.378,\n \"temperature\": {\n \"min\": 130,\n \"max\": 308,\n \"average\": 210,\n },\n },\n \"atmosphere\": [\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n ],\n \"discovered_at\": parse_datetime(\"1610-01-07T00:00:00Z\"),\n \"image\": \"https://cdn.scalar.com/photos/mars.jpg\",\n \"satellites\": [\n {\n \"name\": \"Phobos\",\n \"diameter\": 22.2,\n },\n ],\n \"creator\": {\n \"name\": \"Marc\",\n },\n \"tags\": [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n \"callback_url\": \"https://example.com/webhook\",\n })\n\n # Handle response\n print(res)" + "createdAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" }, - { - "lang": "python", - "label": "createPlanet_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.create_planet_raw(request=io.BytesIO(\"0xE7C2E11da9\".encode()))\n\n # Handle response\n print(res)" + "updatedAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" }, - { - "lang": "ruby", - "label": "createPlanet_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Shared::PlanetInput.new(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Models::Shared::Type::TERRESTRIAL,\n habitability_index: 0.68,\n physical_properties: Models::Shared::PhysicalProperties.new(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: Models::Shared::Temperature.new(\n min: 130.0,\n max: 308.0,\n average: 210.0,\n ),\n ),\n atmosphere: [\n Models::Shared::Atmosphere.new(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discovered_at: DateTime.iso8601('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n Models::Shared::Satellite.new(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: Models::Shared::UserInput.new(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callback_url: 'https://example.com/webhook',\n)\n\nres = s.planets.create_planet_json(req)\n\nif ! res.planet.nil?\n # handle response\nend" + "email": { + "$ref": "#/components/schemas/email" }, - { - "lang": "ruby", - "label": "createPlanet_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0xE7C2E11da9\".encode()\n\nres = s.planets.create_planet_raw(req)\n\nif ! res.planet.nil?\n # handle response\nend" + "theme": { + "type": "string" }, - { - "lang": "typescript", - "label": "createPlanet_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.createPlanetJson({\n name: \"Mars\",\n description: \"The red planet\",\n type: \"terrestrial\",\n habitabilityIndex: 0.68,\n physicalProperties: {\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: {\n min: 130,\n max: 308,\n average: 210,\n },\n },\n atmosphere: [\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n ],\n discoveredAt: new Date(\"1610-01-07T00:00:00Z\"),\n image: \"https://cdn.scalar.com/photos/mars.jpg\",\n satellites: [\n {\n name: \"Phobos\",\n diameter: 22.2,\n },\n ],\n creator: {\n name: \"Marc\",\n },\n tags: [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n callbackUrl: \"https://example.com/webhook\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "activeTeamId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - { - "lang": "typescript", - "label": "createPlanet_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.createPlanetRaw(bytesToStream(new TextEncoder().encode(\"0xE7C2E11da9\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "hasGithub": { + "default": false, + "type": "boolean" }, - { - "lang": "go", - "label": "createPlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetJSON(ctx, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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" + } + } + } + } }, - { - "lang": "go", - "label": "createPlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetRaw(ctx, bytes.NewBuffer([]byte(\"0xEBb3cd2fdF\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "php", - "label": "createPlanet_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\nuse scalar\\PhpSdk\\Utils;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Components\\PlanetInput(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Components\\Type::Terrestrial,\n habitabilityIndex: 0.68,\n physicalProperties: new Components\\PhysicalProperties(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: new Components\\Temperature(\n min: 130,\n max: 308,\n average: 210,\n ),\n ),\n atmosphere: [\n new Components\\Atmosphere(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discoveredAt: Utils\\Utils::parseDateTime('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n new Components\\Satellite(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: new Components\\UserInput(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callbackUrl: 'https://example.com/webhook',\n);\n\n$response = $sdk->planets->createPlanetJson(\n request: $request\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "php", - "label": "createPlanet_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0xE7C2E11da9';\n\n$response = $sdk->planets->createPlanetRaw(\n request: $request\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "python", - "label": "createPlanet_json", - "source": "import scalar_python_sdk\nfrom scalar_python_sdk import ScalarPythonSDK\nfrom scalar_python_sdk.utils import parse_datetime\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.create_planet_json(request={\n \"name\": \"Mars\",\n \"description\": \"The red planet\",\n \"type\": scalar_python_sdk.Type.TERRESTRIAL,\n \"habitability_index\": 0.68,\n \"physical_properties\": {\n \"mass\": 0.107,\n \"radius\": 0.532,\n \"gravity\": 0.378,\n \"temperature\": {\n \"min\": 130,\n \"max\": 308,\n \"average\": 210,\n },\n },\n \"atmosphere\": [\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n ],\n \"discovered_at\": parse_datetime(\"1610-01-07T00:00:00Z\"),\n \"image\": \"https://cdn.scalar.com/photos/mars.jpg\",\n \"satellites\": [\n {\n \"name\": \"Phobos\",\n \"diameter\": 22.2,\n },\n ],\n \"creator\": {\n \"name\": \"Marc\",\n },\n \"tags\": [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n \"callback_url\": \"https://example.com/webhook\",\n })\n\n # Handle response\n print(res)" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "python", - "label": "createPlanet_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.create_planet_raw(request=io.BytesIO(\"0xE7C2E11da9\".encode()))\n\n # Handle response\n print(res)" + "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": [ { - "lang": "ruby", - "label": "createPlanet_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Shared::PlanetInput.new(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Models::Shared::Type::TERRESTRIAL,\n habitability_index: 0.68,\n physical_properties: Models::Shared::PhysicalProperties.new(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: Models::Shared::Temperature.new(\n min: 130.0,\n max: 308.0,\n average: 210.0,\n ),\n ),\n atmosphere: [\n Models::Shared::Atmosphere.new(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discovered_at: DateTime.iso8601('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n Models::Shared::Satellite.new(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: Models::Shared::UserInput.new(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callback_url: 'https://example.com/webhook',\n)\n\nres = s.planets.create_planet_json(req)\n\nif ! res.planet.nil?\n # handle response\nend" + "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);" }, { - "lang": "ruby", - "label": "createPlanet_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0xE7C2E11da9\".encode()\n\nres = s.planets.create_planet_raw(req)\n\nif ! res.planet.nil?\n # handle response\nend" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry list-all-api-documents --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "typescript", - "label": "createPlanet_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.createPlanetJson({\n name: \"Mars\",\n description: \"The red planet\",\n type: \"terrestrial\",\n habitabilityIndex: 0.68,\n physicalProperties: {\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: {\n min: 130,\n max: 308,\n average: 210,\n },\n },\n atmosphere: [\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n ],\n discoveredAt: new Date(\"1610-01-07T00:00:00Z\"),\n image: \"https://cdn.scalar.com/photos/mars.jpg\",\n satellites: [\n {\n name: \"Phobos\",\n diameter: 22.2,\n },\n ],\n creator: {\n name: \"Marc\",\n },\n tags: [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n callbackUrl: \"https://example.com/webhook\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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)" }, { - "lang": "typescript", - "label": "createPlanet_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.createPlanetRaw(bytesToStream(new TextEncoder().encode(\"0xE7C2E11da9\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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}" }, { - "lang": "csharp", - "label": "createPlanet_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Components;\nusing System;\nusing System.Collections.Generic;\n\nvar sdk = new ScalarCsharpSDK();\n\nPlanetInput req = new PlanetInput() {\n Name = \"HD 40307g\",\n Description = \"The red planet\",\n Type = Scalar.CsharpSdk.Models.Components.Type.Terrestrial,\n HabitabilityIndex = 0.68F,\n PhysicalProperties = new PhysicalProperties() {\n Mass = 0.107F,\n Radius = 0.532F,\n Gravity = 0.378F,\n Temperature = new Temperature() {\n Min = 130F,\n Max = 308F,\n Average = 210F,\n },\n },\n Atmosphere = new List() {\n new Atmosphere() {\n Compound = \"N2\",\n Percentage = 95.3F,\n },\n },\n DiscoveredAt = System.DateTime.Parse(\"1610-01-07T00:00:00Z\"),\n Image = \"https://cdn.scalar.com/photos/mars.jpg\",\n Satellites = new List() {\n new Satellite() {\n Name = \"Phobos\",\n Diameter = 22.2F,\n },\n },\n Creator = new UserInput() {\n Name = \"Marc\",\n },\n Tags = new List() {\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackUrl = \"https://example.com/webhook\",\n};\n\nvar res = await sdk.Planets.CreatePlanetJsonAsync(req);\n\n// handle response" + "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);" }, { - "lang": "csharp", - "label": "createPlanet_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nbyte[] req = System.Text.Encoding.UTF8.GetBytes(\"0xE7C2E11da9\");\n\nvar res = await sdk.Planets.CreatePlanetRawAsync(req);\n\n// handle response" + "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)" }, { - "lang": "go", - "label": "createPlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetJSON(ctx, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" - }, - { - "lang": "go", - "label": "createPlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetRaw(ctx, bytes.NewBuffer([]byte(\"0xEBb3cd2fdF\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" - }, - { - "lang": "php", - "label": "createPlanet_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\nuse scalar\\PhpSdk\\Utils;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Components\\PlanetInput(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Components\\Type::Terrestrial,\n habitabilityIndex: 0.68,\n physicalProperties: new Components\\PhysicalProperties(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: new Components\\Temperature(\n min: 130,\n max: 308,\n average: 210,\n ),\n ),\n atmosphere: [\n new Components\\Atmosphere(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discoveredAt: Utils\\Utils::parseDateTime('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n new Components\\Satellite(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: new Components\\UserInput(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callbackUrl: 'https://example.com/webhook',\n);\n\n$response = $sdk->planets->createPlanetJson(\n request: $request\n);\n\nif ($response->planet !== null) {\n // handle response\n}" - }, - { - "lang": "php", - "label": "createPlanet_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0xE7C2E11da9';\n\n$response = $sdk->planets->createPlanetRaw(\n request: $request\n);\n\nif ($response->planet !== null) {\n // handle response\n}" - }, - { - "lang": "java", - "label": "createPlanet_json", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport java.time.OffsetDateTime;\nimport java.util.List;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.components.*;\nimport org.scalar.java_sdk.models.operations.CreatePlanetJsonResponse;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n PlanetInput req = PlanetInput.builder()\n .name(\"Mars\")\n .description(\"The red planet\")\n .type(Type.TERRESTRIAL)\n .habitabilityIndex(0.68f)\n .physicalProperties(PhysicalProperties.builder()\n .mass(0.107f)\n .radius(0.532f)\n .gravity(0.378f)\n .temperature(Temperature.builder()\n .min(130f)\n .max(308f)\n .average(210f)\n .build())\n .build())\n .atmosphere(List.of(\n Atmosphere.builder()\n .compound(\"CO2\")\n .percentage(95.3f)\n .build(),\n Atmosphere.builder()\n .compound(\"CO2\")\n .percentage(95.3f)\n .build(),\n Atmosphere.builder()\n .compound(\"CO2\")\n .percentage(95.3f)\n .build()))\n .discoveredAt(OffsetDateTime.parse(\"1610-01-07T00:00:00Z\"))\n .image(\"https://cdn.scalar.com/photos/mars.jpg\")\n .satellites(List.of(\n Satellite.builder()\n .name(\"Phobos\")\n .diameter(22.2f)\n .build()))\n .creator(UserInput.builder()\n .name(\"Marc\")\n .build())\n .tags(List.of(\n \"solar-system\",\n \"rocky\",\n \"explored\"))\n .callbackUrl(\"https://example.com/webhook\")\n .build();\n\n CreatePlanetJsonResponse res = sdk.planets().createPlanetJson()\n .request(req)\n .call();\n\n if (res.planet().isPresent()) {\n // handle response\n }\n }\n}" - }, - { - "lang": "java", - "label": "createPlanet_raw", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport java.nio.charset.StandardCharsets;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.operations.CreatePlanetRawResponse;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n byte[] req = \"0xE7C2E11da9\".getBytes(StandardCharsets.UTF_8);\n\n CreatePlanetRawResponse res = sdk.planets().createPlanetRaw()\n .request(req)\n .call();\n\n if (res.planet().isPresent()) {\n // handle response\n }\n }\n}" - }, - { - "lang": "python", - "label": "createPlanet_json", - "source": "import scalar_python_sdk\nfrom scalar_python_sdk import ScalarPythonSDK\nfrom scalar_python_sdk.utils import parse_datetime\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.create_planet_json(request={\n \"name\": \"Mars\",\n \"description\": \"The red planet\",\n \"type\": scalar_python_sdk.Type.TERRESTRIAL,\n \"habitability_index\": 0.68,\n \"physical_properties\": {\n \"mass\": 0.107,\n \"radius\": 0.532,\n \"gravity\": 0.378,\n \"temperature\": {\n \"min\": 130,\n \"max\": 308,\n \"average\": 210,\n },\n },\n \"atmosphere\": [\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n ],\n \"discovered_at\": parse_datetime(\"1610-01-07T00:00:00Z\"),\n \"image\": \"https://cdn.scalar.com/photos/mars.jpg\",\n \"satellites\": [\n {\n \"name\": \"Phobos\",\n \"diameter\": 22.2,\n },\n ],\n \"creator\": {\n \"name\": \"Marc\",\n },\n \"tags\": [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n \"callback_url\": \"https://example.com/webhook\",\n })\n\n # Handle response\n print(res)" - }, - { - "lang": "python", - "label": "createPlanet_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.create_planet_raw(request=io.BytesIO(\"0xE7C2E11da9\".encode()))\n\n # Handle response\n print(res)" - }, - { - "lang": "ruby", - "label": "createPlanet_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Shared::PlanetInput.new(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Models::Shared::Type::TERRESTRIAL,\n habitability_index: 0.68,\n physical_properties: Models::Shared::PhysicalProperties.new(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: Models::Shared::Temperature.new(\n min: 130.0,\n max: 308.0,\n average: 210.0,\n ),\n ),\n atmosphere: [\n Models::Shared::Atmosphere.new(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discovered_at: DateTime.iso8601('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n Models::Shared::Satellite.new(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: Models::Shared::UserInput.new(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callback_url: 'https://example.com/webhook',\n)\n\nres = s.planets.create_planet_json(req)\n\nif ! res.planet.nil?\n # handle response\nend" - }, - { - "lang": "ruby", - "label": "createPlanet_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0xE7C2E11da9\".encode()\n\nres = s.planets.create_planet_raw(req)\n\nif ! res.planet.nil?\n # handle response\nend" - }, - { - "lang": "typescript", - "label": "createPlanet_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.createPlanetJson({\n name: \"Mars\",\n description: \"The red planet\",\n type: \"terrestrial\",\n habitabilityIndex: 0.68,\n physicalProperties: {\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: {\n min: 130,\n max: 308,\n average: 210,\n },\n },\n atmosphere: [\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n ],\n discoveredAt: new Date(\"1610-01-07T00:00:00Z\"),\n image: \"https://cdn.scalar.com/photos/mars.jpg\",\n satellites: [\n {\n name: \"Phobos\",\n diameter: 22.2,\n },\n ],\n creator: {\n name: \"Marc\",\n },\n tags: [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n callbackUrl: \"https://example.com/webhook\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "typescript", - "label": "createPlanet_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.createPlanetRaw(bytesToStream(new TextEncoder().encode(\"0xE7C2E11da9\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "go", - "label": "createPlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetJSON(ctx, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" - }, - { - "lang": "go", - "label": "createPlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.CreatePlanetRaw(ctx, bytes.NewBuffer([]byte(\"{\\\"name\\\":\\\"Mars\\\",\\\"description\\\":\\\"The red planet\\\",\\\"type\\\":\\\"terrestrial\\\",\\\"habitabilityIndex\\\":0.68,\\\"physicalProperties\\\":{\\\"mass\\\":0.107,\\\"radius\\\":0.532,\\\"gravity\\\":0.378,\\\"temperature\\\":{\\\"min\\\":130,\\\"max\\\":308,\\\"average\\\":210}},\\\"atmosphere\\\":[{\\\"compound\\\":\\\"CO2\\\",\\\"percentage\\\":95.3}],\\\"discoveredAt\\\":\\\"1610-01-07T00:00:00Z\\\",\\\"image\\\":\\\"https://cdn.scalar.com/photos/mars.jpg\\\",\\\"satellites\\\":[{\\\"name\\\":\\\"Phobos\\\",\\\"diameter\\\":22.2}],\\\"creator\\\":{\\\"name\\\":\\\"Marc\\\"},\\\"tags\\\":[\\\"solar-system\\\",\\\"rocky\\\",\\\"explored\\\"],\\\"callbackUrl\\\":\\\"https://example.com/webhook\\\"}\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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" } ] } }, - "/planets/{planetId}": { + "/v1/apis/{namespace}": { "get": { "tags": [ - "Planets" - ], - "summary": "Get a planet", - "description": "You’ll better learn a little bit more about the planets. It might come in handy once space travel is available for everyone.", - "operationId": "getPlanet", - "security": [ - {} - ], - "parameters": [ - { - "$ref": "#/components/parameters/planetId" - } + "Registry" ], + "description": "List API documents in a namespace.", + "summary": "List API Documents in a namespace", + "operationId": "listApiDocuments", "responses": { "200": { - "description": "Planet Found", + "description": "Default Response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Planet" + "type": "array", + "items": { + "$ref": "#/components/schemas/api-document" + } } - }, - "application/xml": { + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { "schema": { - "$ref": "#/components/schemas/Planet" + "$ref": "#/components/schemas/400" } } } }, - "404": { - "$ref": "#/components/responses/NotFound" - } - }, - "x-codeSamples": [ - { - "lang": "csharp", - "label": "getPlanet", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.GetPlanetAsync(planetId: 1);\n\n// handle response" - }, - { - "lang": "go", - "label": "getPlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetPlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" - }, - { - "lang": "php", - "label": "getPlanet", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->getPlanet(\n planetId: 1\n);\n\nif ($response->planet !== null) {\n // handle response\n}" - }, - { - "lang": "python", - "label": "getPlanet", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.get_planet(planet_id=1)\n\n # Handle response\n print(res)" - }, - { - "lang": "ruby", - "label": "getPlanet", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.get_planet(planet_id=1)\n\nif ! res.planet.nil?\n # handle response\nend" - }, - { - "lang": "typescript", - "label": "getPlanet", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.getPlanet({\n planetId: 1,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "go", - "label": "getPlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetPlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" - }, - { - "lang": "csharp", - "label": "getPlanet", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.GetPlanetAsync(planetId: 1);\n\n// handle response" - }, - { - "lang": "php", - "label": "getPlanet", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->getPlanet(\n planetId: 1\n);\n\nif ($response->planet !== null) {\n // handle response\n}" - }, - { - "lang": "python", - "label": "getPlanet", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.get_planet(planet_id=1)\n\n # Handle response\n print(res)" - }, - { - "lang": "ruby", - "label": "getPlanet", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.get_planet(planet_id=1)\n\nif ! res.planet.nil?\n # handle response\nend" - }, - { - "lang": "typescript", - "label": "getPlanet", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.getPlanet({\n planetId: 1,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "csharp", - "label": "getPlanet", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.GetPlanetAsync(planetId: 1);\n\n// handle response" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "go", - "label": "getPlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetPlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "go", - "label": "getPlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetPlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "php", - "label": "getPlanet", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->getPlanet(\n planetId: 1\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "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": [ { - "lang": "python", - "label": "getPlanet", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.get_planet(planet_id=1)\n\n # Handle response\n print(res)" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "ruby", - "label": "getPlanet", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.get_planet(planet_id=1)\n\nif ! res.planet.nil?\n # handle response\nend" + "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);" }, { - "lang": "typescript", - "label": "getPlanet", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.getPlanet({\n planetId: 1,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry list-api-documents 'namespace_' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "go", - "label": "getPlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetPlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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)" }, { - "lang": "go", - "label": "getPlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetPlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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}" }, { - "lang": "php", - "label": "getPlanet", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->getPlanet(\n planetId: 1\n);\n\nif ($response->planet !== null) {\n // handle response\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);" }, { - "lang": "python", - "label": "getPlanet", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.get_planet(planet_id=1)\n\n # Handle response\n print(res)" + "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)" }, { - "lang": "ruby", - "label": "getPlanet", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.get_planet(planet_id=1)\n\nif ! res.planet.nil?\n # handle response\nend" + "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" + } + ] + }, + "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 + } + } + } }, - { - "lang": "typescript", - "label": "getPlanet", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.getPlanet({\n planetId: 1,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "go", - "label": "getPlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetPlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "php", - "label": "getPlanet", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->getPlanet(\n planetId: 1\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "python", - "label": "getPlanet", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.get_planet(planet_id=1)\n\n # Handle response\n print(res)" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "ruby", - "label": "getPlanet", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.get_planet(planet_id=1)\n\nif ! res.planet.nil?\n # handle response\nend" + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - { - "lang": "typescript", - "label": "getPlanet", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.getPlanet({\n planetId: 1,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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": [ { - "lang": "csharp", - "label": "getPlanet", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.GetPlanetAsync(planetId: 1);\n\n// handle response" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "go", - "label": "getPlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetPlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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: \"x\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(createAPIDocument);" }, { - "lang": "php", - "label": "getPlanet", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->getPlanet(\n planetId: 1\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry create-api-document 'namespace_' --bearer-auth \"$BEARER_AUTH\" --title 'title' --version-command 'version' --slug 'slug' --document 'document'" }, { - "lang": "java", - "label": "getPlanet", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.operations.GetPlanetResponse;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n GetPlanetResponse res = sdk.planets().getPlanet()\n .planetId(1L)\n .call();\n\n if (res.planet().isPresent()) {\n // handle response\n }\n }\n}" + "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=\"x\",\n slug=\"\",\n document=\"\",\n)\nprint(registry)" }, { - "lang": "python", - "label": "getPlanet", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.get_planet(planet_id=1)\n\n # Handle response\n print(res)" + "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: sdk.F[string](\"\"),\n\t\tSlug: sdk.F[string](\"\"),\n\t\tTitle: sdk.F[string](\"\"),\n\t\tVersion: sdk.F[string](\"x\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" }, { - "lang": "ruby", - "label": "getPlanet", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.get_planet(planet_id=1)\n\nif ! res.planet.nil?\n # handle response\nend" + "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);" }, { - "lang": "typescript", - "label": "getPlanet", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.getPlanet({\n planetId: 1,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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)" }, { - "lang": "go", - "label": "getPlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.GetPlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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: \"\", description: \"\", version: \"x\", slug: \"\", ruleset: \"\", is_private: false, document: \"\" })\nputs response.inspect" } ] - }, - "put": { + } + }, + "/v1/apis/{namespace}/{slug}": { + "patch": { "tags": [ - "Planets" - ], - "summary": "Update a planet", - "description": "Sometimes you make mistakes, that's fine. No worries, you can update all planets.", - "operationId": "updatePlanet", - "requestBody": { - "description": "New information about the planet", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Planet" - } - }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Planet" - } - } - } - }, - "parameters": [ - { - "$ref": "#/components/parameters/planetId" - } + "Registry" ], + "description": "Update metadata for an API document.", + "summary": "Update API Document metadata", + "operationId": "updateApiDocument", "responses": { "200": { - "description": "OK", + "description": "Default Response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Planet" + "type": "null" } - }, - "application/xml": { + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { "schema": { - "$ref": "#/components/schemas/Planet" + "$ref": "#/components/schemas/400" } } } }, - "400": { - "$ref": "#/components/responses/BadRequest" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, "403": { - "$ref": "#/components/responses/Forbidden" + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, "404": { - "$ref": "#/components/responses/NotFound" - } - }, - "x-codeSamples": [ - { - "lang": "csharp", - "label": "updatePlanet_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Components;\nusing System;\nusing System.Collections.Generic;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.UpdatePlanetJsonAsync(\n planetId: 1,\n planet: new PlanetInput() {\n Name = \"HD 40307g\",\n Description = \"The red planet\",\n Type = Scalar.CsharpSdk.Models.Components.Type.Terrestrial,\n HabitabilityIndex = 0.68F,\n PhysicalProperties = new PhysicalProperties() {\n Mass = 0.107F,\n Radius = 0.532F,\n Gravity = 0.378F,\n Temperature = new Temperature() {\n Min = 130F,\n Max = 308F,\n Average = 210F,\n },\n },\n Atmosphere = new List() {\n new Atmosphere() {\n Compound = \"N2\",\n Percentage = 95.3F,\n },\n },\n DiscoveredAt = System.DateTime.Parse(\"1610-01-07T00:00:00Z\"),\n Image = \"https://cdn.scalar.com/photos/mars.jpg\",\n Satellites = new List() {\n new Satellite() {\n Name = \"Phobos\",\n Diameter = 22.2F,\n },\n },\n Creator = new UserInput() {\n Name = \"Marc\",\n },\n Tags = new List() {\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackUrl = \"https://example.com/webhook\",\n }\n);\n\n// handle response" - }, - { - "lang": "csharp", - "label": "updatePlanet_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.UpdatePlanetRawAsync(\n planetId: 1,\n planet: System.Text.Encoding.UTF8.GetBytes(\"0xD0A6Bd2A9d\")\n);\n\n// handle response" - }, - { - "lang": "go", - "label": "updatePlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetJSON(ctx, 1, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "go", - "label": "updatePlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetRaw(ctx, 1, bytes.NewBuffer([]byte(\"0xdCF6474Ed3\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - { - "lang": "php", - "label": "updatePlanet_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\nuse scalar\\PhpSdk\\Utils;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$planet = new Components\\PlanetInput(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Components\\Type::Terrestrial,\n habitabilityIndex: 0.68,\n physicalProperties: new Components\\PhysicalProperties(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: new Components\\Temperature(\n min: 130,\n max: 308,\n average: 210,\n ),\n ),\n atmosphere: [\n new Components\\Atmosphere(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discoveredAt: Utils\\Utils::parseDateTime('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n new Components\\Satellite(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: new Components\\UserInput(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callbackUrl: 'https://example.com/webhook',\n);\n\n$response = $sdk->planets->updatePlanetJson(\n planetId: 1,\n planet: $planet\n\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "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": [ { - "lang": "php", - "label": "updatePlanet_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->updatePlanetRaw(\n planetId: 1,\n planet: '0xD0A6Bd2A9d'\n\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "python", - "label": "updatePlanet_json", - "source": "import scalar_python_sdk\nfrom scalar_python_sdk import ScalarPythonSDK\nfrom scalar_python_sdk.utils import parse_datetime\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.update_planet_json(planet_id=1, name=\"Mars\", description=\"The red planet\", type_=scalar_python_sdk.Type.TERRESTRIAL, habitability_index=0.68, physical_properties={\n \"mass\": 0.107,\n \"radius\": 0.532,\n \"gravity\": 0.378,\n \"temperature\": {\n \"min\": 130,\n \"max\": 308,\n \"average\": 210,\n },\n }, atmosphere=[\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n ], discovered_at=parse_datetime(\"1610-01-07T00:00:00Z\"), image=\"https://cdn.scalar.com/photos/mars.jpg\", satellites=[\n {\n \"name\": \"Phobos\",\n \"diameter\": 22.2,\n },\n ], creator={\n \"name\": \"Marc\",\n }, tags=[\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ], callback_url=\"https://example.com/webhook\")\n\n # Handle response\n print(res)" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "python", - "label": "updatePlanet_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.update_planet_raw(planet_id=1, planet=io.BytesIO(\"0xD0A6Bd2A9d\".encode()))\n\n # Handle response\n print(res)" + "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\", {});" }, { - "lang": "ruby", - "label": "updatePlanet_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.update_planet_json(planet_id=1, planet=Models::Shared::PlanetInput.new(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Models::Shared::Type::TERRESTRIAL,\n habitability_index: 0.68,\n physical_properties: Models::Shared::PhysicalProperties.new(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: Models::Shared::Temperature.new(\n min: 130.0,\n max: 308.0,\n average: 210.0,\n ),\n ),\n atmosphere: [\n Models::Shared::Atmosphere.new(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discovered_at: DateTime.iso8601('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n Models::Shared::Satellite.new(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: Models::Shared::UserInput.new(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callback_url: 'https://example.com/webhook',\n))\n\nif ! res.planet.nil?\n # handle response\nend" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry update-api-document 'namespace_' 'slug' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "ruby", - "label": "updatePlanet_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.update_planet_raw(planet_id=1, planet=\"0xD0A6Bd2A9d\".encode())\n\nif ! res.planet.nil?\n # handle response\nend" + "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)\nprint(registry)" }, { - "lang": "typescript", - "label": "updatePlanet_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.updatePlanetJson({\n planetId: 1,\n planet: {\n name: \"Mars\",\n description: \"The red planet\",\n type: \"terrestrial\",\n habitabilityIndex: 0.68,\n physicalProperties: {\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: {\n min: 130,\n max: 308,\n average: 210,\n },\n },\n atmosphere: [\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n ],\n discoveredAt: new Date(\"1610-01-07T00:00:00Z\"),\n image: \"https://cdn.scalar.com/photos/mars.jpg\",\n satellites: [\n {\n name: \"Phobos\",\n diameter: 22.2,\n },\n ],\n creator: {\n name: \"Marc\",\n },\n tags: [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n callbackUrl: \"https://example.com/webhook\",\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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}" }, { - "lang": "typescript", - "label": "updatePlanet_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.updatePlanetRaw({\n planetId: 1,\n planet: bytesToStream(new TextEncoder().encode(\"0xD0A6Bd2A9d\")),\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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);" }, { - "lang": "go", - "label": "updatePlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetJSON(ctx, 1, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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)" }, { - "lang": "go", - "label": "updatePlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetRaw(ctx, 1, bytes.NewBuffer([]byte(\"0xdCF6474Ed3\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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: \"\", description: \"\", is_private: false, ruleset: \"\" })\nputs response.inspect" + } + ] + }, + "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" + } + } + } }, - { - "lang": "csharp", - "label": "updatePlanet_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Components;\nusing System;\nusing System.Collections.Generic;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.UpdatePlanetJsonAsync(\n planetId: 1,\n planet: new PlanetInput() {\n Name = \"HD 40307g\",\n Description = \"The red planet\",\n Type = Scalar.CsharpSdk.Models.Components.Type.Terrestrial,\n HabitabilityIndex = 0.68F,\n PhysicalProperties = new PhysicalProperties() {\n Mass = 0.107F,\n Radius = 0.532F,\n Gravity = 0.378F,\n Temperature = new Temperature() {\n Min = 130F,\n Max = 308F,\n Average = 210F,\n },\n },\n Atmosphere = new List() {\n new Atmosphere() {\n Compound = \"N2\",\n Percentage = 95.3F,\n },\n },\n DiscoveredAt = System.DateTime.Parse(\"1610-01-07T00:00:00Z\"),\n Image = \"https://cdn.scalar.com/photos/mars.jpg\",\n Satellites = new List() {\n new Satellite() {\n Name = \"Phobos\",\n Diameter = 22.2F,\n },\n },\n Creator = new UserInput() {\n Name = \"Marc\",\n },\n Tags = new List() {\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackUrl = \"https://example.com/webhook\",\n }\n);\n\n// handle response" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "csharp", - "label": "updatePlanet_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.UpdatePlanetRawAsync(\n planetId: 1,\n planet: System.Text.Encoding.UTF8.GetBytes(\"0xD0A6Bd2A9d\")\n);\n\n// handle response" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "php", - "label": "updatePlanet_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\nuse scalar\\PhpSdk\\Utils;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$planet = new Components\\PlanetInput(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Components\\Type::Terrestrial,\n habitabilityIndex: 0.68,\n physicalProperties: new Components\\PhysicalProperties(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: new Components\\Temperature(\n min: 130,\n max: 308,\n average: 210,\n ),\n ),\n atmosphere: [\n new Components\\Atmosphere(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discoveredAt: Utils\\Utils::parseDateTime('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n new Components\\Satellite(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: new Components\\UserInput(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callbackUrl: 'https://example.com/webhook',\n);\n\n$response = $sdk->planets->updatePlanetJson(\n planetId: 1,\n planet: $planet\n\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "php", - "label": "updatePlanet_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->updatePlanetRaw(\n planetId: 1,\n planet: '0xD0A6Bd2A9d'\n\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "python", - "label": "updatePlanet_json", - "source": "import scalar_python_sdk\nfrom scalar_python_sdk import ScalarPythonSDK\nfrom scalar_python_sdk.utils import parse_datetime\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.update_planet_json(planet_id=1, name=\"Mars\", description=\"The red planet\", type_=scalar_python_sdk.Type.TERRESTRIAL, habitability_index=0.68, physical_properties={\n \"mass\": 0.107,\n \"radius\": 0.532,\n \"gravity\": 0.378,\n \"temperature\": {\n \"min\": 130,\n \"max\": 308,\n \"average\": 210,\n },\n }, atmosphere=[\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n ], discovered_at=parse_datetime(\"1610-01-07T00:00:00Z\"), image=\"https://cdn.scalar.com/photos/mars.jpg\", satellites=[\n {\n \"name\": \"Phobos\",\n \"diameter\": 22.2,\n },\n ], creator={\n \"name\": \"Marc\",\n }, tags=[\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ], callback_url=\"https://example.com/webhook\")\n\n # Handle response\n print(res)" + "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": [ { - "lang": "python", - "label": "updatePlanet_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.update_planet_raw(planet_id=1, planet=io.BytesIO(\"0xD0A6Bd2A9d\".encode()))\n\n # Handle response\n print(res)" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "ruby", - "label": "updatePlanet_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.update_planet_json(planet_id=1, planet=Models::Shared::PlanetInput.new(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Models::Shared::Type::TERRESTRIAL,\n habitability_index: 0.68,\n physical_properties: Models::Shared::PhysicalProperties.new(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: Models::Shared::Temperature.new(\n min: 130.0,\n max: 308.0,\n average: 210.0,\n ),\n ),\n atmosphere: [\n Models::Shared::Atmosphere.new(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discovered_at: DateTime.iso8601('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n Models::Shared::Satellite.new(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: Models::Shared::UserInput.new(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callback_url: 'https://example.com/webhook',\n))\n\nif ! res.planet.nil?\n # handle response\nend" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "ruby", - "label": "updatePlanet_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.update_planet_raw(planet_id=1, planet=\"0xD0A6Bd2A9d\".encode())\n\nif ! res.planet.nil?\n # handle response\nend" + "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\");" }, { - "lang": "typescript", - "label": "updatePlanet_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.updatePlanetJson({\n planetId: 1,\n planet: {\n name: \"Mars\",\n description: \"The red planet\",\n type: \"terrestrial\",\n habitabilityIndex: 0.68,\n physicalProperties: {\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: {\n min: 130,\n max: 308,\n average: 210,\n },\n },\n atmosphere: [\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n ],\n discoveredAt: new Date(\"1610-01-07T00:00:00Z\"),\n image: \"https://cdn.scalar.com/photos/mars.jpg\",\n satellites: [\n {\n name: \"Phobos\",\n diameter: 22.2,\n },\n ],\n creator: {\n name: \"Marc\",\n },\n tags: [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n callbackUrl: \"https://example.com/webhook\",\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry delete-api-document 'namespace_' 'slug' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "typescript", - "label": "updatePlanet_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.updatePlanetRaw({\n planetId: 1,\n planet: bytesToStream(new TextEncoder().encode(\"0xD0A6Bd2A9d\")),\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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)\nprint(registry)" }, { - "lang": "csharp", - "label": "updatePlanet_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Components;\nusing System;\nusing System.Collections.Generic;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.UpdatePlanetJsonAsync(\n planetId: 1,\n planet: new PlanetInput() {\n Name = \"HD 40307g\",\n Description = \"The red planet\",\n Type = Scalar.CsharpSdk.Models.Components.Type.Terrestrial,\n HabitabilityIndex = 0.68F,\n PhysicalProperties = new PhysicalProperties() {\n Mass = 0.107F,\n Radius = 0.532F,\n Gravity = 0.378F,\n Temperature = new Temperature() {\n Min = 130F,\n Max = 308F,\n Average = 210F,\n },\n },\n Atmosphere = new List() {\n new Atmosphere() {\n Compound = \"N2\",\n Percentage = 95.3F,\n },\n },\n DiscoveredAt = System.DateTime.Parse(\"1610-01-07T00:00:00Z\"),\n Image = \"https://cdn.scalar.com/photos/mars.jpg\",\n Satellites = new List() {\n new Satellite() {\n Name = \"Phobos\",\n Diameter = 22.2F,\n },\n },\n Creator = new UserInput() {\n Name = \"Marc\",\n },\n Tags = new List() {\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackUrl = \"https://example.com/webhook\",\n }\n);\n\n// handle response" + "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}" }, { - "lang": "csharp", - "label": "updatePlanet_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.UpdatePlanetRawAsync(\n planetId: 1,\n planet: System.Text.Encoding.UTF8.GetBytes(\"0xD0A6Bd2A9d\")\n);\n\n// handle response" + "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);" }, { - "lang": "go", - "label": "updatePlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetJSON(ctx, 1, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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)" }, { - "lang": "go", - "label": "updatePlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetRaw(ctx, 1, bytes.NewBuffer([]byte(\"0xdCF6474Ed3\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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" + } + ] + } + }, + "/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" + } + } + } }, - { - "lang": "go", - "label": "updatePlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetJSON(ctx, 1, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "go", - "label": "updatePlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetRaw(ctx, 1, bytes.NewBuffer([]byte(\"0xdCF6474Ed3\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "php", - "label": "updatePlanet_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\nuse scalar\\PhpSdk\\Utils;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$planet = new Components\\PlanetInput(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Components\\Type::Terrestrial,\n habitabilityIndex: 0.68,\n physicalProperties: new Components\\PhysicalProperties(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: new Components\\Temperature(\n min: 130,\n max: 308,\n average: 210,\n ),\n ),\n atmosphere: [\n new Components\\Atmosphere(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discoveredAt: Utils\\Utils::parseDateTime('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n new Components\\Satellite(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: new Components\\UserInput(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callbackUrl: 'https://example.com/webhook',\n);\n\n$response = $sdk->planets->updatePlanetJson(\n planetId: 1,\n planet: $planet\n\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "php", - "label": "updatePlanet_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->updatePlanetRaw(\n planetId: 1,\n planet: '0xD0A6Bd2A9d'\n\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "python", - "label": "updatePlanet_json", - "source": "import scalar_python_sdk\nfrom scalar_python_sdk import ScalarPythonSDK\nfrom scalar_python_sdk.utils import parse_datetime\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.update_planet_json(planet_id=1, name=\"Mars\", description=\"The red planet\", type_=scalar_python_sdk.Type.TERRESTRIAL, habitability_index=0.68, physical_properties={\n \"mass\": 0.107,\n \"radius\": 0.532,\n \"gravity\": 0.378,\n \"temperature\": {\n \"min\": 130,\n \"max\": 308,\n \"average\": 210,\n },\n }, atmosphere=[\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n ], discovered_at=parse_datetime(\"1610-01-07T00:00:00Z\"), image=\"https://cdn.scalar.com/photos/mars.jpg\", satellites=[\n {\n \"name\": \"Phobos\",\n \"diameter\": 22.2,\n },\n ], creator={\n \"name\": \"Marc\",\n }, tags=[\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ], callback_url=\"https://example.com/webhook\")\n\n # Handle response\n print(res)" + "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": [ { - "lang": "python", - "label": "updatePlanet_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.update_planet_raw(planet_id=1, planet=io.BytesIO(\"0xD0A6Bd2A9d\".encode()))\n\n # Handle response\n print(res)" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "ruby", - "label": "updatePlanet_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.update_planet_json(planet_id=1, planet=Models::Shared::PlanetInput.new(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Models::Shared::Type::TERRESTRIAL,\n habitability_index: 0.68,\n physical_properties: Models::Shared::PhysicalProperties.new(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: Models::Shared::Temperature.new(\n min: 130.0,\n max: 308.0,\n average: 210.0,\n ),\n ),\n atmosphere: [\n Models::Shared::Atmosphere.new(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discovered_at: DateTime.iso8601('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n Models::Shared::Satellite.new(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: Models::Shared::UserInput.new(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callback_url: 'https://example.com/webhook',\n))\n\nif ! res.planet.nil?\n # handle response\nend" + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true }, { - "lang": "ruby", - "label": "updatePlanet_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.update_planet_raw(planet_id=1, planet=\"0xD0A6Bd2A9d\".encode())\n\nif ! res.planet.nil?\n # handle response\nend" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "typescript", - "label": "updatePlanet_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.updatePlanetJson({\n planetId: 1,\n planet: {\n name: \"Mars\",\n description: \"The red planet\",\n type: \"terrestrial\",\n habitabilityIndex: 0.68,\n physicalProperties: {\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: {\n min: 130,\n max: 308,\n average: 210,\n },\n },\n atmosphere: [\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n ],\n discoveredAt: new Date(\"1610-01-07T00:00:00Z\"),\n image: \"https://cdn.scalar.com/photos/mars.jpg\",\n satellites: [\n {\n name: \"Phobos\",\n diameter: 22.2,\n },\n ],\n creator: {\n name: \"Marc\",\n },\n tags: [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n callbackUrl: \"https://example.com/webhook\",\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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_);" }, { - "lang": "typescript", - "label": "updatePlanet_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.updatePlanetRaw({\n planetId: 1,\n planet: bytesToStream(new TextEncoder().encode(\"0xD0A6Bd2A9d\")),\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry retrieve-api-document-version 'namespace_' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "go", - "label": "updatePlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetJSON(ctx, 1, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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)" }, { - "lang": "go", - "label": "updatePlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetRaw(ctx, 1, bytes.NewBuffer([]byte(\"0xdCF6474Ed3\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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}" }, { - "lang": "go", - "label": "updatePlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetJSON(ctx, 1, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\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);" }, { - "lang": "go", - "label": "updatePlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetRaw(ctx, 1, bytes.NewBuffer([]byte(\"0xdCF6474Ed3\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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)" }, { - "lang": "php", - "label": "updatePlanet_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\nuse scalar\\PhpSdk\\Utils;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$planet = new Components\\PlanetInput(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Components\\Type::Terrestrial,\n habitabilityIndex: 0.68,\n physicalProperties: new Components\\PhysicalProperties(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: new Components\\Temperature(\n min: 130,\n max: 308,\n average: 210,\n ),\n ),\n atmosphere: [\n new Components\\Atmosphere(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discoveredAt: Utils\\Utils::parseDateTime('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n new Components\\Satellite(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: new Components\\UserInput(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callbackUrl: 'https://example.com/webhook',\n);\n\n$response = $sdk->planets->updatePlanetJson(\n planetId: 1,\n planet: $planet\n\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "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" + } + ] + }, + "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 + } + } + } }, - { - "lang": "php", - "label": "updatePlanet_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->updatePlanetRaw(\n planetId: 1,\n planet: '0xD0A6Bd2A9d'\n\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "python", - "label": "updatePlanet_json", - "source": "import scalar_python_sdk\nfrom scalar_python_sdk import ScalarPythonSDK\nfrom scalar_python_sdk.utils import parse_datetime\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.update_planet_json(planet_id=1, name=\"Mars\", description=\"The red planet\", type_=scalar_python_sdk.Type.TERRESTRIAL, habitability_index=0.68, physical_properties={\n \"mass\": 0.107,\n \"radius\": 0.532,\n \"gravity\": 0.378,\n \"temperature\": {\n \"min\": 130,\n \"max\": 308,\n \"average\": 210,\n },\n }, atmosphere=[\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n ], discovered_at=parse_datetime(\"1610-01-07T00:00:00Z\"), image=\"https://cdn.scalar.com/photos/mars.jpg\", satellites=[\n {\n \"name\": \"Phobos\",\n \"diameter\": 22.2,\n },\n ], creator={\n \"name\": \"Marc\",\n }, tags=[\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ], callback_url=\"https://example.com/webhook\")\n\n # Handle response\n print(res)" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "python", - "label": "updatePlanet_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.update_planet_raw(planet_id=1, planet=io.BytesIO(\"0xD0A6Bd2A9d\".encode()))\n\n # Handle response\n print(res)" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "ruby", - "label": "updatePlanet_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.update_planet_json(planet_id=1, planet=Models::Shared::PlanetInput.new(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Models::Shared::Type::TERRESTRIAL,\n habitability_index: 0.68,\n physical_properties: Models::Shared::PhysicalProperties.new(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: Models::Shared::Temperature.new(\n min: 130.0,\n max: 308.0,\n average: 210.0,\n ),\n ),\n atmosphere: [\n Models::Shared::Atmosphere.new(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discovered_at: DateTime.iso8601('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n Models::Shared::Satellite.new(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: Models::Shared::UserInput.new(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callback_url: 'https://example.com/webhook',\n))\n\nif ! res.planet.nil?\n # handle response\nend" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "ruby", - "label": "updatePlanet_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.update_planet_raw(planet_id=1, planet=\"0xD0A6Bd2A9d\".encode())\n\nif ! res.planet.nil?\n # handle response\nend" + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - { - "lang": "typescript", - "label": "updatePlanet_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.updatePlanetJson({\n planetId: 1,\n planet: {\n name: \"Mars\",\n description: \"The red planet\",\n type: \"terrestrial\",\n habitabilityIndex: 0.68,\n physicalProperties: {\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: {\n min: 130,\n max: 308,\n average: 210,\n },\n },\n atmosphere: [\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n ],\n discoveredAt: new Date(\"1610-01-07T00:00:00Z\"),\n image: \"https://cdn.scalar.com/photos/mars.jpg\",\n satellites: [\n {\n name: \"Phobos\",\n diameter: 22.2,\n },\n ],\n creator: {\n name: \"Marc\",\n },\n tags: [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n callbackUrl: \"https://example.com/webhook\",\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "typescript", - "label": "updatePlanet_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.updatePlanetRaw({\n planetId: 1,\n planet: bytesToStream(new TextEncoder().encode(\"0xD0A6Bd2A9d\")),\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "go", - "label": "updatePlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetJSON(ctx, 1, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" - }, - { - "lang": "go", - "label": "updatePlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetRaw(ctx, 1, bytes.NewBuffer([]byte(\"0xdCF6474Ed3\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" - }, - { - "lang": "php", - "label": "updatePlanet_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\nuse scalar\\PhpSdk\\Utils;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$planet = new Components\\PlanetInput(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Components\\Type::Terrestrial,\n habitabilityIndex: 0.68,\n physicalProperties: new Components\\PhysicalProperties(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: new Components\\Temperature(\n min: 130,\n max: 308,\n average: 210,\n ),\n ),\n atmosphere: [\n new Components\\Atmosphere(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discoveredAt: Utils\\Utils::parseDateTime('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n new Components\\Satellite(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: new Components\\UserInput(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callbackUrl: 'https://example.com/webhook',\n);\n\n$response = $sdk->planets->updatePlanetJson(\n planetId: 1,\n planet: $planet\n\n);\n\nif ($response->planet !== null) {\n // handle response\n}" - }, - { - "lang": "php", - "label": "updatePlanet_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->updatePlanetRaw(\n planetId: 1,\n planet: '0xD0A6Bd2A9d'\n\n);\n\nif ($response->planet !== null) {\n // handle response\n}" - }, - { - "lang": "python", - "label": "updatePlanet_json", - "source": "import scalar_python_sdk\nfrom scalar_python_sdk import ScalarPythonSDK\nfrom scalar_python_sdk.utils import parse_datetime\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.update_planet_json(planet_id=1, name=\"Mars\", description=\"The red planet\", type_=scalar_python_sdk.Type.TERRESTRIAL, habitability_index=0.68, physical_properties={\n \"mass\": 0.107,\n \"radius\": 0.532,\n \"gravity\": 0.378,\n \"temperature\": {\n \"min\": 130,\n \"max\": 308,\n \"average\": 210,\n },\n }, atmosphere=[\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n ], discovered_at=parse_datetime(\"1610-01-07T00:00:00Z\"), image=\"https://cdn.scalar.com/photos/mars.jpg\", satellites=[\n {\n \"name\": \"Phobos\",\n \"diameter\": 22.2,\n },\n ], creator={\n \"name\": \"Marc\",\n }, tags=[\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ], callback_url=\"https://example.com/webhook\")\n\n # Handle response\n print(res)" - }, - { - "lang": "python", - "label": "updatePlanet_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.update_planet_raw(planet_id=1, planet=io.BytesIO(\"0xD0A6Bd2A9d\".encode()))\n\n # Handle response\n print(res)" - }, - { - "lang": "ruby", - "label": "updatePlanet_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.update_planet_json(planet_id=1, planet=Models::Shared::PlanetInput.new(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Models::Shared::Type::TERRESTRIAL,\n habitability_index: 0.68,\n physical_properties: Models::Shared::PhysicalProperties.new(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: Models::Shared::Temperature.new(\n min: 130.0,\n max: 308.0,\n average: 210.0,\n ),\n ),\n atmosphere: [\n Models::Shared::Atmosphere.new(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discovered_at: DateTime.iso8601('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n Models::Shared::Satellite.new(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: Models::Shared::UserInput.new(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callback_url: 'https://example.com/webhook',\n))\n\nif ! res.planet.nil?\n # handle response\nend" - }, - { - "lang": "ruby", - "label": "updatePlanet_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.update_planet_raw(planet_id=1, planet=\"0xD0A6Bd2A9d\".encode())\n\nif ! res.planet.nil?\n # handle response\nend" - }, - { - "lang": "typescript", - "label": "updatePlanet_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.updatePlanetJson({\n planetId: 1,\n planet: {\n name: \"Mars\",\n description: \"The red planet\",\n type: \"terrestrial\",\n habitabilityIndex: 0.68,\n physicalProperties: {\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: {\n min: 130,\n max: 308,\n average: 210,\n },\n },\n atmosphere: [\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n ],\n discoveredAt: new Date(\"1610-01-07T00:00:00Z\"),\n image: \"https://cdn.scalar.com/photos/mars.jpg\",\n satellites: [\n {\n name: \"Phobos\",\n diameter: 22.2,\n },\n ],\n creator: {\n name: \"Marc\",\n },\n tags: [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n callbackUrl: \"https://example.com/webhook\",\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "typescript", - "label": "updatePlanet_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.updatePlanetRaw({\n planetId: 1,\n planet: bytesToStream(new TextEncoder().encode(\"0xD0A6Bd2A9d\")),\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "csharp", - "label": "updatePlanet_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Components;\nusing System;\nusing System.Collections.Generic;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.UpdatePlanetJsonAsync(\n planetId: 1,\n planet: new PlanetInput() {\n Name = \"HD 40307g\",\n Description = \"The red planet\",\n Type = Scalar.CsharpSdk.Models.Components.Type.Terrestrial,\n HabitabilityIndex = 0.68F,\n PhysicalProperties = new PhysicalProperties() {\n Mass = 0.107F,\n Radius = 0.532F,\n Gravity = 0.378F,\n Temperature = new Temperature() {\n Min = 130F,\n Max = 308F,\n Average = 210F,\n },\n },\n Atmosphere = new List() {\n new Atmosphere() {\n Compound = \"N2\",\n Percentage = 95.3F,\n },\n },\n DiscoveredAt = System.DateTime.Parse(\"1610-01-07T00:00:00Z\"),\n Image = \"https://cdn.scalar.com/photos/mars.jpg\",\n Satellites = new List() {\n new Satellite() {\n Name = \"Phobos\",\n Diameter = 22.2F,\n },\n },\n Creator = new UserInput() {\n Name = \"Marc\",\n },\n Tags = new List() {\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackUrl = \"https://example.com/webhook\",\n }\n);\n\n// handle response" - }, - { - "lang": "csharp", - "label": "updatePlanet_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.UpdatePlanetRawAsync(\n planetId: 1,\n planet: System.Text.Encoding.UTF8.GetBytes(\"0xD0A6Bd2A9d\")\n);\n\n// handle response" - }, - { - "lang": "go", - "label": "updatePlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetJSON(ctx, 1, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" - }, - { - "lang": "go", - "label": "updatePlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetRaw(ctx, 1, bytes.NewBuffer([]byte(\"0xdCF6474Ed3\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" - }, - { - "lang": "php", - "label": "updatePlanet_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\nuse scalar\\PhpSdk\\Utils;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$planet = new Components\\PlanetInput(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Components\\Type::Terrestrial,\n habitabilityIndex: 0.68,\n physicalProperties: new Components\\PhysicalProperties(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: new Components\\Temperature(\n min: 130,\n max: 308,\n average: 210,\n ),\n ),\n atmosphere: [\n new Components\\Atmosphere(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discoveredAt: Utils\\Utils::parseDateTime('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n new Components\\Satellite(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: new Components\\UserInput(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callbackUrl: 'https://example.com/webhook',\n);\n\n$response = $sdk->planets->updatePlanetJson(\n planetId: 1,\n planet: $planet\n\n);\n\nif ($response->planet !== null) {\n // handle response\n}" - }, - { - "lang": "php", - "label": "updatePlanet_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->updatePlanetRaw(\n planetId: 1,\n planet: '0xD0A6Bd2A9d'\n\n);\n\nif ($response->planet !== null) {\n // handle response\n}" + "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": [ { - "lang": "java", - "label": "updatePlanet_json", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport java.time.OffsetDateTime;\nimport java.util.List;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.components.*;\nimport org.scalar.java_sdk.models.operations.UpdatePlanetJsonResponse;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n UpdatePlanetJsonResponse res = sdk.planets().updatePlanetJson()\n .planetId(1L)\n .planet(PlanetInput.builder()\n .name(\"Mars\")\n .description(\"The red planet\")\n .type(Type.TERRESTRIAL)\n .habitabilityIndex(0.68f)\n .physicalProperties(PhysicalProperties.builder()\n .mass(0.107f)\n .radius(0.532f)\n .gravity(0.378f)\n .temperature(Temperature.builder()\n .min(130f)\n .max(308f)\n .average(210f)\n .build())\n .build())\n .atmosphere(List.of(\n Atmosphere.builder()\n .compound(\"CO2\")\n .percentage(95.3f)\n .build(),\n Atmosphere.builder()\n .compound(\"CO2\")\n .percentage(95.3f)\n .build(),\n Atmosphere.builder()\n .compound(\"CO2\")\n .percentage(95.3f)\n .build()))\n .discoveredAt(OffsetDateTime.parse(\"1610-01-07T00:00:00Z\"))\n .image(\"https://cdn.scalar.com/photos/mars.jpg\")\n .satellites(List.of(\n Satellite.builder()\n .name(\"Phobos\")\n .diameter(22.2f)\n .build()))\n .creator(UserInput.builder()\n .name(\"Marc\")\n .build())\n .tags(List.of(\n \"solar-system\",\n \"rocky\",\n \"explored\"))\n .callbackUrl(\"https://example.com/webhook\")\n .build())\n .call();\n\n if (res.planet().isPresent()) {\n // handle response\n }\n }\n}" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "java", - "label": "updatePlanet_raw", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport java.nio.charset.StandardCharsets;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.operations.UpdatePlanetRawResponse;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n UpdatePlanetRawResponse res = sdk.planets().updatePlanetRaw()\n .planetId(1L)\n .planet(\"0xD0A6Bd2A9d\".getBytes(StandardCharsets.UTF_8))\n .call();\n\n if (res.planet().isPresent()) {\n // handle response\n }\n }\n}" + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true }, { - "lang": "python", - "label": "updatePlanet_json", - "source": "import scalar_python_sdk\nfrom scalar_python_sdk import ScalarPythonSDK\nfrom scalar_python_sdk.utils import parse_datetime\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.update_planet_json(planet_id=1, name=\"Mars\", description=\"The red planet\", type_=scalar_python_sdk.Type.TERRESTRIAL, habitability_index=0.68, physical_properties={\n \"mass\": 0.107,\n \"radius\": 0.532,\n \"gravity\": 0.378,\n \"temperature\": {\n \"min\": 130,\n \"max\": 308,\n \"average\": 210,\n },\n }, atmosphere=[\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n {\n \"compound\": \"CO2\",\n \"percentage\": 95.3,\n },\n ], discovered_at=parse_datetime(\"1610-01-07T00:00:00Z\"), image=\"https://cdn.scalar.com/photos/mars.jpg\", satellites=[\n {\n \"name\": \"Phobos\",\n \"diameter\": 22.2,\n },\n ], creator={\n \"name\": \"Marc\",\n }, tags=[\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ], callback_url=\"https://example.com/webhook\")\n\n # Handle response\n print(res)" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "python", - "label": "updatePlanet_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.update_planet_raw(planet_id=1, planet=io.BytesIO(\"0xD0A6Bd2A9d\".encode()))\n\n # Handle response\n print(res)" + "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);" }, { - "lang": "ruby", - "label": "updatePlanet_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.update_planet_json(planet_id=1, planet=Models::Shared::PlanetInput.new(\n name: 'HD 40307g',\n description: 'The red planet',\n type: Models::Shared::Type::TERRESTRIAL,\n habitability_index: 0.68,\n physical_properties: Models::Shared::PhysicalProperties.new(\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: Models::Shared::Temperature.new(\n min: 130.0,\n max: 308.0,\n average: 210.0,\n ),\n ),\n atmosphere: [\n Models::Shared::Atmosphere.new(\n compound: 'N2',\n percentage: 95.3,\n ),\n ],\n discovered_at: DateTime.iso8601('1610-01-07T00:00:00Z'),\n image: 'https://cdn.scalar.com/photos/mars.jpg',\n satellites: [\n Models::Shared::Satellite.new(\n name: 'Phobos',\n diameter: 22.2,\n ),\n ],\n creator: Models::Shared::UserInput.new(\n name: 'Marc',\n ),\n tags: [\n 'solar-system',\n 'rocky',\n 'explored',\n ],\n callback_url: 'https://example.com/webhook',\n))\n\nif ! res.planet.nil?\n # handle response\nend" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry update-api-document-version 'namespace_' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\" --document 'document'" }, { - "lang": "ruby", - "label": "updatePlanet_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.update_planet_raw(planet_id=1, planet=\"0xD0A6Bd2A9d\".encode())\n\nif ! res.planet.nil?\n # handle response\nend" + "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)\nprint(registry)" }, { - "lang": "typescript", - "label": "updatePlanet_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.updatePlanetJson({\n planetId: 1,\n planet: {\n name: \"Mars\",\n description: \"The red planet\",\n type: \"terrestrial\",\n habitabilityIndex: 0.68,\n physicalProperties: {\n mass: 0.107,\n radius: 0.532,\n gravity: 0.378,\n temperature: {\n min: 130,\n max: 308,\n average: 210,\n },\n },\n atmosphere: [\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n {\n compound: \"CO2\",\n percentage: 95.3,\n },\n ],\n discoveredAt: new Date(\"1610-01-07T00:00:00Z\"),\n image: \"https://cdn.scalar.com/photos/mars.jpg\",\n satellites: [\n {\n name: \"Phobos\",\n diameter: 22.2,\n },\n ],\n creator: {\n name: \"Marc\",\n },\n tags: [\n \"solar-system\",\n \"rocky\",\n \"explored\",\n ],\n callbackUrl: \"https://example.com/webhook\",\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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: sdk.F[string](\"\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" }, { - "lang": "typescript", - "label": "updatePlanet_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.updatePlanetRaw({\n planetId: 1,\n planet: bytesToStream(new TextEncoder().encode(\"0xD0A6Bd2A9d\")),\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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);" }, { - "lang": "go", - "label": "updatePlanet_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/types\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetJSON(ctx, 1, &shared.PlanetInput{\n Name: \"Mars\",\n Description: gosdk.String(\"The red planet\"),\n Type: shared.TypeTerrestrial.ToPointer(),\n HabitabilityIndex: gosdk.Float32(0.68),\n PhysicalProperties: &shared.PhysicalProperties{\n Mass: gosdk.Float32(0.107),\n Radius: gosdk.Float32(0.532),\n Gravity: gosdk.Float32(0.378),\n Temperature: &shared.Temperature{\n Min: gosdk.Float32(130),\n Max: gosdk.Float32(308),\n Average: gosdk.Float32(210),\n },\n },\n Atmosphere: []shared.Atmosphere{\n shared.Atmosphere{\n Compound: gosdk.String(\"CO2\"),\n Percentage: gosdk.Float32(95.3),\n },\n },\n DiscoveredAt: types.MustNewTimeFromString(\"1610-01-07T00:00:00Z\"),\n Image: gosdk.String(\"https://cdn.scalar.com/photos/mars.jpg\"),\n Satellites: []shared.Satellite{\n shared.Satellite{\n Name: \"Phobos\",\n Diameter: gosdk.Float32(22.2),\n },\n },\n Creator: &shared.UserInput{\n Name: gosdk.String(\"Marc\"),\n },\n Tags: []string{\n \"solar-system\",\n \"rocky\",\n \"explored\",\n },\n CallbackURL: gosdk.String(\"https://example.com/webhook\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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)" }, { - "lang": "go", - "label": "updatePlanet_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.UpdatePlanetRaw(ctx, 1, bytes.NewBuffer([]byte(\"{\\\"name\\\":\\\"Mars\\\",\\\"description\\\":\\\"The red planet\\\",\\\"type\\\":\\\"terrestrial\\\",\\\"habitabilityIndex\\\":0.68,\\\"physicalProperties\\\":{\\\"mass\\\":0.107,\\\"radius\\\":0.532,\\\"gravity\\\":0.378,\\\"temperature\\\":{\\\"min\\\":130,\\\"max\\\":308,\\\"average\\\":210}},\\\"atmosphere\\\":[{\\\"compound\\\":\\\"CO2\\\",\\\"percentage\\\":95.3}],\\\"discoveredAt\\\":\\\"1610-01-07T00:00:00Z\\\",\\\"image\\\":\\\"https://cdn.scalar.com/photos/mars.jpg\\\",\\\"satellites\\\":[{\\\"name\\\":\\\"Phobos\\\",\\\"diameter\\\":22.2}],\\\"creator\\\":{\\\"name\\\":\\\"Marc\\\"},\\\"tags\\\":[\\\"solar-system\\\",\\\"rocky\\\",\\\"explored\\\"],\\\"callbackUrl\\\":\\\"https://example.com/webhook\\\"}\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Planet != nil {\n // handle response\n }\n}" + "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: \"\", last_known_version_sha: \"\" })\nputs response.inspect" } ] }, "delete": { "tags": [ - "Planets" - ], - "summary": "Delete a planet", - "operationId": "deletePlanet", - "description": "This endpoint was used to delete planets. Unfortunately, that caused a lot of trouble for planets with life. So, this endpoint is now deprecated and should not be used anymore.", - "x-scalar-stability": "experimental", - "parameters": [ - { - "$ref": "#/components/parameters/planetId" - } + "Registry" ], + "description": "Delete a specific API document version.", + "summary": "Delete API Document version", + "operationId": "deleteApiDocumentVersion", "responses": { - "204": { - "description": "No Content" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - }, - "x-codeSamples": [ - { - "lang": "csharp", - "label": "deletePlanet", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.DeletePlanetAsync(planetId: 1);\n\n// handle response" - }, - { - "lang": "go", - "label": "deletePlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.DeletePlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - }, - { - "lang": "php", - "label": "deletePlanet", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->deletePlanet(\n planetId: 1\n);\n\nif ($response->statusCode === 200) {\n // handle response\n}" - }, - { - "lang": "python", - "label": "deletePlanet", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n sps_client.planets.delete_planet(planet_id=1)\n\n # Use the SDK ..." - }, - { - "lang": "ruby", - "label": "deletePlanet", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.delete_planet(planet_id=1)\n\nif res.status_code == 200\n # handle response\nend" - }, - { - "lang": "typescript", - "label": "deletePlanet", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n await scalarTypescriptSDK.planets.deletePlanet({\n planetId: 1,\n });\n\n\n}\n\nrun();" - }, - { - "lang": "go", - "label": "deletePlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.DeletePlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - }, - { - "lang": "csharp", - "label": "deletePlanet", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.DeletePlanetAsync(planetId: 1);\n\n// handle response" + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } }, - { - "lang": "php", - "label": "deletePlanet", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->deletePlanet(\n planetId: 1\n);\n\nif ($response->statusCode === 200) {\n // handle response\n}" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "python", - "label": "deletePlanet", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n sps_client.planets.delete_planet(planet_id=1)\n\n # Use the SDK ..." + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "ruby", - "label": "deletePlanet", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.delete_planet(planet_id=1)\n\nif res.status_code == 200\n # handle response\nend" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "typescript", - "label": "deletePlanet", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n await scalarTypescriptSDK.planets.deletePlanet({\n planetId: 1,\n });\n\n\n}\n\nrun();" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "csharp", - "label": "deletePlanet", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.DeletePlanetAsync(planetId: 1);\n\n// handle response" + "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": [ { - "lang": "go", - "label": "deletePlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.DeletePlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "go", - "label": "deletePlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.DeletePlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true }, { - "lang": "php", - "label": "deletePlanet", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->deletePlanet(\n planetId: 1\n);\n\nif ($response->statusCode === 200) {\n // handle response\n}" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "python", - "label": "deletePlanet", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n sps_client.planets.delete_planet(planet_id=1)\n\n # Use the SDK ..." + "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\");" }, { - "lang": "ruby", - "label": "deletePlanet", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.delete_planet(planet_id=1)\n\nif res.status_code == 200\n # handle response\nend" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry delete-api-document-version 'namespace_' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "typescript", - "label": "deletePlanet", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n await scalarTypescriptSDK.planets.deletePlanet({\n planetId: 1,\n });\n\n\n}\n\nrun();" + "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)\nprint(registry)" }, { - "lang": "go", - "label": "deletePlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.DeletePlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + "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}" }, { - "lang": "go", - "label": "deletePlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.DeletePlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\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);" }, { - "lang": "php", - "label": "deletePlanet", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->deletePlanet(\n planetId: 1\n);\n\nif ($response->statusCode === 200) {\n // handle response\n}" + "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)" }, { - "lang": "python", - "label": "deletePlanet", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n sps_client.planets.delete_planet(planet_id=1)\n\n # Use the SDK ..." + "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" + } + ] + } + }, + "/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" + } + } + } }, - { - "lang": "ruby", - "label": "deletePlanet", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.delete_planet(planet_id=1)\n\nif res.status_code == 200\n # handle response\nend" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "typescript", - "label": "deletePlanet", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n await scalarTypescriptSDK.planets.deletePlanet({\n planetId: 1,\n });\n\n\n}\n\nrun();" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "go", - "label": "deletePlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.DeletePlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "php", - "label": "deletePlanet", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->deletePlanet(\n planetId: 1\n);\n\nif ($response->statusCode === 200) {\n // handle response\n}" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "python", - "label": "deletePlanet", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n sps_client.planets.delete_planet(planet_id=1)\n\n # Use the SDK ..." + "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": [ { - "lang": "ruby", - "label": "deletePlanet", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.delete_planet(planet_id=1)\n\nif res.status_code == 200\n # handle response\nend" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "typescript", - "label": "deletePlanet", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n await scalarTypescriptSDK.planets.deletePlanet({\n planetId: 1,\n });\n\n\n}\n\nrun();" + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true }, { - "lang": "csharp", - "label": "deletePlanet", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.DeletePlanetAsync(planetId: 1);\n\n// handle response" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "go", - "label": "deletePlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.DeletePlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + "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 listAPIDocumentVersionMetadata = await client.registry.listAPIDocumentVersionMetadata(\"namespace\", \"slug\", \"semver\");\nconsole.log(listAPIDocumentVersionMetadata);" }, { - "lang": "php", - "label": "deletePlanet", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->planets->deletePlanet(\n planetId: 1\n);\n\nif ($response->statusCode === 200) {\n // handle response\n}" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry list-api-document-version-metadata 'namespace_' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "java", - "label": "deletePlanet", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.operations.DeletePlanetResponse;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n DeletePlanetResponse res = sdk.planets().deletePlanet()\n .planetId(1L)\n .call();\n\n // handle response\n }\n}" + "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)" }, { - "lang": "python", - "label": "deletePlanet", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n sps_client.planets.delete_planet(planet_id=1)\n\n # Use the SDK ..." + "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}" }, { - "lang": "ruby", - "label": "deletePlanet", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.delete_planet(planet_id=1)\n\nif res.status_code == 200\n # handle response\nend" + "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);" }, { - "lang": "typescript", - "label": "deletePlanet", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n await scalarTypescriptSDK.planets.deletePlanet({\n planetId: 1,\n });\n\n\n}\n\nrun();" + "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)" }, { - "lang": "go", - "label": "deletePlanet", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Planets.DeletePlanet(ctx, 1)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + "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" } ] } }, - "/planets/{planetId}/image": { + "/v1/apis/{namespace}/{slug}/version": { "post": { "tags": [ - "Planets" + "Registry" ], - "summary": "Upload an image to a planet", - "description": "Got a crazy good photo of a planet? Share it with the world!", - "operationId": "uploadImage", - "parameters": [ - { - "$ref": "#/components/parameters/planetId" - } - ], - "requestBody": { - "description": "Image to upload", - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "properties": { - "image": { - "type": "string", - "format": "binary", - "description": "The image file to upload", - "examples": [ - "@mars.jpg", - "@jupiter.png" - ] - } - } - } - } - } - }, + "description": "Create a new API document version.", + "summary": "Create API Document version", + "operationId": "createApiDocumentVersion", "responses": { "200": { - "$ref": "#/components/responses/ImageUploaded" + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/managed-doc-version" + } + } + } }, "400": { - "$ref": "#/components/responses/BadRequest" + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, "403": { - "$ref": "#/components/responses/Forbidden" + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, "404": { - "$ref": "#/components/responses/NotFound" + "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": [ - { - "lang": "csharp", - "label": "uploadImage", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Requests;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.UploadImageAsync(\n planetId: 1,\n requestBody: new UploadImageRequestBody() {\n Image = new Image() {\n FileName = \"example.file\",\n Content = System.Text.Encoding.UTF8.GetBytes(\"0x0c92e741F1\"),\n },\n }\n);\n\n// handle response" + "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": [ { - "lang": "go", - "label": "uploadImage", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"os\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n content, fileErr := os.Open(\"example.file\")\n if fileErr != nil {\n panic(fileErr)\n }\n\n\n res, err := s.Planets.UploadImage(ctx, 1, &operations.UploadImageRequestBody{\n Image: &operations.Image{\n FileName: \"example.file\",\n Content: content,\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.ImageUploadedMessage != nil {\n // handle response\n }\n}" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "php", - "label": "uploadImage", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Operations;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$requestBody = new Operations\\UploadImageRequestBody(\n image: new Operations\\Image(\n fileName: 'example.file',\n content: '0x0c92e741F1',\n ),\n);\n\n$response = $sdk->planets->uploadImage(\n planetId: 1,\n requestBody: $requestBody\n\n);\n\nif ($response->imageUploadedMessage !== null) {\n // handle response\n}" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "python", - "label": "uploadImage", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.upload_image(planet_id=1, image={\n \"file_name\": \"example.file\",\n \"content\": open(\"example.file\", \"rb\"),\n })\n\n # Handle response\n print(res)" + "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 createAPIDocumentVersion = await client.registry.createAPIDocumentVersion(\"namespace\", \"slug\", {\n version: \"x\",\n document: \"\",\n});\nconsole.log(createAPIDocumentVersion);" }, { - "lang": "ruby", - "label": "uploadImage", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.upload_image(planet_id=1, request_body=Models::Operations::UploadImageRequestBody.new(\n image: Models::Operations::Image.new(\n file_name: 'example.file',\n content: \"0x0c92e741F1\".encode(),\n ),\n))\n\nif ! res.image_uploaded_message.nil?\n # handle response\nend" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry create-api-document-version 'namespace_' 'slug' --bearer-auth \"$BEARER_AUTH\" --version-command 'version' --document 'document'" }, { - "lang": "typescript", - "label": "uploadImage", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\nimport { openAsBlob } from \"node:fs\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.uploadImage({\n planetId: 1,\n requestBody: {\n image: await openAsBlob(\"example.file\"),\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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=\"x\",\n document=\"\",\n)\nprint(registry)" }, { - "lang": "go", - "label": "uploadImage", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"os\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n content, fileErr := os.Open(\"example.file\")\n if fileErr != nil {\n panic(fileErr)\n }\n\n\n res, err := s.Planets.UploadImage(ctx, 1, &operations.UploadImageRequestBody{\n Image: &operations.Image{\n FileName: \"example.file\",\n Content: content,\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.ImageUploadedMessage != nil {\n // handle response\n }\n}" + "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: sdk.F[string](\"\"),\n\t\tVersion: sdk.F[string](\"x\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" }, { - "lang": "csharp", - "label": "uploadImage", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Requests;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.UploadImageAsync(\n planetId: 1,\n requestBody: new UploadImageRequestBody() {\n Image = new Image() {\n FileName = \"example.file\",\n Content = System.Text.Encoding.UTF8.GetBytes(\"0x0c92e741F1\"),\n },\n }\n);\n\n// handle response" + "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);" }, { - "lang": "php", - "label": "uploadImage", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Operations;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$requestBody = new Operations\\UploadImageRequestBody(\n image: new Operations\\Image(\n fileName: 'example.file',\n content: '0x0c92e741F1',\n ),\n);\n\n$response = $sdk->planets->uploadImage(\n planetId: 1,\n requestBody: $requestBody\n\n);\n\nif ($response->imageUploadedMessage !== null) {\n // handle response\n}" + "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)" }, { - "lang": "python", - "label": "uploadImage", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.upload_image(planet_id=1, image={\n \"file_name\": \"example.file\",\n \"content\": open(\"example.file\", \"rb\"),\n })\n\n # Handle response\n print(res)" + "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: \"x\", document: \"\", force: false, last_known_version_sha: \"\" })\nputs response.inspect" + } + ] + } + }, + "/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" + } + } + } }, - { - "lang": "ruby", - "label": "uploadImage", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.upload_image(planet_id=1, request_body=Models::Operations::UploadImageRequestBody.new(\n image: Models::Operations::Image.new(\n file_name: 'example.file',\n content: \"0x0c92e741F1\".encode(),\n ),\n))\n\nif ! res.image_uploaded_message.nil?\n # handle response\nend" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "typescript", - "label": "uploadImage", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\nimport { openAsBlob } from \"node:fs\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.uploadImage({\n planetId: 1,\n requestBody: {\n image: await openAsBlob(\"example.file\"),\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "csharp", - "label": "uploadImage", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Requests;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.UploadImageAsync(\n planetId: 1,\n requestBody: new UploadImageRequestBody() {\n Image = new Image() {\n FileName = \"example.file\",\n Content = System.Text.Encoding.UTF8.GetBytes(\"0x0c92e741F1\"),\n },\n }\n);\n\n// handle response" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "go", - "label": "uploadImage", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"os\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n content, fileErr := os.Open(\"example.file\")\n if fileErr != nil {\n panic(fileErr)\n }\n\n\n res, err := s.Planets.UploadImage(ctx, 1, &operations.UploadImageRequestBody{\n Image: &operations.Image{\n FileName: \"example.file\",\n Content: content,\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.ImageUploadedMessage != nil {\n // handle response\n }\n}" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "go", - "label": "uploadImage", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"os\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n content, fileErr := os.Open(\"example.file\")\n if fileErr != nil {\n panic(fileErr)\n }\n\n\n res, err := s.Planets.UploadImage(ctx, 1, &operations.UploadImageRequestBody{\n Image: &operations.Image{\n FileName: \"example.file\",\n Content: content,\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.ImageUploadedMessage != nil {\n // handle response\n }\n}" + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - { - "lang": "php", - "label": "uploadImage", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Operations;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$requestBody = new Operations\\UploadImageRequestBody(\n image: new Operations\\Image(\n fileName: 'example.file',\n content: '0x0c92e741F1',\n ),\n);\n\n$response = $sdk->planets->uploadImage(\n planetId: 1,\n requestBody: $requestBody\n\n);\n\nif ($response->imageUploadedMessage !== null) {\n // handle response\n}" + "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": [ { - "lang": "python", - "label": "uploadImage", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.upload_image(planet_id=1, image={\n \"file_name\": \"example.file\",\n \"content\": open(\"example.file\", \"rb\"),\n })\n\n # Handle response\n print(res)" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "ruby", - "label": "uploadImage", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.upload_image(planet_id=1, request_body=Models::Operations::UploadImageRequestBody.new(\n image: Models::Operations::Image.new(\n file_name: 'example.file',\n content: \"0x0c92e741F1\".encode(),\n ),\n))\n\nif ! res.image_uploaded_message.nil?\n # handle response\nend" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "typescript", - "label": "uploadImage", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\nimport { openAsBlob } from \"node:fs\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.uploadImage({\n planetId: 1,\n requestBody: {\n image: await openAsBlob(\"example.file\"),\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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: \"xxx\",\n});" }, { - "lang": "go", - "label": "uploadImage", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"os\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n content, fileErr := os.Open(\"example.file\")\n if fileErr != nil {\n panic(fileErr)\n }\n\n\n res, err := s.Planets.UploadImage(ctx, 1, &operations.UploadImageRequestBody{\n Image: &operations.Image{\n FileName: \"example.file\",\n Content: content,\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.ImageUploadedMessage != nil {\n // handle response\n }\n}" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry create-api-document-access-group 'namespace_' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" }, { - "lang": "go", - "label": "uploadImage", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"os\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n content, fileErr := os.Open(\"example.file\")\n if fileErr != nil {\n panic(fileErr)\n }\n\n\n res, err := s.Planets.UploadImage(ctx, 1, &operations.UploadImageRequestBody{\n Image: &operations.Image{\n FileName: \"example.file\",\n Content: content,\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.ImageUploadedMessage != nil {\n // handle response\n }\n}" + "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=\"xxx\",\n)\nprint(registry)" }, { - "lang": "php", - "label": "uploadImage", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Operations;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$requestBody = new Operations\\UploadImageRequestBody(\n image: new Operations\\Image(\n fileName: 'example.file',\n content: '0x0c92e741F1',\n ),\n);\n\n$response = $sdk->planets->uploadImage(\n planetId: 1,\n requestBody: $requestBody\n\n);\n\nif ($response->imageUploadedMessage !== null) {\n // handle response\n}" + "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: sdk.F[string](\"xxx\"),\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" }, { - "lang": "python", - "label": "uploadImage", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.upload_image(planet_id=1, image={\n \"file_name\": \"example.file\",\n \"content\": open(\"example.file\", \"rb\"),\n })\n\n # Handle response\n print(res)" + "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);" }, { - "lang": "ruby", - "label": "uploadImage", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.upload_image(planet_id=1, request_body=Models::Operations::UploadImageRequestBody.new(\n image: Models::Operations::Image.new(\n file_name: 'example.file',\n content: \"0x0c92e741F1\".encode(),\n ),\n))\n\nif ! res.image_uploaded_message.nil?\n # handle response\nend" + "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)" }, { - "lang": "typescript", - "label": "uploadImage", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\nimport { openAsBlob } from \"node:fs\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.uploadImage({\n planetId: 1,\n requestBody: {\n image: await openAsBlob(\"example.file\"),\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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: \"xxx\" })\nputs response.inspect" + } + ] + }, + "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" + } + } + } }, - { - "lang": "go", - "label": "uploadImage", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"os\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n content, fileErr := os.Open(\"example.file\")\n if fileErr != nil {\n panic(fileErr)\n }\n\n\n res, err := s.Planets.UploadImage(ctx, 1, &operations.UploadImageRequestBody{\n Image: &operations.Image{\n FileName: \"example.file\",\n Content: content,\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.ImageUploadedMessage != nil {\n // handle response\n }\n}" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "php", - "label": "uploadImage", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Operations;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$requestBody = new Operations\\UploadImageRequestBody(\n image: new Operations\\Image(\n fileName: 'example.file',\n content: '0x0c92e741F1',\n ),\n);\n\n$response = $sdk->planets->uploadImage(\n planetId: 1,\n requestBody: $requestBody\n\n);\n\nif ($response->imageUploadedMessage !== null) {\n // handle response\n}" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "python", - "label": "uploadImage", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.upload_image(planet_id=1, image={\n \"file_name\": \"example.file\",\n \"content\": open(\"example.file\", \"rb\"),\n })\n\n # Handle response\n print(res)" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "ruby", - "label": "uploadImage", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.upload_image(planet_id=1, request_body=Models::Operations::UploadImageRequestBody.new(\n image: Models::Operations::Image.new(\n file_name: 'example.file',\n content: \"0x0c92e741F1\".encode(),\n ),\n))\n\nif ! res.image_uploaded_message.nil?\n # handle response\nend" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "typescript", - "label": "uploadImage", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\nimport { openAsBlob } from \"node:fs\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.uploadImage({\n planetId: 1,\n requestBody: {\n image: await openAsBlob(\"example.file\"),\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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": [ { - "lang": "csharp", - "label": "uploadImage", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Requests;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Planets.UploadImageAsync(\n planetId: 1,\n requestBody: new UploadImageRequestBody() {\n Image = new Image() {\n FileName = \"example.file\",\n Content = System.Text.Encoding.UTF8.GetBytes(\"0x0c92e741F1\"),\n },\n }\n);\n\n// handle response" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "go", - "label": "uploadImage", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"os\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n content, fileErr := os.Open(\"example.file\")\n if fileErr != nil {\n panic(fileErr)\n }\n\n\n res, err := s.Planets.UploadImage(ctx, 1, &operations.UploadImageRequestBody{\n Image: &operations.Image{\n FileName: \"example.file\",\n Content: content,\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.ImageUploadedMessage != nil {\n // handle response\n }\n}" + "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: \"xxx\",\n});" }, { - "lang": "php", - "label": "uploadImage", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Operations;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$requestBody = new Operations\\UploadImageRequestBody(\n image: new Operations\\Image(\n fileName: 'example.file',\n content: '0x0c92e741F1',\n ),\n);\n\n$response = $sdk->planets->uploadImage(\n planetId: 1,\n requestBody: $requestBody\n\n);\n\nif ($response->imageUploadedMessage !== null) {\n // handle response\n}" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi registry delete-api-document-access-group 'namespace_' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" }, { - "lang": "java", - "label": "uploadImage", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport java.nio.charset.StandardCharsets;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.operations.*;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n UploadImageResponse res = sdk.planets().uploadImage()\n .planetId(1L)\n .requestBody(UploadImageRequestBody.builder()\n .image(Image.builder()\n .fileName(\"example.file\")\n .content(\"0xA0c92e741F\".getBytes(StandardCharsets.UTF_8))\n .build())\n .build())\n .call();\n\n if (res.imageUploadedMessage().isPresent()) {\n // handle response\n }\n }\n}" + "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=\"xxx\",\n)\nprint(registry)" }, { - "lang": "python", - "label": "uploadImage", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.planets.upload_image(planet_id=1, image={\n \"file_name\": \"example.file\",\n \"content\": open(\"example.file\", \"rb\"),\n })\n\n # Handle response\n print(res)" + "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: sdk.F[string](\"xxx\"),\n\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(registry)\n}" }, { - "lang": "ruby", - "label": "uploadImage", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.planets.upload_image(planet_id=1, request_body=Models::Operations::UploadImageRequestBody.new(\n image: Models::Operations::Image.new(\n file_name: 'example.file',\n content: \"0x0c92e741F1\".encode(),\n ),\n))\n\nif ! res.image_uploaded_message.nil?\n # handle response\nend" + "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);" }, { - "lang": "typescript", - "label": "uploadImage", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\nimport { openAsBlob } from \"node:fs\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.planets.uploadImage({\n planetId: 1,\n requestBody: {\n image: await openAsBlob(\"example.file\"),\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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)" }, { - "lang": "go", - "label": "uploadImage", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"os\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n example, fileErr := os.Open(\"example.file\")\n if fileErr != nil {\n panic(fileErr)\n }\n\n res, err := s.Planets.UploadImage(ctx, 1, &operations.UploadImageRequestBody{\n Image: &operations.Image{\n FileName: \"example.file\",\n Content: example,\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.ImageUploadedMessage != nil {\n // handle response\n }\n}" + "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: \"xxx\" })\nputs response.inspect" } ] } }, - "/user/signup": { - "post": { + "/v1/schemas/{namespace}": { + "get": { "tags": [ - "Authentication" + "Schemas" ], - "summary": "Create a user", - "description": "Time to create a user account, eh?", - "operationId": "createUser", - "security": [ - {} - ], - "requestBody": { - "description": "User to create", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/User" - }, - { - "$ref": "#/components/schemas/Credentials" - } - ] - }, - "examples": { - "Marc": { - "value": { - "name": "Marc", - "email": "marc@scalar.com", - "password": "i-love-scalar" - } - }, - "Cam": { - "value": { - "name": "Cam", - "email": "cam@scalar.com", - "password": "scalar-is-cool" - } - } - } - }, - "application/xml": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/User" - }, - { - "$ref": "#/components/schemas/Credentials" - } - ] - }, - "examples": { - "Marc": { - "value": { - "name": "Marc", - "email": "marc@scalar.com", - "password": "i-love-scalar" - } - }, - "Cam": { - "value": { - "name": "Cam", - "email": "cam@scalar.com", - "password": "scalar-is-cool" + "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" } } } } - } - }, - "responses": { - "201": { - "description": "Created", + }, + "400": { + "description": "Bad request", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/User" - } - }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/User" + "$ref": "#/components/schemas/400" } } } }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, "401": { - "$ref": "#/components/responses/Unauthorized" + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, "403": { - "$ref": "#/components/responses/Forbidden" + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - "409": { - "$ref": "#/components/responses/Conflict" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, "422": { - "$ref": "#/components/responses/UnprocessableEntity" + "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": [ - { - "lang": "csharp", - "label": "createUser_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Requests;\n\nvar sdk = new ScalarCsharpSDK();\n\nCreateUserJsonRequestBody req = new CreateUserJsonRequestBody() {\n Name = \"Marc\",\n Email = \"marc@scalar.com\",\n Password = \"i-love-scalar\",\n};\n\nvar res = await sdk.Authentication.CreateUserJsonAsync(req);\n\n// handle response" - }, + "parameters": [ { - "lang": "csharp", - "label": "createUser_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nbyte[] req = System.Text.Encoding.UTF8.GetBytes(\"0x400A6EF4FE\");\n\nvar res = await sdk.Authentication.CreateUserRawAsync(req);\n\n// handle response" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "go", - "label": "createUser_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserJSON(ctx, &operations.CreateUserJSONRequestBody{\n Name: gosdk.String(\"Marc\"),\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "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);" }, { - "lang": "go", - "label": "createUser_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserRaw(ctx, bytes.NewBuffer([]byte(\"0x67aC3aF674\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas list 'namespace_' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "php", - "label": "createUser_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Operations;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Operations\\CreateUserJsonRequestBody(\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n);\n\n$response = $sdk->authentication->createUserJson(\n request: $request\n);\n\nif ($response->user !== null) {\n // handle response\n}" + "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)" }, { - "lang": "php", - "label": "createUser_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0x400A6EF4FE';\n\n$response = $sdk->authentication->createUserRaw(\n request: $request\n);\n\nif ($response->user !== null) {\n // handle response\n}" + "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}" }, { - "lang": "python", - "label": "createUser_json", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.create_user_json(request={\n \"name\": \"Marc\",\n \"email\": \"marc@scalar.com\",\n \"password\": \"i-love-scalar\",\n })\n\n # Handle response\n print(res)" + "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);" }, { - "lang": "python", - "label": "createUser_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.create_user_raw(request=io.BytesIO(\"0x400A6EF4FE\".encode()))\n\n # Handle response\n print(res)" + "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)" }, { - "lang": "ruby", - "label": "createUser_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Operations::CreateUserJsonRequestBody.new(\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n)\n\nres = s.authentication.create_user_json(req)\n\nif ! res.user.nil?\n # handle response\nend" + "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" + } + ] + }, + "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" + } + } + } }, - { - "lang": "ruby", - "label": "createUser_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0x400A6EF4FE\".encode()\n\nres = s.authentication.create_user_raw(req)\n\nif ! res.user.nil?\n # handle response\nend" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "typescript", - "label": "createUser_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.createUserJson({\n name: \"Marc\",\n email: \"marc@scalar.com\",\n password: \"i-love-scalar\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "typescript", - "label": "createUser_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.createUserRaw(bytesToStream(new TextEncoder().encode(\"0x400A6EF4FE\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "go", - "label": "createUser_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserJSON(ctx, &operations.CreateUserJSONRequestBody{\n Name: gosdk.String(\"Marc\"),\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "go", - "label": "createUser_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserRaw(ctx, bytes.NewBuffer([]byte(\"0x67aC3aF674\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - { - "lang": "csharp", - "label": "createUser_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Requests;\n\nvar sdk = new ScalarCsharpSDK();\n\nCreateUserJsonRequestBody req = new CreateUserJsonRequestBody() {\n Name = \"Marc\",\n Email = \"marc@scalar.com\",\n Password = \"i-love-scalar\",\n};\n\nvar res = await sdk.Authentication.CreateUserJsonAsync(req);\n\n// handle response" + "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": [ { - "lang": "csharp", - "label": "createUser_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nbyte[] req = System.Text.Encoding.UTF8.GetBytes(\"0x400A6EF4FE\");\n\nvar res = await sdk.Authentication.CreateUserRawAsync(req);\n\n// handle response" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "php", - "label": "createUser_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Operations;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Operations\\CreateUserJsonRequestBody(\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n);\n\n$response = $sdk->authentication->createUserJson(\n request: $request\n);\n\nif ($response->user !== null) {\n // handle response\n}" + "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 create = await client.schemas.create(\"namespace\", {\n title: \"\",\n version: \"x\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(create);" }, { - "lang": "php", - "label": "createUser_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0x400A6EF4FE';\n\n$response = $sdk->authentication->createUserRaw(\n request: $request\n);\n\nif ($response->user !== null) {\n // handle response\n}" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas create 'namespace_' --bearer-auth \"$BEARER_AUTH\" --title 'title' --version-command 'version' --slug 'slug' --document 'document'" }, { - "lang": "python", - "label": "createUser_json", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.create_user_json(request={\n \"name\": \"Marc\",\n \"email\": \"marc@scalar.com\",\n \"password\": \"i-love-scalar\",\n })\n\n # Handle response\n print(res)" + "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=\"x\",\n slug=\"\",\n document=\"\",\n)\nprint(schema)" }, { - "lang": "python", - "label": "createUser_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.create_user_raw(request=io.BytesIO(\"0x400A6EF4FE\".encode()))\n\n # Handle response\n print(res)" + "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: sdk.F[string](\"\"),\n\t\tSlug: sdk.F[string](\"\"),\n\t\tTitle: sdk.F[string](\"\"),\n\t\tVersion: sdk.F[string](\"x\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}" }, { - "lang": "ruby", - "label": "createUser_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Operations::CreateUserJsonRequestBody.new(\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n)\n\nres = s.authentication.create_user_json(req)\n\nif ! res.user.nil?\n # handle response\nend" + "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);" }, { - "lang": "ruby", - "label": "createUser_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0x400A6EF4FE\".encode()\n\nres = s.authentication.create_user_raw(req)\n\nif ! res.user.nil?\n # handle response\nend" + "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)" }, { - "lang": "typescript", - "label": "createUser_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.createUserJson({\n name: \"Marc\",\n email: \"marc@scalar.com\",\n password: \"i-love-scalar\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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: \"\", description: \"\", version: \"x\", slug: \"\", is_private: false, document: \"\" })\nputs response.inspect" + } + ] + } + }, + "/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" + } + } + } }, - { - "lang": "typescript", - "label": "createUser_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.createUserRaw(bytesToStream(new TextEncoder().encode(\"0x400A6EF4FE\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "csharp", - "label": "createUser_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Requests;\n\nvar sdk = new ScalarCsharpSDK();\n\nCreateUserJsonRequestBody req = new CreateUserJsonRequestBody() {\n Name = \"Marc\",\n Email = \"marc@scalar.com\",\n Password = \"i-love-scalar\",\n};\n\nvar res = await sdk.Authentication.CreateUserJsonAsync(req);\n\n// handle response" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "csharp", - "label": "createUser_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nbyte[] req = System.Text.Encoding.UTF8.GetBytes(\"0x400A6EF4FE\");\n\nvar res = await sdk.Authentication.CreateUserRawAsync(req);\n\n// handle response" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "go", - "label": "createUser_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserJSON(ctx, &operations.CreateUserJSONRequestBody{\n Name: gosdk.String(\"Marc\"),\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "go", - "label": "createUser_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserRaw(ctx, bytes.NewBuffer([]byte(\"0x67aC3aF674\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - { - "lang": "go", - "label": "createUser_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserJSON(ctx, &operations.CreateUserJSONRequestBody{\n Name: gosdk.String(\"Marc\"),\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "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": [ { - "lang": "go", - "label": "createUser_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserRaw(ctx, bytes.NewBuffer([]byte(\"0x67aC3aF674\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "php", - "label": "createUser_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Operations;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Operations\\CreateUserJsonRequestBody(\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n);\n\n$response = $sdk->authentication->createUserJson(\n request: $request\n);\n\nif ($response->user !== null) {\n // handle response\n}" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "php", - "label": "createUser_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0x400A6EF4FE';\n\n$response = $sdk->authentication->createUserRaw(\n request: $request\n);\n\nif ($response->user !== null) {\n // handle response\n}" + "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\", {});" }, { - "lang": "python", - "label": "createUser_json", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.create_user_json(request={\n \"name\": \"Marc\",\n \"email\": \"marc@scalar.com\",\n \"password\": \"i-love-scalar\",\n })\n\n # Handle response\n print(res)" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas update 'namespace_' 'slug' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "python", - "label": "createUser_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.create_user_raw(request=io.BytesIO(\"0x400A6EF4FE\".encode()))\n\n # Handle response\n print(res)" + "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)\nprint(schema)" }, { - "lang": "ruby", - "label": "createUser_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Operations::CreateUserJsonRequestBody.new(\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n)\n\nres = s.authentication.create_user_json(req)\n\nif ! res.user.nil?\n # handle response\nend" + "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}" }, { - "lang": "ruby", - "label": "createUser_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0x400A6EF4FE\".encode()\n\nres = s.authentication.create_user_raw(req)\n\nif ! res.user.nil?\n # handle response\nend" + "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);" }, { - "lang": "typescript", - "label": "createUser_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.createUserJson({\n name: \"Marc\",\n email: \"marc@scalar.com\",\n password: \"i-love-scalar\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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)" }, { - "lang": "typescript", - "label": "createUser_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.createUserRaw(bytesToStream(new TextEncoder().encode(\"0x400A6EF4FE\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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: \"\", description: \"\", is_private: false })\nputs response.inspect" + } + ] + }, + "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" + } + } + } }, - { - "lang": "go", - "label": "createUser_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserJSON(ctx, &operations.CreateUserJSONRequestBody{\n Name: gosdk.String(\"Marc\"),\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" - }, - { - "lang": "go", - "label": "createUser_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserRaw(ctx, bytes.NewBuffer([]byte(\"0x67aC3aF674\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" - }, - { - "lang": "go", - "label": "createUser_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserJSON(ctx, &operations.CreateUserJSONRequestBody{\n Name: gosdk.String(\"Marc\"),\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" - }, - { - "lang": "go", - "label": "createUser_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserRaw(ctx, bytes.NewBuffer([]byte(\"0x67aC3aF674\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" - }, - { - "lang": "php", - "label": "createUser_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Operations;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Operations\\CreateUserJsonRequestBody(\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n);\n\n$response = $sdk->authentication->createUserJson(\n request: $request\n);\n\nif ($response->user !== null) {\n // handle response\n}" - }, - { - "lang": "php", - "label": "createUser_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0x400A6EF4FE';\n\n$response = $sdk->authentication->createUserRaw(\n request: $request\n);\n\nif ($response->user !== null) {\n // handle response\n}" - }, - { - "lang": "python", - "label": "createUser_json", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.create_user_json(request={\n \"name\": \"Marc\",\n \"email\": \"marc@scalar.com\",\n \"password\": \"i-love-scalar\",\n })\n\n # Handle response\n print(res)" - }, - { - "lang": "python", - "label": "createUser_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.create_user_raw(request=io.BytesIO(\"0x400A6EF4FE\".encode()))\n\n # Handle response\n print(res)" - }, - { - "lang": "ruby", - "label": "createUser_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Operations::CreateUserJsonRequestBody.new(\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n)\n\nres = s.authentication.create_user_json(req)\n\nif ! res.user.nil?\n # handle response\nend" - }, - { - "lang": "ruby", - "label": "createUser_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0x400A6EF4FE\".encode()\n\nres = s.authentication.create_user_raw(req)\n\nif ! res.user.nil?\n # handle response\nend" - }, - { - "lang": "typescript", - "label": "createUser_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.createUserJson({\n name: \"Marc\",\n email: \"marc@scalar.com\",\n password: \"i-love-scalar\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "typescript", - "label": "createUser_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.createUserRaw(bytesToStream(new TextEncoder().encode(\"0x400A6EF4FE\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "go", - "label": "createUser_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserJSON(ctx, &operations.CreateUserJSONRequestBody{\n Name: gosdk.String(\"Marc\"),\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" - }, - { - "lang": "go", - "label": "createUser_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserRaw(ctx, bytes.NewBuffer([]byte(\"0x67aC3aF674\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" - }, - { - "lang": "php", - "label": "createUser_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Operations;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Operations\\CreateUserJsonRequestBody(\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n);\n\n$response = $sdk->authentication->createUserJson(\n request: $request\n);\n\nif ($response->user !== null) {\n // handle response\n}" - }, - { - "lang": "php", - "label": "createUser_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0x400A6EF4FE';\n\n$response = $sdk->authentication->createUserRaw(\n request: $request\n);\n\nif ($response->user !== null) {\n // handle response\n}" - }, - { - "lang": "python", - "label": "createUser_json", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.create_user_json(request={\n \"name\": \"Marc\",\n \"email\": \"marc@scalar.com\",\n \"password\": \"i-love-scalar\",\n })\n\n # Handle response\n print(res)" - }, - { - "lang": "python", - "label": "createUser_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.create_user_raw(request=io.BytesIO(\"0x400A6EF4FE\".encode()))\n\n # Handle response\n print(res)" - }, - { - "lang": "ruby", - "label": "createUser_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Operations::CreateUserJsonRequestBody.new(\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n)\n\nres = s.authentication.create_user_json(req)\n\nif ! res.user.nil?\n # handle response\nend" - }, - { - "lang": "ruby", - "label": "createUser_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0x400A6EF4FE\".encode()\n\nres = s.authentication.create_user_raw(req)\n\nif ! res.user.nil?\n # handle response\nend" - }, - { - "lang": "typescript", - "label": "createUser_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.createUserJson({\n name: \"Marc\",\n email: \"marc@scalar.com\",\n password: \"i-love-scalar\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "typescript", - "label": "createUser_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.createUserRaw(bytesToStream(new TextEncoder().encode(\"0x400A6EF4FE\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "csharp", - "label": "createUser_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Requests;\n\nvar sdk = new ScalarCsharpSDK();\n\nCreateUserJsonRequestBody req = new CreateUserJsonRequestBody() {\n Name = \"Marc\",\n Email = \"marc@scalar.com\",\n Password = \"i-love-scalar\",\n};\n\nvar res = await sdk.Authentication.CreateUserJsonAsync(req);\n\n// handle response" - }, - { - "lang": "csharp", - "label": "createUser_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nbyte[] req = System.Text.Encoding.UTF8.GetBytes(\"0x400A6EF4FE\");\n\nvar res = await sdk.Authentication.CreateUserRawAsync(req);\n\n// handle response" - }, - { - "lang": "go", - "label": "createUser_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserJSON(ctx, &operations.CreateUserJSONRequestBody{\n Name: gosdk.String(\"Marc\"),\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "go", - "label": "createUser_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserRaw(ctx, bytes.NewBuffer([]byte(\"0x67aC3aF674\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "php", - "label": "createUser_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Operations;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Operations\\CreateUserJsonRequestBody(\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n);\n\n$response = $sdk->authentication->createUserJson(\n request: $request\n);\n\nif ($response->user !== null) {\n // handle response\n}" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "php", - "label": "createUser_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0x400A6EF4FE';\n\n$response = $sdk->authentication->createUserRaw(\n request: $request\n);\n\nif ($response->user !== null) {\n // handle response\n}" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "java", - "label": "createUser_json", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.operations.CreateUserJsonRequestBody;\nimport org.scalar.java_sdk.models.operations.CreateUserJsonResponse;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n CreateUserJsonRequestBody req = CreateUserJsonRequestBody.builder()\n .email(\"marc@scalar.com\")\n .password(\"i-love-scalar\")\n .name(\"Marc\")\n .build();\n\n CreateUserJsonResponse res = sdk.authentication().createUserJson()\n .request(req)\n .call();\n\n if (res.user().isPresent()) {\n // handle response\n }\n }\n}" + "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": [ { - "lang": "java", - "label": "createUser_raw", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport java.nio.charset.StandardCharsets;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.operations.CreateUserRawResponse;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n byte[] req = \"0x400A6EF4FE\".getBytes(StandardCharsets.UTF_8);\n\n CreateUserRawResponse res = sdk.authentication().createUserRaw()\n .request(req)\n .call();\n\n if (res.user().isPresent()) {\n // handle response\n }\n }\n}" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "python", - "label": "createUser_json", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.create_user_json(request={\n \"name\": \"Marc\",\n \"email\": \"marc@scalar.com\",\n \"password\": \"i-love-scalar\",\n })\n\n # Handle response\n print(res)" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "python", - "label": "createUser_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.create_user_raw(request=io.BytesIO(\"0x400A6EF4FE\".encode()))\n\n # Handle response\n print(res)" + "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\");" }, { - "lang": "ruby", - "label": "createUser_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Operations::CreateUserJsonRequestBody.new(\n name: 'Marc',\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n)\n\nres = s.authentication.create_user_json(req)\n\nif ! res.user.nil?\n # handle response\nend" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas delete 'namespace_' 'slug' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "ruby", - "label": "createUser_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0x400A6EF4FE\".encode()\n\nres = s.authentication.create_user_raw(req)\n\nif ! res.user.nil?\n # handle response\nend" + "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)\nprint(schema)" }, { - "lang": "typescript", - "label": "createUser_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.createUserJson({\n name: \"Marc\",\n email: \"marc@scalar.com\",\n password: \"i-love-scalar\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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}" }, { - "lang": "typescript", - "label": "createUser_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.createUserRaw(bytesToStream(new TextEncoder().encode(\"0x400A6EF4FE\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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);" }, { - "lang": "go", - "label": "createUser_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"go-sdk/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserJSON(ctx, &operations.CreateUserJSONRequestBody{\n Name: gosdk.String(\"Marc\"),\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "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)" }, { - "lang": "go", - "label": "createUser_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.CreateUserRaw(ctx, bytes.NewBuffer([]byte(\"{\\\"name\\\":\\\"Marc\\\",\\\"email\\\":\\\"marc@scalar.com\\\",\\\"password\\\":\\\"i-love-scalar\\\"}\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "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" } ] } }, - "/auth/token": { - "post": { + "/v1/schemas/{namespace}/{slug}/version/{semver}": { + "get": { "tags": [ - "Authentication" - ], - "summary": "Get a token", - "description": "Yeah, this is the boring security stuff. Just get your super secret token and move on.", - "operationId": "getToken", - "security": [ - {} + "Schemas" ], - "requestBody": { - "description": "Credentials to authenticate a user", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Credentials" + "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" + } } - }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Credentials" + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } } } - } - }, - "responses": { - "201": { - "description": "Token Created", + }, + "401": { + "description": "No auth", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Token" + "$ref": "#/components/schemas/401" } - }, - "application/xml": { + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { "schema": { - "$ref": "#/components/schemas/Token" + "$ref": "#/components/schemas/403" } } } }, - "400": { - "$ref": "#/components/responses/BadRequest" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - "401": { - "$ref": "#/components/responses/Unauthorized" + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - "403": { - "$ref": "#/components/responses/Forbidden" + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } } }, - "x-codeSamples": [ - { - "lang": "csharp", - "label": "getToken_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Components;\n\nvar sdk = new ScalarCsharpSDK();\n\nCredentials req = new Credentials() {\n Email = \"marc@scalar.com\",\n Password = \"i-love-scalar\",\n};\n\nvar res = await sdk.Authentication.GetTokenJsonAsync(req);\n\n// handle response" - }, + "parameters": [ { - "lang": "csharp", - "label": "getToken_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nbyte[] req = System.Text.Encoding.UTF8.GetBytes(\"0xfD199ba439\");\n\nvar res = await sdk.Authentication.GetTokenRawAsync(req);\n\n// handle response" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "go", - "label": "getToken_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenJSON(ctx, &shared.Credentials{\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true }, { - "lang": "go", - "label": "getToken_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenRaw(ctx, bytes.NewBuffer([]byte(\"0x7d14eeFEeB\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "php", - "label": "getToken_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Components\\Credentials(\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n);\n\n$response = $sdk->authentication->getTokenJson(\n request: $request\n);\n\nif ($response->token !== null) {\n // handle response\n}" + "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.retrieveVersion(\"namespace\", \"slug\", \"semver\");\nconsole.log(string_);" }, { - "lang": "php", - "label": "getToken_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0xfD199ba439';\n\n$response = $sdk->authentication->getTokenRaw(\n request: $request\n);\n\nif ($response->token !== null) {\n // handle response\n}" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas retrieve-version 'namespace_' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "python", - "label": "getToken_json", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_token_json(request={\n \"email\": \"marc@scalar.com\",\n \"password\": \"i-love-scalar\",\n })\n\n # Handle response\n print(res)" + "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.retrieve_version(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n)\nprint(schema)" }, { - "lang": "python", - "label": "getToken_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_token_raw(request=io.BytesIO(\"0xfD199ba439\".encode()))\n\n # Handle response\n print(res)" + "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.GetVersion(context.Background(), \"namespace\", \"slug\", \"semver\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}" }, { - "lang": "ruby", - "label": "getToken_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Shared::Credentials.new(\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n)\n\nres = s.authentication.get_token_json(req)\n\nif ! res.token.nil?\n # handle response\nend" + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.SchemaRetrieveVersionParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaRetrieveVersionParams params = SchemaRetrieveVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build();\nvar schema = client.schemas().retrieveVersion(params);\nSystem.out.println(schema);" }, { - "lang": "ruby", - "label": "getToken_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0xfD199ba439\".encode()\n\nres = s.authentication.get_token_raw(req)\n\nif ! res.token.nil?\n # handle response\nend" + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.SchemaRetrieveVersionParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaRetrieveVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build()\nval schema = client.schemas().retrieveVersion(params)\nprintln(schema)" }, { - "lang": "typescript", - "label": "getToken_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getTokenJson({\n email: \"marc@scalar.com\",\n password: \"i-love-scalar\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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.retrieve_version(\"smoke-test\", \"smoke-test\", \"smoke-test\")\nputs response.inspect" + } + ] + }, + "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" + } + } + } }, - { - "lang": "typescript", - "label": "getToken_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getTokenRaw(bytesToStream(new TextEncoder().encode(\"0xfD199ba439\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "go", - "label": "getToken_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenJSON(ctx, &shared.Credentials{\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "go", - "label": "getToken_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenRaw(ctx, bytes.NewBuffer([]byte(\"0x7d14eeFEeB\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "csharp", - "label": "getToken_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Components;\n\nvar sdk = new ScalarCsharpSDK();\n\nCredentials req = new Credentials() {\n Email = \"marc@scalar.com\",\n Password = \"i-love-scalar\",\n};\n\nvar res = await sdk.Authentication.GetTokenJsonAsync(req);\n\n// handle response" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "csharp", - "label": "getToken_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nbyte[] req = System.Text.Encoding.UTF8.GetBytes(\"0xfD199ba439\");\n\nvar res = await sdk.Authentication.GetTokenRawAsync(req);\n\n// handle response" + "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": [ { - "lang": "php", - "label": "getToken_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Components\\Credentials(\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n);\n\n$response = $sdk->authentication->getTokenJson(\n request: $request\n);\n\nif ($response->token !== null) {\n // handle response\n}" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "php", - "label": "getToken_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0xfD199ba439';\n\n$response = $sdk->authentication->getTokenRaw(\n request: $request\n);\n\nif ($response->token !== null) {\n // handle response\n}" + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true }, { - "lang": "python", - "label": "getToken_json", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_token_json(request={\n \"email\": \"marc@scalar.com\",\n \"password\": \"i-love-scalar\",\n })\n\n # Handle response\n print(res)" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "python", - "label": "getToken_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_token_raw(request=io.BytesIO(\"0xfD199ba439\".encode()))\n\n # Handle response\n print(res)" + "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.deleteVersion(\"namespace\", \"slug\", \"semver\");" }, { - "lang": "ruby", - "label": "getToken_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Shared::Credentials.new(\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n)\n\nres = s.authentication.get_token_json(req)\n\nif ! res.token.nil?\n # handle response\nend" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas delete-version 'namespace_' 'slug' 'semver' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "ruby", - "label": "getToken_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0xfD199ba439\".encode()\n\nres = s.authentication.get_token_raw(req)\n\nif ! res.token.nil?\n # handle response\nend" + "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_version(\n namespace=\"namespace\",\n slug=\"slug\",\n semver=\"semver\",\n)\nprint(schema)" }, { - "lang": "typescript", - "label": "getToken_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getTokenJson({\n email: \"marc@scalar.com\",\n password: \"i-love-scalar\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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.DeleteVersion(context.Background(), \"namespace\", \"slug\", \"semver\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}" }, { - "lang": "typescript", - "label": "getToken_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getTokenRaw(bytesToStream(new TextEncoder().encode(\"0xfD199ba439\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.SchemaDeleteVersionParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaDeleteVersionParams params = SchemaDeleteVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build();\nvar schema = client.schemas().deleteVersion(params);\nSystem.out.println(schema);" }, { - "lang": "csharp", - "label": "getToken_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Components;\n\nvar sdk = new ScalarCsharpSDK();\n\nCredentials req = new Credentials() {\n Email = \"marc@scalar.com\",\n Password = \"i-love-scalar\",\n};\n\nvar res = await sdk.Authentication.GetTokenJsonAsync(req);\n\n// handle response" + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.SchemaDeleteVersionParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaDeleteVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .semver(\"semver\")\n .build()\nval schema = client.schemas().deleteVersion(params)\nprintln(schema)" }, { - "lang": "csharp", - "label": "getToken_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nbyte[] req = System.Text.Encoding.UTF8.GetBytes(\"0xfD199ba439\");\n\nvar res = await sdk.Authentication.GetTokenRawAsync(req);\n\n// handle response" - }, - { - "lang": "go", - "label": "getToken_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenJSON(ctx, &shared.Credentials{\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" - }, - { - "lang": "go", - "label": "getToken_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenRaw(ctx, bytes.NewBuffer([]byte(\"0x7d14eeFEeB\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "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_version(\"smoke-test\", \"smoke-test\", \"smoke-test\")\nputs response.inspect" + } + ] + } + }, + "/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" + } + } + } }, - { - "lang": "go", - "label": "getToken_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenJSON(ctx, &shared.Credentials{\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "go", - "label": "getToken_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenRaw(ctx, bytes.NewBuffer([]byte(\"0x7d14eeFEeB\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "php", - "label": "getToken_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Components\\Credentials(\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n);\n\n$response = $sdk->authentication->getTokenJson(\n request: $request\n);\n\nif ($response->token !== null) {\n // handle response\n}" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "php", - "label": "getToken_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0xfD199ba439';\n\n$response = $sdk->authentication->getTokenRaw(\n request: $request\n);\n\nif ($response->token !== null) {\n // handle response\n}" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "python", - "label": "getToken_json", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_token_json(request={\n \"email\": \"marc@scalar.com\",\n \"password\": \"i-love-scalar\",\n })\n\n # Handle response\n print(res)" + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - { - "lang": "python", - "label": "getToken_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_token_raw(request=io.BytesIO(\"0xfD199ba439\".encode()))\n\n # Handle response\n print(res)" + "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": [ { - "lang": "ruby", - "label": "getToken_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Shared::Credentials.new(\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n)\n\nres = s.authentication.get_token_json(req)\n\nif ! res.token.nil?\n # handle response\nend" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "ruby", - "label": "getToken_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0xfD199ba439\".encode()\n\nres = s.authentication.get_token_raw(req)\n\nif ! res.token.nil?\n # handle response\nend" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "typescript", - "label": "getToken_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getTokenJson({\n email: \"marc@scalar.com\",\n password: \"i-love-scalar\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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 createVersion = await client.schemas.createVersion(\"namespace\", \"slug\", {\n version: \"x\",\n document: \"\",\n});\nconsole.log(createVersion);" }, { - "lang": "typescript", - "label": "getToken_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getTokenRaw(bytesToStream(new TextEncoder().encode(\"0xfD199ba439\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas create-version 'namespace_' 'slug' --bearer-auth \"$BEARER_AUTH\" --version-command 'version' --document 'document'" }, { - "lang": "go", - "label": "getToken_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenJSON(ctx, &shared.Credentials{\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "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_version(\n namespace=\"namespace\",\n slug=\"slug\",\n version=\"x\",\n document=\"\",\n)\nprint(schema)" }, { - "lang": "go", - "label": "getToken_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenRaw(ctx, bytes.NewBuffer([]byte(\"0x7d14eeFEeB\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "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.NewVersion(context.Background(), \"namespace\", \"slug\", sdk.SchemaNewVersionParams{\n\t\tDocument: sdk.F[string](\"\"),\n\t\tVersion: sdk.F[string](\"x\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}" }, { - "lang": "go", - "label": "getToken_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenJSON(ctx, &shared.Credentials{\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\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.SchemaCreateVersionParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaCreateVersionParams params = SchemaCreateVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .version(\"version\")\n .document(\"document\")\n .build();\nvar schema = client.schemas().createVersion(params);\nSystem.out.println(schema);" }, { - "lang": "go", - "label": "getToken_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenRaw(ctx, bytes.NewBuffer([]byte(\"0x7d14eeFEeB\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.SchemaCreateVersionParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaCreateVersionParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .version(\"version\")\n .document(\"document\")\n .build()\nval schema = client.schemas().createVersion(params)\nprintln(schema)" }, { - "lang": "php", - "label": "getToken_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Components\\Credentials(\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n);\n\n$response = $sdk->authentication->getTokenJson(\n request: $request\n);\n\nif ($response->token !== null) {\n // handle response\n}" + "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_version(\"smoke-test\", \"smoke-test\", { version: \"x\", document: \"\" })\nputs response.inspect" + } + ] + } + }, + "/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" + } + } + } }, - { - "lang": "php", - "label": "getToken_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0xfD199ba439';\n\n$response = $sdk->authentication->getTokenRaw(\n request: $request\n);\n\nif ($response->token !== null) {\n // handle response\n}" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "python", - "label": "getToken_json", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_token_json(request={\n \"email\": \"marc@scalar.com\",\n \"password\": \"i-love-scalar\",\n })\n\n # Handle response\n print(res)" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "python", - "label": "getToken_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_token_raw(request=io.BytesIO(\"0xfD199ba439\".encode()))\n\n # Handle response\n print(res)" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "ruby", - "label": "getToken_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Shared::Credentials.new(\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n)\n\nres = s.authentication.get_token_json(req)\n\nif ! res.token.nil?\n # handle response\nend" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "ruby", - "label": "getToken_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0xfD199ba439\".encode()\n\nres = s.authentication.get_token_raw(req)\n\nif ! res.token.nil?\n # handle response\nend" + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - { - "lang": "typescript", - "label": "getToken_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getTokenJson({\n email: \"marc@scalar.com\",\n password: \"i-love-scalar\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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": [ { - "lang": "typescript", - "label": "getToken_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getTokenRaw(bytesToStream(new TextEncoder().encode(\"0xfD199ba439\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "go", - "label": "getToken_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenJSON(ctx, &shared.Credentials{\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "go", - "label": "getToken_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenRaw(ctx, bytes.NewBuffer([]byte(\"0x7d14eeFEeB\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "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.createAccessGroup(\"namespace\", \"slug\", {\n accessGroupSlug: \"xxx\",\n});" }, { - "lang": "php", - "label": "getToken_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Components\\Credentials(\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n);\n\n$response = $sdk->authentication->getTokenJson(\n request: $request\n);\n\nif ($response->token !== null) {\n // handle response\n}" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas create-access-group 'namespace_' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" }, { - "lang": "php", - "label": "getToken_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0xfD199ba439';\n\n$response = $sdk->authentication->getTokenRaw(\n request: $request\n);\n\nif ($response->token !== null) {\n // handle response\n}" + "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_access_group(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"xxx\",\n)\nprint(schema)" }, { - "lang": "python", - "label": "getToken_json", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_token_json(request={\n \"email\": \"marc@scalar.com\",\n \"password\": \"i-love-scalar\",\n })\n\n # Handle response\n print(res)" + "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.NewAccessGroup(context.Background(), \"namespace\", \"slug\", sdk.SchemaNewAccessGroupParams{\n\t\tAccessGroupSlug: sdk.F[string](\"xxx\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}" }, { - "lang": "python", - "label": "getToken_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_token_raw(request=io.BytesIO(\"0xfD199ba439\".encode()))\n\n # Handle response\n print(res)" + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.SchemaCreateAccessGroupParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaCreateAccessGroupParams params = SchemaCreateAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar schema = client.schemas().createAccessGroup(params);\nSystem.out.println(schema);" }, { - "lang": "ruby", - "label": "getToken_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Shared::Credentials.new(\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n)\n\nres = s.authentication.get_token_json(req)\n\nif ! res.token.nil?\n # handle response\nend" + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.SchemaCreateAccessGroupParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaCreateAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval schema = client.schemas().createAccessGroup(params)\nprintln(schema)" }, { - "lang": "ruby", - "label": "getToken_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0xfD199ba439\".encode()\n\nres = s.authentication.get_token_raw(req)\n\nif ! res.token.nil?\n # handle response\nend" + "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_access_group(\"smoke-test\", \"smoke-test\", { access_group_slug: \"xxx\" })\nputs response.inspect" + } + ] + }, + "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" + } + } + } }, - { - "lang": "typescript", - "label": "getToken_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getTokenJson({\n email: \"marc@scalar.com\",\n password: \"i-love-scalar\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "typescript", - "label": "getToken_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getTokenRaw(bytesToStream(new TextEncoder().encode(\"0xfD199ba439\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "csharp", - "label": "getToken_json", - "source": "using Scalar.CsharpSdk;\nusing Scalar.CsharpSdk.Models.Components;\n\nvar sdk = new ScalarCsharpSDK();\n\nCredentials req = new Credentials() {\n Email = \"marc@scalar.com\",\n Password = \"i-love-scalar\",\n};\n\nvar res = await sdk.Authentication.GetTokenJsonAsync(req);\n\n// handle response" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "csharp", - "label": "getToken_raw", - "source": "using Scalar.CsharpSdk;\nusing System;\n\nvar sdk = new ScalarCsharpSDK();\n\nbyte[] req = System.Text.Encoding.UTF8.GetBytes(\"0xfD199ba439\");\n\nvar res = await sdk.Authentication.GetTokenRawAsync(req);\n\n// handle response" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "go", - "label": "getToken_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenJSON(ctx, &shared.Credentials{\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - { - "lang": "go", - "label": "getToken_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenRaw(ctx, bytes.NewBuffer([]byte(\"0x7d14eeFEeB\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "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": [ { - "lang": "php", - "label": "getToken_json", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\nuse scalar\\PhpSdk\\Models\\Components;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = new Components\\Credentials(\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n);\n\n$response = $sdk->authentication->getTokenJson(\n request: $request\n);\n\nif ($response->token !== null) {\n // handle response\n}" + "schema": { + "type": "string" + }, + "in": "path", + "name": "namespace", + "required": true }, { - "lang": "php", - "label": "getToken_raw", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n$request = '0xfD199ba439';\n\n$response = $sdk->authentication->getTokenRaw(\n request: $request\n);\n\nif ($response->token !== null) {\n // handle response\n}" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "java", - "label": "getToken_json", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.components.Credentials;\nimport org.scalar.java_sdk.models.operations.GetTokenJsonResponse;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n Credentials req = Credentials.builder()\n .email(\"marc@scalar.com\")\n .password(\"i-love-scalar\")\n .build();\n\n GetTokenJsonResponse res = sdk.authentication().getTokenJson()\n .request(req)\n .call();\n\n if (res.token().isPresent()) {\n // handle response\n }\n }\n}" + "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.deleteAccessGroup(\"namespace\", \"slug\", {\n accessGroupSlug: \"xxx\",\n});" }, { - "lang": "java", - "label": "getToken_raw", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport java.nio.charset.StandardCharsets;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.operations.GetTokenRawResponse;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n byte[] req = \"0xfD199ba439\".getBytes(StandardCharsets.UTF_8);\n\n GetTokenRawResponse res = sdk.authentication().getTokenRaw()\n .request(req)\n .call();\n\n if (res.token().isPresent()) {\n // handle response\n }\n }\n}" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi schemas delete-access-group 'namespace_' 'slug' --bearer-auth \"$BEARER_AUTH\" --access-group-slug 'accessGroupSlug'" }, { - "lang": "python", - "label": "getToken_json", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_token_json(request={\n \"email\": \"marc@scalar.com\",\n \"password\": \"i-love-scalar\",\n })\n\n # Handle response\n print(res)" + "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_access_group(\n namespace=\"namespace\",\n slug=\"slug\",\n access_group_slug=\"xxx\",\n)\nprint(schema)" }, { - "lang": "python", - "label": "getToken_raw", - "source": "import io\nfrom scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_token_raw(request=io.BytesIO(\"0xfD199ba439\".encode()))\n\n # Handle response\n print(res)" + "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.DeleteAccessGroup(context.Background(), \"namespace\", \"slug\", sdk.SchemaDeleteAccessGroupParams{\n\t\tAccessGroupSlug: sdk.F[string](\"xxx\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(schema)\n}" }, { - "lang": "ruby", - "label": "getToken_json", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = Models::Shared::Credentials.new(\n email: 'marc@scalar.com',\n password: 'i-love-scalar',\n)\n\nres = s.authentication.get_token_json(req)\n\nif ! res.token.nil?\n # handle response\nend" + "label": "Java", + "lang": "Java", + "source": "import com.scalar.api.client.ScalarClient;\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient;\nimport com.scalar.api.models.schemas.SchemaDeleteAccessGroupParams;\n\nScalarClient client = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build();\n\nSchemaDeleteAccessGroupParams params = SchemaDeleteAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build();\nvar schema = client.schemas().deleteAccessGroup(params);\nSystem.out.println(schema);" }, { - "lang": "ruby", - "label": "getToken_raw", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nreq = \"0xfD199ba439\".encode()\n\nres = s.authentication.get_token_raw(req)\n\nif ! res.token.nil?\n # handle response\nend" + "label": "Kotlin", + "lang": "Kotlin", + "source": "import com.scalar.api.client.ScalarClient\nimport com.scalar.api.client.okhttp.ScalarOkHttpClient\nimport com.scalar.api.models.schemas.SchemaDeleteAccessGroupParams\n\nval client: ScalarClient = ScalarOkHttpClient.builder()\n .bearerAuth(System.getenv(\"BEARER_AUTH\"))\n .build()\n\nval params = SchemaDeleteAccessGroupParams.builder()\n .namespace(\"namespace\")\n .slug(\"slug\")\n .accessGroupSlug(\"accessGroupSlug\")\n .build()\nval schema = client.schemas().deleteAccessGroup(params)\nprintln(schema)" }, { - "lang": "typescript", - "label": "getToken_json", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getTokenJson({\n email: \"marc@scalar.com\",\n password: \"i-love-scalar\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "typescript", - "label": "getToken_raw", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getTokenRaw(bytesToStream(new TextEncoder().encode(\"0xfD199ba439\")));\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - }, - { - "lang": "go", - "label": "getToken_json", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenJSON(ctx, &shared.Credentials{\n Email: \"marc@scalar.com\",\n Password: \"i-love-scalar\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" - }, - { - "lang": "go", - "label": "getToken_raw", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"bytes\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetTokenRaw(ctx, bytes.NewBuffer([]byte(\"{\\\"email\\\":\\\"marc@scalar.com\\\",\\\"password\\\":\\\"i-love-scalar\\\"}\")))\n if err != nil {\n log.Fatal(err)\n }\n if res.Token != nil {\n // handle response\n }\n}" + "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_access_group(\"smoke-test\", \"smoke-test\", { access_group_slug: \"xxx\" })\nputs response.inspect" } ] } }, - "/me": { + "/v1/login-portals/{slug}": { "get": { "tags": [ - "Authentication" - ], - "summary": "Get authenticated user", - "description": "Find yourself they say. That’s what you can do here.", - "operationId": "getMe", - "security": [ - { - "basicAuth": [] - }, - { - "oAuth2": [ - "read:account" - ] - }, - { - "bearerAuth": [] - }, - { - "apiKeyHeader": [] - }, - { - "apiKeyQuery": [] - } + "Login Portals" ], + "description": "Get a login portal by slug.", + "summary": "Get a login portal", + "operationId": "getLoginPortal", "responses": { "200": { - "description": "OK", + "description": "Default Response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/User" + "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 } - }, - "application/xml": { + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { "schema": { - "$ref": "#/components/schemas/User" + "$ref": "#/components/schemas/400" } } } }, "401": { - "$ref": "#/components/responses/Unauthorized" + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, "403": { - "$ref": "#/components/responses/Forbidden" - } - }, - "x-codeSamples": [ - { - "lang": "csharp", - "label": "getMe", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Authentication.GetMeAsync();\n\n// handle response" + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "go", - "label": "getMe", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetMe(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "php", - "label": "getMe", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->authentication->getMe(\n\n);\n\nif ($response->user !== null) {\n // handle response\n}" + "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": [ { - "lang": "python", - "label": "getMe", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_me()\n\n # Handle response\n print(res)" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "ruby", - "label": "getMe", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.authentication.get_me()\n\nif ! res.user.nil?\n # handle response\nend" + "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);" }, { - "lang": "typescript", - "label": "getMe", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getMe();\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi login-portals retrieve 'slug' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "go", - "label": "getMe", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetMe(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "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)" }, { - "lang": "csharp", - "label": "getMe", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Authentication.GetMeAsync();\n\n// handle response" + "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}" }, { - "lang": "php", - "label": "getMe", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->authentication->getMe(\n\n);\n\nif ($response->user !== null) {\n // handle response\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);" }, { - "lang": "python", - "label": "getMe", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_me()\n\n # Handle response\n print(res)" + "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)" }, { - "lang": "ruby", - "label": "getMe", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.authentication.get_me()\n\nif ! res.user.nil?\n # handle response\nend" + "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" + } + ] + }, + "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" + } + } + } }, - { - "lang": "typescript", - "label": "getMe", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getMe();\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "csharp", - "label": "getMe", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Authentication.GetMeAsync();\n\n// handle response" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "go", - "label": "getMe", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetMe(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "go", - "label": "getMe", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetMe(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "php", - "label": "getMe", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->authentication->getMe(\n\n);\n\nif ($response->user !== null) {\n // handle response\n}" + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - { - "lang": "python", - "label": "getMe", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_me()\n\n # Handle response\n print(res)" + "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": [ { - "lang": "ruby", - "label": "getMe", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.authentication.get_me()\n\nif ! res.user.nil?\n # handle response\nend" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "typescript", - "label": "getMe", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getMe();\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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\", {});" }, { - "lang": "go", - "label": "getMe", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetMe(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi login-portals update 'slug' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "go", - "label": "getMe", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetMe(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "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)\nprint(login_portal)" }, { - "lang": "php", - "label": "getMe", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->authentication->getMe(\n\n);\n\nif ($response->user !== null) {\n // handle response\n}" + "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}" }, { - "lang": "python", - "label": "getMe", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_me()\n\n # Handle response\n print(res)" + "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);" }, { - "lang": "ruby", - "label": "getMe", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.authentication.get_me()\n\nif ! res.user.nil?\n # handle response\nend" + "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)" }, { - "lang": "typescript", - "label": "getMe", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getMe();\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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: \"\" })\nputs response.inspect" + } + ] + }, + "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" + } + } + } }, - { - "lang": "go", - "label": "getMe", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetMe(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - { - "lang": "php", - "label": "getMe", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->authentication->getMe(\n\n);\n\nif ($response->user !== null) {\n // handle response\n}" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - { - "lang": "python", - "label": "getMe", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_me()\n\n # Handle response\n print(res)" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - { - "lang": "ruby", - "label": "getMe", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.authentication.get_me()\n\nif ! res.user.nil?\n # handle response\nend" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - { - "lang": "typescript", - "label": "getMe", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getMe();\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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": [ { - "lang": "csharp", - "label": "getMe", - "source": "using Scalar.CsharpSdk;\n\nvar sdk = new ScalarCsharpSDK();\n\nvar res = await sdk.Authentication.GetMeAsync();\n\n// handle response" - }, + "schema": { + "type": "string" + }, + "in": "path", + "name": "slug", + "required": true + } + ], + "x-codeSamples": [ { - "lang": "go", - "label": "getMe", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetMe(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "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\");" }, { - "lang": "php", - "label": "getMe", - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse scalar\\PhpSdk;\n\n$sdk = PhpSdk\\ScalarPhpSDK::builder()->build();\n\n\n\n$response = $sdk->authentication->getMe(\n\n);\n\nif ($response->user !== null) {\n // handle response\n}" + "label": "Shell", + "lang": "Shell", + "source": "scalarapi login-portals delete 'slug' --bearer-auth \"$BEARER_AUTH\"" }, { - "lang": "java", - "label": "getMe", - "source": "package hello.world;\n\nimport java.lang.Exception;\nimport org.scalar.java_sdk.ScalarJavaSDK;\nimport org.scalar.java_sdk.models.operations.GetMeResponse;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n ScalarJavaSDK sdk = ScalarJavaSDK.builder()\n .build();\n\n GetMeResponse res = sdk.authentication().getMe()\n .call();\n\n if (res.user().isPresent()) {\n // handle response\n }\n }\n}" + "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)\nprint(login_portal)" }, { - "lang": "python", - "label": "getMe", - "source": "from scalar_python_sdk import ScalarPythonSDK\n\n\nwith ScalarPythonSDK() as sps_client:\n\n res = sps_client.authentication.get_me()\n\n # Handle response\n print(res)" + "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}" }, { - "lang": "ruby", - "label": "getMe", - "source": "require 'scalar_ruby_sdk'\n\ns = ::ScalarRubySDK::ScalarRubySDK.new\n\nres = s.authentication.get_me()\n\nif ! res.user.nil?\n # handle response\nend" + "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);" }, { - "lang": "typescript", - "label": "getMe", - "source": "import { ScalarTypescriptSDK } from \"@scalar/typescript-sdk\";\n\nconst scalarTypescriptSDK = new ScalarTypescriptSDK();\n\nasync function run() {\n const result = await scalarTypescriptSDK.authentication.getMe();\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "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)" }, { - "lang": "go", - "label": "getMe", - "source": "package main\n\nimport(\n\t\"context\"\n\t\"go-sdk/pkg/models/shared\"\n\tgosdk \"go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := gosdk.New()\n\n res, err := s.Authentication.GetMe(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.User != nil {\n // handle response\n }\n}" + "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" } ] } - } - }, - "webhooks": { - "newPlanet": { + }, + "/v1/login-portals": { "post": { "tags": [ - "Planets" + "Login Portals" ], - "requestBody": { - "description": "Information about a new planet", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Planet" + "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" + } } - }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Planet" + } + }, + "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 create = 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(create);" + }, + { + "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)\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.F[sdk.LoginPortalEmailParam](sdk.LoginPortalEmailParam{\n\t\t\tLogo: sdk.F[string](\"\"),\n\t\t\tLogoSize: sdk.F[string](\"100\"),\n\t\t\tButtonText: sdk.F[string](\"Login\"),\n\t\t\tMessage: sdk.F[string](\"Click to access private documentation hosted by scalar.com\"),\n\t\t\tTitle: sdk.F[string](\"Private Docs\"),\n\t\t\tMainColor: sdk.F[string](\"#2a2f45\"),\n\t\t\tMainBackground: sdk.F[string](\"#f6f6f6\"),\n\t\t\tCardColor: sdk.F[string](\"2a2f45\"),\n\t\t\tCardBackground: sdk.F[string](\"#fff\"),\n\t\t\tButtonColor: sdk.F[string](\"#fff\"),\n\t\t\tButtonBackground: sdk.F[string](\"#0f0f0f\"),\n\t\t}),\n\t\tPage: sdk.F[sdk.LoginPortalPageParam](sdk.LoginPortalPageParam{\n\t\t\tTitle: sdk.F[string](\"Scalar Private Docs\"),\n\t\t\tDescription: sdk.F[string](\"Login to access your documentation\"),\n\t\t\tHead: sdk.F[string](\"\"),\n\t\t\tScript: sdk.F[string](\"\"),\n\t\t\tTheme: sdk.F[string](\"\"),\n\t\t\tCompanyName: sdk.F[string](\"\"),\n\t\t\tLogo: sdk.F[string](\"\"),\n\t\t\tLogoURL: sdk.F[string](\"\"),\n\t\t\tFavicon: sdk.F[string](\"\"),\n\t\t\tTermsLink: sdk.F[string](\"\"),\n\t\t\tPrivacyLink: sdk.F[string](\"\"),\n\t\t\tFormTitle: sdk.F[string](\"Scalar Private Docs\"),\n\t\t\tFormDescription: sdk.F[string](\"Login to access your documentation\"),\n\t\t\tFormImage: sdk.F[string](\"\"),\n\t\t}),\n\t\tSlug: sdk.F[string](\"\"),\n\t\tTitle: sdk.F[string](\"\"),\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: \"\", 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\" => \"\" } })\nputs response.inspect" + } + ] + }, + "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" + } + ] + } + }, + "/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" + } + ] + }, + "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 createRuleset = await client.rules.createRuleset(\"namespace\", {\n title: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(createRuleset);" + }, + { + "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)\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: sdk.F[string](\"\"),\n\t\tSlug: sdk.F[string](\"\"),\n\t\tTitle: sdk.F[string](\"\"),\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: \"\", description: \"\", slug: \"\", is_private: false, document: \"\" })\nputs response.inspect" + } + ] + } + }, + "/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 path_namespace=\"namespace\",\n path_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.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: \"\", slug_2: \"\", title: \"\", description: \"\", is_private: false })\nputs response.inspect" + } + ] + }, + "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)\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" + } + ] + }, + "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" + } + ] + } + }, + "/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: \"xxx\",\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=\"xxx\",\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\tAccessGroupSlug: sdk.F[string](\"xxx\"),\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: \"xxx\" })\nputs response.inspect" + } + ] + }, + "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: \"xxx\",\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=\"xxx\",\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\tAccessGroupSlug: sdk.F[string](\"xxx\"),\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: \"xxx\" })\nputs response.inspect" + } + ] + } + }, + "/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" + } + ] + }, + "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 create = await client.themes.create({\n name: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(create);" + }, + { + "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)\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: sdk.F[string](\"\"),\n\t\tName: sdk.F[string](\"\"),\n\t\tSlug: sdk.F[string](\"\"),\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: \"\", description: \"\", slug: \"\", document: \"\" })\nputs response.inspect" + } + ] + } + }, + "/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)\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: \"\", description: \"\" })\nputs response.inspect" + } + ] + }, + "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)\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: sdk.F[string](\"\"),\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: \"\" })\nputs response.inspect" + } + ] + }, + "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)\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" + } + ] + }, + "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" } - }, - "responses": { - "200": { - "description": "Return a 200 status to indicate that the data was received successfully" - } - } + ] } - } - }, - "components": { - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer", - "description": "JWT Bearer token authentication" - }, - "basicAuth": { - "type": "http", - "scheme": "basic", - "description": "Basic HTTP authentication" - }, - "apiKeyHeader": { - "type": "apiKey", - "in": "header", - "name": "X-API-Key", - "description": "API key request header" - }, - "apiKeyQuery": { - "type": "apiKey", - "in": "query", - "name": "api_key", - "description": "API key query parameter" - }, - "apiKeyCookie": { - "type": "apiKey", - "in": "cookie", - "name": "api_key", - "description": "API key browser cookie" + }, + "/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" + } + ] + } + }, + "/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" + } + ] }, - "oAuth2": { - "type": "oauth2", - "description": "OAuth 2.0 authentication", - "flows": { - "authorizationCode": { - "authorizationUrl": "https://galaxy.scalar.com/oauth/authorize", - "tokenUrl": "https://galaxy.scalar.com/oauth/token", - "scopes": { - "read:account": "read your account information", - "write:planets": "modify planets in your account", - "read:planets": "read your planets" - }, - "refreshUrl": "", - "x-usePkce": "SHA-256" - }, - "clientCredentials": { - "tokenUrl": "https://galaxy.scalar.com/oauth/token", - "scopes": { - "read:account": "read your account information", - "write:planets": "modify planets in your account", - "read:planets": "read your planets" - }, - "refreshUrl": "" - }, - "implicit": { - "authorizationUrl": "https://galaxy.scalar.com/oauth/authorize", - "scopes": { - "read:account": "read your account information", - "write:planets": "modify planets in your account", - "read:planets": "read your planets" - }, - "refreshUrl": "" - }, - "password": { - "tokenUrl": "https://galaxy.scalar.com/oauth/token", - "scopes": { - "read:account": "read your account information", - "write:planets": "modify planets in your account", - "read:planets": "read your planets" - }, - "refreshUrl": "" + "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)\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: sdk.F[[]string]([]string{\"\"}),\n\t\tAllowedUsers: sdk.F[[]string]([]string{\"\"}),\n\t\tIsPrivate: sdk.F[bool](false),\n\t\tName: sdk.F[string](\"\"),\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: \"\", slug: \"xxx\", is_private: false, allowed_users: [], allowed_domains: [] })\nputs response.inspect" } - } - }, - "openIdConnect": { - "type": "openIdConnect", - "openIdConnectUrl": "https://galaxy.scalar.com/.well-known/openid-configuration", - "description": "OpenID Connect Authentication" - } - }, - "parameters": { - "planetId": { - "name": "planetId", - "description": "The ID of the planet to get", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64", - "examples": [ - 1 - ] - } - }, - "limit": { - "name": "limit", - "description": "The number of items to return", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "default": 10 - } - }, - "offset": { - "name": "offset", - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "default": 0 - } + ] } }, - "responses": { - "ImageUploaded": { - "description": "Image uploaded", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ImageUploadedMessage" + "/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 + } + } } }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/ImageUploadedMessage" - } - } - } - }, - "BadRequest": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } } }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } } - } - } - }, - "Forbidden": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ForbiddenError" + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } } }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/ForbiddenError" + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } } - } - } - }, - "NotFound": { - "description": "NotFound", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } } }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } } } - } - }, - "Unauthorized": { - "description": "Unauthorized", - "content": { - "application/json": { + }, + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } + "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);" }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } + { + "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)\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" } - } - }, - "Conflict": { - "description": "Conflict", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Conflict" + ] + } + }, + "/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" + } + } + } } }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/Conflict" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } } - } - } - }, - "UnprocessableEntity": { - "description": "Unprocessable Entity", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnprocessableEntity" + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } } }, - "application/xml": { - "schema": { - "$ref": "#/components/schemas/UnprocessableEntity" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } } - } - } - } - }, - "schemas": { - "User": { - "description": "A user", - "type": "object", - "xml": { - "name": "user" - }, - "properties": { - "id": { - "type": "integer", - "format": "int64", - "readOnly": true, - "examples": [ - 1 - ] }, - "name": { - "type": "string", - "examples": [ - "Marc" - ] - } - } - }, - "Credentials": { - "description": "Credentials to authenticate a user", - "type": "object", - "required": [ - "email", - "password" - ], - "properties": { - "email": { - "type": "string", - "format": "email", - "examples": [ - "marc@scalar.com" - ] + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - "password": { - "type": "string", - "writeOnly": true, - "examples": [ - "i-love-scalar" - ] - } - } - }, - "Token": { - "description": "A token to authenticate a user", - "type": "object", - "properties": { - "token": { - "type": "string", - "examples": [ - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" - ] + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } } - } - }, - "Planet": { - "description": "A planet in the Scalar Galaxy", - "type": "object", - "required": [ - "id", - "name" - ], - "xml": { - "name": "planet" }, - "properties": { - "id": { - "type": "integer", - "format": "int64", - "readOnly": true, - "examples": [ - 1 - ], - "x-variable": "planetId" + "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);" }, - "name": { - "type": "string", - "examples": [ - "Mars", - "Jupiter", - "HD 40307g" - ] + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi namespaces list --bearer-auth \"$BEARER_AUTH\"" }, - "description": { - "type": [ - "string", - "null" - ], - "examples": [ - "The red planet", - "A gas giant with a great red spot" - ] + { + "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)" }, - "type": { - "type": "string", - "enum": [ - "terrestrial", - "gas_giant", - "ice_giant", - "dwarf", - "super_earth" - ], - "examples": [ - "terrestrial" - ] + { + "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}" }, - "habitabilityIndex": { - "type": "number", - "format": "float", - "minimum": 0, - "maximum": 1, - "description": "A score from 0 to 1 indicating potential habitability", - "examples": [ - 0.68 - ] + { + "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);" }, - "physicalProperties": { - "type": "object", - "properties": { - "mass": { - "type": "number", - "format": "float", - "description": "Mass in Earth masses", - "examples": [ - 0.107 - ] - }, - "radius": { - "type": "number", - "format": "float", - "description": "Radius in Earth radii", - "examples": [ - 0.532 - ] - }, - "gravity": { - "type": "number", - "format": "float", - "description": "Surface gravity in Earth g", - "examples": [ - 0.378 - ] - }, - "temperature": { - "type": "object", - "properties": { - "min": { - "type": "number", - "format": "float", - "description": "Minimum temperature in Kelvin", - "examples": [ - 130 - ] - }, - "max": { - "type": "number", - "format": "float", - "description": "Maximum temperature in Kelvin", - "examples": [ - 308 - ] + { + "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" + } + ] + } + }, + "/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" + } }, - "average": { - "type": "number", - "format": "float", - "description": "Average temperature in Kelvin", - "examples": [ - 210 - ] - } + "required": [ + "accessToken" + ], + "additionalProperties": false } } } }, - "atmosphere": { - "type": "array", - "description": "Atmospheric composition", - "items": { - "type": "object", - "properties": { - "compound": { - "type": "string", - "examples": [ - "CO2", - "N2" - ] - }, - "percentage": { - "type": "number", - "format": "float", - "examples": [ - 95.3 - ] + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" } } } }, - "discoveredAt": { - "type": "string", - "format": "date-time", - "examples": [ - "1610-01-07T00:00:00Z" - ] - }, - "image": { - "type": "string", - "nullable": true, - "examples": [ - "https://cdn.scalar.com/photos/mars.jpg" - ] - }, - "satellites": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Satellite" + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } } }, - "creator": { - "$ref": "#/components/schemas/User" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "examples": [ - [ - "solar-system", - "rocky", - "explored" - ] - ] + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - "lastUpdated": { - "type": "string", - "format": "date-time", - "readOnly": true, - "examples": [ - "2024-01-15T14:30:00Z" - ] + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - "callbackUrl": { - "type": "string", - "format": "uri", - "description": "URL to receive notifications about this planet", - "examples": [ - "https://example.com/webhook" - ] + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } } - } - }, - "PaginatedResource": { - "description": "A paginated resource", - "type": "object", - "properties": { - "meta": { - "type": "object", - "properties": { - "limit": { - "type": "integer", - "format": "int64", - "examples": [ - 10 - ] - }, - "offset": { - "type": "integer", - "format": "int64", - "examples": [ - 0 - ] - }, - "total": { - "type": "integer", - "format": "int64", - "examples": [ - 100 - ] - }, - "next": { - "type": [ - "string", - "null" + }, + "security": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "personalToken": { + "type": "string" + } + }, + "required": [ + "personalToken" ], - "examples": [ - "/planets?limit=10&offset=10" - ] + "additionalProperties": false } } - } - } - }, - "ImageUploadedMessage": { - "x-scalar-ignore": true, - "description": "Message about an image upload", - "type": "object", - "properties": { - "message": { - "type": "string", - "examples": [ - "Image uploaded successfully" - ] - }, - "imageUrl": { - "type": "string", - "description": "The URL where the uploaded image can be accessed", - "examples": [ - "https://cdn.scalar.com/images/8f47c132-9d1f-4f83-b5a4-91db5ee757ab.jpg" - ] - }, - "uploadedAt": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the image was uploaded", - "examples": [ - "2024-01-15T14:30:00Z" - ] - }, - "fileSize": { - "type": "integer", - "description": "Size of the uploaded image in bytes", - "examples": [ - 1048576 - ] }, - "mimeType": { - "type": "string", - "description": "The content type of the uploaded image", - "examples": [ - "image/jpeg", - "image/png" - ] - } - } - }, - "BadRequestError": { - "x-scalar-ignore": true, - "description": "RFC 7807 (https://datatracker.ietf.org/doc/html/rfc7807)", - "type": "object", - "properties": { - "type": { - "type": "string", - "examples": [ - "https://example.com/errors/bad-request" - ] + "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);" }, - "title": { - "type": "string", - "examples": [ - "Bad Request" - ] + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi authentication exchange-personal-token --bearer-auth \"$BEARER_AUTH\" --personal-token 'personalToken'" }, - "status": { - "type": "integer", - "format": "int64", - "examples": [ - 400 - ] + { + "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)\nprint(authentication)" }, - "detail": { - "type": "string", - "examples": [ - "The request was invalid." - ] - } - } - }, - "ForbiddenError": { - "x-scalar-ignore": true, - "description": "RFC 7807 (https://datatracker.ietf.org/doc/html/rfc7807)", - "type": "object", - "properties": { - "type": { - "type": "string", - "examples": [ - "https://example.com/errors/forbidden" - ] + { + "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: sdk.F[string](\"\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(authentication)\n}" }, - "title": { - "type": "string", - "examples": [ - "Forbidden" - ] + { + "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);" }, - "status": { - "type": "integer", - "format": "int64", - "examples": [ - 403 - ] + { + "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)" }, - "detail": { - "type": "string", - "examples": [ - "You are not authorized to access this resource." - ] + { + "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: \"\" })\nputs response.inspect" } - } - }, - "NotFoundError": { - "x-scalar-ignore": true, - "description": "RFC 7807 (https://datatracker.ietf.org/doc/html/rfc7807)", - "type": "object", - "properties": { - "type": { - "type": "string", - "examples": [ - "https://example.com/errors/not-found" - ] + ] + } + }, + "/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" + } + } + } }, - "title": { - "type": "string", - "examples": [ - "Not Found" - ] + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } }, - "status": { - "type": "integer", - "format": "int64", - "examples": [ - 404 - ] + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } }, - "detail": { - "type": "string", - "examples": [ - "The resource you are trying to access does not exist." - ] - } - } - }, - "UnauthorizedError": { - "x-scalar-ignore": true, - "description": "RFC 7807 (https://datatracker.ietf.org/doc/html/rfc7807)", - "type": "object", - "properties": { - "type": { - "type": "string", - "examples": [ - "https://example.com/errors/not-found" - ] + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } }, - "title": { - "type": "string", - "examples": [ - "Unauthorized" - ] + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } }, - "status": { - "type": "integer", - "format": "int64", - "examples": [ - 401 - ] + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } }, - "detail": { - "type": "string", - "examples": [ - "You are not authorized to access this resource." - ] + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } } - } - }, - "Conflict": { - "x-scalar-ignore": true, - "description": "RFC 7807 (https://datatracker.ietf.org/doc/html/rfc7807)", - "type": "object", - "properties": { - "type": { - "type": "string", - "examples": [ - "https://example.com/errors/conflict" - ] - }, - "title": { - "type": "string", - "examples": [ - "Conflict" - ] + }, + "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 listCurrentUser = await client.authentication.listCurrentUser();\nconsole.log(listCurrentUser);" }, - "status": { - "type": "integer", - "format": "int64", - "examples": [ - 409 - ] + { + "label": "Shell", + "lang": "Shell", + "source": "scalarapi authentication list-current-user --bearer-auth \"$BEARER_AUTH\"" }, - "detail": { - "type": "string", - "examples": [ - "The resource you are trying to access is in conflict." - ] - } - } - }, - "UnprocessableEntity": { - "x-scalar-ignore": true, - "description": "RFC 7807 (https://datatracker.ietf.org/doc/html/rfc7807)", - "type": "object", - "properties": { - "type": { - "type": "string", - "examples": [ - "https://example.com/errors/unprocessable-entity" - ] + { + "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)" }, - "title": { - "type": "string", - "examples": [ - "Unprocessable Entity" - ] + { + "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}" }, - "status": { - "type": "integer", - "format": "int64", - "examples": [ - 422 - ] + { + "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);" }, - "detail": { - "type": "string", - "examples": [ - "The request was invalid." - ] - } - } - }, - "Satellite": { - "description": "A natural satellite (moon) orbiting a planet", - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "examples": [ - "Phobos" - ] + { + "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)" }, - "diameter": { - "type": "number", - "format": "float", - "description": "Diameter in kilometers", - "examples": [ - 22.2 - ] + { + "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" } - } + ] } } } diff --git a/reference.md b/reference.md index bdd01ae..283de86 100644 --- a/reference.md +++ b/reference.md @@ -1,87 +1,428 @@ -# ScalarGalaxy Rust SDK Reference +# ScalarApi Rust SDK Reference ## Operations -### planets.listAllData +### registry.listAllApiDocuments -Get all planets +List all API Documents -- HTTP: `GET /planets` +- HTTP: `GET /v1/apis` - Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` -### planets.create +### registry.listApiDocuments -Create a planet +List API Documents in a namespace -- HTTP: `POST /planets` +- 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, 403` +- Errors: `400, 401, 403, 404, 422, 500` -### planets.retrieve +### schemas.list -Get a planet +List all shared components -- HTTP: `GET /planets/{planetId}` +- HTTP: `GET /v1/schemas/{namespace}` - Response body: `application/json` -- Errors: `404` +- Errors: `400, 401, 403, 404, 422, 500` -### planets.update +### schemas.create -Update a planet +Create a shared component -- HTTP: `PUT /planets/{planetId}` +- HTTP: `POST /v1/schemas/{namespace}` - Request body: `application/json` - Response body: `application/json` -- Errors: `400, 403, 404` +- Errors: `400, 401, 403, 404, 422, 500` -### planets.delete +### schemas.update -Delete a planet +Update shared component metadata -- HTTP: `DELETE /planets/{planetId}` -- Errors: `404` +- HTTP: `PATCH /v1/schemas/{namespace}/{slug}` +- Request body: `application/json` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` -### planets.uploadImage +### schemas.delete -Upload an image to a planet +Delete a shared component -- HTTP: `POST /planets/{planetId}/image` -- Request body: `multipart/form-data` +- HTTP: `DELETE /v1/schemas/{namespace}/{slug}` - Response body: `application/json` -- Errors: `400, 403, 404` +- Errors: `400, 401, 403, 404, 422, 500` + +### schemas.retrieveVersion -### authentication.createUser +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.deleteVersion + +Delete a shared component version + +- HTTP: `DELETE /v1/schemas/{namespace}/{slug}/version/{semver}` +- Response body: `application/json` +- Errors: `400, 401, 403, 404, 422, 500` -Create a user +### schemas.createVersion -- HTTP: `POST /user/signup` +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.createAccessGroup + +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, 409, 422` +- Errors: `400, 401, 403, 404, 422, 500` + +### schemas.deleteAccessGroup + +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.createToken +### authentication.exchangePersonalToken -Get a token +Exchange token -- HTTP: `POST /auth/token` +- HTTP: `POST /v1/auth/exchange` - Request body: `application/json` - Response body: `application/json` -- Errors: `400, 401, 403` +- Errors: `400, 401, 403, 404, 422, 500` -### authentication.listMe +### authentication.listCurrentUser -Get authenticated user +Get current user -- HTTP: `GET /me` +- HTTP: `GET /v1/auth/me` - Response body: `application/json` -- Errors: `401, 403` +- 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` -- `Credentials` -- `Token` -- `Planet` -- `PaginatedResource` -- `Satellite` diff --git a/scalar-sdk.manifest.json b/scalar-sdk.manifest.json index aa1a064..a05d9b0 100644 --- a/scalar-sdk.manifest.json +++ b/scalar-sdk.manifest.json @@ -1,148 +1,53 @@ { - "name": "ScalarGalaxy", - "slug": "scalarGalaxy", + "name": "ScalarApi", + "slug": "scalarApi", "generatorVersion": "0.19.0", "servers": [ - "https://galaxy.scalar.com", - "{protocol}://void.scalar.com/{path}" + "https://access.scalar.com" ], "environments": { - "production": "https://galaxy.scalar.com", - "responds_with_your_request_data": "{protocol}://void.scalar.com/{path}" + "production": "https://access.scalar.com", + "local": "http://127.0.0.1:4010" }, "environmentOrder": [ "production", - "responds_with_your_request_data" + "local" ], "auth": [ - "bearer", - "basic", - "apiKey", - "apiKey", - "apiKey", - "oauth2", - "oauth2" + "bearer" ], "authDetails": [ { "kind": "bearer", - "id": "bearerAuth" - }, - { - "kind": "basic", - "id": "basicAuth" - }, - { - "kind": "apiKey", - "id": "apiKeyHeader", - "in": "header", - "paramName": "X-API-Key" - }, - { - "kind": "apiKey", - "id": "apiKeyQuery", - "in": "query", - "paramName": "api_key" - }, - { - "kind": "apiKey", - "id": "apiKeyCookie", - "in": "cookie", - "paramName": "api_key" - }, - { - "kind": "oauth2", - "id": "oAuth2", - "flows": [ - { - "kind": "authorizationCode", - "authorizationUrl": "https://galaxy.scalar.com/oauth/authorize", - "tokenUrl": "https://galaxy.scalar.com/oauth/token", - "refreshUrl": "", - "scopes": [ - "read:account", - "write:planets", - "read:planets" - ] - }, - { - "kind": "clientCredentials", - "tokenUrl": "https://galaxy.scalar.com/oauth/token", - "refreshUrl": "", - "scopes": [ - "read:account", - "write:planets", - "read:planets" - ] - }, - { - "kind": "password", - "tokenUrl": "https://galaxy.scalar.com/oauth/token", - "refreshUrl": "", - "scopes": [ - "read:account", - "write:planets", - "read:planets" - ] - }, - { - "kind": "implicit", - "authorizationUrl": "https://galaxy.scalar.com/oauth/authorize", - "refreshUrl": "", - "scopes": [ - "read:account", - "write:planets", - "read:planets" - ] - } - ] - }, - { - "kind": "oauth2", - "id": "openIdConnect", - "flows": [], - "openIdConnectUrl": "https://galaxy.scalar.com/.well-known/openid-configuration" + "id": "BearerAuth", + "bearerFormat": "JWT" } ], "clientHeaderParams": [], "schemas": [ { - "name": "User", - "source": "User", + "name": "_400", + "source": "_400", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "id", - "publicName": "id", - "required": false, + "name": "message", + "publicName": "message", + "required": true, "deprecated": false, - "access": "readOnly", - "extensions": { - "source": [ - "examples" - ], - "examples": 1 - }, "type": { "kind": "primitive", - "type": "integer", - "format": "int64" + "type": "string" } }, { - "name": "name", - "publicName": "name", - "required": false, + "name": "code", + "publicName": "code", + "required": true, "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "Marc" - }, "type": { "kind": "primitive", "type": "string" @@ -153,42 +58,28 @@ } }, { - "name": "Credentials", - "source": "Credentials", + "name": "_401", + "source": "_401", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "email", - "publicName": "email", + "name": "message", + "publicName": "message", "required": true, "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "marc@scalar.com" - }, "type": { "kind": "primitive", - "type": "string", - "format": "email" + "type": "string" } }, { - "name": "password", - "publicName": "password", + "name": "code", + "publicName": "code", "required": true, "deprecated": false, - "access": "writeOnly", - "extensions": { - "source": [ - "examples" - ], - "examples": "i-love-scalar" - }, "type": { "kind": "primitive", "type": "string" @@ -199,24 +90,28 @@ } }, { - "name": "Token", - "source": "Token", + "name": "_403", + "source": "_403", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "token", - "publicName": "token", - "required": false, + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" - }, "type": { "kind": "primitive", "type": "string" @@ -227,419 +122,202 @@ } }, { - "name": "Planet", - "source": "Planet", + "name": "_404", + "source": "_404", "publicAliases": [], "deprecated": false, "type": { "kind": "object", "properties": [ { - "name": "id", - "publicName": "id", + "name": "message", + "publicName": "message", "required": true, "deprecated": false, - "access": "readOnly", - "extensions": { - "source": [ - "examples" - ], - "examples": 1 - }, "type": { "kind": "primitive", - "type": "integer", - "format": "int64" + "type": "string" } }, { - "name": "name", - "publicName": "name", + "name": "code", + "publicName": "code", "required": true, "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "Mars" - }, "type": { "kind": "primitive", "type": "string" } - }, + } + ], + "additionalProperties": false + } + }, + { + "name": "_422", + "source": "_422", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ { - "name": "description", - "publicName": "description", - "required": false, + "name": "message", + "publicName": "message", + "required": true, "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "The red planet" - }, "type": { - "kind": "union", - "variants": [ - { - "kind": "primitive", - "type": "string" - }, - { - "kind": "null" - } - ] + "kind": "primitive", + "type": "string" } }, { - "name": "type", - "publicName": "type", - "required": false, + "name": "code", + "publicName": "code", + "required": true, "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "terrestrial" - }, - "type": { - "kind": "enum", - "values": [ - "terrestrial", - "gas_giant", - "ice_giant", - "dwarf", - "super_earth" - ], - "names": [ - "Terrestrial", - "GasGiant", - "IceGiant", - "Dwarf", - "SuperEarth" - ], - "deprecations": [ - false, - false, - false, - false, - false - ] + "type": { + "kind": "primitive", + "type": "string" } - }, + } + ], + "additionalProperties": false + } + }, + { + "name": "_500", + "source": "_500", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ { - "name": "habitabilityIndex", - "publicName": "habitabilityIndex", - "required": false, + "name": "message", + "publicName": "message", + "required": true, "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 0.68 - }, "type": { "kind": "primitive", - "type": "number", - "format": "float", - "validation": {} + "type": "string" } }, { - "name": "physicalProperties", - "publicName": "physicalProperties", - "required": false, + "name": "code", + "publicName": "code", + "required": true, "deprecated": false, "type": { - "kind": "object", - "properties": [ - { - "name": "mass", - "publicName": "mass", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 0.107 - }, - "type": { - "kind": "primitive", - "type": "number", - "format": "float" - } - }, - { - "name": "radius", - "publicName": "radius", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 0.532 - }, - "type": { - "kind": "primitive", - "type": "number", - "format": "float" - } - }, - { - "name": "gravity", - "publicName": "gravity", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 0.378 - }, - "type": { - "kind": "primitive", - "type": "number", - "format": "float" - } - }, - { - "name": "temperature", - "publicName": "temperature", - "required": false, - "deprecated": false, - "type": { - "kind": "object", - "properties": [ - { - "name": "min", - "publicName": "min", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 130 - }, - "type": { - "kind": "primitive", - "type": "number", - "format": "float" - } - }, - { - "name": "max", - "publicName": "max", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 308 - }, - "type": { - "kind": "primitive", - "type": "number", - "format": "float" - } - }, - { - "name": "average", - "publicName": "average", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 210 - }, - "type": { - "kind": "primitive", - "type": "number", - "format": "float" - } - } - ], - "additionalProperties": false - } - } - ], - "additionalProperties": false + "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": "atmosphere", - "publicName": "atmosphere", - "required": false, + "name": "version", + "publicName": "version", + "required": true, "deprecated": false, "type": { - "kind": "array", - "items": { - "kind": "object", - "properties": [ - { - "name": "compound", - "publicName": "compound", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "CO2" - }, - "type": { - "kind": "primitive", - "type": "string" - } - }, - { - "name": "percentage", - "publicName": "percentage", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 95.3 - }, - "type": { - "kind": "primitive", - "type": "number", - "format": "float" - } - } - ], - "additionalProperties": false - } + "kind": "ref", + "name": "Version" } }, { - "name": "discoveredAt", - "publicName": "discoveredAt", - "required": false, + "name": "title", + "publicName": "title", + "required": true, "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "1610-01-07T00:00:00Z" - }, "type": { "kind": "primitive", "type": "string", - "format": "date-time" + "validation": { + "maxLength": 100 + } } }, { - "name": "image", - "publicName": "image", - "required": false, + "name": "slug", + "publicName": "slug", + "required": true, "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "https://cdn.scalar.com/photos/mars.jpg" - }, "type": { - "kind": "union", - "variants": [ - { - "kind": "primitive", - "type": "string" - }, - { - "kind": "null" - } - ] + "kind": "ref", + "name": "Slug" } }, { - "name": "satellites", - "publicName": "satellites", - "required": false, + "name": "description", + "publicName": "description", + "required": true, "deprecated": false, "type": { - "kind": "array", - "items": { - "kind": "ref", - "name": "Satellite" - } + "kind": "primitive", + "type": "string" } }, { - "name": "creator", - "publicName": "creator", - "required": false, + "name": "namespace", + "publicName": "namespace", + "required": true, "deprecated": false, "type": { "kind": "ref", - "name": "User" + "name": "Namespace" } }, { - "name": "tags", - "publicName": "tags", - "required": false, + "name": "isPrivate", + "publicName": "isPrivate", + "required": true, "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": [ - "solar-system", - "rocky", - "explored" - ] - }, "type": { - "kind": "array", - "items": { - "kind": "primitive", - "type": "string" - } + "kind": "primitive", + "type": "boolean" } }, { - "name": "lastUpdated", - "publicName": "lastUpdated", - "required": false, + "name": "tags", + "publicName": "tags", + "required": true, "deprecated": false, - "access": "readOnly", - "extensions": { - "source": [ - "examples" - ], - "examples": "2024-01-15T14:30:00Z" - }, "type": { - "kind": "primitive", - "type": "string", - "format": "date-time" + "kind": "unknown" } }, { - "name": "callbackUrl", - "publicName": "callbackUrl", - "required": false, + "name": "versions", + "publicName": "versions", + "required": true, "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "https://example.com/webhook" - }, "type": { - "kind": "primitive", - "type": "string", - "format": "uri" + "kind": "array", + "items": { + "kind": "ref", + "name": "ManagedDocVersion" + } } } ], @@ -647,205 +325,8292 @@ } }, { - "name": "PaginatedResource", - "source": "PaginatedResource", + "name": "Nanoid", + "source": "Nanoid", "publicAliases": [], "deprecated": false, "type": { - "kind": "object", - "properties": [ - { - "name": "meta", - "publicName": "meta", - "required": false, - "deprecated": false, - "type": { - "kind": "object", - "properties": [ - { - "name": "limit", - "publicName": "limit", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 10 - }, - "type": { - "kind": "primitive", - "type": "integer", - "format": "int64" - } - }, - { - "name": "offset", - "publicName": "offset", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 0 - }, - "type": { - "kind": "primitive", - "type": "integer", - "format": "int64" - } - }, - { - "name": "total", - "publicName": "total", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 100 - }, - "type": { - "kind": "primitive", - "type": "integer", - "format": "int64" - } - }, - { - "name": "next", - "publicName": "next", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "/planets?limit=10&offset=10" - }, - "type": { - "kind": "union", - "variants": [ - { - "kind": "primitive", - "type": "string" - }, - { - "kind": "null" - } - ] - } - } - ], - "additionalProperties": false - } - } - ], - "additionalProperties": false + "kind": "primitive", + "type": "string", + "validation": { + "minLength": 5 + } } }, { - "name": "Satellite", - "source": "Satellite", + "name": "Version", + "source": "Version", "publicAliases": [], "deprecated": false, "type": { - "kind": "object", - "properties": [ - { - "name": "name", - "publicName": "name", - "required": true, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": "Phobos" - }, - "type": { - "kind": "primitive", - "type": "string" - } - }, - { - "name": "diameter", - "publicName": "diameter", - "required": false, - "deprecated": false, - "extensions": { - "source": [ - "examples" - ], - "examples": 22.2 - }, - "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": "number", - "format": "float" + "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": "unknown" + } + }, + { + "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", + "loginPortals", + "rules", + "themes", + "teams", + "scalarDocs", + "namespaces", + "authentication" + ], + "publicResources": [ + "registry", + "schemas", + "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": [], + "bodyParamDetails": [], + "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": [], + "bodyParamDetails": [], + "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" + ], + "bodyParamDetails": [ + { + "name": "title", + "required": true + }, + { + "name": "description", + "required": false + }, + { + "name": "version", + "required": true + }, + { + "name": "slug", + "required": true + }, + { + "name": "ruleset", + "required": false + }, + { + "name": "isPrivate", + "required": false + }, + { + "name": "document", + "required": true + } + ], + "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" + ], + "bodyParamDetails": [ + { + "name": "title", + "required": false + }, + { + "name": "description", + "required": false + }, + { + "name": "isPrivate", + "required": false + }, + { + "name": "ruleset", + "required": false + } + ], + "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": [], + "bodyParamDetails": [], + "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": [], + "bodyParamDetails": [], + "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" + ], + "bodyParamDetails": [ + { + "name": "document", + "required": true + }, + { + "name": "lastKnownVersionSha", + "required": false + } + ], + "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": [], + "bodyParamDetails": [], + "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": [], + "bodyParamDetails": [], + "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" + ], + "bodyParamDetails": [ + { + "name": "version", + "required": true + }, + { + "name": "document", + "required": true + }, + { + "name": "force", + "required": false + }, + { + "name": "lastKnownVersionSha", + "required": false + } + ], + "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" + ], + "bodyParamDetails": [ + { + "name": "accessGroupSlug", + "required": true + } + ], + "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" + ], + "bodyParamDetails": [ + { + "name": "accessGroupSlug", + "required": true + } + ], + "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": [], + "bodyParamDetails": [], + "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" + ], + "bodyParamDetails": [ + { + "name": "title", + "required": true + }, + { + "name": "description", + "required": false + }, + { + "name": "version", + "required": true + }, + { + "name": "slug", + "required": true + }, + { + "name": "isPrivate", + "required": false + }, + { + "name": "document", + "required": true + } + ], + "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" + ], + "bodyParamDetails": [ + { + "name": "title", + "required": false + }, + { + "name": "description", + "required": false + }, + { + "name": "isPrivate", + "required": false + } + ], + "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": [], + "bodyParamDetails": [], + "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", + "publicResource": "schemas", + "operation": "retrieveVersion", + "publicOperation": "retrieveVersion", + "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": [], + "bodyParamDetails": [], + "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": "SchemaRetrieveVersionParams" + }, + "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", + "publicResource": "schemas", + "operation": "deleteVersion", + "publicOperation": "deleteVersion", + "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": [], + "bodyParamDetails": [], + "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": "SchemaDeleteVersionParams" + }, + "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": "createVersion", + "publicOperation": "createVersion", + "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" + ], + "bodyParamDetails": [ + { + "name": "version", + "required": true + }, + { + "name": "document", + "required": true + } + ], + "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": "SchemaCreateVersionParams" + }, + "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": "createAccessGroup", + "publicOperation": "createAccessGroup", + "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" + ], + "bodyParamDetails": [ + { + "name": "accessGroupSlug", + "required": true + } + ], + "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": "SchemaCreateAccessGroupParams" + }, + "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": "deleteAccessGroup", + "publicOperation": "deleteAccessGroup", + "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" + ], + "bodyParamDetails": [ + { + "name": "accessGroupSlug", + "required": true + } + ], + "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": "SchemaDeleteAccessGroupParams" + }, + "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": [], + "bodyParamDetails": [], + "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" + ], + "bodyParamDetails": [ + { + "name": "title", + "required": false + } + ], + "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": [], + "bodyParamDetails": [], + "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" + ], + "bodyParamDetails": [ + { + "name": "title", + "required": true + }, + { + "name": "slug", + "required": true + }, + { + "name": "email", + "required": true + }, + { + "name": "page", + "required": true + } + ], + "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": [], + "bodyParamDetails": [], + "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": [], + "bodyParamDetails": [], + "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" + ], + "bodyParamDetails": [ + { + "name": "title", + "required": true + }, + { + "name": "description", + "required": false + }, + { + "name": "slug", + "required": true + }, + { + "name": "isPrivate", + "required": false + }, + { + "name": "document", + "required": true + } + ], + "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" + ], + "bodyParamDetails": [ + { + "name": "namespace", + "required": false + }, + { + "name": "slug", + "required": false + }, + { + "name": "title", + "required": false + }, + { + "name": "description", + "required": false + }, + { + "name": "isPrivate", + "required": false + } + ], + "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": [], + "bodyParamDetails": [], + "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": [], + "bodyParamDetails": [], + "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" + ], + "bodyParamDetails": [ + { + "name": "accessGroupSlug", + "required": true + } + ], + "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" + ], + "bodyParamDetails": [ + { + "name": "accessGroupSlug", + "required": true + } + ], + "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": [], + "bodyParamDetails": [], + "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" + ], + "bodyParamDetails": [ + { + "name": "name", + "required": true + }, + { + "name": "description", + "required": false + }, + { + "name": "slug", + "required": true + }, + { + "name": "document", + "required": true + } + ], + "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" + ], + "bodyParamDetails": [ + { + "name": "name", + "required": false + }, + { + "name": "description", + "required": false + } + ], + "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" + ], + "bodyParamDetails": [ + { + "name": "document", + "required": true + } + ], + "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" } ], - "additionalProperties": false - } - } - ], - "resources": [ - "planets", - "authentication" - ], - "publicResources": [ - "planets", - "authentication" - ], - "operations": [ + "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": "planets", - "publicResource": "planets", - "operation": "listAllData", - "publicOperation": "listAllData", + "resource": "themes", + "publicResource": "themes", + "operation": "delete", + "publicOperation": "delete", "deprecated": false, - "method": "GET", - "path": "/planets", - "pathParams": [], - "publicPathParams": [], - "queryParams": [ - "limit", - "offset" + "method": "DELETE", + "path": "/v1/themes/{slug}", + "pathParams": [ + "slug" ], - "publicQueryParams": [ - "limit", - "offset" + "publicPathParams": [ + "slug" ], + "queryParams": [], + "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [], "publicBodyParams": [], - "bodyParamDetails": [], - "pathParamDetails": [], - "queryParamDetails": [ - { - "name": "limit", - "required": false, - "style": "form", - "explode": true, - "defaultValue": 10 - }, + "bodyParamDetails": [], + "publicPositionalParams": [ + "slug" + ], + "pathParamDetails": [ { - "name": "offset", - "required": false, - "style": "form", - "explode": true, - "defaultValue": 0 + "name": "slug", + "required": true, + "style": "simple", + "explode": false } ], + "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "PlanetListAllDataParams" + "publicName": "ThemeDeleteParams" }, "response": { "status": "200", @@ -855,171 +8620,316 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } ] }, - "errorResponses": [], - "responseLinks": [], - "transport": "http" - }, - { - "resource": "planets", - "publicResource": "planets", - "operation": "create", - "publicOperation": "create", - "deprecated": false, - "method": "POST", - "path": "/planets", - "pathParams": [], - "publicPathParams": [], - "queryParams": [], - "publicQueryParams": [], - "headerParams": [], - "publicHeaderParams": [], - "bodyParams": [ - "id", - "name", - "description", - "type", - "habitabilityIndex", - "physicalProperties", - "atmosphere", - "discoveredAt", - "image", - "satellites", - "creator", - "tags", - "lastUpdated", - "callbackUrl" - ], - "publicBodyParams": [ - "id", - "name", - "description", - "type", - "habitabilityIndex", - "physicalProperties", - "atmosphere", - "discoveredAt", - "image", - "satellites", - "creator", - "tags", - "lastUpdated", - "callbackUrl" - ], - "bodyParamDetails": [ - { - "name": "id", - "required": true - }, - { - "name": "name", - "required": true - }, - { - "name": "description", - "required": false - }, - { - "name": "type", - "required": false - }, - { - "name": "habitabilityIndex", - "required": false - }, - { - "name": "physicalProperties", - "required": false - }, - { - "name": "atmosphere", - "required": false - }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ { - "name": "discoveredAt", - "required": false + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } }, { - "name": "image", - "required": false + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } }, { - "name": "satellites", - "required": false + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } }, { - "name": "creator", - "required": false + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } }, { - "name": "tags", - "required": false + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } }, { - "name": "lastUpdated", - "required": false - }, + "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": [], + "bodyParamDetails": [], + "publicPositionalParams": [ + "slug" + ], + "pathParamDetails": [ { - "name": "callbackUrl", - "required": false + "name": "slug", + "required": true, + "style": "simple", + "explode": false } ], - "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "PlanetCreateParams" + "publicName": "ThemeRetrieveParams" }, - "requestBody": { - "contentType": "application/json", - "encoding": "json", + "response": { + "status": "200", + "contentType": "text/plain", + "encoding": "text", "contents": [ { - "contentType": "application/json", - "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "json" + "contentType": "text/plain", + "encoding": "text" } - ], - "required": false, - "publicName": "body", - "publicIdentifier": "body" + ] + }, + "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": [], + "bodyParamDetails": [], + "publicPositionalParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], "response": { - "status": "201", + "status": "200", "contentType": "application/json", "encoding": "json", "contents": [ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } ] }, - "responseModel": { - "name": "Planet", - "publicAliases": [] - }, "result": { - "successStatus": "201", + "successStatus": "200", "errorStatuses": [ "400", - "403" + "401", + "403", + "404", + "422", + "500" ] }, "errorResponses": [ @@ -1031,12 +8941,27 @@ { "contentType": "application/json", "encoding": "json" - }, + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ { - "contentType": "application/xml", - "encoding": "binary" + "contentType": "application/json", + "encoding": "json" } - ] + ], + "model": { + "name": "_401", + "publicAliases": [] + } }, { "status": "403", @@ -1046,31 +8971,72 @@ { "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/xml", - "encoding": "binary" + "contentType": "application/json", + "encoding": "json" } - ] + ], + "model": { + "name": "_500", + "publicAliases": [] + } } ], "responseLinks": [], "transport": "http" }, { - "resource": "planets", - "publicResource": "planets", - "operation": "retrieve", - "publicOperation": "retrieve", + "resource": "scalarDocs", + "publicResource": "scalarDocs", + "operation": "listGuides", + "publicOperation": "listGuides", "deprecated": false, "method": "GET", - "path": "/planets/{planetId}", - "pathParams": [ - "planetId" - ], - "publicPathParams": [ - "planetId" - ], + "path": "/v1/guides", + "pathParams": [], + "publicPathParams": [], "queryParams": [], "publicQueryParams": [], "headerParams": [], @@ -1078,22 +9044,13 @@ "bodyParams": [], "publicBodyParams": [], "bodyParamDetails": [], - "pathParamDetails": [ - { - "name": "planetId", - "required": true, - "style": "simple", - "explode": false - } - ], + "publicPositionalParams": [], + "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], - "paramsModel": { - "publicName": "PlanetRetrieveParams" - }, "response": { "status": "200", "contentType": "application/json", @@ -1102,24 +9059,66 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } ] }, - "responseModel": { - "name": "Planet", - "publicAliases": [] - }, "result": { "successStatus": "200", "errorStatuses": [ - "404" + "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", @@ -1128,140 +9127,106 @@ { "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/xml", - "encoding": "binary" + "contentType": "application/json", + "encoding": "json" } - ] + ], + "model": { + "name": "_500", + "publicAliases": [] + } } ], "responseLinks": [], "transport": "http" }, { - "resource": "planets", - "publicResource": "planets", - "operation": "update", - "publicOperation": "update", + "resource": "scalarDocs", + "publicResource": "scalarDocs", + "operation": "createGuide", + "publicOperation": "createGuide", "deprecated": false, - "method": "PUT", - "path": "/planets/{planetId}", - "pathParams": [ - "planetId" - ], - "publicPathParams": [ - "planetId" - ], + "method": "POST", + "path": "/v1/guides", + "pathParams": [], + "publicPathParams": [], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "id", "name", - "description", - "type", - "habitabilityIndex", - "physicalProperties", - "atmosphere", - "discoveredAt", - "image", - "satellites", - "creator", - "tags", - "lastUpdated", - "callbackUrl" + "slug", + "isPrivate", + "allowedUsers", + "allowedDomains" ], "publicBodyParams": [ - "id", "name", - "description", - "type", - "habitabilityIndex", - "physicalProperties", - "atmosphere", - "discoveredAt", - "image", - "satellites", - "creator", - "tags", - "lastUpdated", - "callbackUrl" + "slug", + "isPrivate", + "allowedUsers", + "allowedDomains" ], "bodyParamDetails": [ - { - "name": "id", - "required": true - }, { "name": "name", "required": true }, { - "name": "description", - "required": false - }, - { - "name": "type", - "required": false - }, - { - "name": "habitabilityIndex", + "name": "slug", "required": false }, { - "name": "physicalProperties", - "required": false - }, - { - "name": "atmosphere", - "required": false - }, - { - "name": "discoveredAt", - "required": false - }, - { - "name": "image", - "required": false - }, - { - "name": "satellites", - "required": false - }, - { - "name": "creator", - "required": false - }, - { - "name": "tags", - "required": false + "name": "isPrivate", + "required": true }, { - "name": "lastUpdated", - "required": false + "name": "allowedUsers", + "required": true }, { - "name": "callbackUrl", - "required": false - } - ], - "pathParamDetails": [ - { - "name": "planetId", - "required": true, - "style": "simple", - "explode": false + "name": "allowedDomains", + "required": true } ], + "publicPositionalParams": [], + "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "PlanetUpdateParams" + "publicName": "ScalarDocCreateGuideParams" }, "requestBody": { "contentType": "application/json", @@ -1270,13 +9235,9 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "json" } ], - "required": false, + "required": true, "publicName": "body", "publicIdentifier": "body" }, @@ -1288,23 +9249,18 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } ] }, - "responseModel": { - "name": "Planet", - "publicAliases": [] - }, "result": { "successStatus": "200", "errorStatuses": [ "400", + "401", "403", - "404" + "404", + "422", + "500" ] }, "errorResponses": [ @@ -1316,12 +9272,27 @@ { "contentType": "application/json", "encoding": "json" - }, + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ { - "contentType": "application/xml", - "encoding": "binary" + "contentType": "application/json", + "encoding": "json" } - ] + ], + "model": { + "name": "_401", + "publicAliases": [] + } }, { "status": "403", @@ -1331,12 +9302,12 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } - ] + ], + "model": { + "name": "_403", + "publicAliases": [] + } }, { "status": "404", @@ -1346,113 +9317,74 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" - } - ] - } - ], - "responseLinks": [], - "transport": "http" - }, - { - "resource": "planets", - "publicResource": "planets", - "operation": "delete", - "publicOperation": "delete", - "deprecated": false, - "method": "DELETE", - "path": "/planets/{planetId}", - "pathParams": [ - "planetId" - ], - "publicPathParams": [ - "planetId" - ], - "queryParams": [], - "publicQueryParams": [], - "headerParams": [], - "publicHeaderParams": [], - "bodyParams": [], - "publicBodyParams": [], - "bodyParamDetails": [], - "pathParamDetails": [ - { - "name": "planetId", - "required": true, - "style": "simple", - "explode": false - } - ], - "queryParamDetails": [], - "headerParamDetails": [], - "cookieParams": [], - "publicCookieParams": [], - "cookieParamDetails": [], - "paramsModel": { - "publicName": "PlanetDeleteParams" - }, - "result": { - "successStatus": "204", - "errorStatuses": [ - "404" - ] - }, - "errorResponses": [ + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, { - "status": "404", + "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/xml", - "encoding": "binary" + "contentType": "application/json", + "encoding": "json" } - ] + ], + "model": { + "name": "_500", + "publicAliases": [] + } } ], "responseLinks": [], "transport": "http" }, { - "resource": "planets", - "publicResource": "planets", - "operation": "uploadImage", - "publicOperation": "uploadImage", + "resource": "scalarDocs", + "publicResource": "scalarDocs", + "operation": "publishGuide", + "publicOperation": "publishGuide", "deprecated": false, "method": "POST", - "path": "/planets/{planetId}/image", + "path": "/v1/guides/{slug}/publish", "pathParams": [ - "planetId" + "slug" ], "publicPathParams": [ - "planetId" + "slug" ], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [ - "image" - ], - "publicBodyParams": [ - "image" - ], - "bodyParamDetails": [ - { - "name": "image", - "required": false - } + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [ + "slug" ], "pathParamDetails": [ { - "name": "planetId", + "name": "slug", "required": true, "style": "simple", "explode": false @@ -1464,20 +9396,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "PlanetUploadImageParams" - }, - "requestBody": { - "contentType": "multipart/form-data", - "encoding": "multipart", - "contents": [ - { - "contentType": "multipart/form-data", - "encoding": "multipart" - } - ], - "required": false, - "publicName": "body", - "publicIdentifier": "body" + "publicName": "ScalarDocPublishGuideParams" }, "response": { "status": "200", @@ -1487,10 +9406,6 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } ] }, @@ -1498,8 +9413,11 @@ "successStatus": "200", "errorStatuses": [ "400", + "401", "403", - "404" + "404", + "422", + "500" ] }, "errorResponses": [ @@ -1511,12 +9429,27 @@ { "contentType": "application/json", "encoding": "json" - }, + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ { - "contentType": "application/xml", - "encoding": "binary" + "contentType": "application/json", + "encoding": "json" } - ] + ], + "model": { + "name": "_401", + "publicAliases": [] + } }, { "status": "403", @@ -1526,12 +9459,12 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } - ] + ], + "model": { + "name": "_403", + "publicAliases": [] + } }, { "status": "404", @@ -1541,114 +9474,91 @@ { "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/xml", - "encoding": "binary" + "contentType": "application/json", + "encoding": "json" } - ] + ], + "model": { + "name": "_500", + "publicAliases": [] + } } ], "responseLinks": [], "transport": "http" }, { - "resource": "authentication", - "publicResource": "authentication", - "operation": "createUser", - "publicOperation": "createUser", + "resource": "namespaces", + "publicResource": "namespaces", + "operation": "list", + "publicOperation": "list", "deprecated": false, - "method": "POST", - "path": "/user/signup", + "method": "GET", + "path": "/v1/namespaces", "pathParams": [], "publicPathParams": [], "queryParams": [], "publicQueryParams": [], "headerParams": [], "publicHeaderParams": [], - "bodyParams": [ - "id", - "name", - "email", - "password" - ], - "publicBodyParams": [ - "id", - "name", - "email", - "password" - ], - "bodyParamDetails": [ - { - "name": "id", - "required": false - }, - { - "name": "name", - "required": false - }, - { - "name": "email", - "required": true - }, - { - "name": "password", - "required": true - } - ], + "bodyParams": [], + "publicBodyParams": [], + "bodyParamDetails": [], + "publicPositionalParams": [], "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], "cookieParams": [], "publicCookieParams": [], "cookieParamDetails": [], - "paramsModel": { - "publicName": "AuthenticationCreateUserParams" - }, - "requestBody": { - "contentType": "application/json", - "encoding": "json", - "contents": [ - { - "contentType": "application/json", - "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "json" - } - ], - "required": false, - "publicName": "body", - "publicIdentifier": "body" - }, "response": { - "status": "201", + "status": "200", "contentType": "application/json", "encoding": "json", "contents": [ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } ] }, - "responseModel": { - "name": "User", - "publicAliases": [] - }, "result": { - "successStatus": "201", + "successStatus": "200", "errorStatuses": [ "400", "401", "403", - "409", - "422" + "404", + "422", + "500" ] }, "errorResponses": [ @@ -1660,12 +9570,12 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } - ] + ], + "model": { + "name": "_400", + "publicAliases": [] + } }, { "status": "401", @@ -1675,12 +9585,12 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } - ] + ], + "model": { + "name": "_401", + "publicAliases": [] + } }, { "status": "403", @@ -1690,27 +9600,27 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } - ] + ], + "model": { + "name": "_403", + "publicAliases": [] + } }, { - "status": "409", + "status": "404", "contentType": "application/json", "encoding": "json", "contents": [ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } - ] + ], + "model": { + "name": "_404", + "publicAliases": [] + } }, { "status": "422", @@ -1720,12 +9630,27 @@ { "contentType": "application/json", "encoding": "json" - }, + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ { - "contentType": "application/xml", - "encoding": "binary" + "contentType": "application/json", + "encoding": "json" } - ] + ], + "model": { + "name": "_500", + "publicAliases": [] + } } ], "responseLinks": [], @@ -1734,11 +9659,11 @@ { "resource": "authentication", "publicResource": "authentication", - "operation": "createToken", - "publicOperation": "createToken", + "operation": "exchangePersonalToken", + "publicOperation": "exchangePersonalToken", "deprecated": false, "method": "POST", - "path": "/auth/token", + "path": "/v1/auth/exchange", "pathParams": [], "publicPathParams": [], "queryParams": [], @@ -1746,23 +9671,18 @@ "headerParams": [], "publicHeaderParams": [], "bodyParams": [ - "email", - "password" + "personalToken" ], "publicBodyParams": [ - "email", - "password" + "personalToken" ], "bodyParamDetails": [ { - "name": "email", - "required": true - }, - { - "name": "password", + "name": "personalToken", "required": true } ], + "publicPositionalParams": [], "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], @@ -1770,7 +9690,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "AuthenticationCreateTokenParams" + "publicName": "AuthenticationExchangePersonalTokenParams" }, "requestBody": { "contentType": "application/json", @@ -1779,41 +9699,32 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "json" } ], - "required": false, + "required": true, "publicName": "body", "publicIdentifier": "body" }, "response": { - "status": "201", + "status": "200", "contentType": "application/json", "encoding": "json", "contents": [ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } ] }, - "responseModel": { - "name": "Token", - "publicAliases": [] - }, "result": { - "successStatus": "201", + "successStatus": "200", "errorStatuses": [ "400", "401", - "403" + "403", + "404", + "422", + "500" ] }, "errorResponses": [ @@ -1825,12 +9736,12 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } - ] + ], + "model": { + "name": "_400", + "publicAliases": [] + } }, { "status": "401", @@ -1840,12 +9751,12 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } - ] + ], + "model": { + "name": "_401", + "publicAliases": [] + } }, { "status": "403", @@ -1855,12 +9766,57 @@ { "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/xml", - "encoding": "binary" + "contentType": "application/json", + "encoding": "json" } - ] + ], + "model": { + "name": "_500", + "publicAliases": [] + } } ], "responseLinks": [], @@ -1869,11 +9825,11 @@ { "resource": "authentication", "publicResource": "authentication", - "operation": "listMe", - "publicOperation": "listMe", + "operation": "listCurrentUser", + "publicOperation": "listCurrentUser", "deprecated": false, "method": "GET", - "path": "/me", + "path": "/v1/auth/me", "pathParams": [], "publicPathParams": [], "queryParams": [], @@ -1883,6 +9839,7 @@ "bodyParams": [], "publicBodyParams": [], "bodyParamDetails": [], + "publicPositionalParams": [], "pathParamDetails": [], "queryParamDetails": [], "headerParamDetails": [], @@ -1897,10 +9854,6 @@ { "contentType": "application/json", "encoding": "json" - }, - { - "contentType": "application/xml", - "encoding": "binary" } ] }, @@ -1911,25 +9864,44 @@ "result": { "successStatus": "200", "errorStatuses": [ + "400", "401", - "403" + "403", + "404", + "422", + "500" ] }, "errorResponses": [ { - "status": "401", + "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/xml", - "encoding": "binary" + "contentType": "application/json", + "encoding": "json" } - ] + ], + "model": { + "name": "_401", + "publicAliases": [] + } }, { "status": "403", @@ -1939,36 +9911,62 @@ { "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/xml", - "encoding": "binary" + "contentType": "application/json", + "encoding": "json" } - ] + ], + "model": { + "name": "_500", + "publicAliases": [] + } } ], "responseLinks": [], "transport": "http" } ], - "webhooks": [ - { - "event": "newPlanet", - "name": "NewPlanet", - "source": "webhook", - "method": "POST", - "path": "newPlanet" - }, - { - "event": "{$request.body#/callbackUrl}", - "name": "RequestBodyCallbackUrl", - "source": "callback", - "method": "POST", - "path": "POST /planets -> {$request.body#/callbackUrl}", - "payloadModel": { - "name": "Planet", - "publicAliases": [] - } - } - ] + "webhooks": [] } diff --git a/src/client.rs b/src/client.rs index 38f1771..ad77779 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1,5 +1,5 @@ // Code generated by Scalar SDK Generator. DO NOT EDIT. -//! The ScalarGalaxyClient API client. +//! The Scalar API client. use std::sync::Arc; use std::time::Duration; @@ -12,7 +12,7 @@ use crate::error::Error; use crate::http::{self, RetryPolicy}; const DEFAULT_MAX_RETRIES: u32 = 2; -const USER_AGENT: &str = concat!("scalargalaxy-rust/", env!("CARGO_PKG_VERSION")); +const USER_AGENT: &str = concat!("scalar-api/", env!("CARGO_PKG_VERSION")); const IDEMPOTENCY_HEADER: &str = "Idempotency-Key"; /// A named API environment with a preset base URL. @@ -22,16 +22,16 @@ pub enum Environment { /// The `production` environment. #[default] Production, - /// The `responds_with_your_request_data` environment. - RespondsWithYourRequestData, + /// The `local` environment. + Local, } impl Environment { /// The base URL for this environment. pub fn base_url(self) -> &'static str { match self { - Self::Production => "https://galaxy.scalar.com", - Self::RespondsWithYourRequestData => "{protocol}://void.scalar.com/{path}", + Self::Production => "https://access.scalar.com", + Self::Local => "http://127.0.0.1:4010", } } } @@ -40,45 +40,13 @@ impl Environment { #[derive(Clone, Default)] struct Auth { bearer_token: Option, - username: Option, - password: Option, - api_key_header: Option, - api_key_query: Option, - api_key_cookie: Option, - access_token: Option, } impl Auth { /// Applies the configured credentials to a request builder. fn apply(&self, mut builder: reqwest::RequestBuilder) -> reqwest::RequestBuilder { - if self.bearer_token.is_some() { - if let Some(value) = &self.bearer_token { - builder = builder.bearer_auth(value); - } - } else if self.username.is_some() && self.password.is_some() { - if let Some(value) = &self.username { - builder = builder.basic_auth(value, self.password.as_ref()); - } - } else if self.api_key_query.is_some() { - if let Some(value) = &self.api_key_query { - builder = builder.query(&[("api_key", value)]); - } - } else if self.api_key_header.is_some() { - if let Some(value) = &self.api_key_header { - builder = builder.header("X-API-Key", value); - } - } else if self.api_key_cookie.is_some() { - if let Some(value) = &self.api_key_cookie { - builder = builder.header(reqwest::header::COOKIE, format!("{}={}", "api_key", value)); - } - } else if self.access_token.is_some() { - if let Some(value) = &self.access_token { - builder = builder.bearer_auth(value); - } - } else if self.access_token.is_some() { - if let Some(value) = &self.access_token { - builder = builder.bearer_auth(value); - } + if let Some(value) = &self.bearer_token { + builder = builder.bearer_auth(value); } builder } @@ -95,48 +63,19 @@ struct Inner { timeout: Option, } -/// How a request body is serialized onto the wire. -#[derive(Clone, Copy)] -enum ContentEncoding { - /// `application/json` body. - Json, - /// `multipart/form-data` body. - Multipart, -} - -/// Builds a `multipart/form-data` form from a JSON object body. -/// -/// Each top-level field becomes a text part: string values are sent verbatim -/// and other scalars use their JSON representation, while nested -/// objects/arrays are JSON-encoded so no information is lost. -fn value_to_multipart(body: &serde_json::Value) -> reqwest::multipart::Form { - let mut form = reqwest::multipart::Form::new(); - if let Some(object) = body.as_object() { - for (key, value) in object { - let part = match value { - serde_json::Value::String(text) => text.clone(), - serde_json::Value::Null => String::new(), - other => other.to_string(), - }; - form = form.text(key.clone(), part); - } - } - form -} - -/// Asynchronous client for the ScalarGalaxyClient API. +/// Asynchronous client for the Scalar API. /// /// Cloning is cheap: all state is shared behind an `Arc`. Construct one with -/// [`ScalarGalaxyClient::builder`] or [`ScalarGalaxyClient::from_env`]. +/// [`Scalar::builder`] or [`Scalar::from_env`]. #[derive(Clone)] -pub struct ScalarGalaxyClient { +pub struct Scalar { inner: Arc, } -impl ScalarGalaxyClient { +impl Scalar { /// Starts building a client with the fluent builder. - pub fn builder() -> ScalarGalaxyClientBuilder { - ScalarGalaxyClientBuilder::new() + pub fn builder() -> ScalarBuilder { + ScalarBuilder::new() } /// Builds a client, reading credentials from the environment. @@ -145,37 +84,19 @@ impl ScalarGalaxyClient { /// missing variables are simply left unset. pub fn from_env() -> Result { let mut builder = Self::builder(); - if let Ok(value) = std::env::var("HARNESS_BASE_URL") { + if let Ok(value) = std::env::var("SCALAR_API_BASE_URL") { builder = builder.base_url(value); } - if let Ok(value) = std::env::var("HARNESS_BEARER_TOKEN") { + if let Ok(value) = std::env::var("SCALAR_API_BEARER_TOKEN") { builder = builder.bearer_token(value); } - if let Ok(value) = std::env::var("HARNESS_USERNAME") { - builder = builder.username(value); - } - if let Ok(value) = std::env::var("HARNESS_PASSWORD") { - builder = builder.password(value); - } - if let Ok(value) = std::env::var("HARNESS_API_KEY_HEADER") { - builder = builder.api_key_header(value); - } - if let Ok(value) = std::env::var("HARNESS_API_KEY_QUERY") { - builder = builder.api_key_query(value); - } - if let Ok(value) = std::env::var("HARNESS_API_KEY_COOKIE") { - builder = builder.api_key_cookie(value); - } - if let Ok(value) = std::env::var("HARNESS_ACCESS_TOKEN") { - builder = builder.access_token(value); - } builder.build() } } -impl std::fmt::Debug for ScalarGalaxyClient { +impl std::fmt::Debug for Scalar { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("ScalarGalaxyClient") + f.debug_struct("Scalar") .field("base_url", &self.inner.base_url.as_str()) .field("retry", &self.inner.retry) .field("timeout", &self.inner.timeout) @@ -184,7 +105,7 @@ impl std::fmt::Debug for ScalarGalaxyClient { } #[allow(dead_code, clippy::too_many_arguments)] -impl ScalarGalaxyClient { +impl Scalar { /// Builds, authenticates, and sends a request, decoding a JSON response. pub(crate) async fn send( &self, @@ -195,7 +116,7 @@ impl ScalarGalaxyClient { body: Option<&B>, apply_auth: bool, ) -> Result { - let response = self.dispatch(method, path, query, headers, body, apply_auth, ContentEncoding::Json).await?; + let response = self.dispatch(method, path, query, headers, body, apply_auth).await?; http::decode_json(response).await } @@ -209,12 +130,12 @@ impl ScalarGalaxyClient { body: Option<&B>, apply_auth: bool, ) -> Result<(), Error> { - let response = self.dispatch(method, path, query, headers, body, apply_auth, ContentEncoding::Json).await?; + let response = self.dispatch(method, path, query, headers, body, apply_auth).await?; http::decode_empty(response).await } - /// Like [`send`](Self::send) but encodes the body as `multipart/form-data`. - pub(crate) async fn send_multipart( + /// Like [`send`](Self::send) but returns the raw response bytes (binary downloads). + pub(crate) async fn send_bytes( &self, method: Method, path: &str, @@ -222,9 +143,9 @@ impl ScalarGalaxyClient { headers: &[(String, String)], body: Option<&B>, apply_auth: bool, - ) -> Result { - let response = self.dispatch(method, path, query, headers, body, apply_auth, ContentEncoding::Multipart).await?; - http::decode_json(response).await + ) -> 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. @@ -237,7 +158,7 @@ impl ScalarGalaxyClient { body: Option<&B>, apply_auth: bool, ) -> Result { - self.dispatch(method, path, query, headers, body, apply_auth, ContentEncoding::Json).await + self.dispatch(method, path, query, headers, body, apply_auth).await } /// Assembles a request (URL, query, headers, body, auth) and sends it with retries. @@ -249,7 +170,6 @@ impl ScalarGalaxyClient { headers: &[(String, String)], body: Option<&B>, apply_auth: bool, - content: ContentEncoding, ) -> Result { let url = self .inner @@ -267,13 +187,7 @@ impl ScalarGalaxyClient { builder = builder.header(name, value); } if let Some(body) = body { - builder = match content { - ContentEncoding::Json => builder.json(body), - ContentEncoding::Multipart => { - let value = serde_json::to_value(body)?; - builder.multipart(value_to_multipart(&value)) - } - }; + builder = builder.json(body); } let keyed = headers.iter().any(|(name, _)| name.eq_ignore_ascii_case(IDEMPOTENCY_HEADER)); if apply_auth { @@ -284,24 +198,18 @@ impl ScalarGalaxyClient { } } -/// Fluent builder for [`ScalarGalaxyClient`]. +/// Fluent builder for [`Scalar`]. #[derive(Default)] -pub struct ScalarGalaxyClientBuilder { +pub struct ScalarBuilder { base_url: Option, environment: Option, timeout: Option, max_retries: Option, http_client: Option, bearer_token: Option, - username: Option, - password: Option, - api_key_header: Option, - api_key_query: Option, - api_key_cookie: Option, - access_token: Option, } -impl ScalarGalaxyClientBuilder { +impl ScalarBuilder { /// Creates an empty builder. pub fn new() -> Self { Self::default() @@ -337,50 +245,14 @@ impl ScalarGalaxyClientBuilder { self } - /// JWT Bearer token authentication + /// Sets the `bearer_token` credential. pub fn bearer_token(mut self, value: impl Into) -> Self { self.bearer_token = Some(value.into()); self } - /// Basic HTTP authentication - pub fn username(mut self, value: impl Into) -> Self { - self.username = Some(value.into()); - self - } - - /// Basic HTTP authentication - pub fn password(mut self, value: impl Into) -> Self { - self.password = Some(value.into()); - self - } - - /// API key request header - pub fn api_key_header(mut self, value: impl Into) -> Self { - self.api_key_header = Some(value.into()); - self - } - - /// API key query parameter - pub fn api_key_query(mut self, value: impl Into) -> Self { - self.api_key_query = Some(value.into()); - self - } - - /// API key browser cookie - pub fn api_key_cookie(mut self, value: impl Into) -> Self { - self.api_key_cookie = Some(value.into()); - self - } - - /// OAuth 2.0 authentication - pub fn access_token(mut self, value: impl Into) -> Self { - self.access_token = Some(value.into()); - self - } - /// Builds the client, resolving the base URL and HTTP stack. - pub fn build(self) -> Result { + pub fn build(self) -> Result { let base_url = self .base_url .unwrap_or_else(|| self.environment.unwrap_or_default().base_url().to_string()); @@ -390,18 +262,12 @@ impl ScalarGalaxyClientBuilder { None => reqwest::Client::builder().user_agent(USER_AGENT).build()?, }; let retry = RetryPolicy::new(self.max_retries.unwrap_or(DEFAULT_MAX_RETRIES)); - Ok(ScalarGalaxyClient { + Ok(Scalar { inner: Arc::new(Inner { http, base_url, auth: Auth { bearer_token: self.bearer_token, - username: self.username, - password: self.password, - api_key_header: self.api_key_header, - api_key_query: self.api_key_query, - api_key_cookie: self.api_key_cookie, - access_token: self.access_token, }, retry, timeout: self.timeout, @@ -410,9 +276,9 @@ impl ScalarGalaxyClientBuilder { } } -impl std::fmt::Debug for ScalarGalaxyClientBuilder { +impl std::fmt::Debug for ScalarBuilder { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("ScalarGalaxyClientBuilder") + f.debug_struct("ScalarBuilder") .field("base_url", &self.base_url) .field("environment", &self.environment) .field("timeout", &self.timeout) diff --git a/src/lib.rs b/src/lib.rs index 2da65c3..fb3a454 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,64 +1,83 @@ // Code generated by Scalar SDK Generator. DO NOT EDIT. -//! The Scalar Galaxy is an example OpenAPI specification to test OpenAPI tools and libraries. It’s a fictional universe with fictional planets and fictional data. Get all the data for [all planets](#tag/planets/GET/planets). +//! API for managing Scalar platform resources. //! -//! ## Resources +//! ## TypeScript SDK //! -//! * https://github.com/scalar/scalar -//! * https://github.com/OAI/OpenAPI-Specification -//! * https://scalar.com +//! For TypeScript, we provide a SDK that makes using our API even easier. //! -//! ## Markdown Support +//! ### Install //! -//! All descriptions *can* contain ~~tons of text~~ **Markdown**. [If GitHub supports the syntax](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax), chances are we’re supporting it, too. You can even create [internal links to reference endpoints](#tag/authentication/POST/user/signup). +//! ```text +//! npm add @scalar/sdk +//! ``` //! -//!
-//! Examples +//! ### Get a Scalar API key //! -//! **Blockquotes** +//! Create an API key in your Scalar account: //! -//! > I love OpenAPI. <3 +//! - Dashboard: https://dashboard.scalar.com/account +//! - Store it in `.env`, for example: //! -//! **Tables** +//! ```text +//! SCALAR_API_KEY=your_personal_token +//! ``` //! -//! | Feature | Availability | -//! | ---------------- | ------------ | -//! | Markdown Support | ✓ | +//! ### Exchange your API key for an access token //! -//! **Accordion** +//! The personal token is not an access token. Exchange it first with `postv1AuthExchange`. //! -//! ```text -//!
-//! Using Details Tags -//!

HTML Example

-//!
-//! ``` +//! If you use the personal token directly for authenticated API calls, the API returns `401 Invalid authentication token`. //! -//! **Images** +//! ```text +//! import { Scalar } from '@scalar/sdk' //! -//! Yes, there’s support for images, too! +//! const scalar = new Scalar() //! -//! ![Empty placeholder image showing the width/height](https://images.placeholders.dev/?width=1280&height=720) +//! const exchange = await scalar.auth.postv1AuthExchange({ +//! personalToken: process.env.SCALAR_API_KEY!, +//! }) //! -//! **Alerts** +//! const accessToken = exchange.accessToken +//! ``` //! -//! > [!tip] -//! > You can now use markdown alerts in your descriptions. +//! ### 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 mod webhooks; -pub use models::{AuthenticationCreateUserBody, Credentials, PaginatedResource, Planet, PlanetType, PlanetsListAllDataResponse, PlanetsListAllDataResponseMeta, PlanetsUploadImageBody, PlanetsUploadImageResponse, Satellite, Token, User}; -pub use client::ScalarGalaxyClient; -pub use client::ScalarGalaxyClientBuilder; +pub use models::{AccessGroup, ActiveDeployment, ApiDocument, AuthenticationExchangePersonalTokenBody, AuthenticationExchangePersonalTokenResponse, BadRequestError, Email, ForbiddenError, GithubProject, GithubProjectRepository, InternalServerError, LoginPortal, LoginPortalEmail, LoginPortalPage, LoginPortalsCreateBody, LoginPortalsRetrieveResponse, LoginPortalsUpdateBody, ManagedDocVersion, ManagedDocVersionEmbedStatus, ManagedSchemaVersion, Method, Namespace, Nanoid, NotFoundError, RegistryCreateApiDocumentBody, RegistryCreateApiDocumentResponse, RegistryCreateApiDocumentVersionBody, RegistryUpdateApiDocumentBody, RegistryUpdateApiDocumentVersionBody, RegistryUpdateApiDocumentVersionResponse, Rule, RulesCreateRulesetBody, RulesUpdateRulesetBody, ScalarDocsCreateGuideBody, ScalarDocsCreateGuideResponse, ScalarDocsPublishGuideResponse, Schema, SchemasCreateBody, SchemasCreateVersionBody, SchemasUpdateBody, Slug, Team, TeamImage, TeamName, TeamSummary, Theme, ThemesCreateBody, ThemesReplaceDocumentBody, ThemesUpdateBody, Timestamp, Uid, UnauthorizedError, UnprocessableEntityError, User, Version}; +pub use client::Scalar; +pub use client::ScalarBuilder; pub use client::Environment; -pub use webhooks::WebhookEvent; pub use error::{ApiError, Error}; /// The version of this crate, matching the published package version. diff --git a/src/models.rs b/src/models.rs index af4e0e6..6a6439d 100644 --- a/src/models.rs +++ b/src/models.rs @@ -4,148 +4,476 @@ use serde::{Deserialize, Serialize}; -/// A user #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct User { +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: serde_json::Value, + 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 id: Option, + pub embed_status: Option, + pub tags: Vec, #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, + 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, 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, preserved verbatim. + #[serde(untagged)] + Unknown(String), } -/// Credentials to authenticate a user #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct Credentials { - pub email: String, - pub password: String, +pub struct AccessGroup { + pub access_group_slug: String, } -/// A token to authenticate a user #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct Token { +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 token: Option, + pub image_uri: Option, + pub slug: String, + pub theme: String, } -/// A planet in the Scalar Galaxy +pub type TeamName = String; + +pub type TeamImage = String; + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct Planet { - pub id: i64, +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 description: Option, + pub active_deployment: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub r#type: Option, - /// A score from 0 to 1 indicating potential habitability + pub last_published: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub habitability_index: Option, + pub last_published_uid: Option, + pub login_portal_uid: String, + pub active_theme_id: String, #[serde(default, skip_serializing_if = "Option::is_none")] - pub physical_properties: Option, - /// Atmospheric composition + pub typesense_id: Option, + pub is_private: bool, + pub agent_enabled: bool, + pub access_groups: serde_json::Value, + pub slug: String, + pub publish_status: String, + pub publish_message: String, #[serde(default, skip_serializing_if = "Option::is_none")] - pub atmosphere: Option>, + 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 discovered_at: Option>, + pub theme: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub active_team_id: Option, + pub has_github: bool, + pub teams: Vec, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct RegistryCreateApiDocumentResponse { + pub uid: String, + pub version_uid: String, + pub title: String, + pub json_sha: String, + pub yaml_sha: String, + pub version_sha: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct RegistryCreateApiDocumentBody { + pub title: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + pub version: String, + pub slug: String, #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option, + pub ruleset: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub satellites: Option>, - /// A user + pub is_private: Option, + pub document: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct RegistryUpdateApiDocumentBody { #[serde(default, skip_serializing_if = "Option::is_none")] - pub creator: Option, + pub title: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub description: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub last_updated: Option>, - /// URL to receive notifications about this planet + pub is_private: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub callback_url: Option, + pub ruleset: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct RegistryUpdateApiDocumentVersionResponse { + pub json_sha: String, + pub yaml_sha: String, + pub version_sha: String, } -/// A paginated resource #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct PaginatedResource { +pub struct RegistryUpdateApiDocumentVersionBody { + pub document: String, #[serde(default, skip_serializing_if = "Option::is_none")] - pub meta: Option, + pub last_known_version_sha: Option, } -/// A natural satellite (moon) orbiting a planet #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct Satellite { - pub name: String, - /// Diameter in kilometers +pub struct RegistryCreateApiDocumentVersionBody { + pub version: String, + pub document: String, #[serde(default, skip_serializing_if = "Option::is_none")] - pub diameter: Option, + pub force: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_known_version_sha: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct PlanetsListAllDataResponse { +pub struct SchemasCreateBody { + pub title: String, #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option>, + pub description: Option, + pub version: String, + pub slug: String, #[serde(default, skip_serializing_if = "Option::is_none")] - pub meta: Option, + pub is_private: Option, + pub document: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct PlanetsListAllDataResponseMeta { +pub struct SchemasUpdateBody { #[serde(default, skip_serializing_if = "Option::is_none")] - pub limit: Option, + pub title: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub offset: Option, + pub description: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub total: Option, + pub is_private: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct SchemasCreateVersionBody { + pub version: String, + pub document: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct LoginPortalsRetrieveResponse { + pub uid: String, + pub title: String, + pub slug: String, + pub email: LoginPortalEmail, + pub page: LoginPortalPage, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct LoginPortalsUpdateBody { #[serde(default, skip_serializing_if = "Option::is_none")] - pub next: Option, + pub title: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct PlanetsUploadImageResponse { +pub struct LoginPortalsCreateBody { + pub title: String, + pub slug: String, + pub email: LoginPortalEmail, + pub page: LoginPortalPage, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct RulesCreateRulesetBody { + pub title: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + pub slug: String, #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - /// The URL where the uploaded image can be accessed + pub is_private: Option, + pub document: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct RulesUpdateRulesetBody { #[serde(default, skip_serializing_if = "Option::is_none")] - pub image_url: Option, - /// Timestamp when the image was uploaded + pub namespace: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub uploaded_at: Option>, - /// Size of the uploaded image in bytes + pub slug: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub file_size: Option, - /// The content type of the uploaded image + pub title: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub mime_type: Option, + pub description: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_private: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct PlanetsUploadImageBody { - /// The image file to upload +pub struct ThemesCreateBody { + pub name: String, #[serde(default, skip_serializing_if = "Option::is_none")] - pub image: Option, + pub description: Option, + pub slug: String, + pub document: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct AuthenticationCreateUserBody { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, +pub struct ThemesUpdateBody { #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, - pub email: String, - pub password: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ThemesReplaceDocumentBody { + pub document: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ScalarDocsCreateGuideResponse { + pub uid: String, + pub slug: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ScalarDocsCreateGuideBody { + pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub slug: Option, + pub is_private: bool, + pub allowed_users: Vec, + pub allowed_domains: Vec, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ScalarDocsPublishGuideResponse { + pub publish_uid: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct AuthenticationExchangePersonalTokenResponse { + pub access_token: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct AuthenticationExchangePersonalTokenBody { + pub personal_token: String, } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[non_exhaustive] -pub enum PlanetType { - #[serde(rename = "terrestrial")] - Terrestrial, - #[serde(rename = "gas_giant")] - GasGiant, - #[serde(rename = "ice_giant")] - IceGiant, - #[serde(rename = "dwarf")] - Dwarf, - #[serde(rename = "super_earth")] - SuperEarth, +pub enum ManagedDocVersionEmbedStatus { + #[serde(rename = "complete")] + Complete, + #[serde(rename = "failed")] + Failed, /// A value not known to this version of the SDK, preserved verbatim. #[serde(untagged)] Unknown(String), diff --git a/src/resources/authentication.rs b/src/resources/authentication.rs index 2c72274..9e8e7b9 100644 --- a/src/resources/authentication.rs +++ b/src/resources/authentication.rs @@ -3,96 +3,42 @@ #[derive(Clone)] pub struct Authentication { - client: crate::client::ScalarGalaxyClient, + client: crate::client::Scalar, } impl Authentication { - pub(crate) fn new(client: crate::client::ScalarGalaxyClient) -> Self { + pub(crate) fn new(client: crate::client::Scalar) -> Self { Self { client } } - /// Create a user - pub fn create_user(&self) -> CreateUserRequest { - CreateUserRequest::new(self.client.clone()) + /// Exchange token + pub fn exchange_personal_token(&self, body: crate::models::AuthenticationExchangePersonalTokenBody) -> ExchangePersonalTokenRequest { + ExchangePersonalTokenRequest::new(self.client.clone(), body) } - /// Get a token - pub fn create_token(&self) -> CreateTokenRequest { - CreateTokenRequest::new(self.client.clone()) - } - - /// Get authenticated user - pub fn list_me(&self) -> ListMeRequest { - ListMeRequest::new(self.client.clone()) + /// Get current user + pub fn list_current_user(&self) -> ListCurrentUserRequest { + ListCurrentUserRequest::new(self.client.clone()) } } -/// Time to create a user account, eh? +/// Exchange an API key for an access token. #[must_use = "a request builder does nothing until `.send().await` is called"] -pub struct CreateUserRequest { - client: crate::client::ScalarGalaxyClient, - body: Option, +pub struct ExchangePersonalTokenRequest { + client: crate::client::Scalar, + body: crate::models::AuthenticationExchangePersonalTokenBody, idempotency_key: Option, } -impl CreateUserRequest { - fn new(client: crate::client::ScalarGalaxyClient) -> Self { +impl ExchangePersonalTokenRequest { + fn new(client: crate::client::Scalar, body: crate::models::AuthenticationExchangePersonalTokenBody) -> Self { Self { client, - body: None, + body, idempotency_key: None, } } - /// User to create - pub fn body(mut self, value: crate::models::AuthenticationCreateUserBody) -> Self { - self.body = Some(value); - self - } - - /// Sets an idempotency key so this request can be safely retried. - pub fn idempotency_key(mut self, value: impl Into) -> Self { - self.idempotency_key = Some(value.into()); - self - } - - /// Sends the request and returns the decoded response. - pub async fn send(self) -> Result { - let path = "/user/signup".to_string(); - let query: Vec<(String, String)> = Vec::new(); - let mut headers: Vec<(String, String)> = Vec::new(); - if let Some(key) = self.idempotency_key { - headers.push(("Idempotency-Key".to_string(), key)); - } - let body = self.body.as_ref(); - self.client - .send::(reqwest::Method::POST, &path, &query, &headers, body, true) - .await - } -} -/// Yeah, this is the boring security stuff. Just get your super secret token and move on. -#[must_use = "a request builder does nothing until `.send().await` is called"] -pub struct CreateTokenRequest { - client: crate::client::ScalarGalaxyClient, - body: Option, - idempotency_key: Option, -} - -impl CreateTokenRequest { - fn new(client: crate::client::ScalarGalaxyClient) -> Self { - Self { - client, - body: None, - idempotency_key: None, - } - } - - /// Credentials to authenticate a user - pub fn body(mut self, value: crate::models::Credentials) -> Self { - self.body = Some(value); - self - } - /// Sets an idempotency key so this request can be safely retried. pub fn idempotency_key(mut self, value: impl Into) -> Self { self.idempotency_key = Some(value.into()); @@ -100,27 +46,27 @@ impl CreateTokenRequest { } /// Sends the request and returns the decoded response. - pub async fn send(self) -> Result { - let path = "/auth/token".to_string(); + pub async fn send(self) -> Result { + let path = "/v1/auth/exchange".to_string(); let query: Vec<(String, String)> = Vec::new(); let mut headers: Vec<(String, String)> = Vec::new(); if let Some(key) = self.idempotency_key { headers.push(("Idempotency-Key".to_string(), key)); } - let body = self.body.as_ref(); + let body = Some(&self.body); self.client - .send::(reqwest::Method::POST, &path, &query, &headers, body, true) + .send::(reqwest::Method::POST, &path, &query, &headers, body, true) .await } } -/// Find yourself they say. That’s what you can do here. +/// Get the authenticated user, including their available teams and theme. #[must_use = "a request builder does nothing until `.send().await` is called"] -pub struct ListMeRequest { - client: crate::client::ScalarGalaxyClient, +pub struct ListCurrentUserRequest { + client: crate::client::Scalar, } -impl ListMeRequest { - fn new(client: crate::client::ScalarGalaxyClient) -> Self { +impl ListCurrentUserRequest { + fn new(client: crate::client::Scalar) -> Self { Self { client, } @@ -128,7 +74,7 @@ impl ListMeRequest { /// Sends the request and returns the decoded response. pub async fn send(self) -> Result { - let path = "/me".to_string(); + let path = "/v1/auth/me".to_string(); let query: Vec<(String, String)> = Vec::new(); let headers: Vec<(String, String)> = Vec::new(); let body: Option<&serde_json::Value> = None; diff --git a/src/resources/login_portals.rs b/src/resources/login_portals.rs new file mode 100644 index 0000000..c41f295 --- /dev/null +++ b/src/resources/login_portals.rs @@ -0,0 +1,202 @@ +// 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: crate::models::LoginPortalsUpdateBody) -> 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: crate::models::LoginPortalsCreateBody) -> 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<&serde_json::Value> = None; + self.client + .send::(reqwest::Method::GET, &path, &query, &headers, body, 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: crate::models::LoginPortalsUpdateBody, + idempotency_key: Option, +} + +impl UpdateRequest { + fn new(client: crate::client::Scalar, slug: String, body: crate::models::LoginPortalsUpdateBody) -> Self { + Self { + client, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::PATCH, &path, &query, &headers, body, 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, + idempotency_key: Option, +} + +impl DeleteRequest { + fn new(client: crate::client::Scalar, slug: String) -> Self { + Self { + client, + slug, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body: Option<&serde_json::Value> = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body, 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: crate::models::LoginPortalsCreateBody, + idempotency_key: Option, +} + +impl CreateRequest { + fn new(client: crate::client::Scalar, body: crate::models::LoginPortalsCreateBody) -> Self { + Self { + client, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body, 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<&serde_json::Value> = None; + self.client + .send::, _>(reqwest::Method::GET, &path, &query, &headers, body, true) + .await + } +} diff --git a/src/resources/mod.rs b/src/resources/mod.rs index 9793bbb..bcc4ebd 100644 --- a/src/resources/mod.rs +++ b/src/resources/mod.rs @@ -1,12 +1,47 @@ // Code generated by Scalar SDK Generator. DO NOT EDIT. //! Resource sub-clients and root accessors. -pub mod planets; +pub mod registry; +pub mod schemas; +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::ScalarGalaxyClient { - pub fn planets(&self) -> crate::resources::planets::Planets { - crate::resources::planets::Planets::new(self.clone()) +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 { diff --git a/src/resources/namespaces.rs b/src/resources/namespaces.rs new file mode 100644 index 0000000..77c6e63 --- /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<&serde_json::Value> = None; + self.client + .send::, _>(reqwest::Method::GET, &path, &query, &headers, body, true) + .await + } +} diff --git a/src/resources/planets.rs b/src/resources/planets.rs deleted file mode 100644 index 0354ad2..0000000 --- a/src/resources/planets.rs +++ /dev/null @@ -1,286 +0,0 @@ -// Code generated by Scalar SDK Generator. DO NOT EDIT. -//! The `planets` resource. - -#[derive(Clone)] -pub struct Planets { - client: crate::client::ScalarGalaxyClient, -} - -impl Planets { - pub(crate) fn new(client: crate::client::ScalarGalaxyClient) -> Self { - Self { client } - } - - /// Get all planets - pub fn list_all_data(&self) -> ListAllDataRequest { - ListAllDataRequest::new(self.client.clone()) - } - - /// Create a planet - pub fn create(&self) -> CreateRequest { - CreateRequest::new(self.client.clone()) - } - - /// Get a planet - pub fn retrieve(&self, planet_id: i64) -> RetrieveRequest { - RetrieveRequest::new(self.client.clone(), planet_id) - } - - /// Update a planet - pub fn update(&self, planet_id: i64) -> UpdateRequest { - UpdateRequest::new(self.client.clone(), planet_id) - } - - /// Delete a planet - pub fn delete(&self, planet_id: i64) -> DeleteRequest { - DeleteRequest::new(self.client.clone(), planet_id) - } - - /// Upload an image to a planet - pub fn upload_image(&self, planet_id: i64) -> UploadImageRequest { - UploadImageRequest::new(self.client.clone(), planet_id) - } -} - -/// It’s easy to say you know them all, but do you really? Retrieve all the planets and check whether you missed one. -#[must_use = "a request builder does nothing until `.send().await` is called"] -pub struct ListAllDataRequest { - client: crate::client::ScalarGalaxyClient, - limit: Option, - offset: Option, -} - -impl ListAllDataRequest { - fn new(client: crate::client::ScalarGalaxyClient) -> Self { - Self { - client, - limit: None, - offset: None, - } - } - - /// The number of items to return - pub fn limit(mut self, value: i64) -> Self { - self.limit = Some(value); - self - } - - /// The number of items to skip before starting to collect the result set - pub fn offset(mut self, value: i64) -> Self { - self.offset = Some(value); - self - } - - /// Sends the request and returns the decoded response. - pub async fn send(self) -> Result { - let path = "/planets".to_string(); - let mut query: Vec<(String, String)> = Vec::new(); - if let Some(value) = &self.limit { - query.push(("limit".to_string(), crate::http::scalar_value(value))); - } - if let Some(value) = &self.offset { - query.push(("offset".to_string(), crate::http::scalar_value(value))); - } - let headers: Vec<(String, String)> = Vec::new(); - let body: Option<&serde_json::Value> = None; - self.client - .send::(reqwest::Method::GET, &path, &query, &headers, body, true) - .await - } -} -/// Time to play god and create a new planet. What do you think? Ah, don’t think too much. What could go wrong anyway? -#[must_use = "a request builder does nothing until `.send().await` is called"] -pub struct CreateRequest { - client: crate::client::ScalarGalaxyClient, - body: Option, - idempotency_key: Option, -} - -impl CreateRequest { - fn new(client: crate::client::ScalarGalaxyClient) -> Self { - Self { - client, - body: None, - idempotency_key: None, - } - } - - /// Planet - pub fn body(mut self, value: crate::models::Planet) -> Self { - self.body = Some(value); - self - } - - /// Sets an idempotency key so this request can be safely retried. - pub fn idempotency_key(mut self, value: impl Into) -> Self { - self.idempotency_key = Some(value.into()); - self - } - - /// Sends the request and returns the decoded response. - pub async fn send(self) -> Result { - let path = "/planets".to_string(); - let query: Vec<(String, String)> = Vec::new(); - let mut headers: Vec<(String, String)> = Vec::new(); - if let Some(key) = self.idempotency_key { - headers.push(("Idempotency-Key".to_string(), key)); - } - let body = self.body.as_ref(); - self.client - .send::(reqwest::Method::POST, &path, &query, &headers, body, true) - .await - } -} -/// You’ll better learn a little bit more about the planets. It might come in handy once space travel is available for everyone. -#[must_use = "a request builder does nothing until `.send().await` is called"] -pub struct RetrieveRequest { - client: crate::client::ScalarGalaxyClient, - planet_id: i64, -} - -impl RetrieveRequest { - fn new(client: crate::client::ScalarGalaxyClient, planet_id: i64) -> Self { - Self { - client, - planet_id, - } - } - - /// Sends the request and returns the decoded response. - pub async fn send(self) -> Result { - let path = format!("/planets/{}", crate::http::encode_path_param(&crate::http::scalar_value(&self.planet_id))); - let query: Vec<(String, String)> = Vec::new(); - let headers: Vec<(String, String)> = Vec::new(); - let body: Option<&serde_json::Value> = None; - self.client - .send::(reqwest::Method::GET, &path, &query, &headers, body, true) - .await - } -} -/// Sometimes you make mistakes, that's fine. No worries, you can update all planets. -#[must_use = "a request builder does nothing until `.send().await` is called"] -pub struct UpdateRequest { - client: crate::client::ScalarGalaxyClient, - planet_id: i64, - body: Option, - idempotency_key: Option, -} - -impl UpdateRequest { - fn new(client: crate::client::ScalarGalaxyClient, planet_id: i64) -> Self { - Self { - client, - planet_id, - body: None, - idempotency_key: None, - } - } - - /// New information about the planet - pub fn body(mut self, value: crate::models::Planet) -> Self { - self.body = Some(value); - self - } - - /// Sets an idempotency key so this request can be safely retried. - pub fn idempotency_key(mut self, value: impl Into) -> Self { - self.idempotency_key = Some(value.into()); - self - } - - /// Sends the request and returns the decoded response. - pub async fn send(self) -> Result { - let path = format!("/planets/{}", crate::http::encode_path_param(&crate::http::scalar_value(&self.planet_id))); - let query: Vec<(String, String)> = Vec::new(); - let mut headers: Vec<(String, String)> = Vec::new(); - if let Some(key) = self.idempotency_key { - headers.push(("Idempotency-Key".to_string(), key)); - } - let body = self.body.as_ref(); - self.client - .send::(reqwest::Method::PUT, &path, &query, &headers, body, true) - .await - } -} -/// This endpoint was used to delete planets. Unfortunately, that caused a lot of trouble for planets with life. So, this endpoint is now deprecated and should not be used anymore. -#[must_use = "a request builder does nothing until `.send().await` is called"] -pub struct DeleteRequest { - client: crate::client::ScalarGalaxyClient, - planet_id: i64, - idempotency_key: Option, -} - -impl DeleteRequest { - fn new(client: crate::client::ScalarGalaxyClient, planet_id: i64) -> Self { - Self { - client, - planet_id, - idempotency_key: None, - } - } - - /// Sets an idempotency key so this request can be safely retried. - pub fn idempotency_key(mut self, value: impl Into) -> Self { - self.idempotency_key = Some(value.into()); - self - } - - /// Sends the request and returns the decoded response. - pub async fn send(self) -> Result<(), crate::error::Error> { - let path = format!("/planets/{}", crate::http::encode_path_param(&crate::http::scalar_value(&self.planet_id))); - let query: Vec<(String, String)> = Vec::new(); - let mut headers: Vec<(String, String)> = Vec::new(); - if let Some(key) = self.idempotency_key { - headers.push(("Idempotency-Key".to_string(), key)); - } - let body: Option<&serde_json::Value> = None; - self.client - .send_empty(reqwest::Method::DELETE, &path, &query, &headers, body, true) - .await - } -} -/// Got a crazy good photo of a planet? Share it with the world! -#[must_use = "a request builder does nothing until `.send().await` is called"] -pub struct UploadImageRequest { - client: crate::client::ScalarGalaxyClient, - planet_id: i64, - body: Option, - idempotency_key: Option, -} - -impl UploadImageRequest { - fn new(client: crate::client::ScalarGalaxyClient, planet_id: i64) -> Self { - Self { - client, - planet_id, - body: None, - idempotency_key: None, - } - } - - /// Image to upload - pub fn body(mut self, value: crate::models::PlanetsUploadImageBody) -> Self { - self.body = Some(value); - self - } - - /// Sets an idempotency key so this request can be safely retried. - pub fn idempotency_key(mut self, value: impl Into) -> Self { - self.idempotency_key = Some(value.into()); - self - } - - /// Sends the request and returns the decoded response. - pub async fn send(self) -> Result { - let path = format!("/planets/{}/image", crate::http::encode_path_param(&crate::http::scalar_value(&self.planet_id))); - let query: Vec<(String, String)> = Vec::new(); - let mut headers: Vec<(String, String)> = Vec::new(); - if let Some(key) = self.idempotency_key { - headers.push(("Idempotency-Key".to_string(), key)); - } - let body = self.body.as_ref(); - self.client - .send_multipart::(reqwest::Method::POST, &path, &query, &headers, body, true) - .await - } -} diff --git a/src/resources/registry.rs b/src/resources/registry.rs new file mode 100644 index 0000000..cbb74a2 --- /dev/null +++ b/src/resources/registry.rs @@ -0,0 +1,510 @@ +// 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: crate::models::RegistryCreateApiDocumentBody) -> 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: crate::models::RegistryUpdateApiDocumentBody) -> 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: crate::models::RegistryUpdateApiDocumentVersionBody) -> 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: crate::models::RegistryCreateApiDocumentVersionBody) -> 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<&serde_json::Value> = None; + self.client + .send::, _>(reqwest::Method::GET, &path, &query, &headers, body, 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<&serde_json::Value> = None; + self.client + .send::, _>(reqwest::Method::GET, &path, &query, &headers, body, 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: crate::models::RegistryCreateApiDocumentBody, + idempotency_key: Option, +} + +impl CreateApiDocumentRequest { + fn new(client: crate::client::Scalar, namespace: String, body: crate::models::RegistryCreateApiDocumentBody) -> Self { + Self { + client, + namespace, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body, 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: crate::models::RegistryUpdateApiDocumentBody, + idempotency_key: Option, +} + +impl UpdateApiDocumentRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::RegistryUpdateApiDocumentBody) -> Self { + Self { + client, + namespace, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::PATCH, &path, &query, &headers, body, 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, + idempotency_key: Option, +} + +impl DeleteApiDocumentRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String) -> Self { + Self { + client, + namespace, + slug, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body: Option<&serde_json::Value> = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body, 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<&serde_json::Value> = None; + self.client + .send_bytes(reqwest::Method::GET, &path, &query, &headers, body, 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: crate::models::RegistryUpdateApiDocumentVersionBody, + idempotency_key: Option, +} + +impl UpdateApiDocumentVersionRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, semver: String, body: crate::models::RegistryUpdateApiDocumentVersionBody) -> Self { + Self { + client, + namespace, + slug, + semver, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::PATCH, &path, &query, &headers, body, 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, + idempotency_key: Option, +} + +impl DeleteApiDocumentVersionRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, semver: String) -> Self { + Self { + client, + namespace, + slug, + semver, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body: Option<&serde_json::Value> = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body, 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<&serde_json::Value> = None; + self.client + .send::(reqwest::Method::GET, &path, &query, &headers, body, 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: crate::models::RegistryCreateApiDocumentVersionBody, + idempotency_key: Option, +} + +impl CreateApiDocumentVersionRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::RegistryCreateApiDocumentVersionBody) -> Self { + Self { + client, + namespace, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body, 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, + idempotency_key: Option, +} + +impl CreateApiDocumentAccessGroupRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::AccessGroup) -> Self { + Self { + client, + namespace, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body, 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, + idempotency_key: Option, +} + +impl DeleteApiDocumentAccessGroupRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::AccessGroup) -> Self { + Self { + client, + namespace, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body, true) + .await + } +} diff --git a/src/resources/rules.rs b/src/resources/rules.rs new file mode 100644 index 0000000..1c7651c --- /dev/null +++ b/src/resources/rules.rs @@ -0,0 +1,304 @@ +// 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: crate::models::RulesCreateRulesetBody) -> CreateRulesetRequest { + CreateRulesetRequest::new(self.client.clone(), namespace.into(), body) + } + + /// Update rule metadata + pub fn update_ruleset(&self, namespace: impl Into, slug: impl Into, body: crate::models::RulesUpdateRulesetBody) -> 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<&serde_json::Value> = None; + self.client + .send::, _>(reqwest::Method::GET, &path, &query, &headers, body, 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: crate::models::RulesCreateRulesetBody, + idempotency_key: Option, +} + +impl CreateRulesetRequest { + fn new(client: crate::client::Scalar, namespace: String, body: crate::models::RulesCreateRulesetBody) -> Self { + Self { + client, + namespace, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body, 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: crate::models::RulesUpdateRulesetBody, + idempotency_key: Option, +} + +impl UpdateRulesetRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::RulesUpdateRulesetBody) -> Self { + Self { + client, + namespace, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::PATCH, &path, &query, &headers, body, 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, + idempotency_key: Option, +} + +impl DeleteRulesetRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String) -> Self { + Self { + client, + namespace, + slug, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body: Option<&serde_json::Value> = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body, 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<&serde_json::Value> = None; + self.client + .send_bytes(reqwest::Method::GET, &path, &query, &headers, body, 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, + idempotency_key: Option, +} + +impl CreateRulesetAccessGroupRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::AccessGroup) -> Self { + Self { + client, + namespace, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body, 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, + idempotency_key: Option, +} + +impl DeleteRulesetAccessGroupRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::AccessGroup) -> Self { + Self { + client, + namespace, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body, true) + .await + } +} diff --git a/src/resources/scalar_docs.rs b/src/resources/scalar_docs.rs new file mode 100644 index 0000000..0b7c338 --- /dev/null +++ b/src/resources/scalar_docs.rs @@ -0,0 +1,127 @@ +// 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: crate::models::ScalarDocsCreateGuideBody) -> 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<&serde_json::Value> = None; + self.client + .send::, _>(reqwest::Method::GET, &path, &query, &headers, body, 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: crate::models::ScalarDocsCreateGuideBody, + idempotency_key: Option, +} + +impl CreateGuideRequest { + fn new(client: crate::client::Scalar, body: crate::models::ScalarDocsCreateGuideBody) -> Self { + Self { + client, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body, 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, + idempotency_key: Option, +} + +impl PublishGuideRequest { + fn new(client: crate::client::Scalar, slug: String) -> Self { + Self { + client, + slug, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body: Option<&serde_json::Value> = None; + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body, true) + .await + } +} diff --git a/src/resources/schemas.rs b/src/resources/schemas.rs new file mode 100644 index 0000000..1a40e7b --- /dev/null +++ b/src/resources/schemas.rs @@ -0,0 +1,398 @@ +// 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: crate::models::SchemasCreateBody) -> CreateRequest { + CreateRequest::new(self.client.clone(), namespace.into(), body) + } + + /// Update shared component metadata + pub fn update(&self, namespace: impl Into, slug: impl Into, body: crate::models::SchemasUpdateBody) -> 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()) + } + + /// Get a shared component document + pub fn retrieve_version(&self, namespace: impl Into, slug: impl Into, semver: impl Into) -> RetrieveVersionRequest { + RetrieveVersionRequest::new(self.client.clone(), namespace.into(), slug.into(), semver.into()) + } + + /// Delete a shared component version + pub fn delete_version(&self, namespace: impl Into, slug: impl Into, semver: impl Into) -> DeleteVersionRequest { + DeleteVersionRequest::new(self.client.clone(), namespace.into(), slug.into(), semver.into()) + } + + /// Create a shared component version + pub fn create_version(&self, namespace: impl Into, slug: impl Into, body: crate::models::SchemasCreateVersionBody) -> CreateVersionRequest { + CreateVersionRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } + + /// Add shared component access group + pub fn create_access_group(&self, namespace: impl Into, slug: impl Into, body: crate::models::AccessGroup) -> CreateAccessGroupRequest { + CreateAccessGroupRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } + + /// Remove shared component access group + pub fn delete_access_group(&self, namespace: impl Into, slug: impl Into, body: crate::models::AccessGroup) -> DeleteAccessGroupRequest { + DeleteAccessGroupRequest::new(self.client.clone(), namespace.into(), slug.into(), body) + } +} + +/// 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<&serde_json::Value> = None; + self.client + .send::, _>(reqwest::Method::GET, &path, &query, &headers, body, 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: crate::models::SchemasCreateBody, + idempotency_key: Option, +} + +impl CreateRequest { + fn new(client: crate::client::Scalar, namespace: String, body: crate::models::SchemasCreateBody) -> Self { + Self { + client, + namespace, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body, 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: crate::models::SchemasUpdateBody, + idempotency_key: Option, +} + +impl UpdateRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::SchemasUpdateBody) -> Self { + Self { + client, + namespace, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::PATCH, &path, &query, &headers, body, 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, + idempotency_key: Option, +} + +impl DeleteRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String) -> Self { + Self { + client, + namespace, + slug, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body: Option<&serde_json::Value> = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body, true) + .await + } +} +/// Get a specific schema version document. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct RetrieveVersionRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + semver: String, +} + +impl RetrieveVersionRequest { + 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<&serde_json::Value> = None; + self.client + .send_bytes(reqwest::Method::GET, &path, &query, &headers, body, true) + .await + } +} +/// Delete a schema version. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct DeleteVersionRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + semver: String, + idempotency_key: Option, +} + +impl DeleteVersionRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, semver: String) -> Self { + Self { + client, + namespace, + slug, + semver, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body: Option<&serde_json::Value> = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body, true) + .await + } +} +/// Create a schema version. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateVersionRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: crate::models::SchemasCreateVersionBody, + idempotency_key: Option, +} + +impl CreateVersionRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::SchemasCreateVersionBody) -> Self { + Self { + client, + namespace, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body, true) + .await + } +} +/// Add an access group to a schema. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct CreateAccessGroupRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: crate::models::AccessGroup, + idempotency_key: Option, +} + +impl CreateAccessGroupRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::AccessGroup) -> Self { + Self { + client, + namespace, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body, true) + .await + } +} +/// Remove an access group from a schema. +#[must_use = "a request builder does nothing until `.send().await` is called"] +pub struct DeleteAccessGroupRequest { + client: crate::client::Scalar, + namespace: String, + slug: String, + body: crate::models::AccessGroup, + idempotency_key: Option, +} + +impl DeleteAccessGroupRequest { + fn new(client: crate::client::Scalar, namespace: String, slug: String, body: crate::models::AccessGroup) -> Self { + Self { + client, + namespace, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body, true) + .await + } +} diff --git a/src/resources/teams.rs b/src/resources/teams.rs new file mode 100644 index 0000000..b44a98d --- /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<&serde_json::Value> = None; + self.client + .send::, _>(reqwest::Method::GET, &path, &query, &headers, body, true) + .await + } +} diff --git a/src/resources/themes.rs b/src/resources/themes.rs new file mode 100644 index 0000000..7cc0b6f --- /dev/null +++ b/src/resources/themes.rs @@ -0,0 +1,246 @@ +// 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: crate::models::ThemesCreateBody) -> CreateRequest { + CreateRequest::new(self.client.clone(), body) + } + + /// Update theme metadata + pub fn update(&self, slug: impl Into, body: crate::models::ThemesUpdateBody) -> UpdateRequest { + UpdateRequest::new(self.client.clone(), slug.into(), body) + } + + /// Update theme document + pub fn replace_document(&self, slug: impl Into, body: crate::models::ThemesReplaceDocumentBody) -> 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<&serde_json::Value> = None; + self.client + .send::, _>(reqwest::Method::GET, &path, &query, &headers, body, 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: crate::models::ThemesCreateBody, + idempotency_key: Option, +} + +impl CreateRequest { + fn new(client: crate::client::Scalar, body: crate::models::ThemesCreateBody) -> Self { + Self { + client, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::POST, &path, &query, &headers, body, 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: crate::models::ThemesUpdateBody, + idempotency_key: Option, +} + +impl UpdateRequest { + fn new(client: crate::client::Scalar, slug: String, body: crate::models::ThemesUpdateBody) -> Self { + Self { + client, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::PATCH, &path, &query, &headers, body, 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: crate::models::ThemesReplaceDocumentBody, + idempotency_key: Option, +} + +impl ReplaceDocumentRequest { + fn new(client: crate::client::Scalar, slug: String, body: crate::models::ThemesReplaceDocumentBody) -> Self { + Self { + client, + slug, + body, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body = Some(&self.body); + self.client + .send::(reqwest::Method::PUT, &path, &query, &headers, body, 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, + idempotency_key: Option, +} + +impl DeleteRequest { + fn new(client: crate::client::Scalar, slug: String) -> Self { + Self { + client, + slug, + idempotency_key: None, + } + } + + /// Sets an idempotency key so this request can be safely retried. + pub fn idempotency_key(mut self, value: impl Into) -> Self { + self.idempotency_key = Some(value.into()); + self + } + + /// 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 mut headers: Vec<(String, String)> = Vec::new(); + if let Some(key) = self.idempotency_key { + headers.push(("Idempotency-Key".to_string(), key)); + } + let body: Option<&serde_json::Value> = None; + self.client + .send::(reqwest::Method::DELETE, &path, &query, &headers, body, 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<&serde_json::Value> = None; + self.client + .send_bytes(reqwest::Method::GET, &path, &query, &headers, body, true) + .await + } +} diff --git a/src/webhooks.rs b/src/webhooks.rs deleted file mode 100644 index 7e6acfd..0000000 --- a/src/webhooks.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by Scalar SDK Generator. DO NOT EDIT. -//! Inbound webhook event types and verification. -#![allow(clippy::large_enum_variant)] - -use crate::error::Error; - -/// A decoded inbound webhook event. -#[derive(Debug, Clone)] -#[non_exhaustive] -pub enum WebhookEvent { - NewPlanet(serde_json::Value), -} - -impl WebhookEvent { - /// Parses a webhook payload, dispatching on the event-type string. - /// - /// `event_type` is the value the webhook delivers to identify the event - /// (typically in a request header); `payload` is the raw JSON body. - pub fn parse(event_type: &str, payload: &[u8]) -> Result { - match event_type { - "newPlanet" => Ok(Self::NewPlanet(serde_json::from_slice(payload)?)), - other => Err(Error::Config(format!("unrecognized webhook event type: {other}"))), - } - } -} diff --git a/tests/smoke.rs b/tests/smoke.rs index 6681638..987087d 100644 --- a/tests/smoke.rs +++ b/tests/smoke.rs @@ -1,125 +1,680 @@ // Code generated by Scalar SDK Generator. DO NOT EDIT. //! Runtime smoke test: drives every synthesizable operation once. //! -//! Set `HARNESS_BASE_URL` (and any credential env vars) to point the client at a +//! Set `SCALAR_API_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 scalargalaxy_rust::*; +use scalar_api::*; #[tokio::test] async fn smoke() { - if std::env::var("HARNESS_BASE_URL").is_err() { + if std::env::var("SCALAR_API_BASE_URL").is_err() { return; } - let client = ScalarGalaxyClient::from_env().expect("client builds from environment"); + let client = Scalar::from_env().expect("client builds from environment"); let mut failures: Vec = Vec::new(); { let result: Result<(), Error> = async { - let _ = client.planets().list_all_data().send().await?; + 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 /planets")); + failures.push(format!("{}: {error}", "GET /v1/apis")); } } } { let result: Result<(), Error> = async { - let _ = client.planets().create().send().await?; + 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}", "POST /planets")); + failures.push(format!("{}: {error}", "GET /v1/apis/{namespace}")); } } } { let result: Result<(), Error> = async { - let _ = client.planets().retrieve(1).send().await?; + let _ = client.registry().create_api_document("example", RegistryCreateApiDocumentBody { + title: "".to_string(), + description: None, + version: "x".to_string(), + slug: "".to_string(), + ruleset: None, + is_private: None, + document: "".to_string(), + }).send().await?; Ok(()) } .await; if let Err(error) = result { if is_smoke_failure(&error) { - failures.push(format!("{}: {error}", "GET /planets/{planetId}")); + failures.push(format!("{}: {error}", "POST /v1/apis/{namespace}")); } } } { let result: Result<(), Error> = async { - let _ = client.planets().update(1).send().await?; + let _ = client.registry().update_api_document("example", "example", RegistryUpdateApiDocumentBody { + title: None, + description: None, + is_private: None, + ruleset: None, + }).send().await?; Ok(()) } .await; if let Err(error) = result { if is_smoke_failure(&error) { - failures.push(format!("{}: {error}", "PUT /planets/{planetId}")); + failures.push(format!("{}: {error}", "PATCH /v1/apis/{namespace}/{slug}")); } } } { let result: Result<(), Error> = async { - client.planets().delete(1).send().await?; + 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 /planets/{planetId}")); + failures.push(format!("{}: {error}", "DELETE /v1/apis/{namespace}/{slug}")); } } } { let result: Result<(), Error> = async { - let _ = client.planets().upload_image(1).send().await?; + 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}", "POST /planets/{planetId}/image")); + failures.push(format!("{}: {error}", "GET /v1/apis/{namespace}/{slug}/version/{semver}")); } } } { let result: Result<(), Error> = async { - let _ = client.authentication().create_user().send().await?; + let _ = client.registry().update_api_document_version("example", "example", "example", RegistryUpdateApiDocumentVersionBody { + document: "".to_string(), + last_known_version_sha: None, + }).send().await?; Ok(()) } .await; if let Err(error) = result { if is_smoke_failure(&error) { - failures.push(format!("{}: {error}", "POST /user/signup")); + failures.push(format!("{}: {error}", "PATCH /v1/apis/{namespace}/{slug}/version/{semver}")); } } } { let result: Result<(), Error> = async { - let _ = client.authentication().create_token().send().await?; + 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}", "POST /auth/token")); + failures.push(format!("{}: {error}", "DELETE /v1/apis/{namespace}/{slug}/version/{semver}")); } } } { let result: Result<(), Error> = async { - let _ = client.authentication().list_me().send().await?; + 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 /me")); + 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", RegistryCreateApiDocumentVersionBody { + version: "x".to_string(), + document: "".to_string(), + force: None, + last_known_version_sha: None, + }).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: "xxx".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: "xxx".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", SchemasCreateBody { + title: "".to_string(), + description: None, + version: "x".to_string(), + slug: "".to_string(), + is_private: None, + document: "".to_string(), + }).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", SchemasUpdateBody { + title: None, + description: None, + is_private: None, + }).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().retrieve_version("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().delete_version("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().create_version("example", "example", SchemasCreateVersionBody { + version: "x".to_string(), + document: "".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}/version")); + } + } + } + { + let result: Result<(), Error> = async { + let _ = client.schemas().create_access_group("example", "example", AccessGroup { + access_group_slug: "xxx".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().delete_access_group("example", "example", AccessGroup { + access_group_slug: "xxx".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", LoginPortalsUpdateBody { + title: None, + }).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(LoginPortalsCreateBody { + title: "".to_string(), + slug: "".to_string(), + email: LoginPortalEmail { + logo: "".to_string(), + logo_size: "100".to_string(), + button_text: "Login".to_string(), + message: "Click to access private documentation hosted by scalar.com".to_string(), + title: "Private Docs".to_string(), + main_color: "#2a2f45".to_string(), + main_background: "#f6f6f6".to_string(), + card_color: "2a2f45".to_string(), + card_background: "#fff".to_string(), + button_color: "#fff".to_string(), + button_background: "#0f0f0f".to_string(), + }, + page: LoginPortalPage { + title: "Scalar Private Docs".to_string(), + description: "Login to access your documentation".to_string(), + head: "".to_string(), + script: "".to_string(), + theme: "".to_string(), + company_name: "".to_string(), + logo: "".to_string(), + logo_url: "".to_string(), + favicon: "".to_string(), + terms_link: "".to_string(), + privacy_link: "".to_string(), + form_title: "Scalar Private Docs".to_string(), + form_description: "Login to access your documentation".to_string(), + form_image: "".to_string(), + }, + }).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", RulesCreateRulesetBody { + title: "".to_string(), + description: None, + slug: "".to_string(), + is_private: None, + document: "".to_string(), + }).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", RulesUpdateRulesetBody { + namespace: None, + slug: None, + title: None, + description: None, + is_private: None, + }).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: "xxx".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: "xxx".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(ThemesCreateBody { + name: "".to_string(), + description: None, + slug: "".to_string(), + document: "".to_string(), + }).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", ThemesUpdateBody { + name: None, + description: None, + }).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", ThemesReplaceDocumentBody { + document: "".to_string(), + }).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(ScalarDocsCreateGuideBody { + name: "".to_string(), + slug: None, + is_private: false, + allowed_users: vec![], + allowed_domains: vec![], + }).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(AuthenticationExchangePersonalTokenBody { + personal_token: "".to_string(), + }).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")); } } } From 5c6ae97bbb949e1bffdc5a2e915c9053bead39c7 Mon Sep 17 00:00:00 2001 From: scalarbot Date: Fri, 17 Jul 2026 23:21:11 +0000 Subject: [PATCH 2/3] chore(api): update generated SDK content 1 generated file changed with no detected API surface change (documentation, examples, or file content). Build: wZCF9y6ji7nADhmNSAF0u --- openapi.augmented.json | 92 +++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/openapi.augmented.json b/openapi.augmented.json index 1c216d6..ed35717 100644 --- a/openapi.augmented.json +++ b/openapi.augmented.json @@ -1070,7 +1070,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -1202,7 +1202,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -1398,7 +1398,7 @@ { "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: \"x\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(createAPIDocument);" + "source": "import Scalar from \"@scalar/access-service\";\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: \"x\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(createAPIDocument);" }, { "label": "Shell", @@ -1560,7 +1560,7 @@ { "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\", {});" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -1695,7 +1695,7 @@ { "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\");" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -1840,7 +1840,7 @@ { "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_);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -2022,7 +2022,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -2165,7 +2165,7 @@ { "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\");" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -2310,7 +2310,7 @@ { "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 listAPIDocumentVersionMetadata = await client.registry.listAPIDocumentVersionMetadata(\"namespace\", \"slug\", \"semver\");\nconsole.log(listAPIDocumentVersionMetadata);" + "source": "import Scalar from \"@scalar/access-service\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst listAPIDocumentVersionMetadata = await client.registry.listAPIDocumentVersionMetadata(\"namespace\", \"slug\", \"semver\");\nconsole.log(listAPIDocumentVersionMetadata);" }, { "label": "Shell", @@ -2476,7 +2476,7 @@ { "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 createAPIDocumentVersion = await client.registry.createAPIDocumentVersion(\"namespace\", \"slug\", {\n version: \"x\",\n document: \"\",\n});\nconsole.log(createAPIDocumentVersion);" + "source": "import Scalar from \"@scalar/access-service\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst createAPIDocumentVersion = await client.registry.createAPIDocumentVersion(\"namespace\", \"slug\", {\n version: \"x\",\n document: \"\",\n});\nconsole.log(createAPIDocumentVersion);" }, { "label": "Shell", @@ -2623,7 +2623,7 @@ { "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: \"xxx\",\n});" + "source": "import Scalar from \"@scalar/access-service\";\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: \"xxx\",\n});" }, { "label": "Shell", @@ -2768,7 +2768,7 @@ { "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: \"xxx\",\n});" + "source": "import Scalar from \"@scalar/access-service\";\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: \"xxx\",\n});" }, { "label": "Shell", @@ -2900,7 +2900,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -3064,7 +3064,7 @@ { "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 create = await client.schemas.create(\"namespace\", {\n title: \"\",\n version: \"x\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(create);" + "source": "import Scalar from \"@scalar/access-service\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst create = await client.schemas.create(\"namespace\", {\n title: \"\",\n version: \"x\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(create);" }, { "label": "Shell", @@ -3223,7 +3223,7 @@ { "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\", {});" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -3358,7 +3358,7 @@ { "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\");" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -3503,7 +3503,7 @@ { "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.retrieveVersion(\"namespace\", \"slug\", \"semver\");\nconsole.log(string_);" + "source": "import Scalar from \"@scalar/access-service\";\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.retrieveVersion(\"namespace\", \"slug\", \"semver\");\nconsole.log(string_);" }, { "label": "Shell", @@ -3646,7 +3646,7 @@ { "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.deleteVersion(\"namespace\", \"slug\", \"semver\");" + "source": "import Scalar from \"@scalar/access-service\";\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.deleteVersion(\"namespace\", \"slug\", \"semver\");" }, { "label": "Shell", @@ -3806,7 +3806,7 @@ { "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 createVersion = await client.schemas.createVersion(\"namespace\", \"slug\", {\n version: \"x\",\n document: \"\",\n});\nconsole.log(createVersion);" + "source": "import Scalar from \"@scalar/access-service\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst createVersion = await client.schemas.createVersion(\"namespace\", \"slug\", {\n version: \"x\",\n document: \"\",\n});\nconsole.log(createVersion);" }, { "label": "Shell", @@ -3953,7 +3953,7 @@ { "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.createAccessGroup(\"namespace\", \"slug\", {\n accessGroupSlug: \"xxx\",\n});" + "source": "import Scalar from \"@scalar/access-service\";\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.createAccessGroup(\"namespace\", \"slug\", {\n accessGroupSlug: \"xxx\",\n});" }, { "label": "Shell", @@ -4098,7 +4098,7 @@ { "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.deleteAccessGroup(\"namespace\", \"slug\", {\n accessGroupSlug: \"xxx\",\n});" + "source": "import Scalar from \"@scalar/access-service\";\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.deleteAccessGroup(\"namespace\", \"slug\", {\n accessGroupSlug: \"xxx\",\n});" }, { "label": "Shell", @@ -4252,7 +4252,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -4395,7 +4395,7 @@ { "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\", {});" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -4522,7 +4522,7 @@ { "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\");" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -4672,7 +4672,7 @@ { "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 create = 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(create);" + "source": "import Scalar from \"@scalar/access-service\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst create = 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(create);" }, { "label": "Shell", @@ -4792,7 +4792,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -4924,7 +4924,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -5084,7 +5084,7 @@ { "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 createRuleset = await client.rules.createRuleset(\"namespace\", {\n title: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(createRuleset);" + "source": "import Scalar from \"@scalar/access-service\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst createRuleset = await client.rules.createRuleset(\"namespace\", {\n title: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(createRuleset);" }, { "label": "Shell", @@ -5249,7 +5249,7 @@ { "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\", {});" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -5384,7 +5384,7 @@ { "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\");" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -5519,7 +5519,7 @@ { "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_);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -5666,7 +5666,7 @@ { "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: \"xxx\",\n});" + "source": "import Scalar from \"@scalar/access-service\";\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: \"xxx\",\n});" }, { "label": "Shell", @@ -5811,7 +5811,7 @@ { "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: \"xxx\",\n});" + "source": "import Scalar from \"@scalar/access-service\";\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: \"xxx\",\n});" }, { "label": "Shell", @@ -5933,7 +5933,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -6080,7 +6080,7 @@ { "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 create = await client.themes.create({\n name: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(create);" + "source": "import Scalar from \"@scalar/access-service\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst create = await client.themes.create({\n name: \"\",\n slug: \"\",\n document: \"\",\n});\nconsole.log(create);" }, { "label": "Shell", @@ -6228,7 +6228,7 @@ { "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\", {});" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -6374,7 +6374,7 @@ { "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});" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -6501,7 +6501,7 @@ { "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\");" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -6628,7 +6628,7 @@ { "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_);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -6750,7 +6750,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -6872,7 +6872,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -7045,7 +7045,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -7183,7 +7183,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -7305,7 +7305,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -7453,7 +7453,7 @@ { "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);" + "source": "import Scalar from \"@scalar/access-service\";\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", @@ -7572,7 +7572,7 @@ { "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 listCurrentUser = await client.authentication.listCurrentUser();\nconsole.log(listCurrentUser);" + "source": "import Scalar from \"@scalar/access-service\";\n\nconst client = new Scalar({\n bearerAuth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n environment: \"production\",\n});\n\nconst listCurrentUser = await client.authentication.listCurrentUser();\nconsole.log(listCurrentUser);" }, { "label": "Shell", From 5c2f29f946a929f0a35877ac7bfcaa4285a3a352 Mon Sep 17 00:00:00 2001 From: "scalar-docs-staging[bot]" <207530426+scalar-docs-staging[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2026 23:21:20 +0000 Subject: [PATCH 3/3] release: 0.2.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 55 +++++++++++++++++++++++++++++++++++ Cargo.toml | 2 +- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 466df71..2be9c43 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0" + ".": "0.2.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..38b6c32 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,55 @@ +# Changelog + +## [0.2.0](https://github.com/scalar/scalar-rust/compare/v0.1.0...v0.2.0) (2026-07-17) + + +### ⚠ BREAKING CHANGES + +* **api:** 37 breaking changes to the SDK surface. + - Renamed SDK from `ScalarGalaxy` to `ScalarApi`. + - Removed server `https://galaxy.scalar.com`. + - Removed server `{protocol}://void.scalar.com/{path}`. + - URL of environment `production` changed from `https://galaxy.scalar.com` to `https://access.scalar.com`. + - Removed environment `responds_with_your_request_data`. + - Removed `bearer` auth scheme `bearerAuth`. + - Removed `basic` auth scheme `basicAuth`. + - Removed `apiKey` auth scheme `apiKeyHeader`. + - Removed `apiKey` auth scheme `apiKeyQuery`. + - Removed `apiKey` auth scheme `apiKeyCookie`. + - Removed `oauth2` auth scheme `oAuth2`. + - Removed `oauth2` auth scheme `openIdConnect`. + - Removed operation `planets.listAllData` (`GET /planets`). + - Removed operation `planets.create` (`POST /planets`). + - Removed operation `planets.retrieve` (`GET /planets/{planetId}`). + - Removed operation `planets.update` (`PUT /planets/{planetId}`). + - Removed operation `planets.delete` (`DELETE /planets/{planetId}`). + - Removed operation `planets.uploadImage` (`POST /planets/{planetId}/image`). + - Removed operation `authentication.createUser` (`POST /user/signup`). + - Removed operation `authentication.createToken` (`POST /auth/token`). + - Removed operation `authentication.listMe` (`GET /me`). + - Added required property `User.uid`. + - Added required property `User.createdAt`. + - Added required property `User.updatedAt`. + - Added required property `User.email`. + - Added required property `User.activeTeamId`. + - Added required property `User.hasGithub`. + - Added required property `User.teams`. + - Removed optional property `User.id`. + - Removed optional property `User.name`. + - Removed schema `Credentials`. + - Removed schema `Token`. + - Removed schema `Planet`. + - Removed schema `PaginatedResource`. + - Removed schema `Satellite`. + - Removed webhook `NewPlanet` (`newPlanet`). + - Removed webhook `RequestBodyCallbackUrl` (`{$request.body#/callbackUrl}`). + +### Features + +* **api:** initial SDK generation ([ffade80](https://github.com/scalar/scalar-rust/commit/ffade8030ce6b907245816d7cfc7b144ddd2a92d)) +* **api:** update SDK name (+117 more changes) ([c4fcf91](https://github.com/scalar/scalar-rust/commit/c4fcf91636ce0a996dd806a7ac7ab03d9a617b4e)) + + +### Chores + +* **api:** update generated SDK content ([5c6ae97](https://github.com/scalar/scalar-rust/commit/5c6ae97bbb949e1bffdc5a2e915c9053bead39c7)) diff --git a/Cargo.toml b/Cargo.toml index 3dc5736..65768ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "scalar-api" -version = "0.1.0" # x-release-please-version +version = "0.2.0" # x-release-please-version edition = "2024" rust-version = "1.85" description = "API for managing Scalar platform resources."