Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to list company associations #27

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

joidegn
Copy link

@joidegn joidegn commented Dec 18, 2023

What to do

Adds the ability to GET company associations

https://developers.hubspot.com/docs/api/crm/associations

Example curl:

curl "https://api.hubapi.com/crm/v3/objects/company/<company-id>/associations/company" \
       -H 'Authorization: Bearer <token-here>'

{"results":[{"id":"8616142197","type":"parent_to_child_company"},{"id":"8921827721","type":"parent_to_child_company"},{"id":"5593726386","type":"child_to_parent_company"},{"id":"5593726386","type":"company_to_company"},{"id":"8616142197","type":"company_to_company"},{"id":"8921827721","type":"company_to_company"}]}%

This PR is stacked on top of #26

Background

This uses the (I think undocumented) GET /crm/v3/objects/{object-type}/{object-ID}/associations/{to-object-type} endpoint

Acceptance criteria

The user can GET company associations with other objects

kk-no and others added 2 commits December 13, 2023 15:05
…es-for-company-object

Add default properties for company object
@kk-no kk-no self-requested a review December 18, 2023 10:15
@joidegn joidegn closed this Dec 18, 2023
@joidegn joidegn reopened this Dec 18, 2023
@joidegn joidegn force-pushed the add-ability-to-list-company-associations branch from f184d47 to 32633a4 Compare December 18, 2023 13:01
Copy link
Member

@kk-no kk-no left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joidegn
Sorry for my late reply...
I merged Unmarshal bugfix #29 and added comments to this PR.

thank you!

association.go Outdated Show resolved Hide resolved
company.go Outdated Show resolved Hide resolved
company.go Outdated Show resolved Hide resolved
@joidegn joidegn force-pushed the add-ability-to-list-company-associations branch 4 times, most recently from e96a606 to 02fe5fe Compare January 18, 2024 14:29
@joidegn joidegn force-pushed the add-ability-to-list-company-associations branch from 02fe5fe to b66728d Compare January 18, 2024 14:30
@joidegn
Copy link
Author

joidegn commented Jan 18, 2024

Sorry it took so long. I think I have revised the PR as you proposed.

@kk-no kk-no self-requested a review January 19, 2024 01:30
Copy link
Member

@kk-no kk-no left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!
It seems that only company_model.go has the previous modification left, so could you please check it again?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I could unmarshal to HsInt using #29, but is this necessary?

@kk-no
Copy link
Member

kk-no commented Feb 1, 2024

Hi, @joidegn !
We plan to create a new version next week.
I would like to include this PR if possible, but did you check the PR comments?

@andrewrynhard
Copy link

Is this going to make it in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants