Update vendored dependencies

This includes github.com/kurin/blazer 0.2.0, which resolves #1291
This commit is contained in:
Alexander Neumann 2017-10-01 10:13:39 +02:00
parent ba23d24dd1
commit 61cb1cc6f8
1044 changed files with 203022 additions and 97709 deletions

View file

@ -18,7 +18,7 @@ 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 (

View file

@ -14,7 +14,7 @@ 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 (

View file

@ -14,7 +14,7 @@ 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 (

View file

@ -14,7 +14,7 @@ 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 (

View file

@ -14,7 +14,7 @@ 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 (

View file

@ -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.

View file

@ -14,7 +14,7 @@ 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 (

View file

@ -1,5 +1,19 @@
package postgresql
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import (
"encoding/json"
"testing"
@ -23,9 +37,9 @@ var (
"capacity": 100
},
"properties": {
"createMode": "Default",
"storageMB": 1024,
"sslEnforcement": "Enabled",
"createMode": "Default",
"administratorLogin": "cloudsa",
"administratorLoginPassword": "password"
},

View file

@ -14,7 +14,7 @@ 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 (
@ -40,14 +40,14 @@ func NewServersClientWithBaseURI(baseURI string, subscriptionID string) ServersC
return ServersClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate creates a new server or updates an existing server. The update action will overwrite the existing
// server. This method may poll for completion. Polling can be canceled by passing the cancel channel argument. The
// channel will be used to cancel polling and any outstanding HTTP requests.
// Create creates a new server, or will overwrite an existing server. This method may poll for completion. Polling can
// be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding
// HTTP requests.
//
// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the
// Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required
// parameters for creating or updating a server.
func (client ServersClient) CreateOrUpdate(resourceGroupName string, serverName string, parameters ServerForCreate, cancel <-chan struct{}) (<-chan Server, <-chan error) {
func (client ServersClient) Create(resourceGroupName string, serverName string, parameters ServerForCreate, cancel <-chan struct{}) (<-chan Server, <-chan error) {
resultChan := make(chan Server, 1)
errChan := make(chan error, 1)
if err := validation.Validate([]validation.Validation{
@ -61,7 +61,7 @@ func (client ServersClient) CreateOrUpdate(resourceGroupName string, serverName
Chain: []validation.Constraint{{Target: "parameters.Properties.StorageMB", Name: validation.InclusiveMinimum, Rule: 1024, Chain: nil}}},
}},
{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
errChan <- validation.NewErrorWithValidationError(err, "postgresql.ServersClient", "CreateOrUpdate")
errChan <- validation.NewErrorWithValidationError(err, "postgresql.ServersClient", "Create")
close(errChan)
close(resultChan)
return resultChan, errChan
@ -78,29 +78,29 @@ func (client ServersClient) CreateOrUpdate(resourceGroupName string, serverName
close(resultChan)
close(errChan)
}()
req, err := client.CreateOrUpdatePreparer(resourceGroupName, serverName, parameters, cancel)
req, err := client.CreatePreparer(resourceGroupName, serverName, parameters, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "CreateOrUpdate", nil, "Failure preparing request")
err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "Create", nil, "Failure preparing request")
return
}
resp, err := client.CreateOrUpdateSender(req)
resp, err := client.CreateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "CreateOrUpdate", resp, "Failure sending request")
err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "Create", resp, "Failure sending request")
return
}
result, err = client.CreateOrUpdateResponder(resp)
result, err = client.CreateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "CreateOrUpdate", resp, "Failure responding to request")
err = autorest.NewErrorWithError(err, "postgresql.ServersClient", "Create", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client ServersClient) CreateOrUpdatePreparer(resourceGroupName string, serverName string, parameters ServerForCreate, cancel <-chan struct{}) (*http.Request, error) {
// CreatePreparer prepares the Create request.
func (client ServersClient) CreatePreparer(resourceGroupName string, serverName string, parameters ServerForCreate, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"serverName": autorest.Encode("path", serverName),
@ -122,17 +122,17 @@ func (client ServersClient) CreateOrUpdatePreparer(resourceGroupName string, ser
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// CreateSender sends the Create request. The method will close the
// http.Response Body if it receives an error.
func (client ServersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
func (client ServersClient) CreateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// CreateResponder handles the response to the Create request. The method always
// closes the http.Response Body.
func (client ServersClient) CreateOrUpdateResponder(resp *http.Response) (result Server, err error) {
func (client ServersClient) CreateResponder(resp *http.Response) (result Server, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),

View file

@ -14,15 +14,15 @@ package postgresql
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 2.2.18.0
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return "Azure-SDK-For-Go/v10.3.1-beta arm-postgresql/2017-04-30-preview"
return "Azure-SDK-For-Go/v11.0.0-beta arm-postgresql/2017-04-30-preview"
}
// Version returns the semantic version (see http://semver.org) of the client.
func Version() string {
return "v10.3.1-beta"
return "v11.0.0-beta"
}