From db139bb6edf2cb103a655e5b23e193834751affe Mon Sep 17 00:00:00 2001 From: "Cuong. Duong Manh" Date: Thu, 30 May 2024 13:14:50 +0700 Subject: [PATCH] [feat] enhance api create volume --- .../services/volume/v2/blockvolume_request.go | 16 ++++++++++++++++ vngcloud/services/volume/v2/irequest.go | 1 + 2 files changed, 17 insertions(+) diff --git a/vngcloud/services/volume/v2/blockvolume_request.go b/vngcloud/services/volume/v2/blockvolume_request.go index dfc0b35..408a2b3 100644 --- a/vngcloud/services/volume/v2/blockvolume_request.go +++ b/vngcloud/services/volume/v2/blockvolume_request.go @@ -125,6 +125,22 @@ func (s *CreateBlockVolumeRequest) ToMap() map[string]interface{} { } } +func (s *CreateBlockVolumeRequest) GetListParameters() []interface{} { + return []interface{}{ + "backupVolumePointId", s.BackupVolumePointId, + "createdFrom", s.CreatedFrom, + "encryptionType", s.EncryptionType, + "multiAttach", s.MultiAttach, + "name", s.Name, + "size", s.Size, + "volumeTypeId", s.VolumeTypeId, + "tags", s.Tags, + "isPoc", s.IsPoc, + "isEnableAutoRenew", s.IsEnableAutoRenew, + "configVolumeRestore", s.ConfigureVolumeRestore, + } +} + func (s *CreateBlockVolumeRequest) WithPoc(pisPoc bool) ICreateBlockVolumeRequest { s.IsPoc = pisPoc return s diff --git a/vngcloud/services/volume/v2/irequest.go b/vngcloud/services/volume/v2/irequest.go index 6f84a12..9d7acc2 100644 --- a/vngcloud/services/volume/v2/irequest.go +++ b/vngcloud/services/volume/v2/irequest.go @@ -3,6 +3,7 @@ package v2 type ICreateBlockVolumeRequest interface { ToRequestBody() interface{} ToMap() map[string]interface{} + GetListParameters() []interface{} WithPoc(pisPoc bool) ICreateBlockVolumeRequest WithAutoRenew(pval bool) ICreateBlockVolumeRequest WithMultiAttach(pmultiAttach bool) ICreateBlockVolumeRequest