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 upload_feed_document method #172

Merged

Conversation

harmonymjb
Copy link
Contributor

This method has previously been mentioned in the README, but was not defined. This PR defines the method, with an additional parameter to take the user requested content-type, which must match due to the signed headers.

Additionally, I noticed that API methods claim in their YARD docs to return a Hash but actually return an HTTP::Response which must be called with .parse to access a Hash version of the response.
I indicated this in line the functionality in the new YARD docs I wrote, but it may be useful to update existing occurrences elsewhere in the gem.

hakanensari added a commit that referenced this pull request Oct 28, 2024
Also, renamed `ResponseDecorator` to `Response` to make the interface
more intuitive and keep the decorator pattern an internal detail.
@hakanensari
Copy link
Member

Hi, thanks for the input! You’re right—#upload_feed_document isn’t part of the original Amazon API, so including it in the README was a mistake.

I appreciate you retroactively adding it to the code; it’s logical to have it as a helper. But since I autogenerate the API files based on Amazon’s Open API files, these kinds of changes would be overwritten each time we regenerate.

Maybe it's best to place this in a separate helper within the Feeds API file, allowing the generator to include that. I'll take a look at this when I have a moment, but feel free to jump in if you have time.

P.S. I've fixed the response error in the documentation.

@harmonymjb harmonymjb force-pushed the harmony/upload_feed_document_method branch from df23b14 to b5bb00c Compare October 29, 2024 17:57
This method has previously been mentioned in the README, but was not
defined. This commit defines the method, with a slight change to take
the user requested content-type, which must match due to the signed
headers.
@harmonymjb harmonymjb force-pushed the harmony/upload_feed_document_method branch from b5bb00c to 0bf58cb Compare October 30, 2024 00:59
@harmonymjb
Copy link
Contributor Author

I appreciate you retroactively adding it to the code; it’s logical to have it as a helper. But since I autogenerate the API files based on Amazon’s Open API files, these kinds of changes would be overwritten each time we regenerate.

Thanks for explaining.
I've taken a stab a change to allow helpers and updated this branch.

@hakanensari
Copy link
Member

This will require a tweak in the generator, but I'll go ahead and merge, thanks 🎃

@hakanensari hakanensari merged commit daf74be into lineofflight:main Oct 31, 2024
5 checks passed
@hakanensari
Copy link
Member

My bad, no tweak required, thanks again!

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.

2 participants