Skip to content

Commit

Permalink
fix: typos in plural acronyms (#176)
Browse files Browse the repository at this point in the history
* feat: update generated apis
  • Loading branch information
kindermoumoute committed Sep 9, 2019
1 parent 1a11352 commit 4c71c0e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
10 changes: 5 additions & 5 deletions api/baremetal/v1alpha1/baremetal_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ type Server struct {
Install *ServerInstall `json:"install"`
// Tags array of customs tags
Tags []string `json:"tags"`
// Ips array of IPs
Ips []*IP `json:"ips"`
// IPs array of IPs
IPs []*IP `json:"ips"`
// Domain the server domain
Domain string `json:"domain"`
// BootType boot type
Expand All @@ -420,7 +420,7 @@ type ServerInstall struct {

Hostname string `json:"hostname"`

SSHKeyIds []string `json:"ssh_key_ids"`
SSHKeyIDs []string `json:"ssh_key_ids"`
// Status
//
// Default value: unknown
Expand Down Expand Up @@ -661,8 +661,8 @@ type InstallServerRequest struct {
OsID string `json:"os_id"`
// Hostname hostname of the server
Hostname string `json:"hostname"`
// SSHKeyIds array of ssh key IDs authorized
SSHKeyIds []string `json:"ssh_key_ids"`
// SSHKeyIDs array of ssh key IDs authorized
SSHKeyIDs []string `json:"ssh_key_ids"`
}

// InstallServer install your server.
Expand Down
32 changes: 16 additions & 16 deletions api/instance/v1/instance_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,11 @@ type Dashboard struct {

ServersCount uint32 `json:"servers_count"`

IpsCount uint32 `json:"ips_count"`
IPsCount uint32 `json:"ips_count"`

SecurityGroupsCount uint32 `json:"security_groups_count"`

IpsUnused uint32 `json:"ips_unused"`
IPsUnused uint32 `json:"ips_unused"`
}

type GetBootscriptResponse struct {
Expand Down Expand Up @@ -802,14 +802,14 @@ type ListComputeClustersResponse struct {
TotalCount uint32 `json:"total_count"`
}

type ListImagesResponse struct {
Images []*Image `json:"images"`
type ListIPsResponse struct {
IPs []*IP `json:"ips"`

TotalCount uint32 `json:"total_count"`
}

type ListIpsResponse struct {
Ips []*IP `json:"ips"`
type ListImagesResponse struct {
Images []*Image `json:"images"`

TotalCount uint32 `json:"total_count"`
}
Expand Down Expand Up @@ -3801,7 +3801,7 @@ func (s *API) DeleteComputeClusterServers(req *DeleteComputeClusterServersReques
return nil
}

type ListIpsRequest struct {
type ListIPsRequest struct {
Zone scw.Zone `json:"-"`

Organization *string `json:"-"`
Expand All @@ -3813,8 +3813,8 @@ type ListIpsRequest struct {
Page *int32 `json:"-"`
}

// ListIps list IPs
func (s *API) ListIps(req *ListIpsRequest, opts ...scw.RequestOption) (*ListIpsResponse, error) {
// ListIPs list IPs
func (s *API) ListIPs(req *ListIPsRequest, opts ...scw.RequestOption) (*ListIPsResponse, error) {
var err error

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
Expand Down Expand Up @@ -3849,7 +3849,7 @@ func (s *API) ListIps(req *ListIpsRequest, opts ...scw.RequestOption) (*ListIpsR
Headers: http.Header{},
}

var resp ListIpsResponse
var resp ListIPsResponse

err = s.client.Do(scwReq, &resp, opts...)
if err != nil {
Expand All @@ -3860,21 +3860,21 @@ func (s *API) ListIps(req *ListIpsRequest, opts ...scw.RequestOption) (*ListIpsR

// UnsafeGetTotalCount should not be used
// Internal usage only
func (r *ListIpsResponse) UnsafeGetTotalCount() int {
func (r *ListIPsResponse) UnsafeGetTotalCount() int {
return int(r.TotalCount)
}

// UnsafeAppend should not be used
// Internal usage only
func (r *ListIpsResponse) UnsafeAppend(res interface{}) (int, scw.SdkError) {
results, ok := res.(*ListIpsResponse)
func (r *ListIPsResponse) UnsafeAppend(res interface{}) (int, scw.SdkError) {
results, ok := res.(*ListIPsResponse)
if !ok {
return 0, errors.New("%T type cannot be appended to type %T", res, r)
}

r.Ips = append(r.Ips, results.Ips...)
r.TotalCount += uint32(len(results.Ips))
return len(results.Ips), nil
r.IPs = append(r.IPs, results.IPs...)
r.TotalCount += uint32(len(results.IPs))
return len(results.IPs), nil
}

type CreateIPRequest struct {
Expand Down
2 changes: 1 addition & 1 deletion api/instance/v1/instance_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (r *ListBootscriptsResponse) UnsafeSetTotalCount(totalCount int) {

// UnsafeSetTotalCount should not be used
// Internal usage only
func (r *ListIpsResponse) UnsafeSetTotalCount(totalCount int) {
func (r *ListIPsResponse) UnsafeSetTotalCount(totalCount int) {
r.TotalCount = uint32(totalCount)
}

Expand Down
36 changes: 18 additions & 18 deletions api/lb/v1/lb_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1095,8 +1095,8 @@ type LbType struct {
}

type ListACLResponse struct {
// Acls list of Acl object (see Acl object description)
Acls []*ACL `json:"acls"`
// ACLs list of Acl object (see Acl object description)
ACLs []*ACL `json:"acls"`
// TotalCount result count
TotalCount uint32 `json:"total_count"`
}
Expand All @@ -1121,9 +1121,9 @@ type ListFrontendsResponse struct {
TotalCount uint32 `json:"total_count"`
}

type ListIpsResponse struct {
// Ips list IP address object
Ips []*IP `json:"ips"`
type ListIPsResponse struct {
// IPs list IP address object
IPs []*IP `json:"ips"`
// TotalCount total count, wihtout pagination
TotalCount uint32 `json:"total_count"`
}
Expand Down Expand Up @@ -1445,7 +1445,7 @@ type ListIPsRequest struct {
}

// ListIPs list IPs
func (s *API) ListIPs(req *ListIPsRequest, opts ...scw.RequestOption) (*ListIpsResponse, error) {
func (s *API) ListIPs(req *ListIPsRequest, opts ...scw.RequestOption) (*ListIPsResponse, error) {
var err error

defaultOrganizationID, exist := s.client.GetDefaultOrganizationID()
Expand Down Expand Up @@ -1480,7 +1480,7 @@ func (s *API) ListIPs(req *ListIPsRequest, opts ...scw.RequestOption) (*ListIpsR
Headers: http.Header{},
}

var resp ListIpsResponse
var resp ListIPsResponse

err = s.client.Do(scwReq, &resp, opts...)
if err != nil {
Expand All @@ -1491,21 +1491,21 @@ func (s *API) ListIPs(req *ListIPsRequest, opts ...scw.RequestOption) (*ListIpsR

// UnsafeGetTotalCount should not be used
// Internal usage only
func (r *ListIpsResponse) UnsafeGetTotalCount() int {
func (r *ListIPsResponse) UnsafeGetTotalCount() int {
return int(r.TotalCount)
}

// UnsafeAppend should not be used
// Internal usage only
func (r *ListIpsResponse) UnsafeAppend(res interface{}) (int, scw.SdkError) {
results, ok := res.(*ListIpsResponse)
func (r *ListIPsResponse) UnsafeAppend(res interface{}) (int, scw.SdkError) {
results, ok := res.(*ListIPsResponse)
if !ok {
return 0, errors.New("%T type cannot be appended to type %T", res, r)
}

r.Ips = append(r.Ips, results.Ips...)
r.TotalCount += uint32(len(results.Ips))
return len(results.Ips), nil
r.IPs = append(r.IPs, results.IPs...)
r.TotalCount += uint32(len(results.IPs))
return len(results.IPs), nil
}

type GetIPRequest struct {
Expand Down Expand Up @@ -2619,7 +2619,7 @@ func (s *API) GetLbStats(req *GetLbStatsRequest, opts ...scw.RequestOption) (*Lb
return &resp, nil
}

type ListAclsRequest struct {
type ListACLsRequest struct {
Region scw.Region `json:"-"`
// FrontendID iD of your frontend
FrontendID string `json:"-"`
Expand All @@ -2635,7 +2635,7 @@ type ListAclsRequest struct {
Name *string `json:"-"`
}

func (s *API) ListAcls(req *ListAclsRequest, opts ...scw.RequestOption) (*ListACLResponse, error) {
func (s *API) ListACLs(req *ListACLsRequest, opts ...scw.RequestOption) (*ListACLResponse, error) {
var err error

if req.Region == "" {
Expand Down Expand Up @@ -2692,9 +2692,9 @@ func (r *ListACLResponse) UnsafeAppend(res interface{}) (int, scw.SdkError) {
return 0, errors.New("%T type cannot be appended to type %T", res, r)
}

r.Acls = append(r.Acls, results.Acls...)
r.TotalCount += uint32(len(results.Acls))
return len(results.Acls), nil
r.ACLs = append(r.ACLs, results.ACLs...)
r.TotalCount += uint32(len(results.ACLs))
return len(results.ACLs), nil
}

type CreateACLRequest struct {
Expand Down

0 comments on commit 4c71c0e

Please sign in to comment.