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

Checking the status of file import does not work #272

Open
aki-dai opened this issue Feb 9, 2024 · 0 comments
Open

Checking the status of file import does not work #272

aki-dai opened this issue Feb 9, 2024 · 0 comments

Comments

@aki-dai
Copy link

aki-dai commented Feb 9, 2024

I uploaded a file for an email attachment and called check_import method to get its file ID.
However, although it seems that I am able to get a response, an error occurs during subsequent deserialization.

client = Hubspot::Client.new(access_token: access_token)
response = client.files.files.files_api.import_from_url(import_from_url_input: {
  url: url,
  folderPath: '/email-attachments',
  access: 'PRIVATE'
})
task_id = response.id

# NoMethodError: undefined method `build_from_hash' for File:Class
# from .rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/hubspot-api-client-17.0.0/lib/hubspot/codegen/files/files/models/file_action_response.rb:309:in `_deserialize'
status = client.files.files.files_api.check_import(task_id: task_id)

When I debugged the gem code, I found that it worked fine by modifying the following code in Hubspot::Files::Files::FileActionResponse.openapi_types.

- :'result' => :'File'
+ :'result' => :'Object'
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

No branches or pull requests

1 participant