Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update version #485

Merged
merged 18 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ sendgrid.env
.vscode
prism*
**/.idea/**/*
**/.openapi-generator*
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.

[2024-10-04] Version 4.0.0-rc.1
---------------------------
Release Candidate Preparation

[2024-08-26] Version 3.16.0
---------------------------
**Library - Chore**
Expand Down
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,49 @@ source ./sendgrid.env

The following is the minimum needed code to send an email with the [/mail/send Helper](helpers/mail) ([here](examples/helpers/mail/example.go#L32) is a full example):

### Using Autogenerated Code
```go
package main

import (
"encoding/json"
"fmt"
"github.com/sendgrid/sendgrid-go"
MailV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/mail"
"net/http"
"os"
)

func main() {
client := sendgrid.NewRestClientWithParams(sendgrid.ClientParams{
ApiKey: os.Getenv("SENDGRID_API_KEY"),
})
name := "John Doe"
subject := "Sending with Twilio SendGrid is Fun"
mailTo := &MailV3.MailTo{Email: "[email protected]"}
to := []MailV3.MailTo{*mailTo}
sendMailRequest := MailV3.SendMailRequest{
From: MailV3.MailFrom{Name: &name, Email: VERIFIED_EMAIL},
ReplyTo: mailTo,
Subject: &subject,
Personalizations: []MailV3.SendMailRequestPersonalizationsInner{{To: to}},
Content: &[]MailV3.SendMailRequestContentInner{{Type: "text/plain", Value: "Abc"}},
}
sendMailParam := &MailV3.SendMailParam{SendMailRequest: &sendMailRequest}
resp, err := client.MailV3.SendMail(sendMailParam)
if err != nil {
fmt.Println("Error sending mail: " + err.Error())
} else {
response, _ := json.Marshal(resp)
var ps http.Response
json.Unmarshal(response, &ps)
fmt.Println(ps.StatusCode)
fmt.Println(ps.Body)
fmt.Println(ps.Header)
}
}
```

### With Mail Helper Class

```go
Expand Down
11 changes: 11 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Upgrade Guide

_`MAJOR` version bumps will have upgrade notes posted here._

[2024-10-04] 3.x.x to 4.x.x-rc.x
--------------------------------
### Overview

#### Sendgrid Go Helper Library's version 4.0.0-rc.x is now available.

Behind the scenes Go Helper is now auto-generated via OpenAPI with this release. This enables us to rapidly add new features and enhance consistency across versions and languages.
2 changes: 1 addition & 1 deletion base_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

// Version is this client library's current version
const (
Version = "3.16.0"
Version = "4.0.0-rc.1"
rateLimitRetry = 5
rateLimitSleep = 1100
)
Expand Down
58 changes: 0 additions & 58 deletions rest/api/v3/account_provisioning/.openapi-generator

This file was deleted.

23 changes: 0 additions & 23 deletions rest/api/v3/account_provisioning/.openapi-generator-ignore

This file was deleted.

2 changes: 1 addition & 1 deletion rest/api/v3/account_provisioning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat

- API version: 1.0.0
- Package version:
- Build date: 2024-10-04T13:25:43.514185+05:30[Asia/Kolkata]
- Build date: 2024-10-04T18:29:01.491818+05:30[Asia/Kolkata]
- Build package: com.sendgrid.oai.go.SendgridGoGenerator
For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us)

Expand Down
3 changes: 2 additions & 1 deletion rest/api/v3/account_provisioning/api_authenticate_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package openapi

import (
"net/http"
"net/url"

"strings"
Expand Down Expand Up @@ -47,5 +48,5 @@ func (c *ApiService) AuthenticateAccount(params *AuthenticateAccountParam) (inte
}

defer resp.Body.Close()
return nil, nil
return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil
}
3 changes: 2 additions & 1 deletion rest/api/v3/account_provisioning/api_create_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package openapi

import (
"encoding/json"
"net/http"
"net/url"
)

Expand Down Expand Up @@ -69,5 +70,5 @@ func (c *ApiService) CreateAccount(params *CreateAccountParam) (interface{}, err

return ps, err
}
return nil, nil
return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil
}
3 changes: 2 additions & 1 deletion rest/api/v3/account_provisioning/api_delete_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package openapi

import (
"net/http"
"net/url"

"strings"
Expand Down Expand Up @@ -47,5 +48,5 @@ func (c *ApiService) DeleteAccount(params *DeleteAccountParam) (interface{}, err
}

defer resp.Body.Close()
return nil, nil
return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil
}
3 changes: 2 additions & 1 deletion rest/api/v3/account_provisioning/api_get_account_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package openapi

import (
"encoding/json"
"net/http"
"net/url"

"strings"
Expand Down Expand Up @@ -56,5 +57,5 @@ func (c *ApiService) GetAccountState(params *GetAccountStateParam) (interface{},

return ps, err
}
return nil, nil
return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil
}
3 changes: 2 additions & 1 deletion rest/api/v3/account_provisioning/api_list_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package openapi
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)

Expand Down Expand Up @@ -65,5 +66,5 @@ func (c *ApiService) ListAccount(params *ListAccountParam) (interface{}, error)

return ps, err
}
return nil, nil
return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package openapi

import (
"encoding/json"
"net/http"
"net/url"

"strings"
Expand Down Expand Up @@ -56,5 +57,5 @@ func (c *ApiService) ListAccountOffering(params *ListAccountOfferingParam) (inte

return ps, err
}
return nil, nil
return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil
}
3 changes: 2 additions & 1 deletion rest/api/v3/account_provisioning/api_list_offering.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package openapi

import (
"encoding/json"
"net/http"
"net/url"
)

Expand Down Expand Up @@ -44,5 +45,5 @@ func (c *ApiService) ListOffering() (interface{}, error) {

return ps, err
}
return nil, nil
return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package openapi

import (
"encoding/json"
"net/http"
"net/url"

"strings"
Expand Down Expand Up @@ -71,5 +72,5 @@ func (c *ApiService) UpdateAccountOffering(params *UpdateAccountOfferingParam) (

return ps, err
}
return nil, nil
return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil
}
3 changes: 2 additions & 1 deletion rest/api/v3/account_provisioning/api_update_account_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package openapi

import (
"encoding/json"
"net/http"
"net/url"

"strings"
Expand Down Expand Up @@ -63,5 +64,5 @@ func (c *ApiService) UpdateAccountState(params *UpdateAccountStateParam) (interf
}

defer resp.Body.Close()
return nil, nil
return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil
}
38 changes: 0 additions & 38 deletions rest/api/v3/alerts/.openapi-generator

This file was deleted.

23 changes: 0 additions & 23 deletions rest/api/v3/alerts/.openapi-generator-ignore

This file was deleted.

2 changes: 1 addition & 1 deletion rest/api/v3/alerts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat

- API version: 1.0.0
- Package version:
- Build date: 2024-10-04T13:25:43.514404+05:30[Asia/Kolkata]
- Build date: 2024-10-04T18:29:01.491895+05:30[Asia/Kolkata]
- Build package: com.sendgrid.oai.go.SendgridGoGenerator
For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us)

Expand Down
Loading
Loading