forked from sendinblue/APIv3-go-library
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for updating EmailBlacklisted field
This is a dirty workaround for the problem with Golang empty values and marshaling to JSON. The problem was described here: https://willnorris.com/2014/05/go-rest-apis-and-pointers/ In this library all struct's fields should be pointers, not simple types like `bool` or `string` because we can't say whether a value is empty and we should omit it (`omitempty` field tag) or not. This library is auto-generated by swagger codegen, and developers created an issue for this problem: swagger-api/swagger-codegen#7391 In this pull request we dirty fix our problem with only one field we want to update (set value to false)
- Loading branch information
Showing
2 changed files
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/sendinblue/APIv3-go-library | ||
module github.com/ghostery/APIv3-go-library | ||
|
||
go 1.16 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* SendinBlue API | ||
* | ||
* SendinBlue 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/sendinblue **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 | | ||
* SendinBlue 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/sendinblue **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 | | ||
* | ||
* API version: 3.0.0 | ||
* Contact: [email protected] | ||
|
@@ -13,7 +13,7 @@ type UpdateContact struct { | |
// Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, `{ \"EMAIL\":\"[email protected]\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}`. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} | ||
Attributes *interface{} `json:"attributes,omitempty"` | ||
// Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) | ||
EmailBlacklisted bool `json:"emailBlacklisted,omitempty"` | ||
EmailBlacklisted bool `json:"emailBlacklisted"` | ||
// Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) | ||
SmsBlacklisted bool `json:"smsBlacklisted,omitempty"` | ||
// Ids of the lists to add the contact to | ||
|