Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion api/audit_trail/v1alpha1/audit_trail_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,47 @@ var (
_ = namegenerator.GetRandomName
)

type Action string

const (
ActionUnknownAction = Action("unknown_action")
ActionCreate = Action("create")
ActionUpdate = Action("update")
ActionDelete = Action("delete")
)

func (enum Action) String() string {
if enum == "" {
// return default value if empty
return string(ActionUnknownAction)
}
return string(enum)
}

func (enum Action) Values() []Action {
return []Action{
"unknown_action",
"create",
"update",
"delete",
}
}

func (enum Action) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}

func (enum *Action) UnmarshalJSON(data []byte) error {
tmp := ""

if err := json.Unmarshal(data, &tmp); err != nil {
return err
}

*enum = Action(Action(tmp).String())
return nil
}

type AlertRuleStatus string

const (
Expand Down Expand Up @@ -1330,7 +1371,8 @@ type Resource struct {

Name *string `json:"name"`

Action *string `json:"action"`
// Action: default value: unknown_action
Action *Action `json:"action"`

// Deprecated
// Precisely one of SecmSecretInfo, SecmSecretVersionInfo, KubeClusterInfo, KubePoolInfo, KubeNodeInfo, KubeACLInfo, KeymKeyInfo, SecretManagerSecretInfo, SecretManagerVersionInfo, KeyManagerKeyInfo, AccountUserInfo, AccountOrganizationInfo, InstanceServerInfo, AppleSiliconServerInfo, AccountProjectInfo, BaremetalServerInfo, BaremetalSettingInfo, IpamIPInfo, LoadBalancerLBInfo, LoadBalancerIPInfo, LoadBalancerFrontendInfo, LoadBalancerBackendInfo, LoadBalancerRouteInfo, LoadBalancerACLInfo, LoadBalancerCertificateInfo, EdgeServicesPlanInfo, EdgeServicesPipelineInfo, EdgeServicesDNSStageInfo, EdgeServicesTLSStageInfo, EdgeServicesCacheStageInfo, EdgeServicesRouteStageInfo, EdgeServicesRouteRulesInfo, EdgeServicesWafStageInfo, EdgeServicesBackendStageInfo, AccountContractSignatureInfo, VpcSubnetInfo, VpcRouteInfo, VpcPrivateNetworkInfo, AuditTrailExportJobInfo, VpcGwGatewayInfo, VpcGwGatewayNetworkInfo, AppleSiliconRunnerInfo, AuditTrailAlertRuleInfo, VpcConnectorInfo, InstancePrivateNetworkInterfaceInfo, VpcIngressRuleInfo, ObservabilityContactPointInfo, ObservabilityAlertRuleInfo, EdgeServicesVpcEndpointInfo, AuditTrailCustomAlertRuleInfo, ServerlessContainersNamespaceInfo, ServerlessContainersContainerInfo, ServerlessContainersDomainInfo, ServerlessContainersTriggerInfo, ServerlessFunctionsNamespaceInfo, ServerlessFunctionsFunctionInfo, ServerlessFunctionsDomainInfo, ServerlessFunctionsCronInfo, ServerlessFunctionsTriggerInfo must be set.
Expand Down
6 changes: 3 additions & 3 deletions api/block/v1/block_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ func (m *Snapshot) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -579,7 +579,7 @@ func (m *VolumeType) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -663,7 +663,7 @@ func (m *Volume) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down
8 changes: 4 additions & 4 deletions api/datawarehouse/v1beta1/datawarehouse_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ func (m *Endpoint) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -409,7 +409,7 @@ func (m *Database) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -499,7 +499,7 @@ func (m *Deployment) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -573,7 +573,7 @@ func (m *User) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down
4 changes: 2 additions & 2 deletions api/file/v1alpha1/file_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (m *Attachment) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -305,7 +305,7 @@ func (m *FileSystem) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down
2 changes: 1 addition & 1 deletion api/flexibleip/v1alpha1/flexibleip_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (m *FlexibleIP) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down
24 changes: 12 additions & 12 deletions api/iam/v1alpha1/iam_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ func (m *JWT) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -1307,7 +1307,7 @@ func (m *APIKey) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -1378,7 +1378,7 @@ func (m *Application) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -1471,7 +1471,7 @@ func (m *Group) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -1538,7 +1538,7 @@ func (m *Log) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -1650,7 +1650,7 @@ func (m *Policy) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -1715,7 +1715,7 @@ func (m *Quotum) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -1778,7 +1778,7 @@ func (m *Rule) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -1843,7 +1843,7 @@ func (m *SSHKey) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -1898,7 +1898,7 @@ func (m *SamlCertificate) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -2010,7 +2010,7 @@ func (m *User) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down Expand Up @@ -3322,7 +3322,7 @@ func (m *Saml) setSRN(platform string) {

notEmpty := func(a any) (string, error) {
s := fmt.Sprint(a)
if s == "" {
if s == "" || s == "<nil>" {
return "", errors.New("value is empty")
}
return s, nil
Expand Down
7 changes: 7 additions & 0 deletions api/instance/v1/instance_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -6638,6 +6638,8 @@ func (s *API) DeleteIP(req *DeleteIPRequest, opts ...scw.RequestOption) error {
}

// ListPrivateNICs: List all private NICs of a specified Instance.
// Some private NICs, such as those in deleting, detaching, or in error state are
// not listed. We strongly recommend migrating to v2alpha1 to retrieve all private NICs.
func (s *API) ListPrivateNICs(req *ListPrivateNICsRequest, opts ...scw.RequestOption) (*ListPrivateNICsResponse, error) {
var err error

Expand Down Expand Up @@ -6677,6 +6679,11 @@ func (s *API) ListPrivateNICs(req *ListPrivateNICsRequest, opts ...scw.RequestOp
}

// CreatePrivateNIC: Create a private NIC connecting an Instance to a Private Network.
// Some private NICs, such as those in deleting, detaching, or in error state are
// not listed in v1.
// Therefore, you may encounter quota limits errors when creating a new private NIC, even if your visible
// count is below the threshold.
// We strongly recommend migrating to v2alpha1 to see all private NICs.
func (s *API) CreatePrivateNIC(req *CreatePrivateNICRequest, opts ...scw.RequestOption) (*CreatePrivateNICResponse, error) {
var err error

Expand Down
Loading
Loading