4个版本
新 0.1.2-rc.1 | 2024年8月23日 |
---|---|
0.1.1 | 2024年8月21日 |
0.1.1-rc.1 | 2024年8月23日 |
0.1.0 | 2024年8月9日 |
#22 in #mocking
257 每月下载量
570KB
12K SLoC
sideko_rest_api rust
Sideko API解锁了包括生成SDK、设置带有模拟服务器的API项目、创建带有生成的API引用和自定义页面的文档项目、管理角色和权限等功能。
身份验证
use sideko_rest_api::Client;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
delete_api_link
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.delete_api_link(DeleteApiLinkRequest {link_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()});
delete_api_link_group
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.delete_api_link_group(DeleteApiLinkGroupRequest {group_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()});
delete_api_project
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.delete_api_project(DeleteApiProjectRequest {project_id_or_name: "string".to_string()});
delete_api_project_role
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.delete_api_project_role(DeleteApiProjectRoleRequest {project_id_or_name: "string".to_string(), user_id: "string".to_string()});
delete_doc_project
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.delete_doc_project(DeleteDocProjectRequest {project_id_or_name: "string".to_string()});
delete_doc_project_role
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.delete_doc_project_role(DeleteDocProjectRoleRequest {project_id_or_name: "string".to_string(), user_id: "string".to_string()});
delete_guide
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.delete_guide(DeleteGuideRequest {project_id_or_name: "string".to_string(), version_id: "string".to_string(), guide_id: "string".to_string()});
delete_guide_href
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.delete_guide_href(DeleteGuideHrefRequest {project_id_or_name: "string".to_string(), version_id: "string".to_string(), guide_id: "string".to_string(), variant: GuideHrefVariantEnum::Next});
delete_asset
删除组织中的资产
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.delete_asset(DeleteAssetRequest {asset_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()});
delete_service_account
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.delete_service_account(DeleteServiceAccountRequest {service_account_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()});
health_check
use sideko_rest_api::Client;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.health_check();
ping_check
use sideko_rest_api::Client;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.ping_check();
list_api_links
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_api_links(ListApiLinksRequest {doc_version_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()});
get_api_link
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_api_link(GetApiLinkRequest {link_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()});
list_api_link_groups
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_api_link_groups(ListApiLinkGroupsRequest {doc_version_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()});
list_api_projects
use sideko_rest_api::Client;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_api_projects();
get_api_project
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_api_project(GetApiProjectRequest {project_id_or_name: "string".to_string()});
list_api_project_members
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_api_project_members(ListApiProjectMembersRequest {project_id_or_name: "string".to_string()});
list_api_versions
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_api_versions(ListApiVersionsRequest {project_id_or_name: "string".to_string()});
get_api_version
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_api_version(GetApiVersionRequest {project_id_or_name: "string".to_string(), version_id_or_semver: "string".to_string()});
get_api_version_openapi
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_api_version_openapi(GetApiVersionOpenapiRequest {project_id_or_name: "string".to_string(), version_id_or_semver: "string".to_string()});
get_api_version_stats
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_api_version_stats(GetApiVersionStatsRequest {project_id_or_name: "string".to_string(), version_id_or_semver: "string".to_string()});
exchange_code_for_key
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.exchange_code_for_key(ExchangeCodeForKeyRequest {code: "string".to_string()});
login_callback
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.login_callback(LoginCallbackRequest {code: "string".to_string(), state: Some("string".to_string())});
login_url
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.login_url(LoginUrlRequest {cli_output: Some("string".to_string()), cli_port: Some(123)});
cli_check_updates
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.cli_check_updates(CliCheckUpdatesRequest {cli_version: "0.1.0".to_string()});
list_doc_projects
use sideko_rest_api::Client;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_doc_projects();
get_doc_project
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_doc_project(GetDocProjectRequest {project_id_or_name: "string".to_string()});
list_deployments
检索文档项目的所有部署
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_deployments(ListDeploymentsRequest {project_id_or_name: "string".to_string(), limit: Some(123), target: Some(DeploymentTargetEnum::Preview)});
get_deployment
检索单个部署
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_deployment(GetDeploymentRequest {project_id_or_name: "string".to_string(), deployment_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()});
list_doc_project_members
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_doc_project_members(ListDocProjectMembersRequest {project_id_or_name: "string".to_string()});
check_preview
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.check_preview(CheckPreviewRequest {project_id_or_name: "string".to_string()});
get_doc_project_theme
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_doc_project_theme(GetDocProjectThemeRequest {project_id_or_name: "string".to_string()});
list_doc_versions
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_doc_versions(ListDocVersionsRequest {project_id_or_name: "string".to_string()});
get_doc_version
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_doc_version(GetDocVersionRequest {project_id_or_name: "string".to_string(), version_id: "string".to_string()});
list_guides
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_guides(ListGuidesRequest {project_id_or_name: "string".to_string(), version_id: "string".to_string()});
get_guide
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_guide(GetGuideRequest {project_id_or_name: "string".to_string(), version_id: "string".to_string(), guide_id: "string".to_string()});
get_guide_content
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_guide_content(GetGuideContentRequest {project_id_or_name: "string".to_string(), version_id: "string".to_string(), guide_id: "string".to_string()});
get_organization
获取用户组织
use sideko_rest_api::Client;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_organization();
list_assets
获取组织的所有资产
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_assets(ListAssetsRequest {name: Some("string".to_string()), page: Some(123)});
list_organization_members
获取组织中的用户
use sideko_rest_api::Client;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_organization_members();
get_organization_theme
获取组织级别配置的文档项目主题
use sideko_rest_api::Client;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_organization_theme();
list_sdks
use sideko_rest_api::Client;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.list_sdks();
get_current_user
use sideko_rest_api::Client;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_current_user();
get_api_key
use sideko_rest_api::Client;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_api_key();
get_user_project_role
检索给定项目类型/ID的当前用户角色
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_user_project_role(GetUserProjectRoleRequest {project_type: ProjectTypeEnum::Api, project_id: Some("string".to_string())});
get_service_accounts
use sideko_rest_api::Client;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.get_service_accounts();
update_api_link
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.update_api_link(UpdateApiLinkRequest {link_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), data: UpdateApiLink {api_version_id: Some("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()), build_request_enabled: Some(true), include_mock_server: Some(true), nav_label: Some("string".to_string()), policy: Some(ApiLinkPolicyEnum::Latest), slug: Some("string".to_string())}});
update_api_link_group
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.update_api_link_group(UpdateApiLinkGroupRequest {group_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), data: UpdateApiLinkGroup {nav_label: Some("string".to_string()), slug: Some("string".to_string())}});
update_api_project
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.update_api_project(UpdateApiProjectRequest {project_id_or_name: "string".to_string(), data: UpdateApiProject {title: Some("my-new-api-name".to_string())}});
update_api_version
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.update_api_version(UpdateApiVersionRequest {project_id_or_name: "string".to_string(), version_id_or_semver: "string".to_string(), data: UpdateApiVersion {mock_server_enabled: Some(true), notes: Some("<p>This version includes a number of excellent improvements</p>".to_string()), openapi: Some("string".to_string()), semver: Some("string".to_string())}});
update_doc_project
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.update_doc_project(UpdateDocProjectRequest {project_id_or_name: "string".to_string(), data: UpdateDocProject {logos: Some(UpdateDocProjectLogos {dark: Some("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()), favicon: Some("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()), light: Some("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string())}), settings: Some(UpdateDocProjectSettings {action_button: Some(UpdateDocProjectSettingsActionButton {enabled: Some(true), label: Some("string".to_string()), url: Some("http://www.example.com".to_string())}), metadata: Some(UpdateDocProjectSettingsMetadata {description: Some("string".to_string()), title: Some("string".to_string())})}), title: Some("my-company-docs".to_string())}});
update_guide
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.update_guide(UpdateGuideRequest {project_id_or_name: "string".to_string(), version_id: "string".to_string(), guide_id: "string".to_string(), data: UpdateGuide {content: Some("string".to_string()), nav_label: Some("string".to_string()), next_id: Some("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()), prev_id: Some("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()), slug: Some("string".to_string())}});
update_asset
更新组织中的资产
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.update_asset(UpdateAssetRequest {asset_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), data: UpdateAsset {name: Some("string".to_string())}});
create_api_link
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.create_api_link(CreateApiLinkRequest {data: NewApiLink {api_version_id: Some("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()), build_request_enabled: Some(true), doc_version_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), group_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), include_mock_server: Some(true), nav_label: "string".to_string(), policy: Union::LatestApiLinkPolicy(LatestApiLinkPolicy {api_project_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), type_field: LatestApiLinkPolicyTypeEnum::Latest}), slug: "string".to_string()}});
reorder_api_links
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.reorder_api_links(ReorderApiLinksRequest {data: ApiReorder {doc_version_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), groups: vec![ApiLinkGroupReorder {id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), order: 123}], links: vec![ApiLinkReorder {group_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), order: 123}]}});
create_api_link_group
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.create_api_link_group(CreateApiLinkGroupRequest {data: NewApiLinkGroup {doc_version_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), nav_label: "string".to_string(), slug: "string".to_string()}});
create_api_project
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.create_api_project(CreateApiProjectRequest {data: NewApiProject {title: "my-api-spec".to_string()}});
grant_api_project_role
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.grant_api_project_role(GrantApiProjectRoleRequest {project_id_or_name: "string".to_string(), data: NewProjectRole {role: ProjectRoleEnum::Admin, user_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()}});
create_api_version
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.create_api_version(CreateApiVersionRequest {project_id_or_name: "string".to_string(), data: NewApiVersion {mock_server_enabled: Some(true), notes: Some("<p>This version includes a number of excellent improvements</p>".to_string()), openapi: "string".to_string(), semver: "string".to_string()}});
create_doc_project
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.create_doc_project(CreateDocProjectRequest {data: NewDocProject {title: "my-company-docs".to_string()}});
trigger_deployment
部署带有链接指南和API的新生成的文档版本
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.trigger_deployment(TriggerDeploymentRequest {project_id_or_name: "string".to_string(), data: NewDeployment {doc_version_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), target: DeploymentTargetEnum::Preview}});
grant_doc_project_role
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.grant_doc_project_role(GrantDocProjectRoleRequest {project_id_or_name: "string".to_string(), data: NewProjectRole {role: ProjectRoleEnum::Admin, user_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()}});
create_guide
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.create_guide(CreateGuideRequest {project_id_or_name: "string".to_string(), version_id: "string".to_string(), data: NewGuide {content: "string".to_string(), is_parent: true, nav_label: "string".to_string(), next_id: Some("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()), parent_id: Some("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()), prev_id: Some("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()), slug: "string".to_string()}});
reorder_guides
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.reorder_guides(ReorderGuidesRequest {project_id_or_name: "string".to_string(), version_id: "string".to_string(), data: vec![ReorderGuide {id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), order: 123, parent_id: Some("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string())}]});
create_organization
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.create_organization(CreateOrganizationRequest {data: NewOrganization {name: "string".to_string(), subdomain: "string".to_string()}});
upload_assets
将像徽标或其他媒体这样的资产添加到组织中
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.upload_assets(UploadAssetsRequest {data: File {file: "path/to/file.pdf".to_string()}});
create_sdk
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.create_sdk(CreateSdkRequest {data: SdkProject {api_project_version_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), language: GenerationLanguageEnum::Go, name: "my-api-python".to_string(), semver: "1.0.0".to_string()}});
update_sdk
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.update_sdk(UpdateSdkRequest {name: "my-python-sdk".to_string(), semver: "0.1.1".to_string(), api_version_id_or_semver: Some("string".to_string()), data: File {file: "path/to/file.pdf".to_string()}});
stateless_generate_sdk
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.stateless_generate_sdk(StatelessGenerateSdkRequest {data: StatelessGenerateSdk {base_url: Some("http://127.0.0.1:8080/api".to_string()), language: GenerationLanguageEnum::Go, openapi: "openapi: 3.0.0".to_string(), package_name: Some("my_sdk".to_string()), tests_mock_server_url: Some("http://127.0.0.1:8080/mock".to_string())}});
invite_user
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.invite_user(InviteUserRequest {data: Invite {email: "[email protected]".to_string(), role: OrganizationRoleEnum::Admin}});
create_service_account
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.create_service_account(CreateServiceAccountRequest {data: CreateServiceAccount {name: "Documentation Publisher Service Account".to_string(), project_roles: vec![UserProjectRole {project_id_or_name: "string".to_string(), project_type: ProjectTypeEnum::Api, role: ProjectRoleEnum::Admin}]}});
vercel_webhook
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.vercel_webhook(VercelWebhookRequest {data: serde_json::json!({})});
update_doc_project_theme
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.update_doc_project_theme(UpdateDocProjectThemeRequest {project_id_or_name: "string".to_string(), data: ThemeValues {api_reference_group_variant: Some("grouped".to_string()), dark_active_button_bg_color: Some("#FFFFFF".to_string()), dark_active_button_text_color: Some("#FFFFFF".to_string()), dark_bg_color: Some("#FFFFFF".to_string()), dark_navbar_color: Some("#FFFFFF".to_string()), dark_navbar_text_color: Some("#FFFFFF".to_string()), light_active_button_bg_color: Some("#FFFFFF".to_string()), light_active_button_text_color: Some("#FFFFFF".to_string()), light_bg_color: Some("#FFFFFF".to_string()), light_navbar_color: Some("#FFFFFF".to_string()), light_navbar_text_color: Some("#FFFFFF".to_string())}});
update_organization_theme
更新组织级别配置的文档项目主题
use sideko_rest_api::Client;
use sideko_rest_api::request_types::*;
use sideko_rest_api::schemas::*;
let client = Client::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined")).with_cookie_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client.update_organization_theme(UpdateOrganizationThemeRequest {data: ThemeValues {api_reference_group_variant: Some("grouped".to_string()), dark_active_button_bg_color: Some("#FFFFFF".to_string()), dark_active_button_text_color: Some("#FFFFFF".to_string()), dark_bg_color: Some("#FFFFFF".to_string()), dark_navbar_color: Some("#FFFFFF".to_string()), dark_navbar_text_color: Some("#FFFFFF".to_string()), light_active_button_bg_color: Some("#FFFFFF".to_string()), light_active_button_text_color: Some("#FFFFFF".to_string()), light_bg_color: Some("#FFFFFF".to_string()), light_navbar_color: Some("#FFFFFF".to_string()), light_navbar_text_color: Some("#FFFFFF".to_string())}});
依赖项
~4–15MB
~235K SLoC