Skip to content

Commit

Permalink
Merge pull request #19 from elliesaber/v3-identities
Browse files Browse the repository at this point in the history
v3 identities
  • Loading branch information
elliesaber authored Nov 26, 2024
2 parents a87e31c + a1728dd commit 9d7f1fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ func (c *Client) DeleteRole(ctx context.Context, role *Role) (*Role, error) {
return &res, nil
}

func (c *Client) GetIdentity(ctx context.Context, alias string) (*Identity, error) {
req, err := http.NewRequest("GET", fmt.Sprintf("%s/v2/identities/%s", c.BaseURL, alias), nil)
func (c *Client) GetIdentity(ctx context.Context, identityId string) ([]*Identity, error) {
req, err := http.NewRequest("GET", fmt.Sprintf("%s/v3/accounts?identityId=%s", c.BaseURL, identityId), nil)
if err != nil {
log.Printf("Creation of new http request failed: %+v\n", err)
return nil, err
Expand All @@ -377,14 +377,14 @@ func (c *Client) GetIdentity(ctx context.Context, alias string) (*Identity, erro

req = req.WithContext(ctx)

res := Identity{}
var res []*Identity
if err := c.sendRequest(req, &res); err != nil {
log.Printf("Failed Identity get response:%+v\n", res)
log.Fatal(err)
return nil, err
}

return &res, nil
return res, nil
}

func (c *Client) GetAccountAggregationSchedule(ctx context.Context, id string) (*AccountAggregationSchedule, error) {
Expand Down
2 changes: 1 addition & 1 deletion data_source_Identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ func dataSourceIdentityRead(d *schema.ResourceData, meta interface{}) error {
return err
}

return flattenIdentity(d, identity)
return flattenIdentity(d, identity[0])
}
2 changes: 1 addition & 1 deletion schema_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func sourceFields() map[string]*schema.Schema {
},
"type": {
Type: schema.TypeString,
Required: true,
Optional: true,
Description: "Specifies the type of system being managed",
},
"connector": {
Expand Down

0 comments on commit 9d7f1fa

Please sign in to comment.