Skip to content

Commit

Permalink
feat: use pointer to time.Time to allow null value (#523)
Browse files Browse the repository at this point in the history
Co-authored-by: Jerome Quere <jquere@scaleway.com>
  • Loading branch information
scaleway-bot and jerome-quere committed Aug 18, 2020
1 parent 8866bd0 commit 42f4b67
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 108 deletions.
4 changes: 2 additions & 2 deletions api/account/v2alpha1/account_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ type SSHKey struct {

Fingerprint string `json:"fingerprint"`

CreatedAt time.Time `json:"created_at"`
CreatedAt *time.Time `json:"created_at"`

UpdatedAt time.Time `json:"updated_at"`
UpdatedAt *time.Time `json:"updated_at"`

CreationInfo *SSHKeyCreationInfo `json:"creation_info"`

Expand Down
10 changes: 5 additions & 5 deletions api/baremetal/v1/baremetal_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ type BMCAccess struct {
// Password: the password to use for the BMC (Baseboard Management Controller) access authentification
Password string `json:"password"`
// ExpiresAt: the date after which the BMC (Baseboard Management Controller) access will be closed
ExpiresAt time.Time `json:"expires_at"`
ExpiresAt *time.Time `json:"expires_at"`
}

// CPU: cpu
Expand Down Expand Up @@ -547,9 +547,9 @@ type Server struct {
// Description: description of the server
Description string `json:"description"`
// UpdatedAt: date of last modification of the server
UpdatedAt time.Time `json:"updated_at"`
UpdatedAt *time.Time `json:"updated_at"`
// CreatedAt: date of creation of the server
CreatedAt time.Time `json:"created_at"`
CreatedAt *time.Time `json:"created_at"`
// Status: status of the server
//
// Default value: unknown
Expand Down Expand Up @@ -583,9 +583,9 @@ type ServerEvent struct {
// Action: the action that will be applied to the server
Action string `json:"action"`
// UpdatedAt: date of last modification of the action
UpdatedAt time.Time `json:"updated_at"`
UpdatedAt *time.Time `json:"updated_at"`
// CreatedAt: date of creation of the action
CreatedAt time.Time `json:"created_at"`
CreatedAt *time.Time `json:"created_at"`
}

type ServerInstall struct {
Expand Down
18 changes: 9 additions & 9 deletions api/baremetal/v1alpha1/baremetal_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,9 @@ type IPFailover struct {
// Tags: tags associated to the IP failover
Tags []string `json:"tags"`
// UpdatedAt: date of last update of the IP failover
UpdatedAt time.Time `json:"updated_at"`
UpdatedAt *time.Time `json:"updated_at"`
// CreatedAt: date of creation of the IP failover
CreatedAt time.Time `json:"created_at"`
CreatedAt *time.Time `json:"created_at"`
// Status: status of the IP failover
//
// Default value: unknown
Expand Down Expand Up @@ -692,9 +692,9 @@ type IPFailoverEvent struct {
// Default value: unknown
Action IPFailoverEventAction `json:"action"`
// UpdatedAt: date of last modification of the action
UpdatedAt time.Time `json:"updated_at"`
UpdatedAt *time.Time `json:"updated_at"`
// CreatedAt: date of creation of the action
CreatedAt time.Time `json:"created_at"`
CreatedAt *time.Time `json:"created_at"`
}

// ListIPFailoverEventsResponse: list ip failover events response
Expand Down Expand Up @@ -809,7 +809,7 @@ type RemoteServerAccess struct {
// Password: the password to use for the remote access authentification
Password string `json:"password"`
// ExpiresAt: the date after which the remote access will be closed
ExpiresAt time.Time `json:"expires_at"`
ExpiresAt *time.Time `json:"expires_at"`
}

// Server: server
Expand All @@ -823,9 +823,9 @@ type Server struct {
// Description: description of the server
Description string `json:"description"`
// UpdatedAt: date of last modification of the server
UpdatedAt time.Time `json:"updated_at"`
UpdatedAt *time.Time `json:"updated_at"`
// CreatedAt: date of creation of the server
CreatedAt time.Time `json:"created_at"`
CreatedAt *time.Time `json:"created_at"`
// Status: status of the server
//
// Default value: unknown
Expand Down Expand Up @@ -859,9 +859,9 @@ type ServerEvent struct {
// Action: the action that will be applied to the server
Action string `json:"action"`
// UpdatedAt: date of last modification of the action
UpdatedAt time.Time `json:"updated_at"`
UpdatedAt *time.Time `json:"updated_at"`
// CreatedAt: date of creation of the action
CreatedAt time.Time `json:"created_at"`
CreatedAt *time.Time `json:"created_at"`
}

// ServerInstall: server install
Expand Down
24 changes: 12 additions & 12 deletions api/domain/v2alpha2/domain_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ type DNSZone struct {

Message *string `json:"message"`

UpdatedAt time.Time `json:"updated_at"`
UpdatedAt *time.Time `json:"updated_at"`

OrganizationIDs []string `json:"organization_ids"`
}
Expand Down Expand Up @@ -1117,9 +1117,9 @@ type Domain struct {

Epp []string `json:"epp"`

ExpiredAt time.Time `json:"expired_at"`
ExpiredAt *time.Time `json:"expired_at"`

UpdatedAt time.Time `json:"updated_at"`
UpdatedAt *time.Time `json:"updated_at"`

Registrar string `json:"registrar"`

Expand Down Expand Up @@ -1178,9 +1178,9 @@ type DomainSummary struct {

Epp []string `json:"epp"`

ExpiredAt time.Time `json:"expired_at"`
ExpiredAt *time.Time `json:"expired_at"`

UpdatedAt time.Time `json:"updated_at"`
UpdatedAt *time.Time `json:"updated_at"`

Registrar string `json:"registrar"`

Expand Down Expand Up @@ -1223,7 +1223,7 @@ type ExtensionFR struct {
}

type ExtensionFRAssociationInfos struct {
PublicationJo time.Time `json:"publication_jo"`
PublicationJo *time.Time `json:"publication_jo"`

PublicationJoPage uint32 `json:"publication_jo_page"`
}
Expand Down Expand Up @@ -1560,7 +1560,7 @@ type RegisterExternalDomainResponse struct {

ValidationToken string `json:"validation_token"`

CreatedAt time.Time `json:"created_at"`
CreatedAt *time.Time `json:"created_at"`
}

// RestoreDNSZoneVersionResponse: restore dns zone version response
Expand All @@ -1584,9 +1584,9 @@ type Task struct {
// Default value: unavailable
Status TaskStatus `json:"status"`

StartedAt time.Time `json:"started_at"`
StartedAt *time.Time `json:"started_at"`

UpdatedAt time.Time `json:"updated_at"`
UpdatedAt *time.Time `json:"updated_at"`

ID string `json:"id"`

Expand Down Expand Up @@ -1640,7 +1640,7 @@ type UpdateDNSZoneRecordsResponse struct {
}

type Version struct {
CreatedAt time.Time `json:"created_at"`
CreatedAt *time.Time `json:"created_at"`
}

type ZoneSSL struct {
Expand All @@ -1656,9 +1656,9 @@ type ZoneSSL struct {

Certificate []string `json:"certificate"`

CreatedAt time.Time `json:"created_at"`
CreatedAt *time.Time `json:"created_at"`

ExpiredAt time.Time `json:"expired_at"`
ExpiredAt *time.Time `json:"expired_at"`
}

// Service API
Expand Down
40 changes: 20 additions & 20 deletions api/instance/v1/instance_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,9 @@ type Image struct {
// Default value: x86_64
Arch Arch `json:"arch"`

CreationDate time.Time `json:"creation_date"`
CreationDate *time.Time `json:"creation_date"`

ModificationDate time.Time `json:"modification_date"`
ModificationDate *time.Time `json:"modification_date"`

DefaultBootscript *Bootscript `json:"default_bootscript"`

Expand Down Expand Up @@ -933,9 +933,9 @@ type SecurityGroup struct {
// ProjectDefault: true if it is your default security group for this project id
ProjectDefault bool `json:"project_default"`
// CreationDate: the security group creation date
CreationDate time.Time `json:"creation_date"`
CreationDate *time.Time `json:"creation_date"`
// ModificationDate: the security group modification date
ModificationDate time.Time `json:"modification_date"`
ModificationDate *time.Time `json:"modification_date"`
// Servers: list of servers attached to this security group
Servers []*ServerSummary `json:"servers"`
// Stateful: true if the security group is stateful
Expand Down Expand Up @@ -1001,7 +1001,7 @@ type Server struct {
// CommercialType: the server commercial type (eg. GP1-M)
CommercialType string `json:"commercial_type"`
// CreationDate: the server creation date
CreationDate time.Time `json:"creation_date"`
CreationDate *time.Time `json:"creation_date"`
// DynamicIPRequired: true if a dynamic IP is required
DynamicIPRequired bool `json:"dynamic_ip_required"`
// EnableIPv6: true if IPv6 is enabled
Expand All @@ -1017,7 +1017,7 @@ type Server struct {
// PublicIP: information about the public IP
PublicIP *ServerIP `json:"public_ip"`
// ModificationDate: the server modification date
ModificationDate time.Time `json:"modification_date"`
ModificationDate *time.Time `json:"modification_date"`
// State: the server state
//
// Default value: running
Expand Down Expand Up @@ -1174,9 +1174,9 @@ type Snapshot struct {

BaseVolume *SnapshotBaseVolume `json:"base_volume"`

CreationDate time.Time `json:"creation_date"`
CreationDate *time.Time `json:"creation_date"`

ModificationDate time.Time `json:"modification_date"`
ModificationDate *time.Time `json:"modification_date"`

Project string `json:"project"`

Expand All @@ -1198,9 +1198,9 @@ type Task struct {
// Progress: the progress of the task in percent
Progress int32 `json:"progress"`
// StartedAt: the task start date
StartedAt time.Time `json:"started_at"`
StartedAt *time.Time `json:"started_at"`
// TerminatedAt: the task end date
TerminatedAt time.Time `json:"terminated_at"`
TerminatedAt *time.Time `json:"terminated_at"`
// Status: the task status
//
// Default value: pending
Expand Down Expand Up @@ -1248,9 +1248,9 @@ type Volume struct {
// Default value: l_ssd
VolumeType VolumeVolumeType `json:"volume_type"`
// CreationDate: the volumes creation date
CreationDate time.Time `json:"creation_date"`
CreationDate *time.Time `json:"creation_date"`
// ModificationDate: the volumes modification date
ModificationDate time.Time `json:"modification_date"`
ModificationDate *time.Time `json:"modification_date"`
// Organization: the volumes organization
Organization string `json:"organization"`
// Project: the volumes project ID
Expand Down Expand Up @@ -1757,7 +1757,7 @@ type setServerRequest struct {
// CommercialType: the server commercial type (eg. GP1-M)
CommercialType string `json:"commercial_type"`
// CreationDate: the server creation date
CreationDate time.Time `json:"creation_date"`
CreationDate *time.Time `json:"creation_date"`
// DynamicIPRequired: true if a dynamic IP is required
DynamicIPRequired bool `json:"dynamic_ip_required"`
// EnableIPv6: true if IPv6 is enabled
Expand All @@ -1773,7 +1773,7 @@ type setServerRequest struct {
// PublicIP: information about the public IP
PublicIP *ServerIP `json:"public_ip"`
// ModificationDate: the server modification date
ModificationDate time.Time `json:"modification_date"`
ModificationDate *time.Time `json:"modification_date"`
// State: the server state
//
// Default value: running
Expand Down Expand Up @@ -2298,9 +2298,9 @@ type SetImageRequest struct {
// Default value: x86_64
Arch Arch `json:"arch"`

CreationDate time.Time `json:"creation_date"`
CreationDate *time.Time `json:"creation_date"`

ModificationDate time.Time `json:"modification_date"`
ModificationDate *time.Time `json:"modification_date"`

DefaultBootscript *Bootscript `json:"default_bootscript"`

Expand Down Expand Up @@ -2604,9 +2604,9 @@ type SetSnapshotRequest struct {

BaseVolume *SnapshotBaseVolume `json:"base_volume"`

CreationDate time.Time `json:"creation_date"`
CreationDate *time.Time `json:"creation_date"`

ModificationDate time.Time `json:"modification_date"`
ModificationDate *time.Time `json:"modification_date"`

Project string `json:"project"`
}
Expand Down Expand Up @@ -3218,9 +3218,9 @@ type setSecurityGroupRequest struct {

Name string `json:"name"`

CreationDate time.Time `json:"creation_date"`
CreationDate *time.Time `json:"creation_date"`

ModificationDate time.Time `json:"modification_date"`
ModificationDate *time.Time `json:"modification_date"`

Description string `json:"description"`

Expand Down
Loading

0 comments on commit 42f4b67

Please sign in to comment.