vendor: update all dependencies to latest versions

This commit is contained in:
Nick Craig-Wood
2017-09-30 15:27:27 +01:00
parent 911d121bb9
commit b017fcfe9a
3048 changed files with 537055 additions and 189679 deletions
+395 -86
View File
@@ -14,9 +14,8 @@ package analysisservices
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/Azure/go-autorest/autorest"
@@ -25,9 +24,8 @@ import (
"net/http"
)
// ServersClient is the the Azure Analysis Services Web API provides a RESTful
// set of web services that enables users to create, retrieve, update, and
// delete Analysis Services servers
// ServersClient is the the Azure Analysis Services Web API provides a RESTful set of web services that enables users
// to create, retrieve, update, and delete Analysis Services servers
type ServersClient struct {
ManagementClient
}
@@ -42,17 +40,14 @@ func NewServersClientWithBaseURI(baseURI string, subscriptionID string) ServersC
return ServersClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Create provisions the specified Analysis Services server based on the
// configuration specified in the request. 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 provisions the specified Analysis Services server based on the configuration specified in the request. 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 Azure Resource group of which a given
// Analysis Services server is part. This name must be at least 1 character in
// length, and no more than 90. serverName is the name of the Analysis Services
// server. It must be a minimum of 3 characters, and a maximum of 63.
// serverParameters is contains the information used to provision the Analysis
// Services server.
// resourceGroupName is the name of the Azure Resource group of which a given Analysis Services server is part. This
// name must be at least 1 character in length, and no more than 90. serverName is the name of the Analysis Services
// server. It must be a minimum of 3 characters, and a maximum of 63. serverParameters is contains the information used
// to provision the Analysis Services server.
func (client ServersClient) Create(resourceGroupName string, serverName string, serverParameters Server, cancel <-chan struct{}) (<-chan Server, <-chan error) {
resultChan := make(chan Server, 1)
errChan := make(chan error, 1)
@@ -75,8 +70,10 @@ func (client ServersClient) Create(resourceGroupName string, serverName string,
var err error
var result Server
defer func() {
if err != nil {
errChan <- err
}
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
@@ -109,7 +106,7 @@ func (client ServersClient) CreatePreparer(resourceGroupName string, serverName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-05-16"
const APIVersion = "2017-08-01-beta"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -145,14 +142,12 @@ func (client ServersClient) CreateResponder(resp *http.Response) (result Server,
return
}
// Delete deletes the specified Analysis Services 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.
// Delete deletes the specified Analysis Services 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 Azure Resource group of which a given
// Analysis Services server is part. This name must be at least 1 character in
// length, and no more than 90. serverName is the name of the Analysis Services
// resourceGroupName is the name of the Azure Resource group of which a given Analysis Services server is part. This
// name must be at least 1 character in length, and no more than 90. serverName is the name of the Analysis Services
// server. It must be at least 3 characters in length, and no more than 63.
func (client ServersClient) Delete(resourceGroupName string, serverName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
resultChan := make(chan autorest.Response, 1)
@@ -176,8 +171,10 @@ func (client ServersClient) Delete(resourceGroupName string, serverName string,
var err error
var result autorest.Response
defer func() {
if err != nil {
errChan <- err
}
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
@@ -210,7 +207,7 @@ func (client ServersClient) DeletePreparer(resourceGroupName string, serverName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-05-16"
const APIVersion = "2017-08-01-beta"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -243,11 +240,88 @@ func (client ServersClient) DeleteResponder(resp *http.Response) (result autores
return
}
// DissociateGateway dissociates a Unified Gateway associated with the server.
//
// resourceGroupName is the name of the Azure Resource group of which a given Analysis Services server is part. This
// name must be at least 1 character in length, and no more than 90. serverName is the name of the Analysis Services
// server. It must be at least 3 characters in length, and no more than 63.
func (client ServersClient) DissociateGateway(resourceGroupName string, serverName string) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
{TargetValue: serverName,
Constraints: []validation.Constraint{{Target: "serverName", Name: validation.MaxLength, Rule: 63, Chain: nil},
{Target: "serverName", Name: validation.MinLength, Rule: 3, Chain: nil},
{Target: "serverName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "analysisservices.ServersClient", "DissociateGateway")
}
req, err := client.DissociateGatewayPreparer(resourceGroupName, serverName)
if err != nil {
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "DissociateGateway", nil, "Failure preparing request")
return
}
resp, err := client.DissociateGatewaySender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "DissociateGateway", resp, "Failure sending request")
return
}
result, err = client.DissociateGatewayResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "DissociateGateway", resp, "Failure responding to request")
}
return
}
// DissociateGatewayPreparer prepares the DissociateGateway request.
func (client ServersClient) DissociateGatewayPreparer(resourceGroupName string, serverName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"serverName": autorest.Encode("path", serverName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-08-01-beta"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/dissociateGateway", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DissociateGatewaySender sends the DissociateGateway request. The method will close the
// http.Response Body if it receives an error.
func (client ServersClient) DissociateGatewaySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// DissociateGatewayResponder handles the response to the DissociateGateway request. The method always
// closes the http.Response Body.
func (client ServersClient) DissociateGatewayResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
}
// GetDetails gets details about the specified Analysis Services server.
//
// resourceGroupName is the name of the Azure Resource group of which a given
// Analysis Services server is part. This name must be at least 1 character in
// length, and no more than 90. serverName is the name of the Analysis Services
// resourceGroupName is the name of the Azure Resource group of which a given Analysis Services server is part. This
// name must be at least 1 character in length, and no more than 90. serverName is the name of the Analysis Services
// server. It must be a minimum of 3 characters, and a maximum of 63.
func (client ServersClient) GetDetails(resourceGroupName string, serverName string) (result Server, err error) {
if err := validation.Validate([]validation.Validation{
@@ -291,7 +365,7 @@ func (client ServersClient) GetDetailsPreparer(resourceGroupName string, serverN
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-05-16"
const APIVersion = "2017-08-01-beta"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -352,7 +426,7 @@ func (client ServersClient) ListPreparer() (*http.Request, error) {
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-05-16"
const APIVersion = "2017-08-01-beta"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -384,12 +458,10 @@ func (client ServersClient) ListResponder(resp *http.Response) (result Servers,
return
}
// ListByResourceGroup gets all the Analysis Services servers for the given
// resource group.
// ListByResourceGroup gets all the Analysis Services servers for the given resource group.
//
// resourceGroupName is the name of the Azure Resource group of which a given
// Analysis Services server is part. This name must be at least 1 character in
// length, and no more than 90.
// resourceGroupName is the name of the Azure Resource group of which a given Analysis Services server is part. This
// name must be at least 1 character in length, and no more than 90.
func (client ServersClient) ListByResourceGroup(resourceGroupName string) (result Servers, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -427,7 +499,7 @@ func (client ServersClient) ListByResourceGroupPreparer(resourceGroupName string
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-05-16"
const APIVersion = "2017-08-01-beta"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -459,14 +531,231 @@ func (client ServersClient) ListByResourceGroupResponder(resp *http.Response) (r
return
}
// Resume resumes operation of the specified Analysis Services server instance.
// 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
// ListGatewayStatus return the gateway status of the specified Analysis Services server instance.
//
// resourceGroupName is the name of the Azure Resource group of which a given Analysis Services server is part. This
// name must be at least 1 character in length, and no more than 90. serverName is the name of the Analysis Services
// server.
func (client ServersClient) ListGatewayStatus(resourceGroupName string, serverName string) (result GatewayListStatusLive, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
{TargetValue: serverName,
Constraints: []validation.Constraint{{Target: "serverName", Name: validation.MaxLength, Rule: 63, Chain: nil},
{Target: "serverName", Name: validation.MinLength, Rule: 3, Chain: nil},
{Target: "serverName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "analysisservices.ServersClient", "ListGatewayStatus")
}
req, err := client.ListGatewayStatusPreparer(resourceGroupName, serverName)
if err != nil {
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "ListGatewayStatus", nil, "Failure preparing request")
return
}
resp, err := client.ListGatewayStatusSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "ListGatewayStatus", resp, "Failure sending request")
return
}
result, err = client.ListGatewayStatusResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "ListGatewayStatus", resp, "Failure responding to request")
}
return
}
// ListGatewayStatusPreparer prepares the ListGatewayStatus request.
func (client ServersClient) ListGatewayStatusPreparer(resourceGroupName string, serverName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"serverName": autorest.Encode("path", serverName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-08-01-beta"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/listGatewayStatus", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListGatewayStatusSender sends the ListGatewayStatus request. The method will close the
// http.Response Body if it receives an error.
func (client ServersClient) ListGatewayStatusSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListGatewayStatusResponder handles the response to the ListGatewayStatus request. The method always
// closes the http.Response Body.
func (client ServersClient) ListGatewayStatusResponder(resp *http.Response) (result GatewayListStatusLive, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListSkusForExisting lists eligible SKUs for an Analysis Services resource.
//
// resourceGroupName is the name of the Azure Resource group of which a given Analysis Services server is part. This
// name must be at least 1 character in length, and no more than 90. serverName is the name of the Analysis Services
// server. It must be at least 3 characters in length, and no more than 63.
func (client ServersClient) ListSkusForExisting(resourceGroupName string, serverName string) (result SkuEnumerationForExistingResourceResult, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
{TargetValue: serverName,
Constraints: []validation.Constraint{{Target: "serverName", Name: validation.MaxLength, Rule: 63, Chain: nil},
{Target: "serverName", Name: validation.MinLength, Rule: 3, Chain: nil},
{Target: "serverName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "analysisservices.ServersClient", "ListSkusForExisting")
}
req, err := client.ListSkusForExistingPreparer(resourceGroupName, serverName)
if err != nil {
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "ListSkusForExisting", nil, "Failure preparing request")
return
}
resp, err := client.ListSkusForExistingSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "ListSkusForExisting", resp, "Failure sending request")
return
}
result, err = client.ListSkusForExistingResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "ListSkusForExisting", resp, "Failure responding to request")
}
return
}
// ListSkusForExistingPreparer prepares the ListSkusForExisting request.
func (client ServersClient) ListSkusForExistingPreparer(resourceGroupName string, serverName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"serverName": autorest.Encode("path", serverName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-08-01-beta"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/skus", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSkusForExistingSender sends the ListSkusForExisting request. The method will close the
// http.Response Body if it receives an error.
func (client ServersClient) ListSkusForExistingSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListSkusForExistingResponder handles the response to the ListSkusForExisting request. The method always
// closes the http.Response Body.
func (client ServersClient) ListSkusForExistingResponder(resp *http.Response) (result SkuEnumerationForExistingResourceResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListSkusForNew lists eligible SKUs for Analysis Services resource provider.
func (client ServersClient) ListSkusForNew() (result SkuEnumerationForNewResourceResult, err error) {
req, err := client.ListSkusForNewPreparer()
if err != nil {
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "ListSkusForNew", nil, "Failure preparing request")
return
}
resp, err := client.ListSkusForNewSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "ListSkusForNew", resp, "Failure sending request")
return
}
result, err = client.ListSkusForNewResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "ListSkusForNew", resp, "Failure responding to request")
}
return
}
// ListSkusForNewPreparer prepares the ListSkusForNew request.
func (client ServersClient) ListSkusForNewPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-08-01-beta"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AnalysisServices/skus", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSkusForNewSender sends the ListSkusForNew request. The method will close the
// http.Response Body if it receives an error.
func (client ServersClient) ListSkusForNewSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListSkusForNewResponder handles the response to the ListSkusForNew request. The method always
// closes the http.Response Body.
func (client ServersClient) ListSkusForNewResponder(resp *http.Response) (result SkuEnumerationForNewResourceResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Resume resumes operation of the specified Analysis Services server instance. 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 Azure Resource group of which a given
// Analysis Services server is part. This name must be at least 1 character in
// length, and no more than 90. serverName is the name of the Analysis Services
// resourceGroupName is the name of the Azure Resource group of which a given Analysis Services server is part. This
// name must be at least 1 character in length, and no more than 90. serverName is the name of the Analysis Services
// server. It must be at least 3 characters in length, and no more than 63.
func (client ServersClient) Resume(resourceGroupName string, serverName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
resultChan := make(chan autorest.Response, 1)
@@ -490,8 +779,10 @@ func (client ServersClient) Resume(resourceGroupName string, serverName string,
var err error
var result autorest.Response
defer func() {
if err != nil {
errChan <- err
}
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
@@ -524,7 +815,7 @@ func (client ServersClient) ResumePreparer(resourceGroupName string, serverName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-05-16"
const APIVersion = "2017-08-01-beta"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -557,14 +848,12 @@ func (client ServersClient) ResumeResponder(resp *http.Response) (result autores
return
}
// Suspend supends operation of the specified Analysis Services server
// instance. 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.
// Suspend supends operation of the specified Analysis Services server instance. 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 Azure Resource group of which a given
// Analysis Services server is part. This name must be at least 1 character in
// length, and no more than 90. serverName is the name of the Analysis Services
// resourceGroupName is the name of the Azure Resource group of which a given Analysis Services server is part. This
// name must be at least 1 character in length, and no more than 90. serverName is the name of the Analysis Services
// server. It must be at least 3 characters in length, and no more than 63.
func (client ServersClient) Suspend(resourceGroupName string, serverName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
resultChan := make(chan autorest.Response, 1)
@@ -588,8 +877,10 @@ func (client ServersClient) Suspend(resourceGroupName string, serverName string,
var err error
var result autorest.Response
defer func() {
if err != nil {
errChan <- err
}
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
@@ -622,7 +913,7 @@ func (client ServersClient) SuspendPreparer(resourceGroupName string, serverName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-05-16"
const APIVersion = "2017-08-01-beta"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -655,15 +946,17 @@ func (client ServersClient) SuspendResponder(resp *http.Response) (result autore
return
}
// Update updates the current state of the specified Analysis Services server.
// Update updates the current state of the specified Analysis Services 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 Azure Resource group of which a given
// Analysis Services server is part. This name must be at least 1 character in
// length, and no more than 90. serverName is the name of the Analysis Services
// server. It must be at least 3 characters in length, and no more than 63.
// serverUpdateParameters is request object that contains the updated
// information for the server.
func (client ServersClient) Update(resourceGroupName string, serverName string, serverUpdateParameters ServerUpdateParameters) (result Server, err error) {
// resourceGroupName is the name of the Azure Resource group of which a given Analysis Services server is part. This
// name must be at least 1 character in length, and no more than 90. serverName is the name of the Analysis Services
// server. It must be at least 3 characters in length, and no more than 63. serverUpdateParameters is request object
// that contains the updated information for the server.
func (client ServersClient) Update(resourceGroupName string, serverName string, serverUpdateParameters ServerUpdateParameters, cancel <-chan struct{}) (<-chan Server, <-chan error) {
resultChan := make(chan Server, 1)
errChan := make(chan error, 1)
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
@@ -673,39 +966,53 @@ func (client ServersClient) Update(resourceGroupName string, serverName string,
Constraints: []validation.Constraint{{Target: "serverName", Name: validation.MaxLength, Rule: 63, Chain: nil},
{Target: "serverName", Name: validation.MinLength, Rule: 3, Chain: nil},
{Target: "serverName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "analysisservices.ServersClient", "Update")
errChan <- validation.NewErrorWithValidationError(err, "analysisservices.ServersClient", "Update")
close(errChan)
close(resultChan)
return resultChan, errChan
}
req, err := client.UpdatePreparer(resourceGroupName, serverName, serverUpdateParameters)
if err != nil {
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "Update", nil, "Failure preparing request")
return
}
go func() {
var err error
var result Server
defer func() {
if err != nil {
errChan <- err
}
resultChan <- result
close(resultChan)
close(errChan)
}()
req, err := client.UpdatePreparer(resourceGroupName, serverName, serverUpdateParameters, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "Update", nil, "Failure preparing request")
return
}
resp, err := client.UpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "Update", resp, "Failure sending request")
return
}
resp, err := client.UpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "Update", resp, "Failure sending request")
return
}
result, err = client.UpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "Update", resp, "Failure responding to request")
}
return
result, err = client.UpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "analysisservices.ServersClient", "Update", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// UpdatePreparer prepares the Update request.
func (client ServersClient) UpdatePreparer(resourceGroupName string, serverName string, serverUpdateParameters ServerUpdateParameters) (*http.Request, error) {
func (client ServersClient) UpdatePreparer(resourceGroupName string, serverName string, serverUpdateParameters ServerUpdateParameters, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"serverName": autorest.Encode("path", serverName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-05-16"
const APIVersion = "2017-08-01-beta"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -717,13 +1024,15 @@ func (client ServersClient) UpdatePreparer(resourceGroupName string, serverName
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}", pathParameters),
autorest.WithJSON(serverUpdateParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client ServersClient) UpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// UpdateResponder handles the response to the Update request. The method always
@@ -732,7 +1041,7 @@ func (client ServersClient) UpdateResponder(resp *http.Response) (result Server,
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}