Add ListResolvableAliases SDK changes (#4653)

* Add API changs for list resolvable aliases
This commit is contained in:
Todd authored and GitHub committed 2024-04-17 11:13:08 -07:00
1 parent c3fc80becf
commit 608b6bb2b7
32 files changed
+614 -411

No files matched your search

+18 -20
View File
@@ -29,13 +29,11 @@ type Group struct {
MemberIds []string `json:"member_ids,omitempty"`
Members []*Member `json:"members,omitempty"`
AuthorizedActions []string `json:"authorized_actions,omitempty"`
response *api.Response
}
type GroupReadResult struct {
Item *Group
response *api.Response
Response *api.Response
}
func (n GroupReadResult) GetItem() *Group {
@@ -43,14 +41,14 @@ func (n GroupReadResult) GetItem() *Group {
}
func (n GroupReadResult) GetResponse() *api.Response {
return n.response
return n.Response
}
type GroupCreateResult = GroupReadResult
type GroupUpdateResult = GroupReadResult
type GroupDeleteResult struct {
response *api.Response
Response *api.Response
}
// GetItem will always be nil for GroupDeleteResult
@@ -59,7 +57,7 @@ func (n GroupDeleteResult) GetItem() interface{} {
}
func (n GroupDeleteResult) GetResponse() *api.Response {
return n.response
return n.Response
}
type GroupListResult struct {
@@ -68,7 +66,7 @@ type GroupListResult struct {
RemovedIds []string `json:"removed_ids,omitempty"`
ListToken string `json:"list_token,omitempty"`
ResponseType string `json:"response_type,omitempty"`
response *api.Response
Response *api.Response
}
func (n GroupListResult) GetItems() []*Group {
@@ -92,7 +90,7 @@ func (n GroupListResult) GetResponseType() string {
}
func (n GroupListResult) GetResponse() *api.Response {
return n.response
return n.Response
}
// Client is a client for this collection
@@ -153,7 +151,7 @@ func (c *Client) Create(ctx context.Context, scopeId string, opt ...Option) (*Gr
if apiErr != nil {
return nil, apiErr
}
target.response = resp
target.Response = resp
return target, nil
}
@@ -194,7 +192,7 @@ func (c *Client) Read(ctx context.Context, id string, opt ...Option) (*GroupRead
if apiErr != nil {
return nil, apiErr
}
target.response = resp
target.Response = resp
return target, nil
}
@@ -257,7 +255,7 @@ func (c *Client) Update(ctx context.Context, id string, version uint32, opt ...O
if apiErr != nil {
return nil, apiErr
}
target.response = resp
target.Response = resp
return target, nil
}
@@ -298,7 +296,7 @@ func (c *Client) Delete(ctx context.Context, id string, opt ...Option) (*GroupDe
}
target := &GroupDeleteResult{
response: resp,
Response: resp,
}
return target, nil
}
@@ -340,7 +338,7 @@ func (c *Client) List(ctx context.Context, scopeId string, opt ...Option) (*Grou
if apiErr != nil {
return nil, apiErr
}
target.response = resp
target.Response = resp
if target.ResponseType == "complete" || target.ResponseType == "" {
return target, nil
}
@@ -398,7 +396,7 @@ func (c *Client) List(ctx context.Context, scopeId string, opt ...Option) (*Grou
target.EstItemCount = page.EstItemCount
target.ListToken = page.ListToken
target.ResponseType = page.ResponseType
target.response = resp
target.Response = resp
if target.ResponseType == "complete" {
break
}
@@ -433,11 +431,11 @@ func (c *Client) List(ctx context.Context, scopeId string, opt ...Option) (*Grou
// Finally, since we made at least 2 requests to the server to fulfill this
// function call, resp.Body and resp.Map will only contain the most recent response.
// Overwrite them with the true response.
target.response.Body.Reset()
if err := json.NewEncoder(target.response.Body).Encode(target); err != nil {
target.Response.Body.Reset()
if err := json.NewEncoder(target.Response.Body).Encode(target); err != nil {
return nil, fmt.Errorf("error encoding final JSON list response: %w", err)
}
if err := json.Unmarshal(target.response.Body.Bytes(), &target.response.Map); err != nil {
if err := json.Unmarshal(target.Response.Body.Bytes(), &target.Response.Map); err != nil {
return nil, fmt.Errorf("error encoding final map list response: %w", err)
}
// Note: the HTTP response body is consumed by resp.Decode in the loop,
@@ -511,7 +509,7 @@ func (c *Client) AddMembers(ctx context.Context, id string, version uint32, memb
if apiErr != nil {
return nil, apiErr
}
target.response = resp
target.Response = resp
return target, nil
}
@@ -577,7 +575,7 @@ func (c *Client) SetMembers(ctx context.Context, id string, version uint32, memb
if apiErr != nil {
return nil, apiErr
}
target.response = resp
target.Response = resp
return target, nil
}
@@ -647,6 +645,6 @@ func (c *Client) RemoveMembers(ctx context.Context, id string, version uint32, m
if apiErr != nil {
return nil, apiErr
}
target.response = resp
target.Response = resp
return target, nil
}