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

Added getParcelDocument for the /parcels/{id}/documents/{type} endpoint #32

Merged
merged 3 commits into from
Feb 13, 2024

Conversation

linaori
Copy link
Contributor

@linaori linaori commented Jan 19, 2024

I've added some basic validation of the request parameters based on the Sendcloud API documentation and added a few tests to verify these scenarios. I wasn't sure about codestyle and function imports so based my changes off existing code.

Closes #31

@villermen villermen self-requested a review February 6, 2024 13:26
Copy link
Member

@villermen villermen left a comment

Choose a reason for hiding this comment

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

Looks like a solid addition. Thanks for this!

I left some minor comments. Let me know once you're done wrapping up and I'll merge it and push a new version.

src/Model/Parcel.php Outdated Show resolved Hide resolved
Comment on lines +461 to +463
* Fetches a single parcel document based on requested document type, content type, and dpi.
*
* If the parcel hasn't had its labels created through {@see self::createLabel()} it will result in an exception.
Copy link
Member

Choose a reason for hiding this comment

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

Explains it very well!

src/Client.php Outdated Show resolved Hide resolved
Comment on lines +491 to +492
RequestOptions::QUERY => ['dpi' => $dpi],
RequestOptions::HEADERS => ['Accept' => $contentType],
Copy link
Member

Choose a reason for hiding this comment

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

Wasn't aware of these constants. I'll make a mental note to use these for the other calls too when this is merged!

linaori and others added 2 commits February 12, 2024 12:03
Co-authored-by: Sjoerd Nuijten <villermen@gmail.com>
@villermen villermen merged commit 50a0436 into Webador:master Feb 13, 2024
1 check passed
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.

Parcel documents endpoint
2 participants