Skip to content

Add missed filters to supported endpoints #508

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

Merged

Conversation

zliang-akamai
Copy link
Member

@zliang-akamai zliang-akamai commented Feb 7, 2025

📝 Description

This is to add missing filters for supported functions.

Some other functions call _get_and_filter but the corresponding API endpoint doesn't have any filterable fields. filters parameters are not added for them in this PR.

Some property calls the API endpoint with filtering support, but filters can't be added.

✔️ How to Test

import os
from linode_api4 import Invoice, LinodeClient, Payment, ServiceTransfer

client = LinodeClient(token=os.getenv("LINODE_TOKEN"))

# Doesn't work due to an API issue
# print(client.account.invoices(Invoice.billing_source=="linode"))

print(list(client.account.payments(Payment.usd == 10)))

print(list(client.account.service_transfers(ServiceTransfer.is_sender == True)))

@zliang-akamai zliang-akamai marked this pull request as ready for review February 19, 2025 21:53
@zliang-akamai zliang-akamai requested a review from a team as a code owner February 19, 2025 21:53
@zliang-akamai zliang-akamai requested review from jriddle-linode and ezilber-akamai and removed request for a team February 19, 2025 21:53
Copy link
Contributor

@ezilber-akamai ezilber-akamai left a comment

Choose a reason for hiding this comment

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

When running the manual test locally, I'm getting empty lists as the result, which I don't think is correct.

@zliang-akamai
Copy link
Member Author

@ezilber-akamai can you see any result without the filers? Our accounts generally don't have payments..

Copy link
Contributor

@ezilber-akamai ezilber-akamai left a comment

Choose a reason for hiding this comment

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

@zliang-akamai good point! Seems to be working as expected!

Copy link
Collaborator

@jriddle-linode jriddle-linode left a comment

Choose a reason for hiding this comment

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

LGTM nice fix

@zliang-akamai zliang-akamai merged commit a24d297 into linode:dev Mar 3, 2025
12 checks passed
@zliang-akamai zliang-akamai deleted the zhiwei/add-back-missing-filters branch March 3, 2025 22:40
@zliang-akamai zliang-akamai added the new-feature for new features in the changelog. label Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature for new features in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants