https://github.com/codespilot/qcloudsharp
https://github.com/codespilot/qcloudsharp
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/codespilot/qcloudsharp
- Owner: Codespilot
- License: mit
- Created: 2017-09-26T02:35:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-26T02:35:26.000Z (over 8 years ago)
- Last Synced: 2023-07-14T14:56:33.412Z (almost 3 years ago)
- Language: C#
- Size: 40 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
QcloudSharp: Unoffical Qcloud.com API wrapper for .Net
===
[](https://ci.appveyor.com/project/7IN0SAN9/qcloudsharp)
[](https://raw.githubusercontent.com/JoyMoe/QcloudSmsSharp/master/LICENSE)
[](https://www.nuget.org/packages/QcloudSharp)




[中文说明](README.zh.md)
### Installation
To install QcloudSharp, run the following command in the Package Manager Console
```powershell
PM> Install-Package QcloudSharp
```
### Example
```csharp
using QcloudSharp;
using Newtonsoft.Json;
dynamic client = new QcloudClient
{
SecretId = "Your_Secret_Id",
SecretKey = "Your_Secret_Key",
Endpoint = Constants.Endpoint.Trade, // Endpoint can be used as the first argument of Dynamic Methods
Region = Constants.Region.CAN, // Region can be used as the first or second argument of Dynamic Methods
};
var resultString = client.DescribeUserInfo();
// e.g. {"code":0,"message": "","userInfo":{"name":"compName","isOwner":1,"mailStatus":1,"mail":"112233@qq.com","phone":"13811112222"}}
dynamic result = JsonConvert.DeserializeObject(resultString);
try
{
Console.WriteLine(result.Code);
Console.WriteLine(result.userInfo.name);
Console.WriteLine(result.notExist);
}
catch(Exception ex)
{
Console.WriteLine(ex.message);
}
```
Or you can have a look at [sample](sample).
### Constants
All Constants are provided by class `QcloudSharp.Constants`.
```csharp
public static class Endpoint // Abbreviation for endpoint domain
```
Members
* Account
* Bill
* Bm
* Cbs
* Cdb
* Cdn
* Cmem
* CmqQueue
* CmqTopic
* Cns
* Csec
* Cvm
* Dayu
* Dfw
* Eip
* Image
* Iot
* Kms
* Lb
* Live
* Market
* Mongodb
* Monitor
* Partners
* Redis
* Scaling
* Snapshot
* Sqlserver
* Tdsql
* Tmt
* Trade
* Vod
* Vod2
* Vpc
* Wenzhi
* Wss
* Yunsou
```csharp
public static class Region // IATA code for Region city
```
Members
* BJS `bj`
* CAN `gz`
* HKG `hk`
* SHA `sh`
* SIN `sg`
* SJC `usw`
* YTO `ca`
* CAN1 `gzopen`
* SHA2 `shjr`
* SZX2 `szjr`
### Classes
#### QcloudClient
```csharp
public class QcloudClient : DynamicObject
```
Constructors
* `QcloudClient()`
* `QcloudClient(SecretId, SecretKey)`
Properties
* string `SecretId`
* string `SecretKey`
* string `Region`
* string `Endpoint`
Methods
* `void AddParameter(KeyValuePair)`
* `void AddParameter(IEnumerable>)`
* `void ClearParameter()`
* `Submit(string, string, string)`
* `Submit(string, string)`
* `Submit(string)`
Dynamic Methods
* `{Action}([string][, string][, IEnumerable>])`
* `{Action}([string][, string][, KeyValuePair ...])`
#### ApiResult
```csharp
public class ApiResult : DynamicObject
```
Constructors
* `ApiResult()`
Properties
* int `Code`
* string `Message`
Dynamic Properties
* object Any { Get; Set; }
## Donate us
[Donate us](https://7in0.me/#donate)
## License
The MIT License
More info see [LICENSE](LICENSE)