diff --git a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/CHANGELOG.md b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/CHANGELOG.md new file mode 100644 index 000000000000..45798ebd2177 --- /dev/null +++ b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/CHANGELOG.md @@ -0,0 +1,8 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82 + +Code generator @microsoft.azure/autorest.go@~2.1.161 + +## Breaking Changes + +- Function `NewOperationsListPage` parameter(s) have been changed from `(func(context.Context, OperationsList) (OperationsList, error))` to `(OperationsList, func(context.Context, OperationsList) (OperationsList, error))` +- Function `NewAlertsListPage` parameter(s) have been changed from `(func(context.Context, AlertsList) (AlertsList, error))` to `(AlertsList, func(context.Context, AlertsList) (AlertsList, error))` diff --git a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/alerts.go b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/alerts.go index d43f83ac01c8..c6e4e119716d 100644 --- a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/alerts.go +++ b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/alerts.go @@ -72,6 +72,7 @@ func (client AlertsClient) ChangeState(ctx context.Context, alertID string, newS result, err = client.ChangeStateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.AlertsClient", "ChangeState", resp, "Failure responding to request") + return } return @@ -160,9 +161,11 @@ func (client AlertsClient) GetAll(ctx context.Context, targetResource string, ta result.al, err = client.GetAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.AlertsClient", "GetAll", resp, "Failure responding to request") + return } if result.al.hasNextLink() && result.al.IsEmpty() { err = result.NextWithContext(ctx) + return } return @@ -311,6 +314,7 @@ func (client AlertsClient) GetByID(ctx context.Context, alertID string) (result result, err = client.GetByIDResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.AlertsClient", "GetByID", resp, "Failure responding to request") + return } return @@ -384,6 +388,7 @@ func (client AlertsClient) GetHistory(ctx context.Context, alertID string) (resu result, err = client.GetHistoryResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.AlertsClient", "GetHistory", resp, "Failure responding to request") + return } return @@ -458,6 +463,7 @@ func (client AlertsClient) GetSummary(ctx context.Context, targetResourceGroup s result, err = client.GetSummaryResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.AlertsClient", "GetSummary", resp, "Failure responding to request") + return } return diff --git a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/models.go b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/models.go index 72d539228bcf..bbf0472a094e 100644 --- a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/models.go +++ b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/models.go @@ -364,8 +364,11 @@ func (page AlertsListPage) Values() []Alert { } // Creates a new instance of the AlertsListPage type. -func NewAlertsListPage(getNextPage func(context.Context, AlertsList) (AlertsList, error)) AlertsListPage { - return AlertsListPage{fn: getNextPage} +func NewAlertsListPage(cur AlertsList, getNextPage func(context.Context, AlertsList) (AlertsList, error)) AlertsListPage { + return AlertsListPage{ + fn: getNextPage, + al: cur, + } } // AlertsSummary summary of the alerts. @@ -494,7 +497,8 @@ type AlertsSummaryBySeverityAndMonitorCondition struct { Sev4 *AlertsSummaryBySeverityAndMonitorConditionSev4 `json:"sev4,omitempty"` } -// AlertsSummaryBySeverityAndMonitorConditionSev0 summary of alerts by monitor condition with severity 'Sev0' +// AlertsSummaryBySeverityAndMonitorConditionSev0 summary of alerts by monitor condition with severity +// 'Sev0' type AlertsSummaryBySeverityAndMonitorConditionSev0 struct { // Fired - Count of alerts with monitorCondition 'Fired' Fired *int32 `json:"fired,omitempty"` @@ -502,7 +506,8 @@ type AlertsSummaryBySeverityAndMonitorConditionSev0 struct { Resolved *int32 `json:"resolved,omitempty"` } -// AlertsSummaryBySeverityAndMonitorConditionSev1 summary of alerts by monitor condition with severity 'Sev1' +// AlertsSummaryBySeverityAndMonitorConditionSev1 summary of alerts by monitor condition with severity +// 'Sev1' type AlertsSummaryBySeverityAndMonitorConditionSev1 struct { // Fired - Count of alerts with monitorCondition 'Fired' Fired *int32 `json:"fired,omitempty"` @@ -510,7 +515,8 @@ type AlertsSummaryBySeverityAndMonitorConditionSev1 struct { Resolved *int32 `json:"resolved,omitempty"` } -// AlertsSummaryBySeverityAndMonitorConditionSev2 summary of alerts by monitor condition with severity 'Sev2' +// AlertsSummaryBySeverityAndMonitorConditionSev2 summary of alerts by monitor condition with severity +// 'Sev2' type AlertsSummaryBySeverityAndMonitorConditionSev2 struct { // Fired - Count of alerts with monitorCondition 'Fired' Fired *int32 `json:"fired,omitempty"` @@ -518,7 +524,8 @@ type AlertsSummaryBySeverityAndMonitorConditionSev2 struct { Resolved *int32 `json:"resolved,omitempty"` } -// AlertsSummaryBySeverityAndMonitorConditionSev3 summary of alerts by monitor condition with severity 'Sev3' +// AlertsSummaryBySeverityAndMonitorConditionSev3 summary of alerts by monitor condition with severity +// 'Sev3' type AlertsSummaryBySeverityAndMonitorConditionSev3 struct { // Fired - Count of alerts with monitorCondition 'Fired' Fired *int32 `json:"fired,omitempty"` @@ -526,7 +533,8 @@ type AlertsSummaryBySeverityAndMonitorConditionSev3 struct { Resolved *int32 `json:"resolved,omitempty"` } -// AlertsSummaryBySeverityAndMonitorConditionSev4 summary of alerts by monitor condition with severity 'Sev4' +// AlertsSummaryBySeverityAndMonitorConditionSev4 summary of alerts by monitor condition with severity +// 'Sev4' type AlertsSummaryBySeverityAndMonitorConditionSev4 struct { // Fired - Count of alerts with monitorCondition 'Fired' Fired *int32 `json:"fired,omitempty"` @@ -872,8 +880,11 @@ func (page OperationsListPage) Values() []Operation { } // Creates a new instance of the OperationsListPage type. -func NewOperationsListPage(getNextPage func(context.Context, OperationsList) (OperationsList, error)) OperationsListPage { - return OperationsListPage{fn: getNextPage} +func NewOperationsListPage(cur OperationsList, getNextPage func(context.Context, OperationsList) (OperationsList, error)) OperationsListPage { + return OperationsListPage{ + fn: getNextPage, + ol: cur, + } } // Resource an azure resource object diff --git a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/operations.go b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/operations.go index 2381df3180d0..4ae771a0ca8b 100644 --- a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/operations.go +++ b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/operations.go @@ -70,9 +70,11 @@ func (client OperationsClient) List(ctx context.Context) (result OperationsListP result.ol, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.OperationsClient", "List", resp, "Failure responding to request") + return } if result.ol.hasNextLink() && result.ol.IsEmpty() { err = result.NextWithContext(ctx) + return } return diff --git a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/smartgroups.go b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/smartgroups.go index 99b120681448..402044879e0c 100644 --- a/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/smartgroups.go +++ b/services/preview/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement/smartgroups.go @@ -73,6 +73,7 @@ func (client SmartGroupsClient) ChangeState(ctx context.Context, smartGroupID st result, err = client.ChangeStateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.SmartGroupsClient", "ChangeState", resp, "Failure responding to request") + return } return @@ -157,6 +158,7 @@ func (client SmartGroupsClient) GetAll(ctx context.Context, targetResource strin result, err = client.GetAllResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.SmartGroupsClient", "GetAll", resp, "Failure responding to request") + return } return @@ -262,6 +264,7 @@ func (client SmartGroupsClient) GetByID(ctx context.Context, smartGroupID string result, err = client.GetByIDResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.SmartGroupsClient", "GetByID", resp, "Failure responding to request") + return } return @@ -335,6 +338,7 @@ func (client SmartGroupsClient) GetHistory(ctx context.Context, smartGroupID str result, err = client.GetHistoryResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "alertsmanagement.SmartGroupsClient", "GetHistory", resp, "Failure responding to request") + return } return