Code Monkey home page Code Monkey logo

Comments (6)

katharosada avatar katharosada commented on July 20, 2024 1

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.

xfxf avatar xfxf commented on July 20, 2024

(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.

katharosada avatar katharosada commented on July 20, 2024

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.

xfxf avatar xfxf commented on July 20, 2024

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.

xfxf avatar xfxf commented on July 20, 2024

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.

xfxf avatar xfxf commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.