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

Missing 'limit' and 'offset' parameters #368

Closed
3 of 5 tasks
Jericho opened this issue Jan 25, 2021 · 3 comments
Closed
3 of 5 tasks

Missing 'limit' and 'offset' parameters #368

Jericho opened this issue Jan 25, 2021 · 3 comments
Assignees
Labels
Breaking Change This change causes backward compatibility issue(s)
Milestone

Comments

@Jericho
Copy link
Owner

Jericho commented Jan 25, 2021

In the process of implementing the changes for #361 and #367, it occurred to me that some methods don't support the 'limit' and 'offset' parameters which are necessary for paging. This seems to have been added to the SendGrid API some time ago but there was no announcement or mention of this in SendGrid's release notes. This explains why some methods in the StrongGrid library, such as ApiKeys.GetAllAsync for example, currently do not support paging.

I will update the following list of methods that are missing the 'limit' and 'offset' parameters:

  • Apikeys.GetAllAsync. SendGrid's documentation talks about the limit parameter but not the offset. That's very odd and I am assuming it's simply an error in the documentation.
  • IpAddresses.GetUnassignedAsync This one is more complicated that it seems at first glance. Simply adding 'limit' and 'offset' does not completely solve the paging issue because we invoke GellAllAsync and filter the result in order to find 'unassigned' addresses. This means that page number 2 of unassigned addresses does not necessarily correspond to page number 2 of all addresses. I need to think about how I will resolve this issue.
  • Teammates.GetAllPendingInvitationsAsync. SendGrid's documentation does not address whether this endpoint supports 'limit' and 'offset' but I performed some testing and I did not observe any error when specifying these two parameters. Therefore I will assume this endpoint does indeed support 'limit' and 'offset'.
  • AccessManagement.GetAccessHistoryAsync . This is another case where SendGrid's documentation talks about the limit parameter but not the offset. Again, I'm assuming it's simply an error in the documentation. UPDATE January 2022: SendGrid throws "unknown field" exception when adding "offset" to the request
  • EmailActivities.SearchAsync. Another case where SendGrid's documentation talks about the limit parameter but not the offset. UPDATE January 2022: I am not able to test this change because my account is not signed up for the Email Activities API. Therefore I am not going to make any change to this functionality.
@Jericho Jericho added the Breaking Change This change causes backward compatibility issue(s) label Jan 25, 2021
@Jericho Jericho self-assigned this Jan 25, 2021
@Jericho Jericho mentioned this issue Jan 25, 2021
11 tasks
@Jericho Jericho added this to the Paging milestone Jan 28, 2021
Jericho added a commit that referenced this issue Jan 28, 2021
Jericho added a commit that referenced this issue Jan 28, 2021
Jericho added a commit that referenced this issue Apr 15, 2021
Jericho added a commit that referenced this issue Apr 15, 2021
Jericho added a commit that referenced this issue May 12, 2021
Jericho added a commit that referenced this issue May 12, 2021
Jericho added a commit that referenced this issue Aug 11, 2021
Jericho added a commit that referenced this issue Aug 11, 2021
Jericho added a commit that referenced this issue Aug 11, 2021
Jericho added a commit that referenced this issue Aug 11, 2021
Jericho added a commit that referenced this issue Nov 13, 2021
Jericho added a commit that referenced this issue Nov 13, 2021
Jericho added a commit that referenced this issue Jan 7, 2022
Jericho added a commit that referenced this issue Jan 7, 2022
Jericho added a commit that referenced this issue Jan 8, 2022
Jericho added a commit that referenced this issue Jan 8, 2022
Jericho added a commit that referenced this issue Jan 11, 2022
Jericho added a commit that referenced this issue Jan 11, 2022
@Jericho Jericho modified the milestones: Paging, 0.85.0 Jan 11, 2022
Jericho added a commit that referenced this issue Jan 11, 2022
Jericho added a commit that referenced this issue Jan 11, 2022
Jericho added a commit that referenced this issue Jan 11, 2022
Jericho added a commit that referenced this issue Jan 11, 2022
Jericho added a commit that referenced this issue Jan 11, 2022
(cherry picked from commit 0309313)
@Jericho
Copy link
Owner Author

Jericho commented Jan 12, 2022

I'm having second thoughts about adding limit and offset to the IpAddresses.GetUnassignedAsync method because GetAssignedAsync does not allow limit/offset and I think it makes sense for the signature of these two methods to be consistent.

@Jericho
Copy link
Owner Author

Jericho commented Jan 13, 2022

Adding offset to the request when invoking AccessManagement.GetAccessHistoryAsync caused the following error:

{
    "errors": [
        {
            "field":"offset",
            "message":"unknown field"
        }
    ]
}

Therefore, I will not be adding offset to this method.

Jericho added a commit that referenced this issue Jan 14, 2022
…ync in order to be consistent with the signature of the GetAssignedAsync method
Jericho added a commit that referenced this issue Jan 14, 2022
…ync in order to be consistent with the signature of the GetAssignedAsync method
Jericho added a commit that referenced this issue Jan 14, 2022
@Jericho Jericho closed this as completed Jan 14, 2022
@Jericho
Copy link
Owner Author

Jericho commented Jan 14, 2022

🎉 This issue has been resolved in version 0.85.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change This change causes backward compatibility issue(s)
Projects
None yet
Development

No branches or pull requests

1 participant