diff --git a/services/monitor/mgmt/2017-05-01-preview/insights/models.go b/services/monitor/mgmt/2017-05-01-preview/insights/models.go index 54027d9bd69d..decb179ef30c 100644 --- a/services/monitor/mgmt/2017-05-01-preview/insights/models.go +++ b/services/monitor/mgmt/2017-05-01-preview/insights/models.go @@ -36,8 +36,8 @@ const ( ) // PossibleCategoryTypeValues returns an array of possible values for the CategoryType const type. -func PossibleCategoryTypeValues() [2]CategoryType { - return [2]CategoryType{Logs, Metrics} +func PossibleCategoryTypeValues() []CategoryType { + return []CategoryType{Logs, Metrics} } // ComparisonOperationType enumerates the values for comparison operation type. @@ -59,8 +59,8 @@ const ( ) // PossibleComparisonOperationTypeValues returns an array of possible values for the ComparisonOperationType const type. -func PossibleComparisonOperationTypeValues() [6]ComparisonOperationType { - return [6]ComparisonOperationType{Equals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, NotEquals} +func PossibleComparisonOperationTypeValues() []ComparisonOperationType { + return []ComparisonOperationType{Equals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, NotEquals} } // ConditionOperator enumerates the values for condition operator. @@ -78,8 +78,8 @@ const ( ) // PossibleConditionOperatorValues returns an array of possible values for the ConditionOperator const type. -func PossibleConditionOperatorValues() [4]ConditionOperator { - return [4]ConditionOperator{ConditionOperatorGreaterThan, ConditionOperatorGreaterThanOrEqual, ConditionOperatorLessThan, ConditionOperatorLessThanOrEqual} +func PossibleConditionOperatorValues() []ConditionOperator { + return []ConditionOperator{ConditionOperatorGreaterThan, ConditionOperatorGreaterThanOrEqual, ConditionOperatorLessThan, ConditionOperatorLessThanOrEqual} } // MetricStatisticType enumerates the values for metric statistic type. @@ -97,8 +97,8 @@ const ( ) // PossibleMetricStatisticTypeValues returns an array of possible values for the MetricStatisticType const type. -func PossibleMetricStatisticTypeValues() [4]MetricStatisticType { - return [4]MetricStatisticType{Average, Max, Min, Sum} +func PossibleMetricStatisticTypeValues() []MetricStatisticType { + return []MetricStatisticType{Average, Max, Min, Sum} } // OdataType enumerates the values for odata type. @@ -114,8 +114,8 @@ const ( ) // PossibleOdataTypeValues returns an array of possible values for the OdataType const type. -func PossibleOdataTypeValues() [3]OdataType { - return [3]OdataType{OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource, OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource, OdataTypeRuleDataSource} +func PossibleOdataTypeValues() []OdataType { + return []OdataType{OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource, OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource, OdataTypeRuleDataSource} } // OdataTypeBasicRuleAction enumerates the values for odata type basic rule action. @@ -131,8 +131,8 @@ const ( ) // PossibleOdataTypeBasicRuleActionValues returns an array of possible values for the OdataTypeBasicRuleAction const type. -func PossibleOdataTypeBasicRuleActionValues() [3]OdataTypeBasicRuleAction { - return [3]OdataTypeBasicRuleAction{OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction, OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction, OdataTypeRuleAction} +func PossibleOdataTypeBasicRuleActionValues() []OdataTypeBasicRuleAction { + return []OdataTypeBasicRuleAction{OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction, OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction, OdataTypeRuleAction} } // OdataTypeBasicRuleCondition enumerates the values for odata type basic rule condition. @@ -150,8 +150,8 @@ const ( ) // PossibleOdataTypeBasicRuleConditionValues returns an array of possible values for the OdataTypeBasicRuleCondition const type. -func PossibleOdataTypeBasicRuleConditionValues() [4]OdataTypeBasicRuleCondition { - return [4]OdataTypeBasicRuleCondition{OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition, OdataTypeRuleCondition} +func PossibleOdataTypeBasicRuleConditionValues() []OdataTypeBasicRuleCondition { + return []OdataTypeBasicRuleCondition{OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition, OdataTypeRuleCondition} } // ReceiverStatus enumerates the values for receiver status. @@ -167,8 +167,8 @@ const ( ) // PossibleReceiverStatusValues returns an array of possible values for the ReceiverStatus const type. -func PossibleReceiverStatusValues() [3]ReceiverStatus { - return [3]ReceiverStatus{Disabled, Enabled, NotSpecified} +func PossibleReceiverStatusValues() []ReceiverStatus { + return []ReceiverStatus{Disabled, Enabled, NotSpecified} } // RecurrenceFrequency enumerates the values for recurrence frequency. @@ -194,8 +194,8 @@ const ( ) // PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type. -func PossibleRecurrenceFrequencyValues() [8]RecurrenceFrequency { - return [8]RecurrenceFrequency{Day, Hour, Minute, Month, None, Second, Week, Year} +func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { + return []RecurrenceFrequency{Day, Hour, Minute, Month, None, Second, Week, Year} } // ScaleDirection enumerates the values for scale direction. @@ -211,8 +211,8 @@ const ( ) // PossibleScaleDirectionValues returns an array of possible values for the ScaleDirection const type. -func PossibleScaleDirectionValues() [3]ScaleDirection { - return [3]ScaleDirection{ScaleDirectionDecrease, ScaleDirectionIncrease, ScaleDirectionNone} +func PossibleScaleDirectionValues() []ScaleDirection { + return []ScaleDirection{ScaleDirectionDecrease, ScaleDirectionIncrease, ScaleDirectionNone} } // ScaleType enumerates the values for scale type. @@ -228,8 +228,8 @@ const ( ) // PossibleScaleTypeValues returns an array of possible values for the ScaleType const type. -func PossibleScaleTypeValues() [3]ScaleType { - return [3]ScaleType{ChangeCount, ExactCount, PercentChangeCount} +func PossibleScaleTypeValues() []ScaleType { + return []ScaleType{ChangeCount, ExactCount, PercentChangeCount} } // TimeAggregationOperator enumerates the values for time aggregation operator. @@ -249,8 +249,8 @@ const ( ) // PossibleTimeAggregationOperatorValues returns an array of possible values for the TimeAggregationOperator const type. -func PossibleTimeAggregationOperatorValues() [5]TimeAggregationOperator { - return [5]TimeAggregationOperator{TimeAggregationOperatorAverage, TimeAggregationOperatorLast, TimeAggregationOperatorMaximum, TimeAggregationOperatorMinimum, TimeAggregationOperatorTotal} +func PossibleTimeAggregationOperatorValues() []TimeAggregationOperator { + return []TimeAggregationOperator{TimeAggregationOperatorAverage, TimeAggregationOperatorLast, TimeAggregationOperatorMaximum, TimeAggregationOperatorMinimum, TimeAggregationOperatorTotal} } // TimeAggregationType enumerates the values for time aggregation type. @@ -270,8 +270,8 @@ const ( ) // PossibleTimeAggregationTypeValues returns an array of possible values for the TimeAggregationType const type. -func PossibleTimeAggregationTypeValues() [5]TimeAggregationType { - return [5]TimeAggregationType{TimeAggregationTypeAverage, TimeAggregationTypeCount, TimeAggregationTypeMaximum, TimeAggregationTypeMinimum, TimeAggregationTypeTotal} +func PossibleTimeAggregationTypeValues() []TimeAggregationType { + return []TimeAggregationType{TimeAggregationTypeAverage, TimeAggregationTypeCount, TimeAggregationTypeMaximum, TimeAggregationTypeMinimum, TimeAggregationTypeTotal} } // ActionGroup an Azure action group. diff --git a/services/monitor/mgmt/2018-03-01/insights/actiongroups.go b/services/monitor/mgmt/2018-03-01/insights/actiongroupsgroup.go similarity index 67% rename from services/monitor/mgmt/2018-03-01/insights/actiongroups.go rename to services/monitor/mgmt/2018-03-01/insights/actiongroupsgroup.go index 124dd11afd5a..c000f69f3359 100644 --- a/services/monitor/mgmt/2018-03-01/insights/actiongroups.go +++ b/services/monitor/mgmt/2018-03-01/insights/actiongroupsgroup.go @@ -25,26 +25,26 @@ import ( "net/http" ) -// ActionGroupsClient is the monitor Management Client -type ActionGroupsClient struct { +// ActionGroupsGroupClient is the monitor Management Client +type ActionGroupsGroupClient struct { BaseClient } -// NewActionGroupsClient creates an instance of the ActionGroupsClient client. -func NewActionGroupsClient(subscriptionID string) ActionGroupsClient { - return NewActionGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewActionGroupsGroupClient creates an instance of the ActionGroupsGroupClient client. +func NewActionGroupsGroupClient(subscriptionID string) ActionGroupsGroupClient { + return NewActionGroupsGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewActionGroupsClientWithBaseURI creates an instance of the ActionGroupsClient client. -func NewActionGroupsClientWithBaseURI(baseURI string, subscriptionID string) ActionGroupsClient { - return ActionGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewActionGroupsGroupClientWithBaseURI creates an instance of the ActionGroupsGroupClient client. +func NewActionGroupsGroupClientWithBaseURI(baseURI string, subscriptionID string) ActionGroupsGroupClient { + return ActionGroupsGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create a new action group or update an existing one. // // resourceGroupName is the name of the resource group. actionGroupName is the name of the action group. // actionGroup is the action group to create or use for the update. -func (client ActionGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroup ActionGroupResource) (result ActionGroupResource, err error) { +func (client ActionGroupsGroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroup ActionGroupResource) (result ActionGroupResource, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: actionGroup, Constraints: []validation.Constraint{{Target: "actionGroup.ActionGroup", Name: validation.Null, Rule: false, @@ -52,32 +52,32 @@ func (client ActionGroupsClient) CreateOrUpdate(ctx context.Context, resourceGro Chain: []validation.Constraint{{Target: "actionGroup.ActionGroup.GroupShortName", Name: validation.MaxLength, Rule: 15, Chain: nil}}}, {Target: "actionGroup.ActionGroup.Enabled", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewError("insights.ActionGroupsClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("insights.ActionGroupsGroupClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, actionGroupName, actionGroup) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ActionGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroup ActionGroupResource) (*http.Request, error) { +func (client ActionGroupsGroupClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroup ActionGroupResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "actionGroupName": autorest.Encode("path", actionGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -101,14 +101,14 @@ func (client ActionGroupsClient) CreateOrUpdatePreparer(ctx context.Context, res // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client ActionGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client ActionGroupsGroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client ActionGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ActionGroupResource, err error) { +func (client ActionGroupsGroupClient) CreateOrUpdateResponder(resp *http.Response) (result ActionGroupResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -122,30 +122,30 @@ func (client ActionGroupsClient) CreateOrUpdateResponder(resp *http.Response) (r // Delete delete an action group. // // resourceGroupName is the name of the resource group. actionGroupName is the name of the action group. -func (client ActionGroupsClient) Delete(ctx context.Context, resourceGroupName string, actionGroupName string) (result autorest.Response, err error) { +func (client ActionGroupsGroupClient) Delete(ctx context.Context, resourceGroupName string, actionGroupName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, actionGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. -func (client ActionGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, actionGroupName string) (*http.Request, error) { +func (client ActionGroupsGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, actionGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "actionGroupName": autorest.Encode("path", actionGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -167,14 +167,14 @@ func (client ActionGroupsClient) DeletePreparer(ctx context.Context, resourceGro // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client ActionGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client ActionGroupsGroupClient) DeleteSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client ActionGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client ActionGroupsGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -188,36 +188,36 @@ func (client ActionGroupsClient) DeleteResponder(resp *http.Response) (result au // // resourceGroupName is the name of the resource group. actionGroupName is the name of the action group. // enableRequest is the receiver to re-enable. -func (client ActionGroupsClient) EnableReceiver(ctx context.Context, resourceGroupName string, actionGroupName string, enableRequest EnableRequest) (result autorest.Response, err error) { +func (client ActionGroupsGroupClient) EnableReceiver(ctx context.Context, resourceGroupName string, actionGroupName string, enableRequest EnableRequest) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: enableRequest, Constraints: []validation.Constraint{{Target: "enableRequest.ReceiverName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("insights.ActionGroupsClient", "EnableReceiver", err.Error()) + return result, validation.NewError("insights.ActionGroupsGroupClient", "EnableReceiver", err.Error()) } req, err := client.EnableReceiverPreparer(ctx, resourceGroupName, actionGroupName, enableRequest) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "EnableReceiver", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "EnableReceiver", nil, "Failure preparing request") return } resp, err := client.EnableReceiverSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "EnableReceiver", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "EnableReceiver", resp, "Failure sending request") return } result, err = client.EnableReceiverResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "EnableReceiver", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "EnableReceiver", resp, "Failure responding to request") } return } // EnableReceiverPreparer prepares the EnableReceiver request. -func (client ActionGroupsClient) EnableReceiverPreparer(ctx context.Context, resourceGroupName string, actionGroupName string, enableRequest EnableRequest) (*http.Request, error) { +func (client ActionGroupsGroupClient) EnableReceiverPreparer(ctx context.Context, resourceGroupName string, actionGroupName string, enableRequest EnableRequest) (*http.Request, error) { pathParameters := map[string]interface{}{ "actionGroupName": autorest.Encode("path", actionGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -241,14 +241,14 @@ func (client ActionGroupsClient) EnableReceiverPreparer(ctx context.Context, res // EnableReceiverSender sends the EnableReceiver request. The method will close the // http.Response Body if it receives an error. -func (client ActionGroupsClient) EnableReceiverSender(req *http.Request) (*http.Response, error) { +func (client ActionGroupsGroupClient) EnableReceiverSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // EnableReceiverResponder handles the response to the EnableReceiver request. The method always // closes the http.Response Body. -func (client ActionGroupsClient) EnableReceiverResponder(resp *http.Response) (result autorest.Response, err error) { +func (client ActionGroupsGroupClient) EnableReceiverResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -261,30 +261,30 @@ func (client ActionGroupsClient) EnableReceiverResponder(resp *http.Response) (r // Get get an action group. // // resourceGroupName is the name of the resource group. actionGroupName is the name of the action group. -func (client ActionGroupsClient) Get(ctx context.Context, resourceGroupName string, actionGroupName string) (result ActionGroupResource, err error) { +func (client ActionGroupsGroupClient) Get(ctx context.Context, resourceGroupName string, actionGroupName string) (result ActionGroupResource, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, actionGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client ActionGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, actionGroupName string) (*http.Request, error) { +func (client ActionGroupsGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, actionGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "actionGroupName": autorest.Encode("path", actionGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -306,14 +306,14 @@ func (client ActionGroupsClient) GetPreparer(ctx context.Context, resourceGroupN // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client ActionGroupsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client ActionGroupsGroupClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client ActionGroupsClient) GetResponder(resp *http.Response) (result ActionGroupResource, err error) { +func (client ActionGroupsGroupClient) GetResponder(resp *http.Response) (result ActionGroupResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -327,30 +327,30 @@ func (client ActionGroupsClient) GetResponder(resp *http.Response) (result Actio // ListByResourceGroup get a list of all action groups in a resource group. // // resourceGroupName is the name of the resource group. -func (client ActionGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ActionGroupList, err error) { +func (client ActionGroupsGroupClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ActionGroupList, err error) { req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "ListByResourceGroup", nil, "Failure preparing request") return } resp, err := client.ListByResourceGroupSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListByResourceGroup", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "ListByResourceGroup", resp, "Failure sending request") return } result, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "ListByResourceGroup", resp, "Failure responding to request") } return } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ActionGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { +func (client ActionGroupsGroupClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -371,14 +371,14 @@ func (client ActionGroupsClient) ListByResourceGroupPreparer(ctx context.Context // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. -func (client ActionGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { +func (client ActionGroupsGroupClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. -func (client ActionGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ActionGroupList, err error) { +func (client ActionGroupsGroupClient) ListByResourceGroupResponder(resp *http.Response) (result ActionGroupList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -390,30 +390,30 @@ func (client ActionGroupsClient) ListByResourceGroupResponder(resp *http.Respons } // ListBySubscriptionID get a list of all action groups in a subscription. -func (client ActionGroupsClient) ListBySubscriptionID(ctx context.Context) (result ActionGroupList, err error) { +func (client ActionGroupsGroupClient) ListBySubscriptionID(ctx context.Context) (result ActionGroupList, err error) { req, err := client.ListBySubscriptionIDPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListBySubscriptionID", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "ListBySubscriptionID", nil, "Failure preparing request") return } resp, err := client.ListBySubscriptionIDSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListBySubscriptionID", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "ListBySubscriptionID", resp, "Failure sending request") return } result, err = client.ListBySubscriptionIDResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListBySubscriptionID", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "ListBySubscriptionID", resp, "Failure responding to request") } return } // ListBySubscriptionIDPreparer prepares the ListBySubscriptionID request. -func (client ActionGroupsClient) ListBySubscriptionIDPreparer(ctx context.Context) (*http.Request, error) { +func (client ActionGroupsGroupClient) ListBySubscriptionIDPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -433,14 +433,14 @@ func (client ActionGroupsClient) ListBySubscriptionIDPreparer(ctx context.Contex // ListBySubscriptionIDSender sends the ListBySubscriptionID request. The method will close the // http.Response Body if it receives an error. -func (client ActionGroupsClient) ListBySubscriptionIDSender(req *http.Request) (*http.Response, error) { +func (client ActionGroupsGroupClient) ListBySubscriptionIDSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListBySubscriptionIDResponder handles the response to the ListBySubscriptionID request. The method always // closes the http.Response Body. -func (client ActionGroupsClient) ListBySubscriptionIDResponder(resp *http.Response) (result ActionGroupList, err error) { +func (client ActionGroupsGroupClient) ListBySubscriptionIDResponder(resp *http.Response) (result ActionGroupList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -455,30 +455,30 @@ func (client ActionGroupsClient) ListBySubscriptionIDResponder(resp *http.Respon // // resourceGroupName is the name of the resource group. actionGroupName is the name of the action group. // actionGroupPatch is parameters supplied to the operation. -func (client ActionGroupsClient) Update(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroupPatch ActionGroupPatchBody) (result ActionGroupResource, err error) { +func (client ActionGroupsGroupClient) Update(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroupPatch ActionGroupPatchBody) (result ActionGroupResource, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, actionGroupName, actionGroupPatch) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActionGroupsGroupClient", "Update", resp, "Failure responding to request") } return } // UpdatePreparer prepares the Update request. -func (client ActionGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroupPatch ActionGroupPatchBody) (*http.Request, error) { +func (client ActionGroupsGroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroupPatch ActionGroupPatchBody) (*http.Request, error) { pathParameters := map[string]interface{}{ "actionGroupName": autorest.Encode("path", actionGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -502,14 +502,14 @@ func (client ActionGroupsClient) UpdatePreparer(ctx context.Context, resourceGro // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client ActionGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { +func (client ActionGroupsGroupClient) UpdateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client ActionGroupsClient) UpdateResponder(resp *http.Response) (result ActionGroupResource, err error) { +func (client ActionGroupsGroupClient) UpdateResponder(resp *http.Response) (result ActionGroupResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/monitor/mgmt/2018-03-01/insights/activitylogalerts.go b/services/monitor/mgmt/2018-03-01/insights/activitylogalertsgroup.go similarity index 72% rename from services/monitor/mgmt/2018-03-01/insights/activitylogalerts.go rename to services/monitor/mgmt/2018-03-01/insights/activitylogalertsgroup.go index fb767a084e10..c34f5dcee51e 100644 --- a/services/monitor/mgmt/2018-03-01/insights/activitylogalerts.go +++ b/services/monitor/mgmt/2018-03-01/insights/activitylogalertsgroup.go @@ -25,26 +25,26 @@ import ( "net/http" ) -// ActivityLogAlertsClient is the monitor Management Client -type ActivityLogAlertsClient struct { +// ActivityLogAlertsGroupClient is the monitor Management Client +type ActivityLogAlertsGroupClient struct { BaseClient } -// NewActivityLogAlertsClient creates an instance of the ActivityLogAlertsClient client. -func NewActivityLogAlertsClient(subscriptionID string) ActivityLogAlertsClient { - return NewActivityLogAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewActivityLogAlertsGroupClient creates an instance of the ActivityLogAlertsGroupClient client. +func NewActivityLogAlertsGroupClient(subscriptionID string) ActivityLogAlertsGroupClient { + return NewActivityLogAlertsGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewActivityLogAlertsClientWithBaseURI creates an instance of the ActivityLogAlertsClient client. -func NewActivityLogAlertsClientWithBaseURI(baseURI string, subscriptionID string) ActivityLogAlertsClient { - return ActivityLogAlertsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewActivityLogAlertsGroupClientWithBaseURI creates an instance of the ActivityLogAlertsGroupClient client. +func NewActivityLogAlertsGroupClientWithBaseURI(baseURI string, subscriptionID string) ActivityLogAlertsGroupClient { + return ActivityLogAlertsGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create a new activity log alert or update an existing one. // // resourceGroupName is the name of the resource group. activityLogAlertName is the name of the activity log alert. // activityLogAlert is the activity log alert to create or use for the update. -func (client ActivityLogAlertsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlert ActivityLogAlertResource) (result ActivityLogAlertResource, err error) { +func (client ActivityLogAlertsGroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlert ActivityLogAlertResource) (result ActivityLogAlertResource, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: activityLogAlert, Constraints: []validation.Constraint{{Target: "activityLogAlert.ActivityLogAlert", Name: validation.Null, Rule: false, @@ -53,32 +53,32 @@ func (client ActivityLogAlertsClient) CreateOrUpdate(ctx context.Context, resour Chain: []validation.Constraint{{Target: "activityLogAlert.ActivityLogAlert.Condition.AllOf", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "activityLogAlert.ActivityLogAlert.Actions", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewError("insights.ActivityLogAlertsClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("insights.ActivityLogAlertsGroupClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, activityLogAlertName, activityLogAlert) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ActivityLogAlertsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlert ActivityLogAlertResource) (*http.Request, error) { +func (client ActivityLogAlertsGroupClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlert ActivityLogAlertResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "activityLogAlertName": autorest.Encode("path", activityLogAlertName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -102,14 +102,14 @@ func (client ActivityLogAlertsClient) CreateOrUpdatePreparer(ctx context.Context // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client ActivityLogAlertsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client ActivityLogAlertsGroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client ActivityLogAlertsClient) CreateOrUpdateResponder(resp *http.Response) (result ActivityLogAlertResource, err error) { +func (client ActivityLogAlertsGroupClient) CreateOrUpdateResponder(resp *http.Response) (result ActivityLogAlertResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -123,30 +123,30 @@ func (client ActivityLogAlertsClient) CreateOrUpdateResponder(resp *http.Respons // Delete delete an activity log alert. // // resourceGroupName is the name of the resource group. activityLogAlertName is the name of the activity log alert. -func (client ActivityLogAlertsClient) Delete(ctx context.Context, resourceGroupName string, activityLogAlertName string) (result autorest.Response, err error) { +func (client ActivityLogAlertsGroupClient) Delete(ctx context.Context, resourceGroupName string, activityLogAlertName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, activityLogAlertName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. -func (client ActivityLogAlertsClient) DeletePreparer(ctx context.Context, resourceGroupName string, activityLogAlertName string) (*http.Request, error) { +func (client ActivityLogAlertsGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, activityLogAlertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "activityLogAlertName": autorest.Encode("path", activityLogAlertName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -168,14 +168,14 @@ func (client ActivityLogAlertsClient) DeletePreparer(ctx context.Context, resour // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client ActivityLogAlertsClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client ActivityLogAlertsGroupClient) DeleteSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client ActivityLogAlertsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client ActivityLogAlertsGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -188,30 +188,30 @@ func (client ActivityLogAlertsClient) DeleteResponder(resp *http.Response) (resu // Get get an activity log alert. // // resourceGroupName is the name of the resource group. activityLogAlertName is the name of the activity log alert. -func (client ActivityLogAlertsClient) Get(ctx context.Context, resourceGroupName string, activityLogAlertName string) (result ActivityLogAlertResource, err error) { +func (client ActivityLogAlertsGroupClient) Get(ctx context.Context, resourceGroupName string, activityLogAlertName string) (result ActivityLogAlertResource, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, activityLogAlertName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client ActivityLogAlertsClient) GetPreparer(ctx context.Context, resourceGroupName string, activityLogAlertName string) (*http.Request, error) { +func (client ActivityLogAlertsGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, activityLogAlertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "activityLogAlertName": autorest.Encode("path", activityLogAlertName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -233,14 +233,14 @@ func (client ActivityLogAlertsClient) GetPreparer(ctx context.Context, resourceG // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client ActivityLogAlertsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client ActivityLogAlertsGroupClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client ActivityLogAlertsClient) GetResponder(resp *http.Response) (result ActivityLogAlertResource, err error) { +func (client ActivityLogAlertsGroupClient) GetResponder(resp *http.Response) (result ActivityLogAlertResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -254,30 +254,30 @@ func (client ActivityLogAlertsClient) GetResponder(resp *http.Response) (result // ListByResourceGroup get a list of all activity log alerts in a resource group. // // resourceGroupName is the name of the resource group. -func (client ActivityLogAlertsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ActivityLogAlertList, err error) { +func (client ActivityLogAlertsGroupClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ActivityLogAlertList, err error) { req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "ListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "ListByResourceGroup", nil, "Failure preparing request") return } resp, err := client.ListByResourceGroupSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "ListByResourceGroup", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "ListByResourceGroup", resp, "Failure sending request") return } result, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "ListByResourceGroup", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "ListByResourceGroup", resp, "Failure responding to request") } return } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ActivityLogAlertsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { +func (client ActivityLogAlertsGroupClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -298,14 +298,14 @@ func (client ActivityLogAlertsClient) ListByResourceGroupPreparer(ctx context.Co // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. -func (client ActivityLogAlertsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { +func (client ActivityLogAlertsGroupClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. -func (client ActivityLogAlertsClient) ListByResourceGroupResponder(resp *http.Response) (result ActivityLogAlertList, err error) { +func (client ActivityLogAlertsGroupClient) ListByResourceGroupResponder(resp *http.Response) (result ActivityLogAlertList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -317,30 +317,30 @@ func (client ActivityLogAlertsClient) ListByResourceGroupResponder(resp *http.Re } // ListBySubscriptionID get a list of all activity log alerts in a subscription. -func (client ActivityLogAlertsClient) ListBySubscriptionID(ctx context.Context) (result ActivityLogAlertList, err error) { +func (client ActivityLogAlertsGroupClient) ListBySubscriptionID(ctx context.Context) (result ActivityLogAlertList, err error) { req, err := client.ListBySubscriptionIDPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "ListBySubscriptionID", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "ListBySubscriptionID", nil, "Failure preparing request") return } resp, err := client.ListBySubscriptionIDSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "ListBySubscriptionID", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "ListBySubscriptionID", resp, "Failure sending request") return } result, err = client.ListBySubscriptionIDResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "ListBySubscriptionID", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "ListBySubscriptionID", resp, "Failure responding to request") } return } // ListBySubscriptionIDPreparer prepares the ListBySubscriptionID request. -func (client ActivityLogAlertsClient) ListBySubscriptionIDPreparer(ctx context.Context) (*http.Request, error) { +func (client ActivityLogAlertsGroupClient) ListBySubscriptionIDPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -360,14 +360,14 @@ func (client ActivityLogAlertsClient) ListBySubscriptionIDPreparer(ctx context.C // ListBySubscriptionIDSender sends the ListBySubscriptionID request. The method will close the // http.Response Body if it receives an error. -func (client ActivityLogAlertsClient) ListBySubscriptionIDSender(req *http.Request) (*http.Response, error) { +func (client ActivityLogAlertsGroupClient) ListBySubscriptionIDSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListBySubscriptionIDResponder handles the response to the ListBySubscriptionID request. The method always // closes the http.Response Body. -func (client ActivityLogAlertsClient) ListBySubscriptionIDResponder(resp *http.Response) (result ActivityLogAlertList, err error) { +func (client ActivityLogAlertsGroupClient) ListBySubscriptionIDResponder(resp *http.Response) (result ActivityLogAlertList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -382,30 +382,30 @@ func (client ActivityLogAlertsClient) ListBySubscriptionIDResponder(resp *http.R // // resourceGroupName is the name of the resource group. activityLogAlertName is the name of the activity log alert. // activityLogAlertPatch is parameters supplied to the operation. -func (client ActivityLogAlertsClient) Update(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlertPatch ActivityLogAlertPatchBody) (result ActivityLogAlertResource, err error) { +func (client ActivityLogAlertsGroupClient) Update(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlertPatch ActivityLogAlertPatchBody) (result ActivityLogAlertResource, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, activityLogAlertName, activityLogAlertPatch) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsGroupClient", "Update", resp, "Failure responding to request") } return } // UpdatePreparer prepares the Update request. -func (client ActivityLogAlertsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlertPatch ActivityLogAlertPatchBody) (*http.Request, error) { +func (client ActivityLogAlertsGroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlertPatch ActivityLogAlertPatchBody) (*http.Request, error) { pathParameters := map[string]interface{}{ "activityLogAlertName": autorest.Encode("path", activityLogAlertName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -429,14 +429,14 @@ func (client ActivityLogAlertsClient) UpdatePreparer(ctx context.Context, resour // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client ActivityLogAlertsClient) UpdateSender(req *http.Request) (*http.Response, error) { +func (client ActivityLogAlertsGroupClient) UpdateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client ActivityLogAlertsClient) UpdateResponder(resp *http.Response) (result ActivityLogAlertResource, err error) { +func (client ActivityLogAlertsGroupClient) UpdateResponder(resp *http.Response) (result ActivityLogAlertResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/monitor/mgmt/2018-03-01/insights/alertruleincidents.go b/services/monitor/mgmt/2018-03-01/insights/alertruleincidentsgroup.go similarity index 70% rename from services/monitor/mgmt/2018-03-01/insights/alertruleincidents.go rename to services/monitor/mgmt/2018-03-01/insights/alertruleincidentsgroup.go index f3d8fc8b20ab..c23ee46a13d1 100644 --- a/services/monitor/mgmt/2018-03-01/insights/alertruleincidents.go +++ b/services/monitor/mgmt/2018-03-01/insights/alertruleincidentsgroup.go @@ -24,49 +24,49 @@ import ( "net/http" ) -// AlertRuleIncidentsClient is the monitor Management Client -type AlertRuleIncidentsClient struct { +// AlertRuleIncidentsGroupClient is the monitor Management Client +type AlertRuleIncidentsGroupClient struct { BaseClient } -// NewAlertRuleIncidentsClient creates an instance of the AlertRuleIncidentsClient client. -func NewAlertRuleIncidentsClient(subscriptionID string) AlertRuleIncidentsClient { - return NewAlertRuleIncidentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewAlertRuleIncidentsGroupClient creates an instance of the AlertRuleIncidentsGroupClient client. +func NewAlertRuleIncidentsGroupClient(subscriptionID string) AlertRuleIncidentsGroupClient { + return NewAlertRuleIncidentsGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewAlertRuleIncidentsClientWithBaseURI creates an instance of the AlertRuleIncidentsClient client. -func NewAlertRuleIncidentsClientWithBaseURI(baseURI string, subscriptionID string) AlertRuleIncidentsClient { - return AlertRuleIncidentsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewAlertRuleIncidentsGroupClientWithBaseURI creates an instance of the AlertRuleIncidentsGroupClient client. +func NewAlertRuleIncidentsGroupClientWithBaseURI(baseURI string, subscriptionID string) AlertRuleIncidentsGroupClient { + return AlertRuleIncidentsGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets an incident associated to an alert rule // // resourceGroupName is the name of the resource group. ruleName is the name of the rule. incidentName is the name // of the incident to retrieve. -func (client AlertRuleIncidentsClient) Get(ctx context.Context, resourceGroupName string, ruleName string, incidentName string) (result Incident, err error) { +func (client AlertRuleIncidentsGroupClient) Get(ctx context.Context, resourceGroupName string, ruleName string, incidentName string) (result Incident, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, ruleName, incidentName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsGroupClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsGroupClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsGroupClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client AlertRuleIncidentsClient) GetPreparer(ctx context.Context, resourceGroupName string, ruleName string, incidentName string) (*http.Request, error) { +func (client AlertRuleIncidentsGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, ruleName string, incidentName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "incidentName": autorest.Encode("path", incidentName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -89,14 +89,14 @@ func (client AlertRuleIncidentsClient) GetPreparer(ctx context.Context, resource // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client AlertRuleIncidentsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client AlertRuleIncidentsGroupClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client AlertRuleIncidentsClient) GetResponder(resp *http.Response) (result Incident, err error) { +func (client AlertRuleIncidentsGroupClient) GetResponder(resp *http.Response) (result Incident, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -110,30 +110,30 @@ func (client AlertRuleIncidentsClient) GetResponder(resp *http.Response) (result // ListByAlertRule gets a list of incidents associated to an alert rule // // resourceGroupName is the name of the resource group. ruleName is the name of the rule. -func (client AlertRuleIncidentsClient) ListByAlertRule(ctx context.Context, resourceGroupName string, ruleName string) (result IncidentListResult, err error) { +func (client AlertRuleIncidentsGroupClient) ListByAlertRule(ctx context.Context, resourceGroupName string, ruleName string) (result IncidentListResult, err error) { req, err := client.ListByAlertRulePreparer(ctx, resourceGroupName, ruleName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsClient", "ListByAlertRule", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsGroupClient", "ListByAlertRule", nil, "Failure preparing request") return } resp, err := client.ListByAlertRuleSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsClient", "ListByAlertRule", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsGroupClient", "ListByAlertRule", resp, "Failure sending request") return } result, err = client.ListByAlertRuleResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsClient", "ListByAlertRule", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsGroupClient", "ListByAlertRule", resp, "Failure responding to request") } return } // ListByAlertRulePreparer prepares the ListByAlertRule request. -func (client AlertRuleIncidentsClient) ListByAlertRulePreparer(ctx context.Context, resourceGroupName string, ruleName string) (*http.Request, error) { +func (client AlertRuleIncidentsGroupClient) ListByAlertRulePreparer(ctx context.Context, resourceGroupName string, ruleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "ruleName": autorest.Encode("path", ruleName), @@ -155,14 +155,14 @@ func (client AlertRuleIncidentsClient) ListByAlertRulePreparer(ctx context.Conte // ListByAlertRuleSender sends the ListByAlertRule request. The method will close the // http.Response Body if it receives an error. -func (client AlertRuleIncidentsClient) ListByAlertRuleSender(req *http.Request) (*http.Response, error) { +func (client AlertRuleIncidentsGroupClient) ListByAlertRuleSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListByAlertRuleResponder handles the response to the ListByAlertRule request. The method always // closes the http.Response Body. -func (client AlertRuleIncidentsClient) ListByAlertRuleResponder(resp *http.Response) (result IncidentListResult, err error) { +func (client AlertRuleIncidentsGroupClient) ListByAlertRuleResponder(resp *http.Response) (result IncidentListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/monitor/mgmt/2018-03-01/insights/alertrules.go b/services/monitor/mgmt/2018-03-01/insights/alertrulesgroup.go similarity index 67% rename from services/monitor/mgmt/2018-03-01/insights/alertrules.go rename to services/monitor/mgmt/2018-03-01/insights/alertrulesgroup.go index 0c1145b37220..92c941652e53 100644 --- a/services/monitor/mgmt/2018-03-01/insights/alertrules.go +++ b/services/monitor/mgmt/2018-03-01/insights/alertrulesgroup.go @@ -25,26 +25,26 @@ import ( "net/http" ) -// AlertRulesClient is the monitor Management Client -type AlertRulesClient struct { +// AlertRulesGroupClient is the monitor Management Client +type AlertRulesGroupClient struct { BaseClient } -// NewAlertRulesClient creates an instance of the AlertRulesClient client. -func NewAlertRulesClient(subscriptionID string) AlertRulesClient { - return NewAlertRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewAlertRulesGroupClient creates an instance of the AlertRulesGroupClient client. +func NewAlertRulesGroupClient(subscriptionID string) AlertRulesGroupClient { + return NewAlertRulesGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewAlertRulesClientWithBaseURI creates an instance of the AlertRulesClient client. -func NewAlertRulesClientWithBaseURI(baseURI string, subscriptionID string) AlertRulesClient { - return AlertRulesClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewAlertRulesGroupClientWithBaseURI creates an instance of the AlertRulesGroupClient client. +func NewAlertRulesGroupClientWithBaseURI(baseURI string, subscriptionID string) AlertRulesGroupClient { + return AlertRulesGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates or updates an alert rule. // // resourceGroupName is the name of the resource group. ruleName is the name of the rule. parameters is the // parameters of the rule to create or update. -func (client AlertRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, parameters AlertRuleResource) (result AlertRuleResource, err error) { +func (client AlertRulesGroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, parameters AlertRuleResource) (result AlertRuleResource, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.AlertRule", Name: validation.Null, Rule: true, @@ -52,32 +52,32 @@ func (client AlertRulesClient) CreateOrUpdate(ctx context.Context, resourceGroup {Target: "parameters.AlertRule.IsEnabled", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.AlertRule.Condition", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewError("insights.AlertRulesClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("insights.AlertRulesGroupClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, ruleName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AlertRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, ruleName string, parameters AlertRuleResource) (*http.Request, error) { +func (client AlertRulesGroupClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, ruleName string, parameters AlertRuleResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "ruleName": autorest.Encode("path", ruleName), @@ -101,14 +101,14 @@ func (client AlertRulesClient) CreateOrUpdatePreparer(ctx context.Context, resou // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client AlertRulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client AlertRulesGroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client AlertRulesClient) CreateOrUpdateResponder(resp *http.Response) (result AlertRuleResource, err error) { +func (client AlertRulesGroupClient) CreateOrUpdateResponder(resp *http.Response) (result AlertRuleResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -122,30 +122,30 @@ func (client AlertRulesClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete deletes an alert rule // // resourceGroupName is the name of the resource group. ruleName is the name of the rule. -func (client AlertRulesClient) Delete(ctx context.Context, resourceGroupName string, ruleName string) (result autorest.Response, err error) { +func (client AlertRulesGroupClient) Delete(ctx context.Context, resourceGroupName string, ruleName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, ruleName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. -func (client AlertRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, ruleName string) (*http.Request, error) { +func (client AlertRulesGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, ruleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "ruleName": autorest.Encode("path", ruleName), @@ -167,14 +167,14 @@ func (client AlertRulesClient) DeletePreparer(ctx context.Context, resourceGroup // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client AlertRulesClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client AlertRulesGroupClient) DeleteSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client AlertRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AlertRulesGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -187,30 +187,30 @@ func (client AlertRulesClient) DeleteResponder(resp *http.Response) (result auto // Get gets an alert rule // // resourceGroupName is the name of the resource group. ruleName is the name of the rule. -func (client AlertRulesClient) Get(ctx context.Context, resourceGroupName string, ruleName string) (result AlertRuleResource, err error) { +func (client AlertRulesGroupClient) Get(ctx context.Context, resourceGroupName string, ruleName string) (result AlertRuleResource, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, ruleName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client AlertRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, ruleName string) (*http.Request, error) { +func (client AlertRulesGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, ruleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "ruleName": autorest.Encode("path", ruleName), @@ -232,14 +232,14 @@ func (client AlertRulesClient) GetPreparer(ctx context.Context, resourceGroupNam // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client AlertRulesClient) GetSender(req *http.Request) (*http.Response, error) { +func (client AlertRulesGroupClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client AlertRulesClient) GetResponder(resp *http.Response) (result AlertRuleResource, err error) { +func (client AlertRulesGroupClient) GetResponder(resp *http.Response) (result AlertRuleResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -253,30 +253,30 @@ func (client AlertRulesClient) GetResponder(resp *http.Response) (result AlertRu // ListByResourceGroup list the alert rules within a resource group. // // resourceGroupName is the name of the resource group. -func (client AlertRulesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AlertRuleResourceCollection, err error) { +func (client AlertRulesGroupClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AlertRuleResourceCollection, err error) { req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "ListByResourceGroup", nil, "Failure preparing request") return } resp, err := client.ListByResourceGroupSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListByResourceGroup", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "ListByResourceGroup", resp, "Failure sending request") return } result, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListByResourceGroup", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "ListByResourceGroup", resp, "Failure responding to request") } return } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AlertRulesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { +func (client AlertRulesGroupClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -297,14 +297,14 @@ func (client AlertRulesClient) ListByResourceGroupPreparer(ctx context.Context, // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. -func (client AlertRulesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { +func (client AlertRulesGroupClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. -func (client AlertRulesClient) ListByResourceGroupResponder(resp *http.Response) (result AlertRuleResourceCollection, err error) { +func (client AlertRulesGroupClient) ListByResourceGroupResponder(resp *http.Response) (result AlertRuleResourceCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -319,30 +319,30 @@ func (client AlertRulesClient) ListByResourceGroupResponder(resp *http.Response) // // resourceGroupName is the name of the resource group. ruleName is the name of the rule. alertRulesResource is // parameters supplied to the operation. -func (client AlertRulesClient) Update(ctx context.Context, resourceGroupName string, ruleName string, alertRulesResource AlertRuleResourcePatch) (result AlertRuleResource, err error) { +func (client AlertRulesGroupClient) Update(ctx context.Context, resourceGroupName string, ruleName string, alertRulesResource AlertRuleResourcePatch) (result AlertRuleResource, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, ruleName, alertRulesResource) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AlertRulesGroupClient", "Update", resp, "Failure responding to request") } return } // UpdatePreparer prepares the Update request. -func (client AlertRulesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, ruleName string, alertRulesResource AlertRuleResourcePatch) (*http.Request, error) { +func (client AlertRulesGroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, ruleName string, alertRulesResource AlertRuleResourcePatch) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "ruleName": autorest.Encode("path", ruleName), @@ -366,14 +366,14 @@ func (client AlertRulesClient) UpdatePreparer(ctx context.Context, resourceGroup // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client AlertRulesClient) UpdateSender(req *http.Request) (*http.Response, error) { +func (client AlertRulesGroupClient) UpdateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client AlertRulesClient) UpdateResponder(resp *http.Response) (result AlertRuleResource, err error) { +func (client AlertRulesGroupClient) UpdateResponder(resp *http.Response) (result AlertRuleResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/monitor/mgmt/2018-03-01/insights/autoscalesettings.go b/services/monitor/mgmt/2018-03-01/insights/autoscalesettingsgroup.go similarity index 71% rename from services/monitor/mgmt/2018-03-01/insights/autoscalesettings.go rename to services/monitor/mgmt/2018-03-01/insights/autoscalesettingsgroup.go index d93536ada7b7..313f86f6fec9 100644 --- a/services/monitor/mgmt/2018-03-01/insights/autoscalesettings.go +++ b/services/monitor/mgmt/2018-03-01/insights/autoscalesettingsgroup.go @@ -25,58 +25,58 @@ import ( "net/http" ) -// AutoscaleSettingsClient is the monitor Management Client -type AutoscaleSettingsClient struct { +// AutoscaleSettingsGroupClient is the monitor Management Client +type AutoscaleSettingsGroupClient struct { BaseClient } -// NewAutoscaleSettingsClient creates an instance of the AutoscaleSettingsClient client. -func NewAutoscaleSettingsClient(subscriptionID string) AutoscaleSettingsClient { - return NewAutoscaleSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewAutoscaleSettingsGroupClient creates an instance of the AutoscaleSettingsGroupClient client. +func NewAutoscaleSettingsGroupClient(subscriptionID string) AutoscaleSettingsGroupClient { + return NewAutoscaleSettingsGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewAutoscaleSettingsClientWithBaseURI creates an instance of the AutoscaleSettingsClient client. -func NewAutoscaleSettingsClientWithBaseURI(baseURI string, subscriptionID string) AutoscaleSettingsClient { - return AutoscaleSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewAutoscaleSettingsGroupClientWithBaseURI creates an instance of the AutoscaleSettingsGroupClient client. +func NewAutoscaleSettingsGroupClientWithBaseURI(baseURI string, subscriptionID string) AutoscaleSettingsGroupClient { + return AutoscaleSettingsGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates or updates an autoscale setting. // // resourceGroupName is the name of the resource group. autoscaleSettingName is the autoscale setting name. // parameters is parameters supplied to the operation. -func (client AutoscaleSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, autoscaleSettingName string, parameters AutoscaleSettingResource) (result AutoscaleSettingResource, err error) { +func (client AutoscaleSettingsGroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, autoscaleSettingName string, parameters AutoscaleSettingResource) (result AutoscaleSettingResource, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.AutoscaleSetting", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.AutoscaleSetting.Profiles", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.AutoscaleSetting.Profiles", Name: validation.MaxItems, Rule: 20, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewError("insights.AutoscaleSettingsClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("insights.AutoscaleSettingsGroupClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, autoscaleSettingName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AutoscaleSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, autoscaleSettingName string, parameters AutoscaleSettingResource) (*http.Request, error) { +func (client AutoscaleSettingsGroupClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, autoscaleSettingName string, parameters AutoscaleSettingResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "autoscaleSettingName": autorest.Encode("path", autoscaleSettingName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -100,14 +100,14 @@ func (client AutoscaleSettingsClient) CreateOrUpdatePreparer(ctx context.Context // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client AutoscaleSettingsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client AutoscaleSettingsGroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client AutoscaleSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result AutoscaleSettingResource, err error) { +func (client AutoscaleSettingsGroupClient) CreateOrUpdateResponder(resp *http.Response) (result AutoscaleSettingResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -121,30 +121,30 @@ func (client AutoscaleSettingsClient) CreateOrUpdateResponder(resp *http.Respons // Delete deletes and autoscale setting // // resourceGroupName is the name of the resource group. autoscaleSettingName is the autoscale setting name. -func (client AutoscaleSettingsClient) Delete(ctx context.Context, resourceGroupName string, autoscaleSettingName string) (result autorest.Response, err error) { +func (client AutoscaleSettingsGroupClient) Delete(ctx context.Context, resourceGroupName string, autoscaleSettingName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, autoscaleSettingName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. -func (client AutoscaleSettingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, autoscaleSettingName string) (*http.Request, error) { +func (client AutoscaleSettingsGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, autoscaleSettingName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "autoscaleSettingName": autorest.Encode("path", autoscaleSettingName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -166,14 +166,14 @@ func (client AutoscaleSettingsClient) DeletePreparer(ctx context.Context, resour // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client AutoscaleSettingsClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client AutoscaleSettingsGroupClient) DeleteSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client AutoscaleSettingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AutoscaleSettingsGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -186,30 +186,30 @@ func (client AutoscaleSettingsClient) DeleteResponder(resp *http.Response) (resu // Get gets an autoscale setting // // resourceGroupName is the name of the resource group. autoscaleSettingName is the autoscale setting name. -func (client AutoscaleSettingsClient) Get(ctx context.Context, resourceGroupName string, autoscaleSettingName string) (result AutoscaleSettingResource, err error) { +func (client AutoscaleSettingsGroupClient) Get(ctx context.Context, resourceGroupName string, autoscaleSettingName string) (result AutoscaleSettingResource, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, autoscaleSettingName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client AutoscaleSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, autoscaleSettingName string) (*http.Request, error) { +func (client AutoscaleSettingsGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, autoscaleSettingName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "autoscaleSettingName": autorest.Encode("path", autoscaleSettingName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -231,14 +231,14 @@ func (client AutoscaleSettingsClient) GetPreparer(ctx context.Context, resourceG // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client AutoscaleSettingsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client AutoscaleSettingsGroupClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client AutoscaleSettingsClient) GetResponder(resp *http.Response) (result AutoscaleSettingResource, err error) { +func (client AutoscaleSettingsGroupClient) GetResponder(resp *http.Response) (result AutoscaleSettingResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -252,31 +252,31 @@ func (client AutoscaleSettingsClient) GetResponder(resp *http.Response) (result // ListByResourceGroup lists the autoscale settings for a resource group // // resourceGroupName is the name of the resource group. -func (client AutoscaleSettingsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AutoscaleSettingResourceCollectionPage, err error) { +func (client AutoscaleSettingsGroupClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AutoscaleSettingResourceCollectionPage, err error) { result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "ListByResourceGroup", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "ListByResourceGroup", nil, "Failure preparing request") return } resp, err := client.ListByResourceGroupSender(req) if err != nil { result.asrc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "ListByResourceGroup", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "ListByResourceGroup", resp, "Failure sending request") return } result.asrc, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "ListByResourceGroup", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "ListByResourceGroup", resp, "Failure responding to request") } return } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AutoscaleSettingsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { +func (client AutoscaleSettingsGroupClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -297,14 +297,14 @@ func (client AutoscaleSettingsClient) ListByResourceGroupPreparer(ctx context.Co // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. -func (client AutoscaleSettingsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { +func (client AutoscaleSettingsGroupClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. -func (client AutoscaleSettingsClient) ListByResourceGroupResponder(resp *http.Response) (result AutoscaleSettingResourceCollection, err error) { +func (client AutoscaleSettingsGroupClient) ListByResourceGroupResponder(resp *http.Response) (result AutoscaleSettingResourceCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -316,10 +316,10 @@ func (client AutoscaleSettingsClient) ListByResourceGroupResponder(resp *http.Re } // listByResourceGroupNextResults retrieves the next set of results, if any. -func (client AutoscaleSettingsClient) listByResourceGroupNextResults(lastResults AutoscaleSettingResourceCollection) (result AutoscaleSettingResourceCollection, err error) { +func (client AutoscaleSettingsGroupClient) listByResourceGroupNextResults(lastResults AutoscaleSettingResourceCollection) (result AutoscaleSettingResourceCollection, err error) { req, err := lastResults.autoscaleSettingResourceCollectionPreparer() if err != nil { - return result, autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -327,17 +327,17 @@ func (client AutoscaleSettingsClient) listByResourceGroupNextResults(lastResults resp, err := client.ListByResourceGroupSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") } result, err = client.ListByResourceGroupResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") } return } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client AutoscaleSettingsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AutoscaleSettingResourceCollectionIterator, err error) { +func (client AutoscaleSettingsGroupClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AutoscaleSettingResourceCollectionIterator, err error) { result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) return } @@ -346,30 +346,30 @@ func (client AutoscaleSettingsClient) ListByResourceGroupComplete(ctx context.Co // // resourceGroupName is the name of the resource group. autoscaleSettingName is the autoscale setting name. // autoscaleSettingResource is parameters supplied to the operation. -func (client AutoscaleSettingsClient) Update(ctx context.Context, resourceGroupName string, autoscaleSettingName string, autoscaleSettingResource AutoscaleSettingResourcePatch) (result AutoscaleSettingResource, err error) { +func (client AutoscaleSettingsGroupClient) Update(ctx context.Context, resourceGroupName string, autoscaleSettingName string, autoscaleSettingResource AutoscaleSettingResourcePatch) (result AutoscaleSettingResource, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, autoscaleSettingName, autoscaleSettingResource) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsGroupClient", "Update", resp, "Failure responding to request") } return } // UpdatePreparer prepares the Update request. -func (client AutoscaleSettingsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, autoscaleSettingName string, autoscaleSettingResource AutoscaleSettingResourcePatch) (*http.Request, error) { +func (client AutoscaleSettingsGroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, autoscaleSettingName string, autoscaleSettingResource AutoscaleSettingResourcePatch) (*http.Request, error) { pathParameters := map[string]interface{}{ "autoscaleSettingName": autorest.Encode("path", autoscaleSettingName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -393,14 +393,14 @@ func (client AutoscaleSettingsClient) UpdatePreparer(ctx context.Context, resour // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client AutoscaleSettingsClient) UpdateSender(req *http.Request) (*http.Response, error) { +func (client AutoscaleSettingsGroupClient) UpdateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client AutoscaleSettingsClient) UpdateResponder(resp *http.Response) (result AutoscaleSettingResource, err error) { +func (client AutoscaleSettingsGroupClient) UpdateResponder(resp *http.Response) (result AutoscaleSettingResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/monitor/mgmt/2018-03-01/insights/diagnosticsettingscategory.go b/services/monitor/mgmt/2018-03-01/insights/diagnosticsettingscategorygroup.go similarity index 66% rename from services/monitor/mgmt/2018-03-01/insights/diagnosticsettingscategory.go rename to services/monitor/mgmt/2018-03-01/insights/diagnosticsettingscategorygroup.go index 538f52abdfe8..60ccaff1a3ae 100644 --- a/services/monitor/mgmt/2018-03-01/insights/diagnosticsettingscategory.go +++ b/services/monitor/mgmt/2018-03-01/insights/diagnosticsettingscategorygroup.go @@ -24,48 +24,49 @@ import ( "net/http" ) -// DiagnosticSettingsCategoryClient is the monitor Management Client -type DiagnosticSettingsCategoryClient struct { +// DiagnosticSettingsCategoryGroupClient is the monitor Management Client +type DiagnosticSettingsCategoryGroupClient struct { BaseClient } -// NewDiagnosticSettingsCategoryClient creates an instance of the DiagnosticSettingsCategoryClient client. -func NewDiagnosticSettingsCategoryClient(subscriptionID string) DiagnosticSettingsCategoryClient { - return NewDiagnosticSettingsCategoryClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewDiagnosticSettingsCategoryGroupClient creates an instance of the DiagnosticSettingsCategoryGroupClient client. +func NewDiagnosticSettingsCategoryGroupClient(subscriptionID string) DiagnosticSettingsCategoryGroupClient { + return NewDiagnosticSettingsCategoryGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewDiagnosticSettingsCategoryClientWithBaseURI creates an instance of the DiagnosticSettingsCategoryClient client. -func NewDiagnosticSettingsCategoryClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticSettingsCategoryClient { - return DiagnosticSettingsCategoryClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewDiagnosticSettingsCategoryGroupClientWithBaseURI creates an instance of the DiagnosticSettingsCategoryGroupClient +// client. +func NewDiagnosticSettingsCategoryGroupClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticSettingsCategoryGroupClient { + return DiagnosticSettingsCategoryGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets the diagnostic settings category for the specified resource. // // resourceURI is the identifier of the resource. name is the name of the diagnostic setting. -func (client DiagnosticSettingsCategoryClient) Get(ctx context.Context, resourceURI string, name string) (result DiagnosticSettingsCategoryResource, err error) { +func (client DiagnosticSettingsCategoryGroupClient) Get(ctx context.Context, resourceURI string, name string) (result DiagnosticSettingsCategoryResource, err error) { req, err := client.GetPreparer(ctx, resourceURI, name) if err != nil { - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryGroupClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryGroupClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryGroupClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client DiagnosticSettingsCategoryClient) GetPreparer(ctx context.Context, resourceURI string, name string) (*http.Request, error) { +func (client DiagnosticSettingsCategoryGroupClient) GetPreparer(ctx context.Context, resourceURI string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceUri": resourceURI, @@ -86,14 +87,14 @@ func (client DiagnosticSettingsCategoryClient) GetPreparer(ctx context.Context, // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client DiagnosticSettingsCategoryClient) GetSender(req *http.Request) (*http.Response, error) { +func (client DiagnosticSettingsCategoryGroupClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client DiagnosticSettingsCategoryClient) GetResponder(resp *http.Response) (result DiagnosticSettingsCategoryResource, err error) { +func (client DiagnosticSettingsCategoryGroupClient) GetResponder(resp *http.Response) (result DiagnosticSettingsCategoryResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -107,30 +108,30 @@ func (client DiagnosticSettingsCategoryClient) GetResponder(resp *http.Response) // List lists the diagnostic settings categories for the specified resource. // // resourceURI is the identifier of the resource. -func (client DiagnosticSettingsCategoryClient) List(ctx context.Context, resourceURI string) (result DiagnosticSettingsCategoryResourceCollection, err error) { +func (client DiagnosticSettingsCategoryGroupClient) List(ctx context.Context, resourceURI string) (result DiagnosticSettingsCategoryResourceCollection, err error) { req, err := client.ListPreparer(ctx, resourceURI) if err != nil { - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryGroupClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryGroupClient", "List", resp, "Failure sending request") return } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryGroupClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. -func (client DiagnosticSettingsCategoryClient) ListPreparer(ctx context.Context, resourceURI string) (*http.Request, error) { +func (client DiagnosticSettingsCategoryGroupClient) ListPreparer(ctx context.Context, resourceURI string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceUri": resourceURI, } @@ -150,14 +151,14 @@ func (client DiagnosticSettingsCategoryClient) ListPreparer(ctx context.Context, // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client DiagnosticSettingsCategoryClient) ListSender(req *http.Request) (*http.Response, error) { +func (client DiagnosticSettingsCategoryGroupClient) ListSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client DiagnosticSettingsCategoryClient) ListResponder(resp *http.Response) (result DiagnosticSettingsCategoryResourceCollection, err error) { +func (client DiagnosticSettingsCategoryGroupClient) ListResponder(resp *http.Response) (result DiagnosticSettingsCategoryResourceCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/monitor/mgmt/2018-03-01/insights/diagnosticsettings.go b/services/monitor/mgmt/2018-03-01/insights/diagnosticsettingsgroup.go similarity index 70% rename from services/monitor/mgmt/2018-03-01/insights/diagnosticsettings.go rename to services/monitor/mgmt/2018-03-01/insights/diagnosticsettingsgroup.go index 525a8a0adb03..f1684a035920 100644 --- a/services/monitor/mgmt/2018-03-01/insights/diagnosticsettings.go +++ b/services/monitor/mgmt/2018-03-01/insights/diagnosticsettingsgroup.go @@ -24,49 +24,49 @@ import ( "net/http" ) -// DiagnosticSettingsClient is the monitor Management Client -type DiagnosticSettingsClient struct { +// DiagnosticSettingsGroupClient is the monitor Management Client +type DiagnosticSettingsGroupClient struct { BaseClient } -// NewDiagnosticSettingsClient creates an instance of the DiagnosticSettingsClient client. -func NewDiagnosticSettingsClient(subscriptionID string) DiagnosticSettingsClient { - return NewDiagnosticSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewDiagnosticSettingsGroupClient creates an instance of the DiagnosticSettingsGroupClient client. +func NewDiagnosticSettingsGroupClient(subscriptionID string) DiagnosticSettingsGroupClient { + return NewDiagnosticSettingsGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewDiagnosticSettingsClientWithBaseURI creates an instance of the DiagnosticSettingsClient client. -func NewDiagnosticSettingsClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticSettingsClient { - return DiagnosticSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewDiagnosticSettingsGroupClientWithBaseURI creates an instance of the DiagnosticSettingsGroupClient client. +func NewDiagnosticSettingsGroupClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticSettingsGroupClient { + return DiagnosticSettingsGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates or updates diagnostic settings for the specified resource. // // resourceURI is the identifier of the resource. parameters is parameters supplied to the operation. name is the // name of the diagnostic setting. -func (client DiagnosticSettingsClient) CreateOrUpdate(ctx context.Context, resourceURI string, parameters DiagnosticSettingsResource, name string) (result DiagnosticSettingsResource, err error) { +func (client DiagnosticSettingsGroupClient) CreateOrUpdate(ctx context.Context, resourceURI string, parameters DiagnosticSettingsResource, name string) (result DiagnosticSettingsResource, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceURI, parameters, name) if err != nil { - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsGroupClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsGroupClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsGroupClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DiagnosticSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceURI string, parameters DiagnosticSettingsResource, name string) (*http.Request, error) { +func (client DiagnosticSettingsGroupClient) CreateOrUpdatePreparer(ctx context.Context, resourceURI string, parameters DiagnosticSettingsResource, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceUri": resourceURI, @@ -89,14 +89,14 @@ func (client DiagnosticSettingsClient) CreateOrUpdatePreparer(ctx context.Contex // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client DiagnosticSettingsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client DiagnosticSettingsGroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client DiagnosticSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result DiagnosticSettingsResource, err error) { +func (client DiagnosticSettingsGroupClient) CreateOrUpdateResponder(resp *http.Response) (result DiagnosticSettingsResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -110,30 +110,30 @@ func (client DiagnosticSettingsClient) CreateOrUpdateResponder(resp *http.Respon // Delete deletes existing diagnostic settings for the specified resource. // // resourceURI is the identifier of the resource. name is the name of the diagnostic setting. -func (client DiagnosticSettingsClient) Delete(ctx context.Context, resourceURI string, name string) (result autorest.Response, err error) { +func (client DiagnosticSettingsGroupClient) Delete(ctx context.Context, resourceURI string, name string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceURI, name) if err != nil { - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsGroupClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsGroupClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsGroupClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. -func (client DiagnosticSettingsClient) DeletePreparer(ctx context.Context, resourceURI string, name string) (*http.Request, error) { +func (client DiagnosticSettingsGroupClient) DeletePreparer(ctx context.Context, resourceURI string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceUri": resourceURI, @@ -154,14 +154,14 @@ func (client DiagnosticSettingsClient) DeletePreparer(ctx context.Context, resou // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client DiagnosticSettingsClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client DiagnosticSettingsGroupClient) DeleteSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client DiagnosticSettingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client DiagnosticSettingsGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -174,30 +174,30 @@ func (client DiagnosticSettingsClient) DeleteResponder(resp *http.Response) (res // Get gets the active diagnostic settings for the specified resource. // // resourceURI is the identifier of the resource. name is the name of the diagnostic setting. -func (client DiagnosticSettingsClient) Get(ctx context.Context, resourceURI string, name string) (result DiagnosticSettingsResource, err error) { +func (client DiagnosticSettingsGroupClient) Get(ctx context.Context, resourceURI string, name string) (result DiagnosticSettingsResource, err error) { req, err := client.GetPreparer(ctx, resourceURI, name) if err != nil { - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsGroupClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsGroupClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsGroupClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client DiagnosticSettingsClient) GetPreparer(ctx context.Context, resourceURI string, name string) (*http.Request, error) { +func (client DiagnosticSettingsGroupClient) GetPreparer(ctx context.Context, resourceURI string, name string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceUri": resourceURI, @@ -218,14 +218,14 @@ func (client DiagnosticSettingsClient) GetPreparer(ctx context.Context, resource // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client DiagnosticSettingsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client DiagnosticSettingsGroupClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client DiagnosticSettingsClient) GetResponder(resp *http.Response) (result DiagnosticSettingsResource, err error) { +func (client DiagnosticSettingsGroupClient) GetResponder(resp *http.Response) (result DiagnosticSettingsResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -239,30 +239,30 @@ func (client DiagnosticSettingsClient) GetResponder(resp *http.Response) (result // List gets the active diagnostic settings list for the specified resource. // // resourceURI is the identifier of the resource. -func (client DiagnosticSettingsClient) List(ctx context.Context, resourceURI string) (result DiagnosticSettingsResourceCollection, err error) { +func (client DiagnosticSettingsGroupClient) List(ctx context.Context, resourceURI string) (result DiagnosticSettingsResourceCollection, err error) { req, err := client.ListPreparer(ctx, resourceURI) if err != nil { - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsGroupClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsGroupClient", "List", resp, "Failure sending request") return } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsGroupClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. -func (client DiagnosticSettingsClient) ListPreparer(ctx context.Context, resourceURI string) (*http.Request, error) { +func (client DiagnosticSettingsGroupClient) ListPreparer(ctx context.Context, resourceURI string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceUri": resourceURI, } @@ -282,14 +282,14 @@ func (client DiagnosticSettingsClient) ListPreparer(ctx context.Context, resourc // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client DiagnosticSettingsClient) ListSender(req *http.Request) (*http.Response, error) { +func (client DiagnosticSettingsGroupClient) ListSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client DiagnosticSettingsClient) ListResponder(resp *http.Response) (result DiagnosticSettingsResourceCollection, err error) { +func (client DiagnosticSettingsGroupClient) ListResponder(resp *http.Response) (result DiagnosticSettingsResourceCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/monitor/mgmt/2018-03-01/insights/logprofiles.go b/services/monitor/mgmt/2018-03-01/insights/logprofilesgroup.go similarity index 67% rename from services/monitor/mgmt/2018-03-01/insights/logprofiles.go rename to services/monitor/mgmt/2018-03-01/insights/logprofilesgroup.go index ab273d46afa4..f9ee0e13a4ac 100644 --- a/services/monitor/mgmt/2018-03-01/insights/logprofiles.go +++ b/services/monitor/mgmt/2018-03-01/insights/logprofilesgroup.go @@ -25,25 +25,25 @@ import ( "net/http" ) -// LogProfilesClient is the monitor Management Client -type LogProfilesClient struct { +// LogProfilesGroupClient is the monitor Management Client +type LogProfilesGroupClient struct { BaseClient } -// NewLogProfilesClient creates an instance of the LogProfilesClient client. -func NewLogProfilesClient(subscriptionID string) LogProfilesClient { - return NewLogProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewLogProfilesGroupClient creates an instance of the LogProfilesGroupClient client. +func NewLogProfilesGroupClient(subscriptionID string) LogProfilesGroupClient { + return NewLogProfilesGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewLogProfilesClientWithBaseURI creates an instance of the LogProfilesClient client. -func NewLogProfilesClientWithBaseURI(baseURI string, subscriptionID string) LogProfilesClient { - return LogProfilesClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewLogProfilesGroupClientWithBaseURI creates an instance of the LogProfilesGroupClient client. +func NewLogProfilesGroupClientWithBaseURI(baseURI string, subscriptionID string) LogProfilesGroupClient { + return LogProfilesGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create or update a log profile in Azure Monitoring REST API. // // logProfileName is the name of the log profile. parameters is parameters supplied to the operation. -func (client LogProfilesClient) CreateOrUpdate(ctx context.Context, logProfileName string, parameters LogProfileResource) (result LogProfileResource, err error) { +func (client LogProfilesGroupClient) CreateOrUpdate(ctx context.Context, logProfileName string, parameters LogProfileResource) (result LogProfileResource, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.LogProfileProperties", Name: validation.Null, Rule: true, @@ -55,32 +55,32 @@ func (client LogProfilesClient) CreateOrUpdate(ctx context.Context, logProfileNa Chain: []validation.Constraint{{Target: "parameters.LogProfileProperties.RetentionPolicy.Days", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, }}, }}}}}); err != nil { - return result, validation.NewError("insights.LogProfilesClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("insights.LogProfilesGroupClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, logProfileName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client LogProfilesClient) CreateOrUpdatePreparer(ctx context.Context, logProfileName string, parameters LogProfileResource) (*http.Request, error) { +func (client LogProfilesGroupClient) CreateOrUpdatePreparer(ctx context.Context, logProfileName string, parameters LogProfileResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "logProfileName": autorest.Encode("path", logProfileName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -103,14 +103,14 @@ func (client LogProfilesClient) CreateOrUpdatePreparer(ctx context.Context, logP // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client LogProfilesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client LogProfilesGroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client LogProfilesClient) CreateOrUpdateResponder(resp *http.Response) (result LogProfileResource, err error) { +func (client LogProfilesGroupClient) CreateOrUpdateResponder(resp *http.Response) (result LogProfileResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -124,30 +124,30 @@ func (client LogProfilesClient) CreateOrUpdateResponder(resp *http.Response) (re // Delete deletes the log profile. // // logProfileName is the name of the log profile. -func (client LogProfilesClient) Delete(ctx context.Context, logProfileName string) (result autorest.Response, err error) { +func (client LogProfilesGroupClient) Delete(ctx context.Context, logProfileName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, logProfileName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. -func (client LogProfilesClient) DeletePreparer(ctx context.Context, logProfileName string) (*http.Request, error) { +func (client LogProfilesGroupClient) DeletePreparer(ctx context.Context, logProfileName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "logProfileName": autorest.Encode("path", logProfileName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -168,14 +168,14 @@ func (client LogProfilesClient) DeletePreparer(ctx context.Context, logProfileNa // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client LogProfilesClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client LogProfilesGroupClient) DeleteSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client LogProfilesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client LogProfilesGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -188,30 +188,30 @@ func (client LogProfilesClient) DeleteResponder(resp *http.Response) (result aut // Get gets the log profile. // // logProfileName is the name of the log profile. -func (client LogProfilesClient) Get(ctx context.Context, logProfileName string) (result LogProfileResource, err error) { +func (client LogProfilesGroupClient) Get(ctx context.Context, logProfileName string) (result LogProfileResource, err error) { req, err := client.GetPreparer(ctx, logProfileName) if err != nil { - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client LogProfilesClient) GetPreparer(ctx context.Context, logProfileName string) (*http.Request, error) { +func (client LogProfilesGroupClient) GetPreparer(ctx context.Context, logProfileName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "logProfileName": autorest.Encode("path", logProfileName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -232,14 +232,14 @@ func (client LogProfilesClient) GetPreparer(ctx context.Context, logProfileName // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client LogProfilesClient) GetSender(req *http.Request) (*http.Response, error) { +func (client LogProfilesGroupClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client LogProfilesClient) GetResponder(resp *http.Response) (result LogProfileResource, err error) { +func (client LogProfilesGroupClient) GetResponder(resp *http.Response) (result LogProfileResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -251,30 +251,30 @@ func (client LogProfilesClient) GetResponder(resp *http.Response) (result LogPro } // List list the log profiles. -func (client LogProfilesClient) List(ctx context.Context) (result LogProfileCollection, err error) { +func (client LogProfilesGroupClient) List(ctx context.Context) (result LogProfileCollection, err error) { req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "List", resp, "Failure sending request") return } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. -func (client LogProfilesClient) ListPreparer(ctx context.Context) (*http.Request, error) { +func (client LogProfilesGroupClient) ListPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -294,14 +294,14 @@ func (client LogProfilesClient) ListPreparer(ctx context.Context) (*http.Request // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client LogProfilesClient) ListSender(req *http.Request) (*http.Response, error) { +func (client LogProfilesGroupClient) ListSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client LogProfilesClient) ListResponder(resp *http.Response) (result LogProfileCollection, err error) { +func (client LogProfilesGroupClient) ListResponder(resp *http.Response) (result LogProfileCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -315,30 +315,30 @@ func (client LogProfilesClient) ListResponder(resp *http.Response) (result LogPr // Update updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. // // logProfileName is the name of the log profile. logProfilesResource is parameters supplied to the operation. -func (client LogProfilesClient) Update(ctx context.Context, logProfileName string, logProfilesResource LogProfileResourcePatch) (result LogProfileResource, err error) { +func (client LogProfilesGroupClient) Update(ctx context.Context, logProfileName string, logProfilesResource LogProfileResourcePatch) (result LogProfileResource, err error) { req, err := client.UpdatePreparer(ctx, logProfileName, logProfilesResource) if err != nil { - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.LogProfilesGroupClient", "Update", resp, "Failure responding to request") } return } // UpdatePreparer prepares the Update request. -func (client LogProfilesClient) UpdatePreparer(ctx context.Context, logProfileName string, logProfilesResource LogProfileResourcePatch) (*http.Request, error) { +func (client LogProfilesGroupClient) UpdatePreparer(ctx context.Context, logProfileName string, logProfilesResource LogProfileResourcePatch) (*http.Request, error) { pathParameters := map[string]interface{}{ "logProfileName": autorest.Encode("path", logProfileName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -361,14 +361,14 @@ func (client LogProfilesClient) UpdatePreparer(ctx context.Context, logProfileNa // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client LogProfilesClient) UpdateSender(req *http.Request) (*http.Response, error) { +func (client LogProfilesGroupClient) UpdateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client LogProfilesClient) UpdateResponder(resp *http.Response) (result LogProfileResource, err error) { +func (client LogProfilesGroupClient) UpdateResponder(resp *http.Response) (result LogProfileResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/services/monitor/mgmt/2018-03-01/insights/models.go b/services/monitor/mgmt/2018-03-01/insights/models.go index 05f32fcc729f..2fa1c3c0e6de 100644 --- a/services/monitor/mgmt/2018-03-01/insights/models.go +++ b/services/monitor/mgmt/2018-03-01/insights/models.go @@ -44,8 +44,8 @@ const ( ) // PossibleAggregationTypeValues returns an array of possible values for the AggregationType const type. -func PossibleAggregationTypeValues() [6]AggregationType { - return [6]AggregationType{Average, Count, Maximum, Minimum, None, Total} +func PossibleAggregationTypeValues() []AggregationType { + return []AggregationType{Average, Count, Maximum, Minimum, None, Total} } // CategoryType enumerates the values for category type. @@ -59,8 +59,8 @@ const ( ) // PossibleCategoryTypeValues returns an array of possible values for the CategoryType const type. -func PossibleCategoryTypeValues() [2]CategoryType { - return [2]CategoryType{Logs, Metrics} +func PossibleCategoryTypeValues() []CategoryType { + return []CategoryType{Logs, Metrics} } // ComparisonOperationType enumerates the values for comparison operation type. @@ -82,8 +82,8 @@ const ( ) // PossibleComparisonOperationTypeValues returns an array of possible values for the ComparisonOperationType const type. -func PossibleComparisonOperationTypeValues() [6]ComparisonOperationType { - return [6]ComparisonOperationType{Equals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, NotEquals} +func PossibleComparisonOperationTypeValues() []ComparisonOperationType { + return []ComparisonOperationType{Equals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, NotEquals} } // ConditionOperator enumerates the values for condition operator. @@ -101,8 +101,8 @@ const ( ) // PossibleConditionOperatorValues returns an array of possible values for the ConditionOperator const type. -func PossibleConditionOperatorValues() [4]ConditionOperator { - return [4]ConditionOperator{ConditionOperatorGreaterThan, ConditionOperatorGreaterThanOrEqual, ConditionOperatorLessThan, ConditionOperatorLessThanOrEqual} +func PossibleConditionOperatorValues() []ConditionOperator { + return []ConditionOperator{ConditionOperatorGreaterThan, ConditionOperatorGreaterThanOrEqual, ConditionOperatorLessThan, ConditionOperatorLessThanOrEqual} } // EventLevel enumerates the values for event level. @@ -122,8 +122,8 @@ const ( ) // PossibleEventLevelValues returns an array of possible values for the EventLevel const type. -func PossibleEventLevelValues() [5]EventLevel { - return [5]EventLevel{Critical, Error, Informational, Verbose, Warning} +func PossibleEventLevelValues() []EventLevel { + return []EventLevel{Critical, Error, Informational, Verbose, Warning} } // MetricStatisticType enumerates the values for metric statistic type. @@ -141,8 +141,8 @@ const ( ) // PossibleMetricStatisticTypeValues returns an array of possible values for the MetricStatisticType const type. -func PossibleMetricStatisticTypeValues() [4]MetricStatisticType { - return [4]MetricStatisticType{MetricStatisticTypeAverage, MetricStatisticTypeMax, MetricStatisticTypeMin, MetricStatisticTypeSum} +func PossibleMetricStatisticTypeValues() []MetricStatisticType { + return []MetricStatisticType{MetricStatisticTypeAverage, MetricStatisticTypeMax, MetricStatisticTypeMin, MetricStatisticTypeSum} } // OdataType enumerates the values for odata type. @@ -158,8 +158,8 @@ const ( ) // PossibleOdataTypeValues returns an array of possible values for the OdataType const type. -func PossibleOdataTypeValues() [3]OdataType { - return [3]OdataType{OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource, OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource, OdataTypeRuleDataSource} +func PossibleOdataTypeValues() []OdataType { + return []OdataType{OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource, OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource, OdataTypeRuleDataSource} } // OdataTypeBasicRuleAction enumerates the values for odata type basic rule action. @@ -175,8 +175,8 @@ const ( ) // PossibleOdataTypeBasicRuleActionValues returns an array of possible values for the OdataTypeBasicRuleAction const type. -func PossibleOdataTypeBasicRuleActionValues() [3]OdataTypeBasicRuleAction { - return [3]OdataTypeBasicRuleAction{OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction, OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction, OdataTypeRuleAction} +func PossibleOdataTypeBasicRuleActionValues() []OdataTypeBasicRuleAction { + return []OdataTypeBasicRuleAction{OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction, OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction, OdataTypeRuleAction} } // OdataTypeBasicRuleCondition enumerates the values for odata type basic rule condition. @@ -194,8 +194,8 @@ const ( ) // PossibleOdataTypeBasicRuleConditionValues returns an array of possible values for the OdataTypeBasicRuleCondition const type. -func PossibleOdataTypeBasicRuleConditionValues() [4]OdataTypeBasicRuleCondition { - return [4]OdataTypeBasicRuleCondition{OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition, OdataTypeRuleCondition} +func PossibleOdataTypeBasicRuleConditionValues() []OdataTypeBasicRuleCondition { + return []OdataTypeBasicRuleCondition{OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition, OdataTypeRuleCondition} } // ReceiverStatus enumerates the values for receiver status. @@ -211,8 +211,8 @@ const ( ) // PossibleReceiverStatusValues returns an array of possible values for the ReceiverStatus const type. -func PossibleReceiverStatusValues() [3]ReceiverStatus { - return [3]ReceiverStatus{Disabled, Enabled, NotSpecified} +func PossibleReceiverStatusValues() []ReceiverStatus { + return []ReceiverStatus{Disabled, Enabled, NotSpecified} } // RecurrenceFrequency enumerates the values for recurrence frequency. @@ -238,8 +238,8 @@ const ( ) // PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type. -func PossibleRecurrenceFrequencyValues() [8]RecurrenceFrequency { - return [8]RecurrenceFrequency{RecurrenceFrequencyDay, RecurrenceFrequencyHour, RecurrenceFrequencyMinute, RecurrenceFrequencyMonth, RecurrenceFrequencyNone, RecurrenceFrequencySecond, RecurrenceFrequencyWeek, RecurrenceFrequencyYear} +func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { + return []RecurrenceFrequency{RecurrenceFrequencyDay, RecurrenceFrequencyHour, RecurrenceFrequencyMinute, RecurrenceFrequencyMonth, RecurrenceFrequencyNone, RecurrenceFrequencySecond, RecurrenceFrequencyWeek, RecurrenceFrequencyYear} } // ResultType enumerates the values for result type. @@ -253,8 +253,8 @@ const ( ) // PossibleResultTypeValues returns an array of possible values for the ResultType const type. -func PossibleResultTypeValues() [2]ResultType { - return [2]ResultType{Data, Metadata} +func PossibleResultTypeValues() []ResultType { + return []ResultType{Data, Metadata} } // ScaleDirection enumerates the values for scale direction. @@ -270,8 +270,8 @@ const ( ) // PossibleScaleDirectionValues returns an array of possible values for the ScaleDirection const type. -func PossibleScaleDirectionValues() [3]ScaleDirection { - return [3]ScaleDirection{ScaleDirectionDecrease, ScaleDirectionIncrease, ScaleDirectionNone} +func PossibleScaleDirectionValues() []ScaleDirection { + return []ScaleDirection{ScaleDirectionDecrease, ScaleDirectionIncrease, ScaleDirectionNone} } // ScaleType enumerates the values for scale type. @@ -287,8 +287,8 @@ const ( ) // PossibleScaleTypeValues returns an array of possible values for the ScaleType const type. -func PossibleScaleTypeValues() [3]ScaleType { - return [3]ScaleType{ChangeCount, ExactCount, PercentChangeCount} +func PossibleScaleTypeValues() []ScaleType { + return []ScaleType{ChangeCount, ExactCount, PercentChangeCount} } // Sensitivity enumerates the values for sensitivity. @@ -304,8 +304,8 @@ const ( ) // PossibleSensitivityValues returns an array of possible values for the Sensitivity const type. -func PossibleSensitivityValues() [3]Sensitivity { - return [3]Sensitivity{High, Low, Medium} +func PossibleSensitivityValues() []Sensitivity { + return []Sensitivity{High, Low, Medium} } // TimeAggregationOperator enumerates the values for time aggregation operator. @@ -325,8 +325,8 @@ const ( ) // PossibleTimeAggregationOperatorValues returns an array of possible values for the TimeAggregationOperator const type. -func PossibleTimeAggregationOperatorValues() [5]TimeAggregationOperator { - return [5]TimeAggregationOperator{TimeAggregationOperatorAverage, TimeAggregationOperatorLast, TimeAggregationOperatorMaximum, TimeAggregationOperatorMinimum, TimeAggregationOperatorTotal} +func PossibleTimeAggregationOperatorValues() []TimeAggregationOperator { + return []TimeAggregationOperator{TimeAggregationOperatorAverage, TimeAggregationOperatorLast, TimeAggregationOperatorMaximum, TimeAggregationOperatorMinimum, TimeAggregationOperatorTotal} } // TimeAggregationType enumerates the values for time aggregation type. @@ -346,8 +346,8 @@ const ( ) // PossibleTimeAggregationTypeValues returns an array of possible values for the TimeAggregationType const type. -func PossibleTimeAggregationTypeValues() [5]TimeAggregationType { - return [5]TimeAggregationType{TimeAggregationTypeAverage, TimeAggregationTypeCount, TimeAggregationTypeMaximum, TimeAggregationTypeMinimum, TimeAggregationTypeTotal} +func PossibleTimeAggregationTypeValues() []TimeAggregationType { + return []TimeAggregationType{TimeAggregationTypeAverage, TimeAggregationTypeCount, TimeAggregationTypeMaximum, TimeAggregationTypeMinimum, TimeAggregationTypeTotal} } // Unit enumerates the values for unit. @@ -375,8 +375,8 @@ const ( ) // PossibleUnitValues returns an array of possible values for the Unit const type. -func PossibleUnitValues() [9]Unit { - return [9]Unit{UnitBytes, UnitByteSeconds, UnitBytesPerSecond, UnitCount, UnitCountPerSecond, UnitMilliSeconds, UnitPercent, UnitSeconds, UnitUnspecified} +func PossibleUnitValues() []Unit { + return []Unit{UnitBytes, UnitByteSeconds, UnitBytesPerSecond, UnitCount, UnitCountPerSecond, UnitMilliSeconds, UnitPercent, UnitSeconds, UnitUnspecified} } // ActionGroup an Azure action group. @@ -401,6 +401,8 @@ type ActionGroup struct { VoiceReceivers *[]VoiceReceiver `json:"voiceReceivers,omitempty"` // LogicAppReceivers - The list of logic app receivers that are part of this action group. LogicAppReceivers *[]LogicAppReceiver `json:"logicAppReceivers,omitempty"` + // AzureFunctionReceivers - The list of azure function receivers that are part of this action group. + AzureFunctionReceivers *[]AzureFunctionReceiver `json:"azureFunctionReceivers,omitempty"` } // ActionGroupList a list of action groups. @@ -1396,6 +1398,18 @@ type AzureAppPushReceiver struct { EmailAddress *string `json:"emailAddress,omitempty"` } +// AzureFunctionReceiver an azure function receiver. +type AzureFunctionReceiver struct { + // Name - The name of the azure function receiver. Names must be unique across all receivers within an action group. + Name *string `json:"name,omitempty"` + // FunctionAppResourceID - The azure resource id of the function app. + FunctionAppResourceID *string `json:"functionAppResourceId,omitempty"` + // FunctionName - The function name in the function app. + FunctionName *string `json:"functionName,omitempty"` + // HTTPTriggerURL - The http trigger url where http request sent to. + HTTPTriggerURL *string `json:"httpTriggerUrl,omitempty"` +} + // Baseline the baseline values for a single sensitivity value. type Baseline struct { // Sensitivity - the sensitivity of the baseline. Possible values include: 'Low', 'Medium', 'High' diff --git a/services/monitor/mgmt/2018-03-01/insights/operations.go b/services/monitor/mgmt/2018-03-01/insights/operationsgroup.go similarity index 63% rename from services/monitor/mgmt/2018-03-01/insights/operations.go rename to services/monitor/mgmt/2018-03-01/insights/operationsgroup.go index bcfbfcf93b3d..959f11660790 100644 --- a/services/monitor/mgmt/2018-03-01/insights/operations.go +++ b/services/monitor/mgmt/2018-03-01/insights/operationsgroup.go @@ -24,46 +24,46 @@ import ( "net/http" ) -// OperationsClient is the monitor Management Client -type OperationsClient struct { +// OperationsGroupClient is the monitor Management Client +type OperationsGroupClient struct { BaseClient } -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewOperationsGroupClient creates an instance of the OperationsGroupClient client. +func NewOperationsGroupClient(subscriptionID string) OperationsGroupClient { + return NewOperationsGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewOperationsGroupClientWithBaseURI creates an instance of the OperationsGroupClient client. +func NewOperationsGroupClientWithBaseURI(baseURI string, subscriptionID string) OperationsGroupClient { + return OperationsGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // List lists all of the available operations from Microsoft.Insights provider. -func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { +func (client OperationsGroupClient) List(ctx context.Context) (result OperationListResult, err error) { req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "insights.OperationsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "insights.OperationsGroupClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.OperationsClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "insights.OperationsGroupClient", "List", resp, "Failure sending request") return } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "insights.OperationsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "insights.OperationsGroupClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { +func (client OperationsGroupClient) ListPreparer(ctx context.Context) (*http.Request, error) { const APIVersion = "2015-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, @@ -79,14 +79,14 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { +func (client OperationsGroupClient) ListSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { +func (client OperationsGroupClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(),