mirror of
https://github.com/restic/restic.git
synced 2025-12-08 06:09:56 +00:00
Update vendored dependencies
This includes github.com/kurin/blazer 0.2.0, which resolves #1291
This commit is contained in:
parent
ba23d24dd1
commit
61cb1cc6f8
1044 changed files with 203022 additions and 97709 deletions
102
vendor/github.com/Azure/azure-sdk-for-go/arm/postgresql/models.go
generated
vendored
102
vendor/github.com/Azure/azure-sdk-for-go/arm/postgresql/models.go
generated
vendored
|
|
@ -14,24 +14,23 @@ package postgresql
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/date"
|
||||
)
|
||||
|
||||
// CreateMode enumerates the mode to create a new server
|
||||
// CreateMode enumerates the values for create mode.
|
||||
type CreateMode string
|
||||
|
||||
const (
|
||||
// CreateModeDefault specifies the mode to create a new server
|
||||
// CreateModeDefault specifies the create mode default state for create mode.
|
||||
CreateModeDefault CreateMode = "Default"
|
||||
// CreateModePointInTimeRestore specifies the mode to create a new server
|
||||
// CreateModePointInTimeRestore specifies the create mode point in time restore state for create mode.
|
||||
CreateModePointInTimeRestore CreateMode = "PointInTimeRestore"
|
||||
)
|
||||
|
||||
|
|
@ -229,15 +228,16 @@ type ServerForCreate struct {
|
|||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON is the custom unmarshaler for ServerForCreate model
|
||||
func (sfc *ServerForCreate) UnmarshalJSON(b []byte) error {
|
||||
// UnmarshalJSON is the custom unmarshaler for ServerForCreate struct.
|
||||
func (sfc *ServerForCreate) UnmarshalJSON(body []byte) error {
|
||||
var m map[string]*json.RawMessage
|
||||
err := json.Unmarshal(b, &m)
|
||||
err := json.Unmarshal(body, &m)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var v *json.RawMessage
|
||||
|
||||
v := m["sku"]
|
||||
v = m["sku"]
|
||||
if v != nil {
|
||||
var sku Sku
|
||||
err = json.Unmarshal(*m["sku"], &sku)
|
||||
|
|
@ -249,11 +249,11 @@ func (sfc *ServerForCreate) UnmarshalJSON(b []byte) error {
|
|||
|
||||
v = m["properties"]
|
||||
if v != nil {
|
||||
p, err := unmarshalServerPropertiesForCreate(*m["properties"])
|
||||
properties, err := unmarshalServerPropertiesForCreate(*m["properties"])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
sfc.Properties = p
|
||||
sfc.Properties = properties
|
||||
}
|
||||
|
||||
v = m["location"]
|
||||
|
|
@ -279,27 +279,6 @@ func (sfc *ServerForCreate) UnmarshalJSON(b []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func unmarshalServerPropertiesForCreate(b []byte) (ServerPropertiesForCreate, error) {
|
||||
var m map[string]interface{}
|
||||
err := json.Unmarshal(b, &m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch m["createMode"] {
|
||||
case string(CreateModeDefault):
|
||||
var spfdc ServerPropertiesForDefaultCreate
|
||||
err := json.Unmarshal(b, &spfdc)
|
||||
return spfdc, err
|
||||
case string(CreateModePointInTimeRestore):
|
||||
var spfr ServerPropertiesForRestore
|
||||
err := json.Unmarshal(b, &spfr)
|
||||
return spfr, err
|
||||
default:
|
||||
return nil, errors.New("Unsupported type")
|
||||
}
|
||||
}
|
||||
|
||||
// ServerListResult is a list of servers.
|
||||
type ServerListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
|
|
@ -316,23 +295,62 @@ type ServerProperties struct {
|
|||
FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
|
||||
}
|
||||
|
||||
// ServerPropertiesForCreate is interface used for polymorphic Properties in ServerForCreate
|
||||
// ServerPropertiesForCreate is the properties used to create a new server.
|
||||
type ServerPropertiesForCreate interface {
|
||||
AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool)
|
||||
AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool)
|
||||
}
|
||||
|
||||
func unmarshalServerPropertiesForCreate(body []byte) (ServerPropertiesForCreate, error) {
|
||||
var m map[string]interface{}
|
||||
err := json.Unmarshal(body, &m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch m["createMode"] {
|
||||
case string(CreateModeDefault):
|
||||
var spfdc ServerPropertiesForDefaultCreate
|
||||
err := json.Unmarshal(body, &spfdc)
|
||||
return spfdc, err
|
||||
case string(CreateModePointInTimeRestore):
|
||||
var spfr ServerPropertiesForRestore
|
||||
err := json.Unmarshal(body, &spfr)
|
||||
return spfr, err
|
||||
default:
|
||||
return nil, errors.New("Unsupported type")
|
||||
}
|
||||
}
|
||||
func unmarshalServerPropertiesForCreateArray(body []byte) ([]ServerPropertiesForCreate, error) {
|
||||
var rawMessages []*json.RawMessage
|
||||
err := json.Unmarshal(body, &rawMessages)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
spfcArray := make([]ServerPropertiesForCreate, len(rawMessages))
|
||||
|
||||
for index, rawMessage := range rawMessages {
|
||||
spfc, err := unmarshalServerPropertiesForCreate(*rawMessage)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
spfcArray[index] = spfc
|
||||
}
|
||||
return spfcArray, nil
|
||||
}
|
||||
|
||||
// ServerPropertiesForDefaultCreate is the properties used to create a new server.
|
||||
type ServerPropertiesForDefaultCreate struct {
|
||||
CreateMode CreateMode `json:"createMode,omitempty"`
|
||||
StorageMB *int64 `json:"storageMB,omitempty"`
|
||||
Version ServerVersion `json:"version,omitempty"`
|
||||
SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"`
|
||||
CreateMode CreateMode `json:"createMode,omitempty"`
|
||||
AdministratorLogin *string `json:"administratorLogin,omitempty"`
|
||||
AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON is the custom marshaler for ServerPropertiesForDefaultCreate
|
||||
// MarshalJSON is the custom marshaler for ServerPropertiesForDefaultCreate.
|
||||
func (spfdc ServerPropertiesForDefaultCreate) MarshalJSON() ([]byte, error) {
|
||||
spfdc.CreateMode = CreateModeDefault
|
||||
type Alias ServerPropertiesForDefaultCreate
|
||||
|
|
@ -343,27 +361,27 @@ func (spfdc ServerPropertiesForDefaultCreate) MarshalJSON() ([]byte, error) {
|
|||
})
|
||||
}
|
||||
|
||||
// AsServerPropertiesForDefaultCreate is the IServerPropertiesForCreate for ServerPropertiesForDefaultCreate
|
||||
// AsServerPropertiesForDefaultCreate is the ServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate.
|
||||
func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) {
|
||||
return &spfdc, true
|
||||
}
|
||||
|
||||
// AsServerPropertiesForRestore is the IServerPropertiesForCreate for ServerPropertiesForDefaultCreate
|
||||
// AsServerPropertiesForRestore is the ServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate.
|
||||
func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// ServerPropertiesForRestore is the properties to a new server by restoring from a backup.
|
||||
type ServerPropertiesForRestore struct {
|
||||
CreateMode CreateMode `json:"createMode,omitempty"`
|
||||
StorageMB *int64 `json:"storageMB,omitempty"`
|
||||
Version ServerVersion `json:"version,omitempty"`
|
||||
SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"`
|
||||
CreateMode CreateMode `json:"createMode,omitempty"`
|
||||
SourceServerID *string `json:"sourceServerId,omitempty"`
|
||||
RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON is the custom marshaler for ServerPropertiesForRestore
|
||||
// MarshalJSON is the custom marshaler for ServerPropertiesForRestore.
|
||||
func (spfr ServerPropertiesForRestore) MarshalJSON() ([]byte, error) {
|
||||
spfr.CreateMode = CreateModePointInTimeRestore
|
||||
type Alias ServerPropertiesForRestore
|
||||
|
|
@ -374,14 +392,14 @@ func (spfr ServerPropertiesForRestore) MarshalJSON() ([]byte, error) {
|
|||
})
|
||||
}
|
||||
|
||||
// AsServerPropertiesForDefaultCreate is the IServerPropertiesForCreate for ServerPropertiesForRestore
|
||||
// AsServerPropertiesForDefaultCreate is the ServerPropertiesForCreate implementation for ServerPropertiesForRestore.
|
||||
func (spfr ServerPropertiesForRestore) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// AsServerPropertiesForRestore is the IServerPropertiesForCreate for ServerPropertiesForRestore
|
||||
// AsServerPropertiesForRestore is the ServerPropertiesForCreate implementation for ServerPropertiesForRestore.
|
||||
func (spfr ServerPropertiesForRestore) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) {
|
||||
return &spfr, false
|
||||
return &spfr, true
|
||||
}
|
||||
|
||||
// ServerUpdateParameters is parameters allowd to update for a server.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue