Crates.io | dsh_rest_api_client |
lib.rs | dsh_rest_api_client |
version | 0.3.0-rc.1 |
source | src |
created_at | 2024-07-01 10:39:37.53263 |
updated_at | 2024-11-04 11:21:51.945349 |
description | REST API client for KPN Data Services Hub |
homepage | https://www.kpn.com/dsh |
repository | https://github.com/kpn-dsh/dsh-sdk-platform-rs |
max_upload_size | |
id | 1288641 |
size | 1,385,201 |
An OpenAPI Spec implementation for the DSH REST API.
This crate is part of the DSH_SDK. It provides a Rust client for the DSH REST API. This client is generated from the OpenAPI specification using Progenitor.
The versions of this crate are tied to the versions of the OpenAPI spec and the Progenitor version used to generate the client.
Release candidate version as this version is based on to be released OpenAPI spec 1.9.0, which is still under development.
This crate provides:
This crate does not provide:
These goals are provided by the DSH_SDK crate.
It is recommended to use the Rest Token Fetcher from the dsh_sdk
crate. To do this, add the following to your Cargo.toml file:
[dependencies]
dsh_rest_api_client = "0.2.0"
dsh_sdk = { version = "0.4", features = ["rest-token-fetcher"], default-features = false }
tokio = { version = "1", features = ["full"] }
To use the client in your project:
use dsh_rest_api_client::Client;
use dsh_sdk::{Platform, RestTokenFetcherBuilder};
const CLIENT_SECRET: &str = "";
const TENANT: &str = "tenant-name";
#[tokio::main]
async fn main() {
let platform = Platform::NpLz;
let client = Client::new(platform.endpoint_rest_api());
let tf = RestTokenFetcherBuilder::new(platform)
.tenant_name(TENANT.to_string())
.client_secret(CLIENT_SECRET.to_string())
.build()
.unwrap();
let response = client
.topic_get_by_tenant_topic(TENANT, &tf.get_token().await.unwrap())
.await;
println!("Available topics: {:#?}", response);
}
See CHANGELOG.md for all changes per version.
See LICENSE for more information on the license for this project.
Copyright (c) Koninklijke KPN N.V.