@@ -314,6 +314,29 @@ func (enum *VolumeStatus) UnmarshalJSON(data []byte) error {
314314 return nil
315315}
316316
317+ // Reference: reference.
318+ type Reference struct {
319+ // ID: UUID of the reference.
320+ ID string `json:"id"`
321+
322+ // ProductResourceType: type of resource to which the reference is associated.
323+ ProductResourceType string `json:"product_resource_type"`
324+
325+ // ProductResourceID: UUID of the product resource it refers to (according to the product_resource_type).
326+ ProductResourceID string `json:"product_resource_id"`
327+
328+ // CreatedAt: creation date of the reference.
329+ CreatedAt * time.Time `json:"created_at"`
330+
331+ // Type: type of reference (link, exclusive, read_only).
332+ // Default value: unknown_type
333+ Type ReferenceType `json:"type"`
334+
335+ // Status: status of reference (attaching, attached, detaching).
336+ // Default value: unknown_status
337+ Status ReferenceStatus `json:"status"`
338+ }
339+
317340// SnapshotParentVolume: snapshot parent volume.
318341type SnapshotParentVolume struct {
319342 // ID: parent volume UUID (volume from which the snapshot originates).
@@ -340,29 +363,6 @@ type VolumeSpecifications struct {
340363 Class StorageClass `json:"class"`
341364}
342365
343- // Reference: reference.
344- type Reference struct {
345- // ID: UUID of the reference.
346- ID string `json:"id"`
347-
348- // ProductResourceType: type of resource to which the reference is associated.
349- ProductResourceType string `json:"product_resource_type"`
350-
351- // ProductResourceID: UUID of the product resource it refers to (according to the product_resource_type).
352- ProductResourceID string `json:"product_resource_id"`
353-
354- // CreatedAt: creation date of the reference.
355- CreatedAt * time.Time `json:"created_at"`
356-
357- // Type: type of reference (link, exclusive, read_only).
358- // Default value: unknown_type
359- Type ReferenceType `json:"type"`
360-
361- // Status: status of reference (attaching, attached, detaching).
362- // Default value: unknown_status
363- Status ReferenceStatus `json:"status"`
364- }
365-
366366// CreateVolumeRequestFromEmpty: create volume request from empty.
367367type CreateVolumeRequestFromEmpty struct {
368368 // Size: must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size.
@@ -379,18 +379,18 @@ type CreateVolumeRequestFromSnapshot struct {
379379 SnapshotID string `json:"snapshot_id"`
380380}
381381
382- // SnapshotSummary : snapshot summary .
383- type SnapshotSummary struct {
382+ // Snapshot : snapshot.
383+ type Snapshot struct {
384384 // ID: UUID of the snapshot.
385385 ID string `json:"id"`
386386
387387 // Name: name of the snapshot.
388388 Name string `json:"name"`
389389
390- // ParentVolume: if the parent volume has been deleted, value is null.
390+ // ParentVolume: if the parent volume was deleted, value is null.
391391 ParentVolume * SnapshotParentVolume `json:"parent_volume"`
392392
393- // Size: size of the snapshot in bytes .
393+ // Size: size in bytes of the snapshot.
394394 Size scw.Size `json:"size"`
395395
396396 // ProjectID: UUID of the project the snapshot belongs to.
@@ -402,14 +402,17 @@ type SnapshotSummary struct {
402402 // UpdatedAt: last modification date of the properties of a snapshot.
403403 UpdatedAt * time.Time `json:"updated_at"`
404404
405+ // References: list of the references to the snapshot.
406+ References []* Reference `json:"references"`
407+
405408 // Status: current status of the snapshot (available, in_use, ...).
406409 // Default value: unknown_status
407410 Status SnapshotStatus `json:"status"`
408411
409412 // Tags: list of tags assigned to the volume.
410413 Tags []string `json:"tags"`
411414
412- // Zone: snapshot Availability Zone .
415+ // Zone: snapshot zone .
413416 Zone scw.Zone `json:"zone"`
414417
415418 // Class: storage class of the snapshot.
@@ -590,7 +593,7 @@ type ListSnapshotsRequest struct {
590593// ListSnapshotsResponse: list snapshots response.
591594type ListSnapshotsResponse struct {
592595 // Snapshots: paginated returned list of snapshots.
593- Snapshots []* SnapshotSummary `json:"snapshots"`
596+ Snapshots []* Snapshot `json:"snapshots"`
594597
595598 // TotalCount: total number of snpashots in the project.
596599 TotalCount uint64 `json:"total_count"`
@@ -711,47 +714,6 @@ func (r *ListVolumesResponse) UnsafeAppend(res interface{}) (uint64, error) {
711714 return uint64 (len (results .Volumes )), nil
712715}
713716
714- // Snapshot: snapshot.
715- type Snapshot struct {
716- // ID: UUID of the snapshot.
717- ID string `json:"id"`
718-
719- // Name: name of the snapshot.
720- Name string `json:"name"`
721-
722- // ParentVolume: if the parent volume was deleted, value is null.
723- ParentVolume * SnapshotParentVolume `json:"parent_volume"`
724-
725- // Size: size in bytes of the snapshot.
726- Size scw.Size `json:"size"`
727-
728- // ProjectID: UUID of the project the snapshot belongs to.
729- ProjectID string `json:"project_id"`
730-
731- // CreatedAt: creation date of the snapshot.
732- CreatedAt * time.Time `json:"created_at"`
733-
734- // UpdatedAt: last modification date of the properties of a snapshot.
735- UpdatedAt * time.Time `json:"updated_at"`
736-
737- // References: list of the references to the snapshot.
738- References []* Reference `json:"references"`
739-
740- // Status: current status of the snapshot (available, in_use, ...).
741- // Default value: unknown_status
742- Status SnapshotStatus `json:"status"`
743-
744- // Tags: list of tags assigned to the volume.
745- Tags []string `json:"tags"`
746-
747- // Zone: snapshot zone.
748- Zone scw.Zone `json:"zone"`
749-
750- // Class: storage class of the snapshot.
751- // Default value: unknown_storage_class
752- Class StorageClass `json:"class"`
753- }
754-
755717// UpdateSnapshotRequest: update snapshot request.
756718type UpdateSnapshotRequest struct {
757719 // Zone: zone to target. If none is passed will use default zone from the config.
0 commit comments