Skip to content

Commit 42f4b67

Browse files
feat: use pointer to time.Time to allow null value (#523)
Co-authored-by: Jerome Quere <[email protected]>
1 parent 8866bd0 commit 42f4b67

File tree

14 files changed

+108
-108
lines changed

14 files changed

+108
-108
lines changed

api/account/v2alpha1/account_sdk.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ type SSHKey struct {
108108

109109
Fingerprint string `json:"fingerprint"`
110110

111-
CreatedAt time.Time `json:"created_at"`
111+
CreatedAt *time.Time `json:"created_at"`
112112

113-
UpdatedAt time.Time `json:"updated_at"`
113+
UpdatedAt *time.Time `json:"updated_at"`
114114

115115
CreationInfo *SSHKeyCreationInfo `json:"creation_info"`
116116

api/baremetal/v1/baremetal_sdk.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ type BMCAccess struct {
378378
// Password: the password to use for the BMC (Baseboard Management Controller) access authentification
379379
Password string `json:"password"`
380380
// ExpiresAt: the date after which the BMC (Baseboard Management Controller) access will be closed
381-
ExpiresAt time.Time `json:"expires_at"`
381+
ExpiresAt *time.Time `json:"expires_at"`
382382
}
383383

384384
// CPU: cpu
@@ -547,9 +547,9 @@ type Server struct {
547547
// Description: description of the server
548548
Description string `json:"description"`
549549
// UpdatedAt: date of last modification of the server
550-
UpdatedAt time.Time `json:"updated_at"`
550+
UpdatedAt *time.Time `json:"updated_at"`
551551
// CreatedAt: date of creation of the server
552-
CreatedAt time.Time `json:"created_at"`
552+
CreatedAt *time.Time `json:"created_at"`
553553
// Status: status of the server
554554
//
555555
// Default value: unknown
@@ -583,9 +583,9 @@ type ServerEvent struct {
583583
// Action: the action that will be applied to the server
584584
Action string `json:"action"`
585585
// UpdatedAt: date of last modification of the action
586-
UpdatedAt time.Time `json:"updated_at"`
586+
UpdatedAt *time.Time `json:"updated_at"`
587587
// CreatedAt: date of creation of the action
588-
CreatedAt time.Time `json:"created_at"`
588+
CreatedAt *time.Time `json:"created_at"`
589589
}
590590

591591
type ServerInstall struct {

api/baremetal/v1alpha1/baremetal_sdk.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,9 @@ type IPFailover struct {
654654
// Tags: tags associated to the IP failover
655655
Tags []string `json:"tags"`
656656
// UpdatedAt: date of last update of the IP failover
657-
UpdatedAt time.Time `json:"updated_at"`
657+
UpdatedAt *time.Time `json:"updated_at"`
658658
// CreatedAt: date of creation of the IP failover
659-
CreatedAt time.Time `json:"created_at"`
659+
CreatedAt *time.Time `json:"created_at"`
660660
// Status: status of the IP failover
661661
//
662662
// Default value: unknown
@@ -692,9 +692,9 @@ type IPFailoverEvent struct {
692692
// Default value: unknown
693693
Action IPFailoverEventAction `json:"action"`
694694
// UpdatedAt: date of last modification of the action
695-
UpdatedAt time.Time `json:"updated_at"`
695+
UpdatedAt *time.Time `json:"updated_at"`
696696
// CreatedAt: date of creation of the action
697-
CreatedAt time.Time `json:"created_at"`
697+
CreatedAt *time.Time `json:"created_at"`
698698
}
699699

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

815815
// Server: server
@@ -823,9 +823,9 @@ type Server struct {
823823
// Description: description of the server
824824
Description string `json:"description"`
825825
// UpdatedAt: date of last modification of the server
826-
UpdatedAt time.Time `json:"updated_at"`
826+
UpdatedAt *time.Time `json:"updated_at"`
827827
// CreatedAt: date of creation of the server
828-
CreatedAt time.Time `json:"created_at"`
828+
CreatedAt *time.Time `json:"created_at"`
829829
// Status: status of the server
830830
//
831831
// Default value: unknown
@@ -859,9 +859,9 @@ type ServerEvent struct {
859859
// Action: the action that will be applied to the server
860860
Action string `json:"action"`
861861
// UpdatedAt: date of last modification of the action
862-
UpdatedAt time.Time `json:"updated_at"`
862+
UpdatedAt *time.Time `json:"updated_at"`
863863
// CreatedAt: date of creation of the action
864-
CreatedAt time.Time `json:"created_at"`
864+
CreatedAt *time.Time `json:"created_at"`
865865
}
866866

867867
// ServerInstall: server install

api/domain/v2alpha2/domain_sdk.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ type DNSZone struct {
10591059

10601060
Message *string `json:"message"`
10611061

1062-
UpdatedAt time.Time `json:"updated_at"`
1062+
UpdatedAt *time.Time `json:"updated_at"`
10631063

10641064
OrganizationIDs []string `json:"organization_ids"`
10651065
}
@@ -1117,9 +1117,9 @@ type Domain struct {
11171117

11181118
Epp []string `json:"epp"`
11191119

1120-
ExpiredAt time.Time `json:"expired_at"`
1120+
ExpiredAt *time.Time `json:"expired_at"`
11211121

1122-
UpdatedAt time.Time `json:"updated_at"`
1122+
UpdatedAt *time.Time `json:"updated_at"`
11231123

11241124
Registrar string `json:"registrar"`
11251125

@@ -1178,9 +1178,9 @@ type DomainSummary struct {
11781178

11791179
Epp []string `json:"epp"`
11801180

1181-
ExpiredAt time.Time `json:"expired_at"`
1181+
ExpiredAt *time.Time `json:"expired_at"`
11821182

1183-
UpdatedAt time.Time `json:"updated_at"`
1183+
UpdatedAt *time.Time `json:"updated_at"`
11841184

11851185
Registrar string `json:"registrar"`
11861186

@@ -1223,7 +1223,7 @@ type ExtensionFR struct {
12231223
}
12241224

12251225
type ExtensionFRAssociationInfos struct {
1226-
PublicationJo time.Time `json:"publication_jo"`
1226+
PublicationJo *time.Time `json:"publication_jo"`
12271227

12281228
PublicationJoPage uint32 `json:"publication_jo_page"`
12291229
}
@@ -1560,7 +1560,7 @@ type RegisterExternalDomainResponse struct {
15601560

15611561
ValidationToken string `json:"validation_token"`
15621562

1563-
CreatedAt time.Time `json:"created_at"`
1563+
CreatedAt *time.Time `json:"created_at"`
15641564
}
15651565

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

1587-
StartedAt time.Time `json:"started_at"`
1587+
StartedAt *time.Time `json:"started_at"`
15881588

1589-
UpdatedAt time.Time `json:"updated_at"`
1589+
UpdatedAt *time.Time `json:"updated_at"`
15901590

15911591
ID string `json:"id"`
15921592

@@ -1640,7 +1640,7 @@ type UpdateDNSZoneRecordsResponse struct {
16401640
}
16411641

16421642
type Version struct {
1643-
CreatedAt time.Time `json:"created_at"`
1643+
CreatedAt *time.Time `json:"created_at"`
16441644
}
16451645

16461646
type ZoneSSL struct {
@@ -1656,9 +1656,9 @@ type ZoneSSL struct {
16561656

16571657
Certificate []string `json:"certificate"`
16581658

1659-
CreatedAt time.Time `json:"created_at"`
1659+
CreatedAt *time.Time `json:"created_at"`
16601660

1661-
ExpiredAt time.Time `json:"expired_at"`
1661+
ExpiredAt *time.Time `json:"expired_at"`
16621662
}
16631663

16641664
// Service API

api/instance/v1/instance_sdk.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -769,9 +769,9 @@ type Image struct {
769769
// Default value: x86_64
770770
Arch Arch `json:"arch"`
771771

772-
CreationDate time.Time `json:"creation_date"`
772+
CreationDate *time.Time `json:"creation_date"`
773773

774-
ModificationDate time.Time `json:"modification_date"`
774+
ModificationDate *time.Time `json:"modification_date"`
775775

776776
DefaultBootscript *Bootscript `json:"default_bootscript"`
777777

@@ -933,9 +933,9 @@ type SecurityGroup struct {
933933
// ProjectDefault: true if it is your default security group for this project id
934934
ProjectDefault bool `json:"project_default"`
935935
// CreationDate: the security group creation date
936-
CreationDate time.Time `json:"creation_date"`
936+
CreationDate *time.Time `json:"creation_date"`
937937
// ModificationDate: the security group modification date
938-
ModificationDate time.Time `json:"modification_date"`
938+
ModificationDate *time.Time `json:"modification_date"`
939939
// Servers: list of servers attached to this security group
940940
Servers []*ServerSummary `json:"servers"`
941941
// Stateful: true if the security group is stateful
@@ -1001,7 +1001,7 @@ type Server struct {
10011001
// CommercialType: the server commercial type (eg. GP1-M)
10021002
CommercialType string `json:"commercial_type"`
10031003
// CreationDate: the server creation date
1004-
CreationDate time.Time `json:"creation_date"`
1004+
CreationDate *time.Time `json:"creation_date"`
10051005
// DynamicIPRequired: true if a dynamic IP is required
10061006
DynamicIPRequired bool `json:"dynamic_ip_required"`
10071007
// EnableIPv6: true if IPv6 is enabled
@@ -1017,7 +1017,7 @@ type Server struct {
10171017
// PublicIP: information about the public IP
10181018
PublicIP *ServerIP `json:"public_ip"`
10191019
// ModificationDate: the server modification date
1020-
ModificationDate time.Time `json:"modification_date"`
1020+
ModificationDate *time.Time `json:"modification_date"`
10211021
// State: the server state
10221022
//
10231023
// Default value: running
@@ -1174,9 +1174,9 @@ type Snapshot struct {
11741174

11751175
BaseVolume *SnapshotBaseVolume `json:"base_volume"`
11761176

1177-
CreationDate time.Time `json:"creation_date"`
1177+
CreationDate *time.Time `json:"creation_date"`
11781178

1179-
ModificationDate time.Time `json:"modification_date"`
1179+
ModificationDate *time.Time `json:"modification_date"`
11801180

11811181
Project string `json:"project"`
11821182

@@ -1198,9 +1198,9 @@ type Task struct {
11981198
// Progress: the progress of the task in percent
11991199
Progress int32 `json:"progress"`
12001200
// StartedAt: the task start date
1201-
StartedAt time.Time `json:"started_at"`
1201+
StartedAt *time.Time `json:"started_at"`
12021202
// TerminatedAt: the task end date
1203-
TerminatedAt time.Time `json:"terminated_at"`
1203+
TerminatedAt *time.Time `json:"terminated_at"`
12041204
// Status: the task status
12051205
//
12061206
// Default value: pending
@@ -1248,9 +1248,9 @@ type Volume struct {
12481248
// Default value: l_ssd
12491249
VolumeType VolumeVolumeType `json:"volume_type"`
12501250
// CreationDate: the volumes creation date
1251-
CreationDate time.Time `json:"creation_date"`
1251+
CreationDate *time.Time `json:"creation_date"`
12521252
// ModificationDate: the volumes modification date
1253-
ModificationDate time.Time `json:"modification_date"`
1253+
ModificationDate *time.Time `json:"modification_date"`
12541254
// Organization: the volumes organization
12551255
Organization string `json:"organization"`
12561256
// Project: the volumes project ID
@@ -1757,7 +1757,7 @@ type setServerRequest struct {
17571757
// CommercialType: the server commercial type (eg. GP1-M)
17581758
CommercialType string `json:"commercial_type"`
17591759
// CreationDate: the server creation date
1760-
CreationDate time.Time `json:"creation_date"`
1760+
CreationDate *time.Time `json:"creation_date"`
17611761
// DynamicIPRequired: true if a dynamic IP is required
17621762
DynamicIPRequired bool `json:"dynamic_ip_required"`
17631763
// EnableIPv6: true if IPv6 is enabled
@@ -1773,7 +1773,7 @@ type setServerRequest struct {
17731773
// PublicIP: information about the public IP
17741774
PublicIP *ServerIP `json:"public_ip"`
17751775
// ModificationDate: the server modification date
1776-
ModificationDate time.Time `json:"modification_date"`
1776+
ModificationDate *time.Time `json:"modification_date"`
17771777
// State: the server state
17781778
//
17791779
// Default value: running
@@ -2298,9 +2298,9 @@ type SetImageRequest struct {
22982298
// Default value: x86_64
22992299
Arch Arch `json:"arch"`
23002300

2301-
CreationDate time.Time `json:"creation_date"`
2301+
CreationDate *time.Time `json:"creation_date"`
23022302

2303-
ModificationDate time.Time `json:"modification_date"`
2303+
ModificationDate *time.Time `json:"modification_date"`
23042304

23052305
DefaultBootscript *Bootscript `json:"default_bootscript"`
23062306

@@ -2604,9 +2604,9 @@ type SetSnapshotRequest struct {
26042604

26052605
BaseVolume *SnapshotBaseVolume `json:"base_volume"`
26062606

2607-
CreationDate time.Time `json:"creation_date"`
2607+
CreationDate *time.Time `json:"creation_date"`
26082608

2609-
ModificationDate time.Time `json:"modification_date"`
2609+
ModificationDate *time.Time `json:"modification_date"`
26102610

26112611
Project string `json:"project"`
26122612
}
@@ -3218,9 +3218,9 @@ type setSecurityGroupRequest struct {
32183218

32193219
Name string `json:"name"`
32203220

3221-
CreationDate time.Time `json:"creation_date"`
3221+
CreationDate *time.Time `json:"creation_date"`
32223222

3223-
ModificationDate time.Time `json:"modification_date"`
3223+
ModificationDate *time.Time `json:"modification_date"`
32243224

32253225
Description string `json:"description"`
32263226

0 commit comments

Comments
 (0)