Coder Social home page Coder Social logo

Comments (4)

jpetrucciani avatar jpetrucciani commented on July 17, 2024 1

First off I'd like to thank you and your colleagues for the contributions on behalf of everyone using this library! Looking forward to more PR's coming in! 😄

Yep, a few of these clients are particularly gross name-wise at the moment. I'm still thinking about which naming convention I like the best, but I'm open to suggestions as well!

I think at the moment, I prefer the more explicit names (perhaps like update_by_email and update_by_id), and deprecating the regular update method (and also the ones ending in the a_contact because I agree that it's not great that way!). It's also a bit odd here because in a few other clients, you can only lookup by ID, and so we just use the basic get delete and update method names like in the CompaniesClient:

def update(self, company_id: str, data: Dict = None, **options) -> Dict:
"""update the given company with data"""
data = data or {}
return self._call(
"companies/{}".format(company_id), data=data, method="PUT", **options
)
def delete(self, company_id: str, **options) -> Dict:
"""delete a company"""
return self._call("companies/{}".format(company_id), method="DELETE", **options)
def get(self, company_id: str, **options) -> Dict:
"""get a single company by it's ID"""
return self._call("companies/{}".format(company_id), method="GET", **options)

I think that inside ContactsClient they should be renamed from update_a_contact and delete_a_contact to update_by_id and delete_by_id respectively (and deprecating the former) to make a bit more sense, since we're already in the context of Contacts, so having the word contact in the method name seems a bit redundant! And also doing the same to get_contact_by_email and get_contact_by_id -> get_by_email and get_by_id may make more sense in the long run.

from hubspot3.

W1ldPo1nter avatar W1ldPo1nter commented on July 17, 2024 1

Thanks for the quick reply!

We are also preferring concise names without redundancy, so we'll make these changes the way you proposed. A PR will come your way as soon as we got this done (including the new endpoints).

from hubspot3.

W1ldPo1nter avatar W1ldPo1nter commented on July 17, 2024 1

I'm closing this since these questions were specific to the Contacts API and the corresponding changes are already pulled. Thanks for the quick answers and pulls.

from hubspot3.

jpetrucciani avatar jpetrucciani commented on July 17, 2024

Also to the point of deprecation notice, we could just say next major version bump, or just sometime in the future! I do know it may be annoying to have something small like that break, but it'd be a pretty quick fix whenever someone upgrades the library - we'd just want to make sure that we have it documented in the release notes!

from hubspot3.

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.