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

Changed method to search #97

Merged
merged 4 commits into from
Apr 5, 2024
Merged

Changed method to search #97

merged 4 commits into from
Apr 5, 2024

Conversation

notanthony
Copy link
Contributor

This will allow us to exclude deleted policies during generation.

@@ -12,9 +11,9 @@ func (c *client) ListPolicies(ctx context.Context) ([]shared.Policy, error) {
pageSize := float64(100)
pageToken := ""
for {
resp, err := c.sdk.Policies.List(ctx, operations.C1APIPolicyV1PoliciesListRequest{
PageToken: &pageToken,
resp, err := c.sdk.PolicySearch.Search(ctx, &shared.SearchPoliciesRequest{
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm glad our type system and API responses are so regular. Even though this changed from a C1APIPolicyV1PoliciesListResponse to a C1APIPolicyV1PolicySearchSearchResponse, it has the same resp.ListPolicyResponse.List.

@notanthony notanthony enabled auto-merge (squash) April 5, 2024 21:15
@notanthony notanthony merged commit 0f49af7 into main Apr 5, 2024
2 checks passed
@notanthony notanthony deleted the anthony/list-policies branch April 5, 2024 21:15
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