Add Sync, Bandwidth and Health Check Period to replication set (#771)

* Add Sync, Bandwidth and Health Check Period to replication set

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>

* Update Columns

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>

* Add Prefix and Tags

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>

* Last fields

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Daniel Valdivia
2021-05-27 16:25:00 -07:00
committed by GitHub
parent 49f0b83613
commit 59c4ac6336
25 changed files with 852 additions and 244 deletions

View File

@@ -23,6 +23,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"strconv"
"github.com/go-openapi/errors"
@@ -41,19 +42,44 @@ type MultiBucketReplication struct {
// Min Length: 3
AccessKey *string `json:"accessKey"`
// bandwidth
Bandwidth int64 `json:"bandwidth,omitempty"`
// buckets relation
// Required: true
// Min Length: 1
BucketsRelation []*MultiBucketsRelation `json:"bucketsRelation"`
// health check period
HealthCheckPeriod int32 `json:"healthCheckPeriod,omitempty"`
// prefix
Prefix string `json:"prefix,omitempty"`
// region
Region string `json:"region,omitempty"`
// replicate delete markers
ReplicateDeleteMarkers bool `json:"replicateDeleteMarkers,omitempty"`
// replicate deletes
ReplicateDeletes bool `json:"replicateDeletes,omitempty"`
// replicate metadata
ReplicateMetadata bool `json:"replicateMetadata,omitempty"`
// secret key
// Required: true
// Min Length: 8
SecretKey *string `json:"secretKey"`
// sync mode
// Enum: [async sync]
SyncMode *string `json:"syncMode,omitempty"`
// tags
Tags string `json:"tags,omitempty"`
// target URL
// Required: true
TargetURL *string `json:"targetURL"`
@@ -75,6 +101,10 @@ func (m *MultiBucketReplication) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateSyncMode(formats); err != nil {
res = append(res, err)
}
if err := m.validateTargetURL(formats); err != nil {
res = append(res, err)
}
@@ -136,6 +166,49 @@ func (m *MultiBucketReplication) validateSecretKey(formats strfmt.Registry) erro
return nil
}
var multiBucketReplicationTypeSyncModePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["async","sync"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
multiBucketReplicationTypeSyncModePropEnum = append(multiBucketReplicationTypeSyncModePropEnum, v)
}
}
const (
// MultiBucketReplicationSyncModeAsync captures enum value "async"
MultiBucketReplicationSyncModeAsync string = "async"
// MultiBucketReplicationSyncModeSync captures enum value "sync"
MultiBucketReplicationSyncModeSync string = "sync"
)
// prop value enum
func (m *MultiBucketReplication) validateSyncModeEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, multiBucketReplicationTypeSyncModePropEnum, true); err != nil {
return err
}
return nil
}
func (m *MultiBucketReplication) validateSyncMode(formats strfmt.Registry) error {
if swag.IsZero(m.SyncMode) { // not required
return nil
}
// value enum
if err := m.validateSyncModeEnum("syncMode", "body", *m.SyncMode); err != nil {
return err
}
return nil
}
func (m *MultiBucketReplication) validateTargetURL(formats strfmt.Registry) error {
if err := validate.Required("targetURL", "body", m.TargetURL); err != nil {