Skip to content

Commit 0fbf981

Browse files
authored
Merge pull request #130 from ShekharPaatni/ttndev_FE-1988
#FE-1988
2 parents 1291273 + ec3c6d6 commit 0fbf981

File tree

108 files changed

+8957
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+8957
-0
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Hydrogen Proton API
2+
3+
Hydrogen Proton API
4+
- API version: 1.9.2
5+
- Build date: 10-11-2021
6+
7+
For more information, please visit [https://www.hydrogenplatform.com/apis](https://www.hydrogenplatform.com/apis)
8+
9+
10+
## Documentation
11+
12+
https://www.hydrogenplatform.com/docs/proton/v1
13+
## Installation
14+
Put the package under your project folder and add the following in import:
15+
```golang
16+
import sw "proton_api"
17+
```
18+
19+
## Documentation For Authorization
20+
21+
## oauth2
22+
- **Type**: OAuth
23+
- **Flow**: application
24+
- **Authorization URL**:
25+
- **Scopes**: N/A
26+
27+
```golang
28+
import "./proton_api"
29+
```
30+
31+
Example
32+
```golang
33+
package main
34+
35+
import (
36+
"bytes"
37+
"encoding/json"
38+
"fmt"
39+
"golang.org/x/net/context"
40+
sw1 "proton_api"
41+
)
42+
43+
const (
44+
empty = ""
45+
tab = "\t"
46+
)
47+
48+
func PrettyJson(data interface{}) (string, error) {
49+
buffer := new(bytes.Buffer)
50+
encoder := json.NewEncoder(buffer)
51+
encoder.SetIndent(empty, tab)
52+
53+
err := encoder.Encode(data)
54+
if err != nil {
55+
return empty, err
56+
}
57+
return buffer.String(), nil
58+
}
59+
func main() {
60+
// Hello world, the web server
61+
var authConfigService = sw1.AuthConfigurationService{};
62+
auth := context.WithValue(context.Background(), sw1.ContextAccessToken, nil)
63+
r1, _, _ := authConfigService.CreateClientCredential(auth, "TestUser", "eIDan^(U3vJ#BAJ2whoRBtC8CoLow)Mj",
64+
sw1.SANDBOX)
65+
tokenSettingAuth := context.WithValue(context.Background(), sw1.ContextAccessToken, r1.AccessToken)
66+
tokenSettingAuth = context.WithValue(tokenSettingAuth, "BasePath", sw1.SANDBOX)
67+
var ratioTargets1 = sw1.RatioTargets1{}
68+
ratioTargets1.ProfitMargin = 0.1
69+
ratioTargets1.ReturnOnAssets = 0.05
70+
ratioTargets1.ReturnOnEquity = 0.15
71+
ratioTargets1.DebtToEquity = 1.5
72+
ratioTargets1.AssetTurnover = 1.0
73+
var businessFinancialManagementService = sw1.BusinessFinancialManagementApiService{}
74+
var businessFinancialHealthCheckRequest = sw1.BusinessFinancialHealthCheckRequest{
75+
RatioTargets: ratioTargets1,
76+
}
77+
businessFinancialHealthCheckRequest.NetIncome = 10000
78+
businessFinancialHealthCheckRequest.TotalRevenue = 50000
79+
businessFinancialHealthCheckRequest.TotalAssets = 122141
80+
businessFinancialHealthCheckRequest.TotalLiabilities = 132542
81+
businessFinancialHealthCheckRequest.TotalEquity = 555
82+
r11, _, _ := businessFinancialManagementService.BusinessFinancialHealthCheck(
83+
tokenSettingAuth, businessFinancialHealthCheckRequest)
84+
b11, _ := PrettyJson(r11)
85+
fmt.Printf("%s",b11)
86+
}
87+
```
88+
89+
## Author
90+
91+
92+

0 commit comments

Comments
 (0)