ListMembersIter returns an iterator that paginates through all results of ListMembers.
(ctx context.Context, org string, opts *ListMembersOptions)
| 4481 | |
| 4482 | // ListMembersIter returns an iterator that paginates through all results of ListMembers. |
| 4483 | func (s *OrganizationsService) ListMembersIter(ctx context.Context, org string, opts *ListMembersOptions) iter.Seq2[*User, error] { |
| 4484 | return func(yield func(*User, error) bool) { |
| 4485 | // Create a copy of opts to avoid mutating the caller's struct |
| 4486 | if opts == nil { |
| 4487 | opts = &ListMembersOptions{} |
| 4488 | } else { |
| 4489 | opts = Ptr(*opts) |
| 4490 | } |
| 4491 | |
| 4492 | for { |
| 4493 | results, resp, err := s.ListMembers(ctx, org, opts) |
| 4494 | if err != nil { |
| 4495 | yield(nil, err) |
| 4496 | return |
| 4497 | } |
| 4498 | |
| 4499 | for _, item := range results { |
| 4500 | if !yield(item, nil) { |
| 4501 | return |
| 4502 | } |
| 4503 | } |
| 4504 | |
| 4505 | if resp.NextPage == 0 { |
| 4506 | break |
| 4507 | } |
| 4508 | opts.ListOptions.Page = resp.NextPage |
| 4509 | } |
| 4510 | } |
| 4511 | } |
| 4512 | |
| 4513 | // ListNetworkConfigurationsIter returns an iterator that paginates through all results of ListNetworkConfigurations. |
| 4514 | func (s *OrganizationsService) ListNetworkConfigurationsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*NetworkConfiguration, error] { |