Skip to content

Commit

Permalink
[chore] add method user agents
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpiger committed Mar 7, 2025
1 parent 8db4d7c commit ea10e05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vngcloud/services/compute/v2/irequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ type IDeleteServerGroupByIdRequest interface {

type IListServerGroupsRequest interface {
WithName(pname string) IListServerGroupsRequest
AddUserAgent(pagent ...string) IListServerGroupsRequest
ToListQuery() (string, error)
ParseUserAgent() string
GetDefaultQuery() string
Expand All @@ -93,6 +94,7 @@ type IListServerGroupsRequest interface {

type ICreateServerGroupRequest interface {
ParseUserAgent() string
AddUserAgent(pagent ...string) ICreateServerGroupRequest
ToRequestBody() interface{}
ToMap() map[string]interface{}
}
10 changes: 10 additions & 0 deletions vngcloud/services/compute/v2/server_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,11 @@ func (s *ListServerGroupsRequest) ToMap() map[string]interface{} {
}
}

func (s *ListServerGroupsRequest) AddUserAgent(pagent ...string) IListServerGroupsRequest {
s.UserAgent.AddUserAgent(pagent...)
return s
}

type CreateServerGroupRequest struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Expand All @@ -382,3 +387,8 @@ func (s *CreateServerGroupRequest) ToMap() map[string]interface{} {
"policyId": s.PolicyId,
}
}

func (s *CreateServerGroupRequest) AddUserAgent(pagent ...string) ICreateServerGroupRequest {
s.UserAgent.AddUserAgent(pagent...)
return s
}

0 comments on commit ea10e05

Please sign in to comment.