From db5ac2e80d1b7c49508c54c763b1bc20810e3fed Mon Sep 17 00:00:00 2001 From: teddy Date: Tue, 30 Jul 2024 20:08:37 +0200 Subject: [PATCH 1/2] fix(brevo) : remove redeclared struc * fix redeclared GetAccountActivityOpts * fix redeclared Configuration * fix undefined optional * fix undefined os --- lib/api_account.go | 8 -------- lib/api_conversations.go | 2 ++ lib/api_domains.go | 2 ++ lib/api_inbound_parsing.go | 4 +++- lib/api_master_account.go | 3 ++- lib/model_configuration.go | 8 ++++---- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/api_account.go b/lib/api_account.go index 044226a..5e923b3 100644 --- a/lib/api_account.go +++ b/lib/api_account.go @@ -12,7 +12,6 @@ package lib import ( "context" - "github.com/antihax/optional" "io/ioutil" "net/http" "net/url" @@ -150,13 +149,6 @@ AccountApiService Get user activity logs @return GetAccountActivity */ -type GetAccountActivityOpts struct { - StartDate optional.String - EndDate optional.String - Limit optional.Int64 - Offset optional.Int64 -} - func (a *AccountApiService) GetAccountActivity(ctx context.Context, localVarOptionals *GetAccountActivityOpts) (GetAccountActivity, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") diff --git a/lib/api_conversations.go b/lib/api_conversations.go index c491fb7..f932f08 100644 --- a/lib/api_conversations.go +++ b/lib/api_conversations.go @@ -17,6 +17,8 @@ import ( "net/http" "net/url" "strings" + + "github.com/antihax/optional" ) // Linger please diff --git a/lib/api_domains.go b/lib/api_domains.go index 00e49d1..cfc38fa 100644 --- a/lib/api_domains.go +++ b/lib/api_domains.go @@ -17,6 +17,8 @@ import ( "net/http" "net/url" "strings" + + "github.com/antihax/optional" ) // Linger please diff --git a/lib/api_inbound_parsing.go b/lib/api_inbound_parsing.go index 9560e6f..b06565b 100644 --- a/lib/api_inbound_parsing.go +++ b/lib/api_inbound_parsing.go @@ -13,11 +13,13 @@ package lib import ( "context" "fmt" - "github.com/antihax/optional" "io/ioutil" "net/http" "net/url" + "os" "strings" + + "github.com/antihax/optional" ) // Linger please diff --git a/lib/api_master_account.go b/lib/api_master_account.go index ec6d874..ae30238 100644 --- a/lib/api_master_account.go +++ b/lib/api_master_account.go @@ -13,11 +13,12 @@ package lib import ( "context" "fmt" - "github.com/antihax/optional" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/antihax/optional" ) // Linger please diff --git a/lib/model_configuration.go b/lib/model_configuration.go index 8732fce..d5680c5 100644 --- a/lib/model_configuration.go +++ b/lib/model_configuration.go @@ -11,7 +11,7 @@ package lib // Optional. Redirect contact to a custom success page once payment is successful. If empty the default Brevo page will be displayed once a payment is validated -type Configuration struct { - // Absolute URL of the custom success page. - CustomSuccessUrl string `json:"customSuccessUrl"` -} +// type Configuration struct { +// // Absolute URL of the custom success page. +// CustomSuccessUrl string `json:"customSuccessUrl"` +// } From 1d9e00cf66bca6bd7434a4e244629e4ba9de0c9a Mon Sep 17 00:00:00 2001 From: teddy Date: Tue, 30 Jul 2024 20:26:09 +0200 Subject: [PATCH 2/2] fix(configuration) : remove model_configuration.go * move CustomSuccessUrl from model_configuration.go to configuration.go --- lib/configuration.go | 13 +++++++------ lib/model_configuration.go | 17 ----------------- 2 files changed, 7 insertions(+), 23 deletions(-) delete mode 100644 lib/model_configuration.go diff --git a/lib/configuration.go b/lib/configuration.go index 9fa1b0d..22f4163 100644 --- a/lib/configuration.go +++ b/lib/configuration.go @@ -51,12 +51,13 @@ type APIKey struct { } type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - HTTPClient *http.Client + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + CustomSuccessUrl string `json:"customSuccessUrl"` + HTTPClient *http.Client } func NewConfiguration() *Configuration { diff --git a/lib/model_configuration.go b/lib/model_configuration.go deleted file mode 100644 index d5680c5..0000000 --- a/lib/model_configuration.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Brevo API - * - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * API version: 3.0.0 - * Contact: contact@brevo.com - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package lib - -// Optional. Redirect contact to a custom success page once payment is successful. If empty the default Brevo page will be displayed once a payment is validated -// type Configuration struct { -// // Absolute URL of the custom success page. -// CustomSuccessUrl string `json:"customSuccessUrl"` -// }