Add ListResolvableAliases SDK changes (#4653)
* Add API changs for list resolvable aliases
This commit is contained in:
32 files changed
+614
-411
No files matched your search
@@ -96,6 +96,6 @@ func (c *Client) ReApplyStoragePolicy(ctx context.Context, contentId string, opt
|
||||
if apiErr != nil {
|
||||
return nil, apiErr
|
||||
}
|
||||
target.response = resp
|
||||
target.Response = resp
|
||||
return target, nil
|
||||
}
|
||||
@@ -38,13 +38,11 @@ type SessionRecording struct {
|
||||
AuthorizedActions []string `json:"authorized_actions,omitempty"`
|
||||
RetainUntil time.Time `json:"retain_until,omitempty"`
|
||||
DeleteAfter time.Time `json:"delete_after,omitempty"`
|
||||
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
type SessionRecordingReadResult struct {
|
||||
Item *SessionRecording
|
||||
response *api.Response
|
||||
Response *api.Response
|
||||
}
|
||||
|
||||
func (n SessionRecordingReadResult) GetItem() *SessionRecording {
|
||||
@@ -52,11 +50,11 @@ func (n SessionRecordingReadResult) GetItem() *SessionRecording {
|
||||
}
|
||||
|
||||
func (n SessionRecordingReadResult) GetResponse() *api.Response {
|
||||
return n.response
|
||||
return n.Response
|
||||
}
|
||||
|
||||
type SessionRecordingDeleteResult struct {
|
||||
response *api.Response
|
||||
Response *api.Response
|
||||
}
|
||||
|
||||
// GetItem will always be nil for SessionRecordingDeleteResult
|
||||
@@ -65,7 +63,7 @@ func (n SessionRecordingDeleteResult) GetItem() interface{} {
|
||||
}
|
||||
|
||||
func (n SessionRecordingDeleteResult) GetResponse() *api.Response {
|
||||
return n.response
|
||||
return n.Response
|
||||
}
|
||||
|
||||
type SessionRecordingListResult struct {
|
||||
@@ -74,7 +72,7 @@ type SessionRecordingListResult 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 SessionRecordingListResult) GetItems() []*SessionRecording {
|
||||
@@ -98,7 +96,7 @@ func (n SessionRecordingListResult) GetResponseType() string {
|
||||
}
|
||||
|
||||
func (n SessionRecordingListResult) GetResponse() *api.Response {
|
||||
return n.response
|
||||
return n.Response
|
||||
}
|
||||
|
||||
// Client is a client for this collection
|
||||
@@ -156,7 +154,7 @@ func (c *Client) Read(ctx context.Context, id string, opt ...Option) (*SessionRe
|
||||
if apiErr != nil {
|
||||
return nil, apiErr
|
||||
}
|
||||
target.response = resp
|
||||
target.Response = resp
|
||||
return target, nil
|
||||
}
|
||||
|
||||
@@ -197,7 +195,7 @@ func (c *Client) Delete(ctx context.Context, id string, opt ...Option) (*Session
|
||||
}
|
||||
|
||||
target := &SessionRecordingDeleteResult{
|
||||
response: resp,
|
||||
Response: resp,
|
||||
}
|
||||
return target, nil
|
||||
}
|
||||
@@ -239,7 +237,7 @@ func (c *Client) List(ctx context.Context, scopeId string, opt ...Option) (*Sess
|
||||
if apiErr != nil {
|
||||
return nil, apiErr
|
||||
}
|
||||
target.response = resp
|
||||
target.Response = resp
|
||||
if target.ResponseType == "complete" || target.ResponseType == "" {
|
||||
return target, nil
|
||||
}
|
||||
@@ -297,7 +295,7 @@ func (c *Client) List(ctx context.Context, scopeId string, opt ...Option) (*Sess
|
||||
target.EstItemCount = page.EstItemCount
|
||||
target.ListToken = page.ListToken
|
||||
target.ResponseType = page.ResponseType
|
||||
target.response = resp
|
||||
target.Response = resp
|
||||
if target.ResponseType == "complete" {
|
||||
break
|
||||
}
|
||||
@@ -332,11 +330,11 @@ func (c *Client) List(ctx context.Context, scopeId string, opt ...Option) (*Sess
|
||||
// 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,
|
||||
|
||||
Reference in new issue
Block a user