sideko_rest_api 0.9.2

Rust API Client
Documentation
#[serial_test::serial]
#[tokio::test]
async fn test_delete_204_success_all_params() {
    let mut client = sideko_rest_api::SidekoClient::default()
        .with_api_key_auth("API_KEY")
        .with_cookie_auth("API_KEY")
        .with_environment(sideko_rest_api::Environment::MockServer);
    let res = client
        .api()
        .spec()
        .delete(sideko_rest_api::resources::api::spec::DeleteRequest {
            api_name: "my-project".to_string(),
            api_version: sideko_rest_api::models::ApiVersion::VersionTypeEnum(
                sideko_rest_api::models::VersionTypeEnum::Latest,
            ),
        })
        .await;
    println!("{res:?}");
    assert!(res.is_ok());
}
#[serial_test::serial]
#[tokio::test]
async fn test_list_200_success_all_params() {
    let mut client = sideko_rest_api::SidekoClient::default()
        .with_api_key_auth("API_KEY")
        .with_cookie_auth("API_KEY")
        .with_environment(sideko_rest_api::Environment::MockServer);
    let res = client
        .api()
        .spec()
        .list(sideko_rest_api::resources::api::spec::ListRequest {
            api_name: "my-project".to_string(),
        })
        .await;
    println!("{res:?}");
    assert!(res.is_ok());
}
#[serial_test::serial]
#[tokio::test]
async fn test_get_200_success_all_params() {
    let mut client = sideko_rest_api::SidekoClient::default()
        .with_api_key_auth("API_KEY")
        .with_cookie_auth("API_KEY")
        .with_environment(sideko_rest_api::Environment::MockServer);
    let res = client
        .api()
        .spec()
        .get(sideko_rest_api::resources::api::spec::GetRequest {
            api_name: "my-project".to_string(),
            api_version: sideko_rest_api::models::ApiVersion::VersionTypeEnum(
                sideko_rest_api::models::VersionTypeEnum::Latest,
            ),
        })
        .await;
    println!("{res:?}");
    assert!(res.is_ok());
}
#[serial_test::serial]
#[tokio::test]
async fn test_get_openapi_200_success_all_params() {
    let mut client = sideko_rest_api::SidekoClient::default()
        .with_api_key_auth("API_KEY")
        .with_cookie_auth("API_KEY")
        .with_environment(sideko_rest_api::Environment::MockServer);
    let res = client
        .api()
        .spec()
        .get_openapi(sideko_rest_api::resources::api::spec::GetOpenapiRequest {
            api_name: "my-project".to_string(),
            api_version: sideko_rest_api::models::ApiVersion::VersionTypeEnum(
                sideko_rest_api::models::VersionTypeEnum::Latest,
            ),
        })
        .await;
    println!("{res:?}");
    assert!(res.is_ok());
}
#[serial_test::serial]
#[tokio::test]
async fn test_get_stats_200_success_all_params() {
    let mut client = sideko_rest_api::SidekoClient::default()
        .with_api_key_auth("API_KEY")
        .with_cookie_auth("API_KEY")
        .with_environment(sideko_rest_api::Environment::MockServer);
    let res = client
        .api()
        .spec()
        .get_stats(sideko_rest_api::resources::api::spec::GetStatsRequest {
            api_name: "my-project".to_string(),
            api_version: sideko_rest_api::models::ApiVersion::VersionTypeEnum(
                sideko_rest_api::models::VersionTypeEnum::Latest,
            ),
        })
        .await;
    println!("{res:?}");
    assert!(res.is_ok());
}
#[serial_test::serial]
#[tokio::test]
async fn test_patch_200_success_all_params() {
    let mut client = sideko_rest_api::SidekoClient::default()
        .with_api_key_auth("API_KEY")
        .with_cookie_auth("API_KEY")
        .with_environment(sideko_rest_api::Environment::MockServer);
    let res = client
        .api()
        .spec()
        .patch(sideko_rest_api::resources::api::spec::PatchRequest {
            allow_lint_errors: Some(true),
            mock_server_enabled: Some(true),
            notes: Some(
                "<p>This version includes a number of excellent improvements</p>"
                    .to_string(),
            ),
            openapi: Some(sideko_rest_api::UploadFile {
                file_name: "test.pdf".into(),
                content: bytes::Bytes::from_static(b"123"),
            }),
            version: Some("string".to_string()),
            api_name: "my-project".to_string(),
            api_version: sideko_rest_api::models::ApiVersion::VersionTypeEnum(
                sideko_rest_api::models::VersionTypeEnum::Latest,
            ),
        })
        .await;
    println!("{res:?}");
    assert!(res.is_ok());
}
#[serial_test::serial]
#[tokio::test]
async fn test_create_201_success_all_params() {
    let mut client = sideko_rest_api::SidekoClient::default()
        .with_api_key_auth("API_KEY")
        .with_cookie_auth("API_KEY")
        .with_environment(sideko_rest_api::Environment::MockServer);
    let res = client
        .api()
        .spec()
        .create(sideko_rest_api::resources::api::spec::CreateRequest {
            allow_lint_errors: Some(true),
            mock_server_enabled: Some(true),
            notes: Some(
                "<p>This version includes a number of excellent improvements</p>"
                    .to_string(),
            ),
            openapi: sideko_rest_api::UploadFile {
                file_name: "test.pdf".into(),
                content: bytes::Bytes::from_static(b"123"),
            },
            version: Some(
                sideko_rest_api::models::VersionOrBump::VersionBumpEnum(
                    sideko_rest_api::models::VersionBumpEnum::Auto,
                ),
            ),
            api_name: "my-project".to_string(),
        })
        .await;
    println!("{res:?}");
    assert!(res.is_ok());
}