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
+194 -87
View File
@@ -14,9 +14,8 @@ package cognitiveservices
// 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"
@@ -35,27 +34,21 @@ func NewAccountsClient(subscriptionID string) AccountsClient {
return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewAccountsClientWithBaseURI creates an instance of the AccountsClient
// client.
// NewAccountsClientWithBaseURI creates an instance of the AccountsClient client.
func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient {
return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Create create Cognitive Services Account. Accounts is a resource group wide
// resource type. It holds the keys for developer to access intelligent APIs.
// It's also the resource type for billing.
// Create create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for
// developer to access intelligent APIs. It's also the resource type for billing.
//
// resourceGroupName is the name of the resource group within the user's
// subscription. accountName is the name of the cognitive services account
// within the specified resource group. Cognitive Services account names must
// be between 3 and 24 characters in length and use numbers and lower-case
// letters only. parameters is the parameters to provide for the created
// account.
// resourceGroupName is the name of the resource group within the user's subscription. accountName is the name of
// Cognitive Services account. parameters is the parameters to provide for the created account.
func (client AccountsClient) Create(resourceGroupName string, accountName string, parameters AccountCreateParameters) (result Account, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: accountName,
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil},
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}},
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil},
@@ -93,7 +86,7 @@ func (client AccountsClient) CreatePreparer(resourceGroupName string, accountNam
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-02-01-preview"
const APIVersion = "2017-04-18"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -129,16 +122,13 @@ func (client AccountsClient) CreateResponder(resp *http.Response) (result Accoun
// Delete deletes a Cognitive Services account from the resource group.
//
// resourceGroupName is the name of the resource group within the user's
// subscription. accountName is the name of the cognitive services account
// within the specified resource group. Cognitive Services account names must
// be between 3 and 24 characters in length and use numbers and lower-case
// letters only.
// resourceGroupName is the name of the resource group within the user's subscription. accountName is the name of
// Cognitive Services account.
func (client AccountsClient) Delete(resourceGroupName string, accountName string) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: accountName,
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil},
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cognitiveservices.AccountsClient", "Delete")
}
@@ -172,7 +162,7 @@ func (client AccountsClient) DeletePreparer(resourceGroupName string, accountNam
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-02-01-preview"
const APIVersion = "2017-04-18"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -203,19 +193,15 @@ func (client AccountsClient) DeleteResponder(resp *http.Response) (result autore
return
}
// GetProperties returns a Cognitive Services account specified by the
// parameters.
// GetProperties returns a Cognitive Services account specified by the parameters.
//
// resourceGroupName is the name of the resource group within the user's
// subscription. accountName is the name of the cognitive services account
// within the specified resource group. Cognitive Services account names must
// be between 3 and 24 characters in length and use numbers and lower-case
// letters only.
// resourceGroupName is the name of the resource group within the user's subscription. accountName is the name of
// Cognitive Services account.
func (client AccountsClient) GetProperties(resourceGroupName string, accountName string) (result Account, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: accountName,
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil},
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cognitiveservices.AccountsClient", "GetProperties")
}
@@ -249,7 +235,7 @@ func (client AccountsClient) GetPropertiesPreparer(resourceGroupName string, acc
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-02-01-preview"
const APIVersion = "2017-04-18"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -281,8 +267,7 @@ func (client AccountsClient) GetPropertiesResponder(resp *http.Response) (result
return
}
// List returns all the resources of a particular type belonging to a
// subscription.
// List returns all the resources of a particular type belonging to a subscription.
func (client AccountsClient) List() (result AccountListResult, err error) {
req, err := client.ListPreparer()
if err != nil {
@@ -311,7 +296,7 @@ func (client AccountsClient) ListPreparer() (*http.Request, error) {
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-02-01-preview"
const APIVersion = "2017-04-18"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -343,11 +328,78 @@ func (client AccountsClient) ListResponder(resp *http.Response) (result AccountL
return
}
// ListByResourceGroup returns all the resources of a particular type belonging
// to a resource group
// ListNextResults retrieves the next set of results, if any.
func (client AccountsClient) ListNextResults(lastResults AccountListResult) (result AccountListResult, err error) {
req, err := lastResults.AccountListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "List", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "List", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "List", resp, "Failure responding to next results request")
}
return
}
// ListComplete gets all elements from the list without paging.
func (client AccountsClient) ListComplete(cancel <-chan struct{}) (<-chan Account, <-chan error) {
resultChan := make(chan Account)
errChan := make(chan error, 1)
go func() {
defer func() {
close(resultChan)
close(errChan)
}()
list, err := client.List()
if err != nil {
errChan <- err
return
}
if list.Value != nil {
for _, item := range *list.Value {
select {
case <-cancel:
return
case resultChan <- item:
// Intentionally left blank
}
}
}
for list.NextLink != nil {
list, err = client.ListNextResults(list)
if err != nil {
errChan <- err
return
}
if list.Value != nil {
for _, item := range *list.Value {
select {
case <-cancel:
return
case resultChan <- item:
// Intentionally left blank
}
}
}
}
}()
return resultChan, errChan
}
// ListByResourceGroup returns all the resources of a particular type belonging to a resource group
//
// resourceGroupName is the name of the resource group within the user's
// subscription.
// resourceGroupName is the name of the resource group within the user's subscription.
func (client AccountsClient) ListByResourceGroup(resourceGroupName string) (result AccountListResult, err error) {
req, err := client.ListByResourceGroupPreparer(resourceGroupName)
if err != nil {
@@ -377,7 +429,7 @@ func (client AccountsClient) ListByResourceGroupPreparer(resourceGroupName strin
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-02-01-preview"
const APIVersion = "2017-04-18"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -409,19 +461,84 @@ func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) (
return
}
// ListKeys lists the account keys for the specified Cognitive Services
// account.
// ListByResourceGroupNextResults retrieves the next set of results, if any.
func (client AccountsClient) ListByResourceGroupNextResults(lastResults AccountListResult) (result AccountListResult, err error) {
req, err := lastResults.AccountListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "ListByResourceGroup", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "ListByResourceGroup", resp, "Failure sending next results request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "ListByResourceGroup", resp, "Failure responding to next results request")
}
return
}
// ListByResourceGroupComplete gets all elements from the list without paging.
func (client AccountsClient) ListByResourceGroupComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan Account, <-chan error) {
resultChan := make(chan Account)
errChan := make(chan error, 1)
go func() {
defer func() {
close(resultChan)
close(errChan)
}()
list, err := client.ListByResourceGroup(resourceGroupName)
if err != nil {
errChan <- err
return
}
if list.Value != nil {
for _, item := range *list.Value {
select {
case <-cancel:
return
case resultChan <- item:
// Intentionally left blank
}
}
}
for list.NextLink != nil {
list, err = client.ListByResourceGroupNextResults(list)
if err != nil {
errChan <- err
return
}
if list.Value != nil {
for _, item := range *list.Value {
select {
case <-cancel:
return
case resultChan <- item:
// Intentionally left blank
}
}
}
}
}()
return resultChan, errChan
}
// ListKeys lists the account keys for the specified Cognitive Services account.
//
// resourceGroupName is the name of the resource group within the user's
// subscription. accountName is the name of the cognitive services account
// within the specified resource group. Congitive Services account names must
// be between 3 and 24 characters in length and use numbers and lower-case
// letters only.
// resourceGroupName is the name of the resource group within the user's subscription. accountName is the name of
// Cognitive Services account.
func (client AccountsClient) ListKeys(resourceGroupName string, accountName string) (result AccountKeys, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: accountName,
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil},
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cognitiveservices.AccountsClient", "ListKeys")
}
@@ -455,7 +572,7 @@ func (client AccountsClient) ListKeysPreparer(resourceGroupName string, accountN
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-02-01-preview"
const APIVersion = "2017-04-18"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -489,16 +606,13 @@ func (client AccountsClient) ListKeysResponder(resp *http.Response) (result Acco
// ListSkus list available SKUs for the requested Cognitive Services account
//
// resourceGroupName is the name of the resource group within the user's
// subscription. accountName is the name of the cognitive services account
// within the specified resource group. Cognitive Services account names must
// be between 3 and 24 characters in length and use numbers and lower-case
// letters only.
// resourceGroupName is the name of the resource group within the user's subscription. accountName is the name of
// Cognitive Services account.
func (client AccountsClient) ListSkus(resourceGroupName string, accountName string) (result AccountEnumerateSkusResult, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: accountName,
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil},
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cognitiveservices.AccountsClient", "ListSkus")
}
@@ -532,7 +646,7 @@ func (client AccountsClient) ListSkusPreparer(resourceGroupName string, accountN
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-02-01-preview"
const APIVersion = "2017-04-18"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -564,24 +678,20 @@ func (client AccountsClient) ListSkusResponder(resp *http.Response) (result Acco
return
}
// RegenerateKey regenerates the specified account key for the specified
// Cognitive Services account.
// RegenerateKey regenerates the specified account key for the specified Cognitive Services account.
//
// resourceGroupName is the name of the resource group within the user's
// subscription. accountName is the name of the cognitive services account
// within the specified resource group. Cognitive Services account names must
// be between 3 and 24 characters in length and use numbers and lower-case
// letters only. body is regenerate key parameters.
func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName string, body RegenerateKeyParameters) (result AccountKeys, err error) {
// resourceGroupName is the name of the resource group within the user's subscription. accountName is the name of
// Cognitive Services account. parameters is regenerate key parameters.
func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName string, parameters RegenerateKeyParameters) (result AccountKeys, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: accountName,
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil},
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cognitiveservices.AccountsClient", "RegenerateKey")
}
req, err := client.RegenerateKeyPreparer(resourceGroupName, accountName, body)
req, err := client.RegenerateKeyPreparer(resourceGroupName, accountName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "RegenerateKey", nil, "Failure preparing request")
return
@@ -603,14 +713,14 @@ func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName
}
// RegenerateKeyPreparer prepares the RegenerateKey request.
func (client AccountsClient) RegenerateKeyPreparer(resourceGroupName string, accountName string, body RegenerateKeyParameters) (*http.Request, error) {
func (client AccountsClient) RegenerateKeyPreparer(resourceGroupName string, accountName string, parameters RegenerateKeyParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"accountName": autorest.Encode("path", accountName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-02-01-preview"
const APIVersion = "2017-04-18"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -620,7 +730,7 @@ func (client AccountsClient) RegenerateKeyPreparer(resourceGroupName string, acc
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey", pathParameters),
autorest.WithJSON(body),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
@@ -646,21 +756,18 @@ func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result
// Update updates a Cognitive Services account
//
// resourceGroupName is the name of the resource group within the user's
// subscription. accountName is the name of the cognitive services account
// within the specified resource group. Cognitive Services account names must
// be between 3 and 24 characters in length and use numbers and lower-case
// letters only. body is the parameters to provide for the created account.
func (client AccountsClient) Update(resourceGroupName string, accountName string, body AccountUpdateParameters) (result Account, err error) {
// resourceGroupName is the name of the resource group within the user's subscription. accountName is the name of
// Cognitive Services account. parameters is the parameters to provide for the created account.
func (client AccountsClient) Update(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: accountName,
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil},
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil},
{Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil},
{Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cognitiveservices.AccountsClient", "Update")
}
req, err := client.UpdatePreparer(resourceGroupName, accountName, body)
req, err := client.UpdatePreparer(resourceGroupName, accountName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "Update", nil, "Failure preparing request")
return
@@ -682,14 +789,14 @@ func (client AccountsClient) Update(resourceGroupName string, accountName string
}
// UpdatePreparer prepares the Update request.
func (client AccountsClient) UpdatePreparer(resourceGroupName string, accountName string, body AccountUpdateParameters) (*http.Request, error) {
func (client AccountsClient) UpdatePreparer(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"accountName": autorest.Encode("path", accountName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-02-01-preview"
const APIVersion = "2017-04-18"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -699,7 +806,7 @@ func (client AccountsClient) UpdatePreparer(resourceGroupName string, accountNam
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", pathParameters),
autorest.WithJSON(body),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}