Skip to content

Commit aae3a06

Browse files
jain-raunakRaunak Jain
and
Raunak Jain
authored
Feature ap 1328 (#20)
* go module * corrections * corrections Co-authored-by: Raunak Jain <[email protected]>
1 parent 5a38210 commit aae3a06

File tree

3 files changed

+381
-15
lines changed

3 files changed

+381
-15
lines changed

README.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,17 @@ This is the wrapper for the API. It implements all the features of the API v3.
77
SendinBlue's API matches the [OpenAPI v2 definition](https://www.openapis.org/). The specification can be downloaded [here](https://api.sendinblue.com/v3/swagger_definition.yml).
88

99
This Golang package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project and is reviewed and maintained by SendinBlue:
10-
- API version: 3.0.0
11-
- Package version: 2.0.0
10+
- API version: 3.x.x
11+
- Package version: 2.0.1
1212
- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen
1313
For more information, please visit [https://account.sendinblue.com/support](https://account.sendinblue.com/support)
1414

1515
## Installation & Usage
16-
If the Golang package is hosted on Github, you can install directly from Github
16+
Install the package to your GoLang project.
1717
```golang
18-
go get github.com/GIT_USER_ID/GIT_REPO_ID.git
18+
go get github.com/sendinblue/APIv3-go-library
1919
```
2020

21-
Put the package under your project folder and add the following in import:
22-
```golang
23-
import "./lib"
24-
```
2521
## Getting Started
2622

2723
Please follow the [installation procedure](#installation--usage) and then run the following:
@@ -31,20 +27,18 @@ package main
3127
import (
3228
"fmt"
3329
"context"
34-
sib_api_v3_sdk "./lib"
30+
sendinblue "github.com/sendinblue/APIv3-go-library/lib"
3531
)
3632

3733
func main() {
3834
var ctx context.Context
39-
var cli = sib_api_v3_sdk.APIClient{
40-
cfg: sib_api_v3_sdk.NewConfiguration(),
41-
}
35+
cfg := sendinblue.NewConfiguration()
4236
//Configure API key authorization: api-key
43-
cli.cfg.AddDefaultHeader("api-key", "YOUR_API_KEY")
37+
cfg.AddDefaultHeader("api-key", "YOUR_API_KEY")
4438
//Configure API key authorization: partner-key
45-
cli.cfg.AddDefaultHeader("partner-key","YOUR_API_KEY")
39+
cfg.AddDefaultHeader("partner-key","YOUR_API_KEY")
4640

47-
sib := sib_api_v3_sdk.NewAPIClient(cli.cfg)
41+
sib := sendinblue.NewAPIClient(cfg)
4842
result, resp, err := sib.AccountApi.GetAccount(ctx)
4943
if err != nil {
5044
fmt.Println("Error when calling AccountApi->get_account: ",err.Error())

go.mod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module github.com/sendinblue/APIv3-go-library
2+
3+
go 1.16
4+
5+
require (
6+
github.com/antihax/optional v1.0.0
7+
golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558
8+
)

0 commit comments

Comments
 (0)