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 Feb 13, 2025
1 parent 428f1d2 commit 14067b3
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions api/applesilicon/v1alpha1/applesilicon_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,45 @@ var (
_ = namegenerator.GetRandomName
)

type CommitmentType string

const (
CommitmentTypeDuration24h = CommitmentType("duration_24h")
CommitmentTypeRenewedMonthly = CommitmentType("renewed_monthly")
CommitmentTypeNone = CommitmentType("none")
)

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

func (enum CommitmentType) Values() []CommitmentType {
return []CommitmentType{
"duration_24h",
"renewed_monthly",
"none",
}
}

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

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

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

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

type ConnectivityDiagnosticActionType string

const (
Expand Down Expand Up @@ -440,6 +479,14 @@ type ServerTypeNetwork struct {
PublicBandwidthBps uint64 `json:"public_bandwidth_bps"`
}

// Commitment: commitment.
type Commitment struct {
// Type: default value: duration_24h
Type CommitmentType `json:"type"`

Cancelled bool `json:"cancelled"`
}

// ConnectivityDiagnosticServerHealth: connectivity diagnostic server health.
type ConnectivityDiagnosticServerHealth struct {
LastCheckinDate *time.Time `json:"last_checkin_date"`
Expand Down Expand Up @@ -577,6 +624,15 @@ type Server struct {
// VpcStatus: activation status of optional Private Network feature support for this server.
// Default value: vpc_unknown_status
VpcStatus ServerPrivateNetworkStatus `json:"vpc_status"`

// Commitment: commitment scheme applied to this server.
Commitment *Commitment `json:"commitment"`
}

// CommitmentTypeValue: commitment type value.
type CommitmentTypeValue struct {
// CommitmentType: default value: duration_24h
CommitmentType CommitmentType `json:"commitment_type"`
}

// ConnectivityDiagnostic: connectivity diagnostic.
Expand Down Expand Up @@ -614,6 +670,10 @@ type CreateServerRequest struct {

// EnableVpc: activate the Private Network feature for this server. This feature is configured through the Apple Silicon - Private Networks API.
EnableVpc bool `json:"enable_vpc"`

// CommitmentType: activate commitment for this server. If not specified, there is a 24h commitment due to Apple licensing. It can be updated with the Update Server request. Available commitment depends on server type.
// Default value: duration_24h
CommitmentType CommitmentType `json:"commitment_type"`
}

// DeleteServerRequest: delete server request.
Expand Down Expand Up @@ -929,6 +989,9 @@ type UpdateServerRequest struct {

// EnableVpc: activate or deactivate Private Network support for this server.
EnableVpc *bool `json:"enable_vpc,omitempty"`

// CommitmentType: change commitment. Use 'none' to automatically cancel a renewing commitment.
CommitmentType *CommitmentTypeValue `json:"commitment_type,omitempty"`
}

// This API allows you to manage your Apple silicon machines.
Expand Down

0 comments on commit 14067b3

Please sign in to comment.