Skip to content

Commit

Permalink
feat: update generated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot committed Oct 31, 2023
1 parent 33dd2a3 commit ea6e3f9
Showing 1 changed file with 58 additions and 58 deletions.
116 changes: 58 additions & 58 deletions api/instance/v1/instance_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1310,11 +1310,11 @@ type VolumeTemplate struct {
VolumeType VolumeVolumeType `json:"volume_type,omitempty"`

// Deprecated: Organization: organization ID of the volume.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Organization *string `json:"organization,omitempty"`

// Project: project ID of the volume.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Project *string `json:"project,omitempty"`
}

Expand Down Expand Up @@ -1789,11 +1789,11 @@ type CreateIPRequest struct {
Zone scw.Zone `json:"-"`

// Deprecated: Organization: organization ID in which the IP is reserved.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Organization *string `json:"organization,omitempty"`

// Project: project ID in which the IP is reserved.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Project *string `json:"project,omitempty"`

// Tags: tags of the IP.
Expand Down Expand Up @@ -1834,11 +1834,11 @@ type CreateImageRequest struct {
ExtraVolumes map[string]*VolumeTemplate `json:"extra_volumes,omitempty"`

// Deprecated: Organization: organization ID of the image.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Organization *string `json:"organization,omitempty"`

// Project: project ID of the image.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Project *string `json:"project,omitempty"`

// Tags: tags of the image.
Expand All @@ -1862,11 +1862,11 @@ type CreatePlacementGroupRequest struct {
Name string `json:"name,omitempty"`

// Deprecated: Organization: organization ID of the placement group.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Organization *string `json:"organization,omitempty"`

// Project: project ID of the placement group.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Project *string `json:"project,omitempty"`

// Tags: tags of the placement group.
Expand Down Expand Up @@ -1921,11 +1921,11 @@ type CreateSecurityGroupRequest struct {
Description string `json:"description,omitempty"`

// Deprecated: Organization: organization ID the security group belongs to.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Organization *string `json:"organization,omitempty"`

// Project: project ID the security group belong to.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Project *string `json:"project,omitempty"`

// Tags: tags of the security group.
Expand Down Expand Up @@ -2036,11 +2036,11 @@ type CreateServerRequest struct {
Bootscript *string `json:"bootscript,omitempty"`

// Deprecated: Organization: instance Organization ID.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Organization *string `json:"organization,omitempty"`

// Project: instance Project ID.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Project *string `json:"project,omitempty"`

// Tags: instance tags.
Expand Down Expand Up @@ -2073,11 +2073,11 @@ type CreateSnapshotRequest struct {
Tags *[]string `json:"tags,omitempty"`

// Deprecated: Organization: organization ID of the snapshot.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Organization *string `json:"organization,omitempty"`

// Project: project ID of the snapshot.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Project *string `json:"project,omitempty"`

// VolumeType: overrides the volume_type of the snapshot.
Expand Down Expand Up @@ -2111,11 +2111,11 @@ type CreateVolumeRequest struct {
Name string `json:"name,omitempty"`

// Deprecated: Organization: volume Organization ID.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Organization *string `json:"organization,omitempty"`

// Project: volume Project ID.
// Precisely one of Organization, Project must be set.
// Precisely one of Project, Organization must be set.
Project *string `json:"project,omitempty"`

// Tags: volume tags.
Expand Down Expand Up @@ -3859,16 +3859,16 @@ func (s *API) createServer(req *CreateServerRequest, opts ...scw.RequestOption)
req.Zone = defaultZone
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Organization == nil && req.Project == nil {
req.Organization = &defaultOrganization
}

defaultProject, exist := s.client.GetDefaultProjectID()
if exist && req.Organization == nil && req.Project == nil {
if exist && req.Project == nil && req.Organization == nil {
req.Project = &defaultProject
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Project == nil && req.Organization == nil {
req.Organization = &defaultOrganization
}

if req.Name == "" {
req.Name = namegenerator.GetRandomName("srv")
}
Expand Down Expand Up @@ -4259,16 +4259,16 @@ func (s *API) CreateImage(req *CreateImageRequest, opts ...scw.RequestOption) (*
req.Zone = defaultZone
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Organization == nil && req.Project == nil {
req.Organization = &defaultOrganization
}

defaultProject, exist := s.client.GetDefaultProjectID()
if exist && req.Organization == nil && req.Project == nil {
if exist && req.Project == nil && req.Organization == nil {
req.Project = &defaultProject
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Project == nil && req.Organization == nil {
req.Organization = &defaultOrganization
}

if req.Name == "" {
req.Name = namegenerator.GetRandomName("img")
}
Expand Down Expand Up @@ -4417,16 +4417,16 @@ func (s *API) CreateSnapshot(req *CreateSnapshotRequest, opts ...scw.RequestOpti
req.Zone = defaultZone
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Organization == nil && req.Project == nil {
req.Organization = &defaultOrganization
}

defaultProject, exist := s.client.GetDefaultProjectID()
if exist && req.Organization == nil && req.Project == nil {
if exist && req.Project == nil && req.Organization == nil {
req.Project = &defaultProject
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Project == nil && req.Organization == nil {
req.Organization = &defaultOrganization
}

if req.Name == "" {
req.Name = namegenerator.GetRandomName("snp")
}
Expand Down Expand Up @@ -4644,16 +4644,16 @@ func (s *API) CreateVolume(req *CreateVolumeRequest, opts ...scw.RequestOption)
req.Zone = defaultZone
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Organization == nil && req.Project == nil {
req.Organization = &defaultOrganization
}

defaultProject, exist := s.client.GetDefaultProjectID()
if exist && req.Organization == nil && req.Project == nil {
if exist && req.Project == nil && req.Organization == nil {
req.Project = &defaultProject
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Project == nil && req.Organization == nil {
req.Organization = &defaultOrganization
}

if req.Name == "" {
req.Name = namegenerator.GetRandomName("vol")
}
Expand Down Expand Up @@ -4825,16 +4825,16 @@ func (s *API) CreateSecurityGroup(req *CreateSecurityGroupRequest, opts ...scw.R
req.Zone = defaultZone
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Organization == nil && req.Project == nil {
req.Organization = &defaultOrganization
}

defaultProject, exist := s.client.GetDefaultProjectID()
if exist && req.Organization == nil && req.Project == nil {
if exist && req.Project == nil && req.Organization == nil {
req.Project = &defaultProject
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Project == nil && req.Organization == nil {
req.Organization = &defaultOrganization
}

if req.Name == "" {
req.Name = namegenerator.GetRandomName("sg")
}
Expand Down Expand Up @@ -5258,16 +5258,16 @@ func (s *API) CreatePlacementGroup(req *CreatePlacementGroupRequest, opts ...scw
req.Zone = defaultZone
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Organization == nil && req.Project == nil {
req.Organization = &defaultOrganization
}

defaultProject, exist := s.client.GetDefaultProjectID()
if exist && req.Organization == nil && req.Project == nil {
if exist && req.Project == nil && req.Organization == nil {
req.Project = &defaultProject
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Project == nil && req.Organization == nil {
req.Organization = &defaultOrganization
}

if req.Name == "" {
req.Name = namegenerator.GetRandomName("pg")
}
Expand Down Expand Up @@ -5588,16 +5588,16 @@ func (s *API) CreateIP(req *CreateIPRequest, opts ...scw.RequestOption) (*Create
req.Zone = defaultZone
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Organization == nil && req.Project == nil {
req.Organization = &defaultOrganization
}

defaultProject, exist := s.client.GetDefaultProjectID()
if exist && req.Organization == nil && req.Project == nil {
if exist && req.Project == nil && req.Organization == nil {
req.Project = &defaultProject
}

defaultOrganization, exist := s.client.GetDefaultOrganizationID()
if exist && req.Project == nil && req.Organization == nil {
req.Organization = &defaultOrganization
}

if fmt.Sprint(req.Zone) == "" {
return nil, errors.New("field Zone cannot be empty in request")
}
Expand Down

0 comments on commit ea6e3f9

Please sign in to comment.