Overview

A Rusty Tencent Api Client with v3 authorization. Only machine translation api is supported now, other apis are not supported at present

Example

```rust fn buildclient() -> TencentClient> { let client = TencentClient::native(client::Credential { key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".tostring(), id: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".to_string(), }); client }

fn main() { let client = buildclient(); let call = client .translate() .texttranslate() .source("it") // Italy .target("zh") .projectid(PROJECTID) .region("REGION") .sourcetext("Credere è destino") .build() .unwrap(); // {"Response":{"RequestId":"38b2df48-48e6-4aa5-ace4-xxxxxxxxx","Source":"it","Target":"zh","TargetText":"相信就是命运"}} let result = call .doit(|body| { let string = String::fromutf8(body).unwrap(); let value = serdejson::fromstr::(&string).unwrap(); let text = value .get("Response") .andthen(|res| res.get("TargetText")) .andthen(|e| e.asstr()) .unwrap(); asserteq!(text, "相信就是命运"); }) .await; } ```

The API is structured into the following primary items:

Client

Resources

Parts

Activities