Expand description
§Generic API function calls
These functions are only available when the generic feature is enabled.
Module that contains methods to call the API methods in a generic way. What this means is that the API functions can be called indirect, where the path of the method must be provided as an argument.
This has a number of consequences,
which are caused by the limitations of the rust language with respect to abstraction:
- The number and types of the required parameters for each method
are not known at compile time, which means that (emulated) dynamic typing is used
and parameter errors will occur at run-time instead of compile time.
- Path parameters must be provided as
&str. - Body parameters must be provided as a json formatted
Stringthat can be deserialized at run-time into the expected type.
- Path parameters must be provided as
- The response type for each method is not known at compile time.
- For
GETmethods the responses will be returned as dynamic trait objects that implementerased_serde::Serialize, defined in theerased_serdecrate. These objects can be serialized intojson,yamlortomlwithout any type information. - If
DELETE,HEAD,PATCH,POSTandPUTmethods return data this will be ignored and only errors will be returned.
- For
§Examples
Get the configuration of the application my-application and print it as json.
ⓘ
let application = client.get("application_configuration", &["my-application"]).await?;
println!("{}", serde_json::to_string_pretty(&application)?);Update the secret abcdef to the value ABCDEF.
ⓘ
let secret = serde_json::to_string("ABCDEF")?;
client.put("put_secret_by_tenant_by_id", &["abcdef"], &secret).await?;§API functions
DshApiClient methods that call the DSH resource management API.
Structs§
- Method
Descriptor - Describes one method
Constants§
- DELETE_
METHODS deletemethod descriptors- GET_
METHODS getmethod descriptors- HEAD_
METHODS headmethod descriptors- PATCH_
METHODS patchmethod descriptors- POST_
METHODS postmethod descriptors- PUT_
METHODS putmethod descriptors