Skip to content

Commit

Permalink
fix(doc): update README.md to reflect latest version of sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Leaseweb CI committed Nov 27, 2024
1 parent fbfbc05 commit 51422f2
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
Leaseweb Go SDK provides a golang client for Leaseweb's REST API.

### Installation

```bash
go get github.com/LeaseWeb/leaseweb-go-sdk/publiccloud # for publicCloud

go get github.com/LeaseWeb/leaseweb-go-sdk/dedicatedserver # for dedicatedServer
go get github.com/LeaseWeb/leaseweb-go-sdk/v2
```

### Generate your API Key
You can generate your API key at the [Customer Portal](https://secure.leaseweb.com/)
You can generate your API key at the [Customer Portal](https://secure.leaseweb.com/).

### Example
```golang
Expand All @@ -21,11 +18,10 @@ import (
"fmt"
"os"

openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud"
openapiclient "github.com/leaseweb/leaseweb-go-sdk/v2/publiccloud"
)

func main() {

ctx := context.WithValue(
context.Background(),
openapiclient.ContextAPIKeys,
Expand All @@ -38,22 +34,31 @@ func main() {
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.PubliccloudAPI.GetInstanceList(ctx).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetInstanceList``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
_, err := fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetInstanceList``: %v\n", err)
if err != nil {
return
}
_, err = fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
if err != nil {
return
}
}
// response from `GetInstanceList`: GetInstanceListResult
fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetInstanceList`: %v\n", resp)
_, err = fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetInstanceList`: %v\n", resp)
if err != nil {
return
}
}
```

### Documentation
The Leaseweb Go SDK documentation based on product:

- [Public Cloud](publiccloud/README.md)
- [Dedicated Server](dedicatedserver/README.md)
- [Aggregation Pack](aggregationPack/README.md)
- [Abuse](abuse/README.md)
- [Invoice](invoice/README.md)
- [Public Cloud](publiccloud/docs/PubliccloudAPI.md)
- [Dedicated Server](dedicatedserver/docs/DedicatedserverAPI.md)
- [Aggregation Pack](aggregationpack/docs/AggregationpackAPI.md)
- [Abuse](abuse/docs/AbuseAPI.md)
- [Invoice](invoice/docs/InvoiceAPI.md)

### Issues
If you encounter an issue with the project, you are welcome to submit an [issue](https://github.com/Leaseweb/leaseweb-go-sdk/issues).
Expand Down

0 comments on commit 51422f2

Please sign in to comment.