Trouble using the command line "AttributeError: 'int' object has no attribute 'value'"
myperfectcolor opened this issue · 16 comments
I am trying to use hubspot3 with this command:
hubspot3 --config config.json crm_associations create --from_object 7307801 --to_object 1181162112 --definition 4
and receive the following error.
AttributeError: 'int' object has no attribute 'value'
I cannot figure it out. Any ideas?
My apologies if this question is super basic and obvious. I'm new to this and after 12 hours I think I need some help.
I have a little more info. I believe the problem is I'm passing a single value for the definition, yet the code is looking for definition.value. I don't know what this means and how to change the code.
This is what I have:
import json
from hubspot3.crm_associations import CRMAssociationsClient
API_KEY = "#############################"
associate_client = CRMAssociationsClient(api_key=API_KEY)
params = {
"from_object": 7307801,
"to_object": 1181162112,
"category": "HUBSPOT_DEFINED",
"definitionId": 4
}
associate_data = associate_client.create(params.get(
"from_object"), params.get("to_object"), params.get("definitionId"))
print(json.dumps(associate_data))
ERROR:
"definitionId": definition.value,
AttributeError: 'int' object has no attribute 'value'
Ah yeah, in the CRMAssociationsClient, it's expecting an enum value for definition (hence the .value
). I can see if I can fix that up to accept enum or int!
Okay I've pushed a fix, it should be available as version 3.2.41
on pip now.
Could you try:
pip install hubspot3==3.2.41
and then attempt to run the CLI command from your first message?
Awesome! Glad it's working now 😄
Apologies for the lack of response here - I'm currently on vacation, but I could help out after Christmas if you still need it!