summaryrefslogtreecommitdiff
path: root/external/evcli/client.go
diff options
context:
space:
mode:
authorJulien Dessaux2023-07-31 00:31:43 +0200
committerJulien Dessaux2023-07-31 00:31:43 +0200
commit6642a66a1df5db5f2f9780905e83ba2c412128f6 (patch)
tree35d04ade200db806152bc80cd6cf33ed6bf23052 /external/evcli/client.go
parentUpgrade notes (diff)
downloadterraform-provider-eventline-3f53f3f059902ff0a4e4cd6abd114029a11a5080.tar.gz
terraform-provider-eventline-3f53f3f059902ff0a4e4cd6abd114029a11a5080.tar.bz2
terraform-provider-eventline-3f53f3f059902ff0a4e4cd6abd114029a11a5080.zip
Implemented identities datasourcev0.0.5
Diffstat (limited to '')
-rw-r--r--external/evcli/client.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/external/evcli/client.go b/external/evcli/client.go
index b9d5032..ce3d4a0 100644
--- a/external/evcli/client.go
+++ b/external/evcli/client.go
@@ -181,6 +181,34 @@ func (c *Client) UpdateProject(project *eventline.Project) error {
return c.SendRequest("PUT", uri, project, nil)
}
+func (c *Client) FetchIdentities() (Identities, error) {
+ var identities Identities
+
+ cursor := eventline.Cursor{Size: 20}
+
+ for {
+ var page IdentityPage
+
+ uri := NewURL("identities")
+ uri.RawQuery = cursor.Query().Encode()
+
+ err := c.SendRequest("GET", uri, nil, &page)
+ if err != nil {
+ return nil, err
+ }
+
+ identities = append(identities, page.Elements...)
+
+ if page.Next == nil {
+ break
+ }
+
+ cursor = *page.Next
+ }
+
+ return identities, nil
+}
+
func (c *Client) ReplayEvent(id string) (*eventline.Event, error) {
var event eventline.Event