Comments (6)
Yeah, that decision was consistent across the APIs. The Pythonic-ness of the APIs is up to my discretion though, so I'm happy to review and accept PRs updating the README or adding support for True/False/None
from createsend-python.
(On Campaign Monitor's side - is this a simple boolean, or can it also be unset (3 states)? In which case, is 'None' a good default, assuming the API accepts that?)
edit: tried this, I get ClientError: Consent to track value must be one of ('yes', 'no', 'unchanged').
My assertion here is the default (i.e. not set) should be 'unchanged' - please confirm if OK, will put a PR in. Could we also make it so a nullable bool is accepted here (i.e. True, False, None) as well as the current strings?
from createsend-python.
Yeah, it was a tough call to introduce a breaking change in the API. Since the changes were made for the purpose of GDPR we were (and are) very wary of assuming consent at any point in the process.
The breaking change was described in the release notes: https://github.com/campaignmonitor/createsend-python/blob/master/HISTORY.md but yes, I agree that it would be useful to have this clearly called out in the README as well.
The API will only accept the values "yes", "no" and "unchanged" so that's what the Python wrapper accept.s I'd be happy to change the Python wrapper to also accept True/False/None and convert to the equivalent string value before making the request. With providing a default value, though, I'll need to double check with the relevant people since that was consciously decided against in the original decision.
from createsend-python.
I figured it was intentional, given this is an official library and consent should be explicit. We've solved this issue in our code base (we discovered it in advance of merging in a GDPR PR, which uses this parameter, so the fix was just to merge that PR in), but I created this issue as I'm sure it'll bite others who aren't expecting a breaking change by just upgrading their libraries.
More than happy to whip up a PR based on what you're comfortable doing.
from createsend-python.
Looks like it being explicit / breaking the API was the decision in other language libraries:
campaignmonitor/createsend-ruby@180b658
campaignmonitor/createsend-php@e343054
from createsend-python.
As per #63 I'm going to close this. Given this is a breaking change across all libraries, it's not a problem that is particularly unique to this implementation nor deserves to be at the top of the README.md.
from createsend-python.
Related Issues (20)
- access response headers for transactional API calls
- Support unicode in json_to_py
- module on pypi is missing six dependence HOT 3
- Failed to install 4.2.2 from pypi HOT 14
- Code in master can't doesn't allow installation using pip HOT 4
- Test requirements installed HOT 2
- WHATEVER CAMPAIGN MONITOR TEAM THAT OWNS THIS BURNING PILE OF RUBISH PLEASE GET YOUR ACT TOGETHER HOT 2
- Clean up `simplejson` imports
- Values of PageNumber and NumberOfPages seems inconsistent.
- Question: timing expectations
- API auth not working, contradicting documentation. HOT 2
- No module named 'createsend' HOT 1
- Python wrapper not working with API connection HOT 2
- None handling
- Stop hiding HTTP status codes HOT 1
- How do I get data using createsend? HOT 2
- Is it possible to override the From field in a smart email? HOT 4
- client.campaigns() TypeError: 'type' object is not iterable HOT 4
- Python 3.12 error (AttributeError: module 'ssl' has no attribute 'wrap_socket') HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from createsend-python.