diff --git a/services/appinsights/mgmt/2015-05-01/insights/analyticsitems.go b/services/appinsights/mgmt/2015-05-01/insights/analyticsitems.go index 6cae13130257..ddb0ff5d1bee 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/analyticsitems.go +++ b/services/appinsights/mgmt/2015-05-01/insights/analyticsitems.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -42,7 +43,7 @@ func NewAnalyticsItemsClientWithBaseURI(baseURI string, subscriptionID string) A // Delete deletes a specific Analytics Items defined within an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // scopePath - enum indicating if this item definition is owned by a specific user or is shared between all // users with access to the Application Insights component. @@ -59,6 +60,16 @@ func (client AnalyticsItemsClient) Delete(ctx context.Context, resourceGroupName tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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}}}}); err != nil { + return result, validation.NewError("insights.AnalyticsItemsClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, scopePath, ID, name) if err != nil { err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "Delete", nil, "Failure preparing request") @@ -129,7 +140,7 @@ func (client AnalyticsItemsClient) DeleteResponder(resp *http.Response) (result // Get gets a specific Analytics Items defined within an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // scopePath - enum indicating if this item definition is owned by a specific user or is shared between all // users with access to the Application Insights component. @@ -146,6 +157,16 @@ func (client AnalyticsItemsClient) Get(ctx context.Context, resourceGroupName st tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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}}}}); err != nil { + return result, validation.NewError("insights.AnalyticsItemsClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, scopePath, ID, name) if err != nil { err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "Get", nil, "Failure preparing request") @@ -217,7 +238,7 @@ func (client AnalyticsItemsClient) GetResponder(resp *http.Response) (result App // List gets a list of Analytics Items defined within an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // scopePath - enum indicating if this item definition is owned by a specific user or is shared between all // users with access to the Application Insights component. @@ -237,6 +258,16 @@ func (client AnalyticsItemsClient) List(ctx context.Context, resourceGroupName s tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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}}}}); err != nil { + return result, validation.NewError("insights.AnalyticsItemsClient", "List", err.Error()) + } + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName, scopePath, scope, typeParameter, includeContent) if err != nil { err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "List", nil, "Failure preparing request") @@ -315,7 +346,7 @@ func (client AnalyticsItemsClient) ListResponder(resp *http.Response) (result Li // Put adds or Updates a specific Analytics Item within an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // scopePath - enum indicating if this item definition is owned by a specific user or is shared between all // users with access to the Application Insights component. @@ -334,6 +365,16 @@ func (client AnalyticsItemsClient) Put(ctx context.Context, resourceGroupName st tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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}}}}); err != nil { + return result, validation.NewError("insights.AnalyticsItemsClient", "Put", err.Error()) + } + req, err := client.PutPreparer(ctx, resourceGroupName, resourceName, scopePath, itemProperties, overrideItem) if err != nil { err = autorest.NewErrorWithError(err, "insights.AnalyticsItemsClient", "Put", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/annotations.go b/services/appinsights/mgmt/2015-05-01/insights/annotations.go index badc8bddc5b9..11b5f5d36fb3 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/annotations.go +++ b/services/appinsights/mgmt/2015-05-01/insights/annotations.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -42,7 +43,7 @@ func NewAnnotationsClientWithBaseURI(baseURI string, subscriptionID string) Anno // Create create an Annotation of an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // annotationProperties - properties that need to be specified to create an annotation of a Application // Insights component. @@ -57,6 +58,16 @@ func (client AnnotationsClient) Create(ctx context.Context, resourceGroupName st tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.AnnotationsClient", "Create", err.Error()) + } + req, err := client.CreatePreparer(ctx, resourceGroupName, resourceName, annotationProperties) if err != nil { err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "Create", nil, "Failure preparing request") @@ -123,7 +134,7 @@ func (client AnnotationsClient) CreateResponder(resp *http.Response) (result Lis // Delete delete an Annotation of an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // annotationID - the unique annotation ID. This is unique within a Application Insights component. func (client AnnotationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, annotationID string) (result SetObject, err error) { @@ -137,6 +148,16 @@ func (client AnnotationsClient) Delete(ctx context.Context, resourceGroupName st tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.AnnotationsClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, annotationID) if err != nil { err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "Delete", nil, "Failure preparing request") @@ -202,7 +223,7 @@ func (client AnnotationsClient) DeleteResponder(resp *http.Response) (result Set // Get get the annotation for given id. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // annotationID - the unique annotation ID. This is unique within a Application Insights component. func (client AnnotationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, annotationID string) (result ListAnnotation, err error) { @@ -216,6 +237,16 @@ func (client AnnotationsClient) Get(ctx context.Context, resourceGroupName strin tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.AnnotationsClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, annotationID) if err != nil { err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "Get", nil, "Failure preparing request") @@ -281,7 +312,7 @@ func (client AnnotationsClient) GetResponder(resp *http.Response) (result ListAn // List gets the list of annotations for a component for given time range // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // start - the start time to query from for annotations, cannot be older than 90 days from current date. // end - the end time to query for annotations. @@ -296,6 +327,16 @@ func (client AnnotationsClient) List(ctx context.Context, resourceGroupName stri tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.AnnotationsClient", "List", err.Error()) + } + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName, start, end) if err != nil { err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "List", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/apikeys.go b/services/appinsights/mgmt/2015-05-01/insights/apikeys.go index 335aae099a13..a966f1acc2a9 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/apikeys.go +++ b/services/appinsights/mgmt/2015-05-01/insights/apikeys.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -42,7 +43,7 @@ func NewAPIKeysClientWithBaseURI(baseURI string, subscriptionID string) APIKeysC // Create create an API Key of an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // APIKeyProperties - properties that need to be specified to create an API key of a Application Insights // component. @@ -57,6 +58,16 @@ func (client APIKeysClient) Create(ctx context.Context, resourceGroupName string tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.APIKeysClient", "Create", err.Error()) + } + req, err := client.CreatePreparer(ctx, resourceGroupName, resourceName, APIKeyProperties) if err != nil { err = autorest.NewErrorWithError(err, "insights.APIKeysClient", "Create", nil, "Failure preparing request") @@ -123,7 +134,7 @@ func (client APIKeysClient) CreateResponder(resp *http.Response) (result Applica // Delete delete an API Key of an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // keyID - the API Key ID. This is unique within a Application Insights component. func (client APIKeysClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, keyID string) (result ApplicationInsightsComponentAPIKey, err error) { @@ -137,6 +148,16 @@ func (client APIKeysClient) Delete(ctx context.Context, resourceGroupName string tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.APIKeysClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, keyID) if err != nil { err = autorest.NewErrorWithError(err, "insights.APIKeysClient", "Delete", nil, "Failure preparing request") @@ -202,7 +223,7 @@ func (client APIKeysClient) DeleteResponder(resp *http.Response) (result Applica // Get get the API Key for this key id. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // keyID - the API Key ID. This is unique within a Application Insights component. func (client APIKeysClient) Get(ctx context.Context, resourceGroupName string, resourceName string, keyID string) (result ApplicationInsightsComponentAPIKey, err error) { @@ -216,6 +237,16 @@ func (client APIKeysClient) Get(ctx context.Context, resourceGroupName string, r tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.APIKeysClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, keyID) if err != nil { err = autorest.NewErrorWithError(err, "insights.APIKeysClient", "Get", nil, "Failure preparing request") @@ -281,7 +312,7 @@ func (client APIKeysClient) GetResponder(resp *http.Response) (result Applicatio // List gets a list of API keys of an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client APIKeysClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsComponentAPIKeyListResult, err error) { if tracing.IsEnabled() { @@ -294,6 +325,16 @@ func (client APIKeysClient) List(ctx context.Context, resourceGroupName string, tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.APIKeysClient", "List", err.Error()) + } + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.APIKeysClient", "List", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/componentavailablefeatures.go b/services/appinsights/mgmt/2015-05-01/insights/componentavailablefeatures.go index f3bad06a7795..257e66609d3f 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/componentavailablefeatures.go +++ b/services/appinsights/mgmt/2015-05-01/insights/componentavailablefeatures.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -42,7 +43,7 @@ func NewComponentAvailableFeaturesClientWithBaseURI(baseURI string, subscription // Get returns all available features of the application insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client ComponentAvailableFeaturesClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsComponentAvailableFeatures, err error) { if tracing.IsEnabled() { @@ -55,6 +56,16 @@ func (client ComponentAvailableFeaturesClient) Get(ctx context.Context, resource tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ComponentAvailableFeaturesClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.ComponentAvailableFeaturesClient", "Get", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/componentcurrentbillingfeatures.go b/services/appinsights/mgmt/2015-05-01/insights/componentcurrentbillingfeatures.go index a8377cfcfee6..6bca2c0682e2 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/componentcurrentbillingfeatures.go +++ b/services/appinsights/mgmt/2015-05-01/insights/componentcurrentbillingfeatures.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -43,7 +44,7 @@ func NewComponentCurrentBillingFeaturesClientWithBaseURI(baseURI string, subscri // Get returns current billing features for an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client ComponentCurrentBillingFeaturesClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsComponentBillingFeatures, err error) { if tracing.IsEnabled() { @@ -56,6 +57,16 @@ func (client ComponentCurrentBillingFeaturesClient) Get(ctx context.Context, res tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ComponentCurrentBillingFeaturesClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.ComponentCurrentBillingFeaturesClient", "Get", nil, "Failure preparing request") @@ -120,7 +131,7 @@ func (client ComponentCurrentBillingFeaturesClient) GetResponder(resp *http.Resp // Update update current billing features for an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // billingFeaturesProperties - properties that need to be specified to update billing features for an // Application Insights component. @@ -135,6 +146,16 @@ func (client ComponentCurrentBillingFeaturesClient) Update(ctx context.Context, tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ComponentCurrentBillingFeaturesClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, billingFeaturesProperties) if err != nil { err = autorest.NewErrorWithError(err, "insights.ComponentCurrentBillingFeaturesClient", "Update", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/componentfeaturecapabilities.go b/services/appinsights/mgmt/2015-05-01/insights/componentfeaturecapabilities.go index 6e8b2c4f5f3a..0f323cdb59e6 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/componentfeaturecapabilities.go +++ b/services/appinsights/mgmt/2015-05-01/insights/componentfeaturecapabilities.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -43,7 +44,7 @@ func NewComponentFeatureCapabilitiesClientWithBaseURI(baseURI string, subscripti // Get returns feature capabilities of the application insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client ComponentFeatureCapabilitiesClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsComponentFeatureCapabilities, err error) { if tracing.IsEnabled() { @@ -56,6 +57,16 @@ func (client ComponentFeatureCapabilitiesClient) Get(ctx context.Context, resour tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ComponentFeatureCapabilitiesClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.ComponentFeatureCapabilitiesClient", "Get", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/componentquotastatus.go b/services/appinsights/mgmt/2015-05-01/insights/componentquotastatus.go index 85c74ca43e41..b768ae80a520 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/componentquotastatus.go +++ b/services/appinsights/mgmt/2015-05-01/insights/componentquotastatus.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -42,7 +43,7 @@ func NewComponentQuotaStatusClientWithBaseURI(baseURI string, subscriptionID str // Get returns daily data volume cap (quota) status for an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client ComponentQuotaStatusClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsComponentQuotaStatus, err error) { if tracing.IsEnabled() { @@ -55,6 +56,16 @@ func (client ComponentQuotaStatusClient) Get(ctx context.Context, resourceGroupN tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ComponentQuotaStatusClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.ComponentQuotaStatusClient", "Get", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/components.go b/services/appinsights/mgmt/2015-05-01/insights/components.go index 773ecb4b8668..0453032cb2d0 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/components.go +++ b/services/appinsights/mgmt/2015-05-01/insights/components.go @@ -44,7 +44,7 @@ func NewComponentsClientWithBaseURI(baseURI string, subscriptionID string) Compo // CreateOrUpdate creates (or updates) an Application Insights component. Note: You cannot specify a different value // for InstrumentationKey nor AppId in the Put operation. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // insightProperties - properties that need to be specified to create an Application Insights component. func (client ComponentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, insightProperties ApplicationInsightsComponent) (result ApplicationInsightsComponent, err error) { @@ -59,6 +59,12 @@ func (client ComponentsClient) CreateOrUpdate(ctx context.Context, resourceGroup }() } 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: insightProperties, Constraints: []validation.Constraint{{Target: "insightProperties.Kind", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("insights.ComponentsClient", "CreateOrUpdate", err.Error()) @@ -130,7 +136,7 @@ func (client ComponentsClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete deletes an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client ComponentsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result autorest.Response, err error) { if tracing.IsEnabled() { @@ -143,6 +149,16 @@ func (client ComponentsClient) Delete(ctx context.Context, resourceGroupName str tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ComponentsClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "Delete", nil, "Failure preparing request") @@ -206,7 +222,7 @@ func (client ComponentsClient) DeleteResponder(resp *http.Response) (result auto // Get returns an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client ComponentsClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsComponent, err error) { if tracing.IsEnabled() { @@ -219,6 +235,16 @@ func (client ComponentsClient) Get(ctx context.Context, resourceGroupName string tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ComponentsClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "Get", nil, "Failure preparing request") @@ -283,7 +309,7 @@ func (client ComponentsClient) GetResponder(resp *http.Response) (result Applica // GetPurgeStatus get status for an ongoing purge operation. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // purgeID - in a purge status request, this is the Id of the operation the status of which is returned. func (client ComponentsClient) GetPurgeStatus(ctx context.Context, resourceGroupName string, resourceName string, purgeID string) (result ComponentPurgeStatusResponse, err error) { @@ -297,6 +323,16 @@ func (client ComponentsClient) GetPurgeStatus(ctx context.Context, resourceGroup tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ComponentsClient", "GetPurgeStatus", err.Error()) + } + req, err := client.GetPurgeStatusPreparer(ctx, resourceGroupName, resourceName, purgeID) if err != nil { err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "GetPurgeStatus", nil, "Failure preparing request") @@ -372,6 +408,12 @@ func (client ComponentsClient) List(ctx context.Context) (result ApplicationInsi tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ComponentsClient", "List", err.Error()) + } + result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { @@ -472,7 +514,7 @@ func (client ComponentsClient) ListComplete(ctx context.Context) (result Applica // ListByResourceGroup gets a list of Application Insights components within a resource group. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. func (client ComponentsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ApplicationInsightsComponentListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ComponentsClient.ListByResourceGroup") @@ -484,6 +526,16 @@ func (client ComponentsClient) ListByResourceGroup(ctx context.Context, resource tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ComponentsClient", "ListByResourceGroup", err.Error()) + } + result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { @@ -585,7 +637,7 @@ func (client ComponentsClient) ListByResourceGroupComplete(ctx context.Context, // Purge purges data in an Application Insights component by a set of user-defined filters. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // body - describes the body of a request to purge data in a single table of an Application Insights component func (client ComponentsClient) Purge(ctx context.Context, resourceGroupName string, resourceName string, body ComponentPurgeBody) (result ComponentPurgeResponse, err error) { @@ -600,6 +652,12 @@ func (client ComponentsClient) Purge(ctx context.Context, resourceGroupName stri }() } 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: body, Constraints: []validation.Constraint{{Target: "body.Table", Name: validation.Null, Rule: true, Chain: nil}, {Target: "body.Filters", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { @@ -672,7 +730,7 @@ func (client ComponentsClient) PurgeResponder(resp *http.Response) (result Compo // UpdateTags updates an existing component's tags. To update other fields use the CreateOrUpdate method. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // componentTags - updated tag information to set into the component instance. func (client ComponentsClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, componentTags TagsResource) (result ApplicationInsightsComponent, err error) { @@ -686,6 +744,16 @@ func (client ComponentsClient) UpdateTags(ctx context.Context, resourceGroupName tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ComponentsClient", "UpdateTags", err.Error()) + } + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, resourceName, componentTags) if err != nil { err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "UpdateTags", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/exportconfigurations.go b/services/appinsights/mgmt/2015-05-01/insights/exportconfigurations.go index 105952def012..3bc9b17b62cf 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/exportconfigurations.go +++ b/services/appinsights/mgmt/2015-05-01/insights/exportconfigurations.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -42,7 +43,7 @@ func NewExportConfigurationsClientWithBaseURI(baseURI string, subscriptionID str // Create create a Continuous Export configuration of an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // exportProperties - properties that need to be specified to create a Continuous Export configuration of a // Application Insights component. @@ -57,6 +58,16 @@ func (client ExportConfigurationsClient) Create(ctx context.Context, resourceGro tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ExportConfigurationsClient", "Create", err.Error()) + } + req, err := client.CreatePreparer(ctx, resourceGroupName, resourceName, exportProperties) if err != nil { err = autorest.NewErrorWithError(err, "insights.ExportConfigurationsClient", "Create", nil, "Failure preparing request") @@ -123,7 +134,7 @@ func (client ExportConfigurationsClient) CreateResponder(resp *http.Response) (r // Delete delete a Continuous Export configuration of an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // exportID - the Continuous Export configuration ID. This is unique within a Application Insights component. func (client ExportConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, exportID string) (result ApplicationInsightsComponentExportConfiguration, err error) { @@ -137,6 +148,16 @@ func (client ExportConfigurationsClient) Delete(ctx context.Context, resourceGro tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ExportConfigurationsClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, exportID) if err != nil { err = autorest.NewErrorWithError(err, "insights.ExportConfigurationsClient", "Delete", nil, "Failure preparing request") @@ -202,7 +223,7 @@ func (client ExportConfigurationsClient) DeleteResponder(resp *http.Response) (r // Get get the Continuous Export configuration for this export id. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // exportID - the Continuous Export configuration ID. This is unique within a Application Insights component. func (client ExportConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, exportID string) (result ApplicationInsightsComponentExportConfiguration, err error) { @@ -216,6 +237,16 @@ func (client ExportConfigurationsClient) Get(ctx context.Context, resourceGroupN tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ExportConfigurationsClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, exportID) if err != nil { err = autorest.NewErrorWithError(err, "insights.ExportConfigurationsClient", "Get", nil, "Failure preparing request") @@ -281,7 +312,7 @@ func (client ExportConfigurationsClient) GetResponder(resp *http.Response) (resu // List gets a list of Continuous Export configuration of an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client ExportConfigurationsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result ListApplicationInsightsComponentExportConfiguration, err error) { if tracing.IsEnabled() { @@ -294,6 +325,16 @@ func (client ExportConfigurationsClient) List(ctx context.Context, resourceGroup tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ExportConfigurationsClient", "List", err.Error()) + } + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.ExportConfigurationsClient", "List", nil, "Failure preparing request") @@ -358,7 +399,7 @@ func (client ExportConfigurationsClient) ListResponder(resp *http.Response) (res // Update update the Continuous Export configuration for this export id. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // exportID - the Continuous Export configuration ID. This is unique within a Application Insights component. // exportProperties - properties that need to be specified to update the Continuous Export configuration. @@ -373,6 +414,16 @@ func (client ExportConfigurationsClient) Update(ctx context.Context, resourceGro tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ExportConfigurationsClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, exportID, exportProperties) if err != nil { err = autorest.NewErrorWithError(err, "insights.ExportConfigurationsClient", "Update", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/favorites.go b/services/appinsights/mgmt/2015-05-01/insights/favorites.go index d4f322684731..60d2748529e5 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/favorites.go +++ b/services/appinsights/mgmt/2015-05-01/insights/favorites.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -42,7 +43,7 @@ func NewFavoritesClientWithBaseURI(baseURI string, subscriptionID string) Favori // Add adds a new favorites to an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // favoriteID - the Id of a specific favorite defined in the Application Insights component // favoriteProperties - properties that need to be specified to create a new favorite and add it to an @@ -58,6 +59,16 @@ func (client FavoritesClient) Add(ctx context.Context, resourceGroupName string, tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.FavoritesClient", "Add", err.Error()) + } + req, err := client.AddPreparer(ctx, resourceGroupName, resourceName, favoriteID, favoriteProperties) if err != nil { err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Add", nil, "Failure preparing request") @@ -125,7 +136,7 @@ func (client FavoritesClient) AddResponder(resp *http.Response) (result Applicat // Delete remove a favorite that is associated to an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // favoriteID - the Id of a specific favorite defined in the Application Insights component func (client FavoritesClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (result autorest.Response, err error) { @@ -139,6 +150,16 @@ func (client FavoritesClient) Delete(ctx context.Context, resourceGroupName stri tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.FavoritesClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, favoriteID) if err != nil { err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Delete", nil, "Failure preparing request") @@ -203,7 +224,7 @@ func (client FavoritesClient) DeleteResponder(resp *http.Response) (result autor // Get get a single favorite by its FavoriteId, defined within an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // favoriteID - the Id of a specific favorite defined in the Application Insights component func (client FavoritesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (result ApplicationInsightsComponentFavorite, err error) { @@ -217,6 +238,16 @@ func (client FavoritesClient) Get(ctx context.Context, resourceGroupName string, tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.FavoritesClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, favoriteID) if err != nil { err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Get", nil, "Failure preparing request") @@ -282,7 +313,7 @@ func (client FavoritesClient) GetResponder(resp *http.Response) (result Applicat // List gets a list of favorites defined within an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // favoriteType - the type of favorite. Value can be either shared or user. // sourceType - source type of favorite to return. When left out, the source type defaults to 'other' (not @@ -301,6 +332,16 @@ func (client FavoritesClient) List(ctx context.Context, resourceGroupName string tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.FavoritesClient", "List", err.Error()) + } + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName, favoriteType, sourceType, canFetchContent, tags) if err != nil { err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "List", nil, "Failure preparing request") @@ -379,7 +420,7 @@ func (client FavoritesClient) ListResponder(resp *http.Response) (result ListApp // Update updates a favorite that has already been added to an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // favoriteID - the Id of a specific favorite defined in the Application Insights component // favoriteProperties - properties that need to be specified to update the existing favorite. @@ -394,6 +435,16 @@ func (client FavoritesClient) Update(ctx context.Context, resourceGroupName stri tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.FavoritesClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, favoriteID, favoriteProperties) if err != nil { err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "Update", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/proactivedetectionconfigurations.go b/services/appinsights/mgmt/2015-05-01/insights/proactivedetectionconfigurations.go index f661970b2658..906b07dbb2e6 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/proactivedetectionconfigurations.go +++ b/services/appinsights/mgmt/2015-05-01/insights/proactivedetectionconfigurations.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -43,7 +44,7 @@ func NewProactiveDetectionConfigurationsClientWithBaseURI(baseURI string, subscr // Get get the ProactiveDetection configuration for this configuration id. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // configurationID - the ProactiveDetection configuration ID. This is unique within a Application Insights // component. @@ -58,6 +59,16 @@ func (client ProactiveDetectionConfigurationsClient) Get(ctx context.Context, re tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ProactiveDetectionConfigurationsClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, configurationID) if err != nil { err = autorest.NewErrorWithError(err, "insights.ProactiveDetectionConfigurationsClient", "Get", nil, "Failure preparing request") @@ -123,7 +134,7 @@ func (client ProactiveDetectionConfigurationsClient) GetResponder(resp *http.Res // List gets a list of ProactiveDetection configurations of an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client ProactiveDetectionConfigurationsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result ListApplicationInsightsComponentProactiveDetectionConfiguration, err error) { if tracing.IsEnabled() { @@ -136,6 +147,16 @@ func (client ProactiveDetectionConfigurationsClient) List(ctx context.Context, r tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ProactiveDetectionConfigurationsClient", "List", err.Error()) + } + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.ProactiveDetectionConfigurationsClient", "List", nil, "Failure preparing request") @@ -200,7 +221,7 @@ func (client ProactiveDetectionConfigurationsClient) ListResponder(resp *http.Re // Update update the ProactiveDetection configuration for this configuration id. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // configurationID - the ProactiveDetection configuration ID. This is unique within a Application Insights // component. @@ -217,6 +238,16 @@ func (client ProactiveDetectionConfigurationsClient) Update(ctx context.Context, tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ProactiveDetectionConfigurationsClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, configurationID, proactiveDetectionProperties) if err != nil { err = autorest.NewErrorWithError(err, "insights.ProactiveDetectionConfigurationsClient", "Update", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/webtestlocations.go b/services/appinsights/mgmt/2015-05-01/insights/webtestlocations.go index 0c7c04dc98d7..5f938e383113 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/webtestlocations.go +++ b/services/appinsights/mgmt/2015-05-01/insights/webtestlocations.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -42,7 +43,7 @@ func NewWebTestLocationsClientWithBaseURI(baseURI string, subscriptionID string) // List gets a list of web test locations available to this Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client WebTestLocationsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsWebTestLocationsListResult, err error) { if tracing.IsEnabled() { @@ -55,6 +56,16 @@ func (client WebTestLocationsClient) List(ctx context.Context, resourceGroupName tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.WebTestLocationsClient", "List", err.Error()) + } + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.WebTestLocationsClient", "List", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/webtests.go b/services/appinsights/mgmt/2015-05-01/insights/webtests.go index d0bece1a049b..87a0564689a8 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/webtests.go +++ b/services/appinsights/mgmt/2015-05-01/insights/webtests.go @@ -43,7 +43,7 @@ func NewWebTestsClientWithBaseURI(baseURI string, subscriptionID string) WebTest // CreateOrUpdate creates or updates an Application Insights web test definition. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // webTestName - the name of the Application Insights webtest resource. // webTestDefinition - properties that need to be specified to create or update an Application Insights web // test definition. @@ -59,6 +59,12 @@ func (client WebTestsClient) CreateOrUpdate(ctx context.Context, resourceGroupNa }() } 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: webTestDefinition, Constraints: []validation.Constraint{{Target: "webTestDefinition.WebTestProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "webTestDefinition.WebTestProperties.SyntheticMonitorID", Name: validation.Null, Rule: true, Chain: nil}, @@ -134,7 +140,7 @@ func (client WebTestsClient) CreateOrUpdateResponder(resp *http.Response) (resul // Delete deletes an Application Insights web test. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // webTestName - the name of the Application Insights webtest resource. func (client WebTestsClient) Delete(ctx context.Context, resourceGroupName string, webTestName string) (result autorest.Response, err error) { if tracing.IsEnabled() { @@ -147,6 +153,16 @@ func (client WebTestsClient) Delete(ctx context.Context, resourceGroupName strin tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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}}}}); err != nil { + return result, validation.NewError("insights.WebTestsClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, webTestName) if err != nil { err = autorest.NewErrorWithError(err, "insights.WebTestsClient", "Delete", nil, "Failure preparing request") @@ -210,7 +226,7 @@ func (client WebTestsClient) DeleteResponder(resp *http.Response) (result autore // Get get a specific Application Insights web test definition. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // webTestName - the name of the Application Insights webtest resource. func (client WebTestsClient) Get(ctx context.Context, resourceGroupName string, webTestName string) (result WebTest, err error) { if tracing.IsEnabled() { @@ -223,6 +239,16 @@ func (client WebTestsClient) Get(ctx context.Context, resourceGroupName string, tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.WebTestsClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, webTestName) if err != nil { err = autorest.NewErrorWithError(err, "insights.WebTestsClient", "Get", nil, "Failure preparing request") @@ -297,6 +323,12 @@ func (client WebTestsClient) List(ctx context.Context) (result WebTestListResult tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.WebTestsClient", "List", err.Error()) + } + result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { @@ -398,7 +430,7 @@ func (client WebTestsClient) ListComplete(ctx context.Context) (result WebTestLi // ListByComponent get all Application Insights web tests defined for the specified component. // Parameters: // componentName - the name of the Application Insights component resource. -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. func (client WebTestsClient) ListByComponent(ctx context.Context, componentName string, resourceGroupName string) (result WebTestListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/WebTestsClient.ListByComponent") @@ -410,6 +442,16 @@ func (client WebTestsClient) ListByComponent(ctx context.Context, componentName tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.WebTestsClient", "ListByComponent", err.Error()) + } + result.fn = client.listByComponentNextResults req, err := client.ListByComponentPreparer(ctx, componentName, resourceGroupName) if err != nil { @@ -512,7 +554,7 @@ func (client WebTestsClient) ListByComponentComplete(ctx context.Context, compon // ListByResourceGroup get all Application Insights web tests defined within a specified resource group. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. func (client WebTestsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result WebTestListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/WebTestsClient.ListByResourceGroup") @@ -524,6 +566,16 @@ func (client WebTestsClient) ListByResourceGroup(ctx context.Context, resourceGr tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.WebTestsClient", "ListByResourceGroup", err.Error()) + } + result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { @@ -625,7 +677,7 @@ func (client WebTestsClient) ListByResourceGroupComplete(ctx context.Context, re // UpdateTags creates or updates an Application Insights web test definition. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // webTestName - the name of the Application Insights webtest resource. // webTestTags - updated tag information to set into the web test instance. func (client WebTestsClient) UpdateTags(ctx context.Context, resourceGroupName string, webTestName string, webTestTags TagsResource) (result WebTest, err error) { @@ -639,6 +691,16 @@ func (client WebTestsClient) UpdateTags(ctx context.Context, resourceGroupName s tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.WebTestsClient", "UpdateTags", err.Error()) + } + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, webTestName, webTestTags) if err != nil { err = autorest.NewErrorWithError(err, "insights.WebTestsClient", "UpdateTags", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/workbooks.go b/services/appinsights/mgmt/2015-05-01/insights/workbooks.go index 05f15244280c..777097b086a5 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/workbooks.go +++ b/services/appinsights/mgmt/2015-05-01/insights/workbooks.go @@ -43,7 +43,7 @@ func NewWorkbooksClientWithBaseURI(baseURI string, subscriptionID string) Workbo // CreateOrUpdate create a new workbook. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // workbookProperties - properties that need to be specified to create a new workbook. func (client WorkbooksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties Workbook) (result Workbook, err error) { @@ -58,6 +58,12 @@ func (client WorkbooksClient) CreateOrUpdate(ctx context.Context, resourceGroupN }() } if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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: workbookProperties, Constraints: []validation.Constraint{{Target: "workbookProperties.WorkbookProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "workbookProperties.WorkbookProperties.Name", Name: validation.Null, Rule: true, Chain: nil}, @@ -135,7 +141,7 @@ func (client WorkbooksClient) CreateOrUpdateResponder(resp *http.Response) (resu // Delete delete a workbook. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client WorkbooksClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result autorest.Response, err error) { if tracing.IsEnabled() { @@ -148,6 +154,16 @@ func (client WorkbooksClient) Delete(ctx context.Context, resourceGroupName stri tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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}}}}); err != nil { + return result, validation.NewError("insights.WorkbooksClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "Delete", nil, "Failure preparing request") @@ -211,7 +227,7 @@ func (client WorkbooksClient) DeleteResponder(resp *http.Response) (result autor // Get get a single workbook by its resourceName. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client WorkbooksClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result Workbook, err error) { if tracing.IsEnabled() { @@ -224,6 +240,16 @@ func (client WorkbooksClient) Get(ctx context.Context, resourceGroupName string, tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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}}}}); err != nil { + return result, validation.NewError("insights.WorkbooksClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "Get", nil, "Failure preparing request") @@ -288,7 +314,7 @@ func (client WorkbooksClient) GetResponder(resp *http.Response) (result Workbook // ListByResourceGroup get all Workbooks defined within a specified resource group and category. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // category - category of workbook to return. // tags - tags presents on each workbook returned. // canFetchContent - flag indicating whether or not to return the full content for each applicable workbook. If @@ -304,6 +330,16 @@ func (client WorkbooksClient) ListByResourceGroup(ctx context.Context, resourceG tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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}}}}); err != nil { + return result, validation.NewError("insights.WorkbooksClient", "ListByResourceGroup", err.Error()) + } + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, category, tags, canFetchContent) if err != nil { err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "ListByResourceGroup", nil, "Failure preparing request") @@ -374,7 +410,7 @@ func (client WorkbooksClient) ListByResourceGroupResponder(resp *http.Response) // Update updates a workbook that has already been added. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // workbookProperties - properties that need to be specified to create a new workbook. func (client WorkbooksClient) Update(ctx context.Context, resourceGroupName string, resourceName string, workbookProperties Workbook) (result Workbook, err error) { @@ -388,6 +424,16 @@ func (client WorkbooksClient) Update(ctx context.Context, resourceGroupName stri tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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}}}}); err != nil { + return result, validation.NewError("insights.WorkbooksClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, workbookProperties) if err != nil { err = autorest.NewErrorWithError(err, "insights.WorkbooksClient", "Update", nil, "Failure preparing request") diff --git a/services/appinsights/mgmt/2015-05-01/insights/workitemconfigurations.go b/services/appinsights/mgmt/2015-05-01/insights/workitemconfigurations.go index 364c392bde51..cfb613f61fd6 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/workitemconfigurations.go +++ b/services/appinsights/mgmt/2015-05-01/insights/workitemconfigurations.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -42,7 +43,7 @@ func NewWorkItemConfigurationsClientWithBaseURI(baseURI string, subscriptionID s // Create create a work item configuration for an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // workItemConfigurationProperties - properties that need to be specified to create a work item configuration // of a Application Insights component. @@ -57,6 +58,16 @@ func (client WorkItemConfigurationsClient) Create(ctx context.Context, resourceG tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.WorkItemConfigurationsClient", "Create", err.Error()) + } + req, err := client.CreatePreparer(ctx, resourceGroupName, resourceName, workItemConfigurationProperties) if err != nil { err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "Create", nil, "Failure preparing request") @@ -123,7 +134,7 @@ func (client WorkItemConfigurationsClient) CreateResponder(resp *http.Response) // Delete delete a work item configuration of an Application Insights component. // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. // workItemConfigID - the unique work item configuration Id. This can be either friendly name of connector as // defined in connector configuration @@ -138,6 +149,16 @@ func (client WorkItemConfigurationsClient) Delete(ctx context.Context, resourceG tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.WorkItemConfigurationsClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, workItemConfigID) if err != nil { err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "Delete", nil, "Failure preparing request") @@ -203,7 +224,7 @@ func (client WorkItemConfigurationsClient) DeleteResponder(resp *http.Response) // GetDefault gets default work item configurations that exist for the application // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client WorkItemConfigurationsClient) GetDefault(ctx context.Context, resourceGroupName string, resourceName string) (result WorkItemConfiguration, err error) { if tracing.IsEnabled() { @@ -216,6 +237,16 @@ func (client WorkItemConfigurationsClient) GetDefault(ctx context.Context, resou tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.WorkItemConfigurationsClient", "GetDefault", err.Error()) + } + req, err := client.GetDefaultPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "GetDefault", nil, "Failure preparing request") @@ -280,7 +311,7 @@ func (client WorkItemConfigurationsClient) GetDefaultResponder(resp *http.Respon // List gets the list work item configurations that exist for the application // Parameters: -// resourceGroupName - the name of the resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the Application Insights component resource. func (client WorkItemConfigurationsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result WorkItemConfigurationsListResult, err error) { if tracing.IsEnabled() { @@ -293,6 +324,16 @@ func (client WorkItemConfigurationsClient) List(ctx context.Context, resourceGro tracing.EndSpan(ctx, sc, err) }() } + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.WorkItemConfigurationsClient", "List", err.Error()) + } + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) if err != nil { err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "List", nil, "Failure preparing request")