diff --git a/sdk/resourcemanager/monitor/armmonitor/CHANGELOG.md b/sdk/resourcemanager/monitor/armmonitor/CHANGELOG.md index 59a3eb8955a7..8ea1a78a8cca 100644 --- a/sdk/resourcemanager/monitor/armmonitor/CHANGELOG.md +++ b/sdk/resourcemanager/monitor/armmonitor/CHANGELOG.md @@ -1,8 +1,10 @@ # Release History -## 0.10.1 (2023-07-18) +## 0.10.1 (2023-07-19) -- Update `azcore` to latest beta version. +### Bug Fixes + +- Fixed a potential panic in faked paged and long-running operations. ## 0.10.0 (2023-06-13) diff --git a/sdk/resourcemanager/monitor/armmonitor/build.go b/sdk/resourcemanager/monitor/armmonitor/build.go index 418e64373da6..71e8fa011e95 100644 --- a/sdk/resourcemanager/monitor/armmonitor/build.go +++ b/sdk/resourcemanager/monitor/armmonitor/build.go @@ -2,6 +2,6 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -goExtension "@autorest/go@4.0.0-preview.51" -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/monitor/armmonitor +//go:generate pwsh ../../../../eng/scripts/build.ps1 -goExtension "@autorest/go@4.0.0-preview.53" -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/monitor/armmonitor package armmonitor diff --git a/sdk/resourcemanager/monitor/armmonitor/client_factory.go b/sdk/resourcemanager/monitor/armmonitor/client_factory.go index c0762a73286d..ad1c5b830b04 100644 --- a/sdk/resourcemanager/monitor/armmonitor/client_factory.go +++ b/sdk/resourcemanager/monitor/armmonitor/client_factory.go @@ -37,18 +37,18 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewAutoscaleSettingsClient() *AutoscaleSettingsClient { - subClient, _ := NewAutoscaleSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewActionGroupsClient() *ActionGroupsClient { + subClient, _ := NewActionGroupsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPredictiveMetricClient() *PredictiveMetricClient { - subClient, _ := NewPredictiveMetricClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewActivityLogAlertsClient() *ActivityLogAlertsClient { + subClient, _ := NewActivityLogAlertsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewActivityLogsClient() *ActivityLogsClient { + subClient, _ := NewActivityLogsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -62,58 +62,53 @@ func (c *ClientFactory) NewAlertRulesClient() *AlertRulesClient { return subClient } -func (c *ClientFactory) NewLogProfilesClient() *LogProfilesClient { - subClient, _ := NewLogProfilesClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewDiagnosticSettingsClient() *DiagnosticSettingsClient { - subClient, _ := NewDiagnosticSettingsClient(c.credential, c.options) +func (c *ClientFactory) NewAutoscaleSettingsClient() *AutoscaleSettingsClient { + subClient, _ := NewAutoscaleSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDiagnosticSettingsCategoryClient() *DiagnosticSettingsCategoryClient { - subClient, _ := NewDiagnosticSettingsCategoryClient(c.credential, c.options) +func (c *ClientFactory) NewAzureMonitorWorkspacesClient() *AzureMonitorWorkspacesClient { + subClient, _ := NewAzureMonitorWorkspacesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewActionGroupsClient() *ActionGroupsClient { - subClient, _ := NewActionGroupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBaselinesClient() *BaselinesClient { + subClient, _ := NewBaselinesClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewTenantActionGroupsClient() *TenantActionGroupsClient { - subClient, _ := NewTenantActionGroupsClient(c.credential, c.options) +func (c *ClientFactory) NewDataCollectionEndpointsClient() *DataCollectionEndpointsClient { + subClient, _ := NewDataCollectionEndpointsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewActivityLogsClient() *ActivityLogsClient { - subClient, _ := NewActivityLogsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDataCollectionRuleAssociationsClient() *DataCollectionRuleAssociationsClient { + subClient, _ := NewDataCollectionRuleAssociationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewEventCategoriesClient() *EventCategoriesClient { - subClient, _ := NewEventCategoriesClient(c.credential, c.options) +func (c *ClientFactory) NewDataCollectionRulesClient() *DataCollectionRulesClient { + subClient, _ := NewDataCollectionRulesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewTenantActivityLogsClient() *TenantActivityLogsClient { - subClient, _ := NewTenantActivityLogsClient(c.credential, c.options) +func (c *ClientFactory) NewDiagnosticSettingsCategoryClient() *DiagnosticSettingsCategoryClient { + subClient, _ := NewDiagnosticSettingsCategoryClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewMetricDefinitionsClient() *MetricDefinitionsClient { - subClient, _ := NewMetricDefinitionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDiagnosticSettingsClient() *DiagnosticSettingsClient { + subClient, _ := NewDiagnosticSettingsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewMetricsClient() *MetricsClient { - subClient, _ := NewMetricsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewEventCategoriesClient() *EventCategoriesClient { + subClient, _ := NewEventCategoriesClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewBaselinesClient() *BaselinesClient { - subClient, _ := NewBaselinesClient(c.credential, c.options) +func (c *ClientFactory) NewLogProfilesClient() *LogProfilesClient { + subClient, _ := NewLogProfilesClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -127,8 +122,8 @@ func (c *ClientFactory) NewMetricAlertsStatusClient() *MetricAlertsStatusClient return subClient } -func (c *ClientFactory) NewScheduledQueryRulesClient() *ScheduledQueryRulesClient { - subClient, _ := NewScheduledQueryRulesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewMetricDefinitionsClient() *MetricDefinitionsClient { + subClient, _ := NewMetricDefinitionsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -137,23 +132,23 @@ func (c *ClientFactory) NewMetricNamespacesClient() *MetricNamespacesClient { return subClient } -func (c *ClientFactory) NewVMInsightsClient() *VMInsightsClient { - subClient, _ := NewVMInsightsClient(c.credential, c.options) +func (c *ClientFactory) NewMetricsClient() *MetricsClient { + subClient, _ := NewMetricsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPrivateLinkScopesClient() *PrivateLinkScopesClient { - subClient, _ := NewPrivateLinkScopesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewPrivateLinkScopeOperationStatusClient() *PrivateLinkScopeOperationStatusClient { - subClient, _ := NewPrivateLinkScopeOperationStatusClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsForMonitorClient() *OperationsForMonitorClient { + subClient, _ := NewOperationsForMonitorClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPredictiveMetricClient() *PredictiveMetricClient { + subClient, _ := NewPredictiveMetricClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -162,37 +157,42 @@ func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointCo return subClient } -func (c *ClientFactory) NewPrivateLinkScopedResourcesClient() *PrivateLinkScopedResourcesClient { - subClient, _ := NewPrivateLinkScopedResourcesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { + subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewActivityLogAlertsClient() *ActivityLogAlertsClient { - subClient, _ := NewActivityLogAlertsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPrivateLinkScopeOperationStatusClient() *PrivateLinkScopeOperationStatusClient { + subClient, _ := NewPrivateLinkScopeOperationStatusClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDataCollectionEndpointsClient() *DataCollectionEndpointsClient { - subClient, _ := NewDataCollectionEndpointsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPrivateLinkScopedResourcesClient() *PrivateLinkScopedResourcesClient { + subClient, _ := NewPrivateLinkScopedResourcesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDataCollectionRuleAssociationsClient() *DataCollectionRuleAssociationsClient { - subClient, _ := NewDataCollectionRuleAssociationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPrivateLinkScopesClient() *PrivateLinkScopesClient { + subClient, _ := NewPrivateLinkScopesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDataCollectionRulesClient() *DataCollectionRulesClient { - subClient, _ := NewDataCollectionRulesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewScheduledQueryRulesClient() *ScheduledQueryRulesClient { + subClient, _ := NewScheduledQueryRulesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAzureMonitorWorkspacesClient() *AzureMonitorWorkspacesClient { - subClient, _ := NewAzureMonitorWorkspacesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewTenantActionGroupsClient() *TenantActionGroupsClient { + subClient, _ := NewTenantActionGroupsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewOperationsForMonitorClient() *OperationsForMonitorClient { - subClient, _ := NewOperationsForMonitorClient(c.credential, c.options) +func (c *ClientFactory) NewTenantActivityLogsClient() *TenantActivityLogsClient { + subClient, _ := NewTenantActivityLogsClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVMInsightsClient() *VMInsightsClient { + subClient, _ := NewVMInsightsClient(c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/actiongroups_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/actiongroups_server.go index 3841ae3529ac..cb33ca46f1fd 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/actiongroups_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/actiongroups_server.go @@ -61,19 +61,24 @@ type ActionGroupsServer struct { } // NewActionGroupsServerTransport creates a new instance of ActionGroupsServerTransport with the provided implementation. -// The returned ActionGroupsServerTransport instance is connected to an instance of armmonitor.ActionGroupsClient by way of the -// undefined.Transporter field. +// The returned ActionGroupsServerTransport instance is connected to an instance of armmonitor.ActionGroupsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewActionGroupsServerTransport(srv *ActionGroupsServer) *ActionGroupsServerTransport { - return &ActionGroupsServerTransport{srv: srv} + return &ActionGroupsServerTransport{ + srv: srv, + beginCreateNotificationsAtActionGroupResourceLevel: newTracker[azfake.PollerResponder[armmonitor.ActionGroupsClientCreateNotificationsAtActionGroupResourceLevelResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmonitor.ActionGroupsClientListByResourceGroupResponse]](), + newListBySubscriptionIDPager: newTracker[azfake.PagerResponder[armmonitor.ActionGroupsClientListBySubscriptionIDResponse]](), + } } // ActionGroupsServerTransport connects instances of armmonitor.ActionGroupsClient to instances of ActionGroupsServer. // Don't use this type directly, use NewActionGroupsServerTransport instead. type ActionGroupsServerTransport struct { srv *ActionGroupsServer - beginCreateNotificationsAtActionGroupResourceLevel *azfake.PollerResponder[armmonitor.ActionGroupsClientCreateNotificationsAtActionGroupResourceLevelResponse] - newListByResourceGroupPager *azfake.PagerResponder[armmonitor.ActionGroupsClientListByResourceGroupResponse] - newListBySubscriptionIDPager *azfake.PagerResponder[armmonitor.ActionGroupsClientListBySubscriptionIDResponse] + beginCreateNotificationsAtActionGroupResourceLevel *tracker[azfake.PollerResponder[armmonitor.ActionGroupsClientCreateNotificationsAtActionGroupResourceLevelResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armmonitor.ActionGroupsClientListByResourceGroupResponse]] + newListBySubscriptionIDPager *tracker[azfake.PagerResponder[armmonitor.ActionGroupsClientListBySubscriptionIDResponse]] } // Do implements the policy.Transporter interface for ActionGroupsServerTransport. @@ -121,7 +126,8 @@ func (a *ActionGroupsServerTransport) dispatchBeginCreateNotificationsAtActionGr if a.srv.BeginCreateNotificationsAtActionGroupResourceLevel == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateNotificationsAtActionGroupResourceLevel not implemented")} } - if a.beginCreateNotificationsAtActionGroupResourceLevel == nil { + beginCreateNotificationsAtActionGroupResourceLevel := a.beginCreateNotificationsAtActionGroupResourceLevel.get(req) + if beginCreateNotificationsAtActionGroupResourceLevel == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/actionGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/createNotifications` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -144,19 +150,21 @@ func (a *ActionGroupsServerTransport) dispatchBeginCreateNotificationsAtActionGr if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - a.beginCreateNotificationsAtActionGroupResourceLevel = &respr + beginCreateNotificationsAtActionGroupResourceLevel = &respr + a.beginCreateNotificationsAtActionGroupResourceLevel.add(req, beginCreateNotificationsAtActionGroupResourceLevel) } - resp, err := server.PollerResponderNext(a.beginCreateNotificationsAtActionGroupResourceLevel, req) + resp, err := server.PollerResponderNext(beginCreateNotificationsAtActionGroupResourceLevel, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + a.beginCreateNotificationsAtActionGroupResourceLevel.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(a.beginCreateNotificationsAtActionGroupResourceLevel) { - a.beginCreateNotificationsAtActionGroupResourceLevel = nil + if !server.PollerResponderMore(beginCreateNotificationsAtActionGroupResourceLevel) { + a.beginCreateNotificationsAtActionGroupResourceLevel.remove(req) } return resp, nil @@ -343,7 +351,8 @@ func (a *ActionGroupsServerTransport) dispatchNewListByResourceGroupPager(req *h if a.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if a.newListByResourceGroupPager == nil { + newListByResourceGroupPager := a.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/actionGroups` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -355,17 +364,19 @@ func (a *ActionGroupsServerTransport) dispatchNewListByResourceGroupPager(req *h return nil, err } resp := a.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - a.newListByResourceGroupPager = &resp + newListByResourceGroupPager = &resp + a.newListByResourceGroupPager.add(req, newListByResourceGroupPager) } - resp, err := server.PagerResponderNext(a.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListByResourceGroupPager) { - a.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + a.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -374,7 +385,8 @@ func (a *ActionGroupsServerTransport) dispatchNewListBySubscriptionIDPager(req * if a.srv.NewListBySubscriptionIDPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionIDPager not implemented")} } - if a.newListBySubscriptionIDPager == nil { + newListBySubscriptionIDPager := a.newListBySubscriptionIDPager.get(req) + if newListBySubscriptionIDPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/actionGroups` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -382,17 +394,19 @@ func (a *ActionGroupsServerTransport) dispatchNewListBySubscriptionIDPager(req * return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := a.srv.NewListBySubscriptionIDPager(nil) - a.newListBySubscriptionIDPager = &resp + newListBySubscriptionIDPager = &resp + a.newListBySubscriptionIDPager.add(req, newListBySubscriptionIDPager) } - resp, err := server.PagerResponderNext(a.newListBySubscriptionIDPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionIDPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListBySubscriptionIDPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListBySubscriptionIDPager) { - a.newListBySubscriptionIDPager = nil + if !server.PagerResponderMore(newListBySubscriptionIDPager) { + a.newListBySubscriptionIDPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/activitylogalerts_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/activitylogalerts_server.go index bf70204d1171..2637dbd0babe 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/activitylogalerts_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/activitylogalerts_server.go @@ -50,18 +50,22 @@ type ActivityLogAlertsServer struct { } // NewActivityLogAlertsServerTransport creates a new instance of ActivityLogAlertsServerTransport with the provided implementation. -// The returned ActivityLogAlertsServerTransport instance is connected to an instance of armmonitor.ActivityLogAlertsClient by way of the -// undefined.Transporter field. +// The returned ActivityLogAlertsServerTransport instance is connected to an instance of armmonitor.ActivityLogAlertsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewActivityLogAlertsServerTransport(srv *ActivityLogAlertsServer) *ActivityLogAlertsServerTransport { - return &ActivityLogAlertsServerTransport{srv: srv} + return &ActivityLogAlertsServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmonitor.ActivityLogAlertsClientListByResourceGroupResponse]](), + newListBySubscriptionIDPager: newTracker[azfake.PagerResponder[armmonitor.ActivityLogAlertsClientListBySubscriptionIDResponse]](), + } } // ActivityLogAlertsServerTransport connects instances of armmonitor.ActivityLogAlertsClient to instances of ActivityLogAlertsServer. // Don't use this type directly, use NewActivityLogAlertsServerTransport instead. type ActivityLogAlertsServerTransport struct { srv *ActivityLogAlertsServer - newListByResourceGroupPager *azfake.PagerResponder[armmonitor.ActivityLogAlertsClientListByResourceGroupResponse] - newListBySubscriptionIDPager *azfake.PagerResponder[armmonitor.ActivityLogAlertsClientListBySubscriptionIDResponse] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armmonitor.ActivityLogAlertsClientListByResourceGroupResponse]] + newListBySubscriptionIDPager *tracker[azfake.PagerResponder[armmonitor.ActivityLogAlertsClientListBySubscriptionIDResponse]] } // Do implements the policy.Transporter interface for ActivityLogAlertsServerTransport. @@ -206,7 +210,8 @@ func (a *ActivityLogAlertsServerTransport) dispatchNewListByResourceGroupPager(r if a.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if a.newListByResourceGroupPager == nil { + newListByResourceGroupPager := a.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/activityLogAlerts` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -218,20 +223,22 @@ func (a *ActivityLogAlertsServerTransport) dispatchNewListByResourceGroupPager(r return nil, err } resp := a.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - a.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(a.newListByResourceGroupPager, req, func(page *armmonitor.ActivityLogAlertsClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + a.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armmonitor.ActivityLogAlertsClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(a.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListByResourceGroupPager) { - a.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + a.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -240,7 +247,8 @@ func (a *ActivityLogAlertsServerTransport) dispatchNewListBySubscriptionIDPager( if a.srv.NewListBySubscriptionIDPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionIDPager not implemented")} } - if a.newListBySubscriptionIDPager == nil { + newListBySubscriptionIDPager := a.newListBySubscriptionIDPager.get(req) + if newListBySubscriptionIDPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/activityLogAlerts` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -248,20 +256,22 @@ func (a *ActivityLogAlertsServerTransport) dispatchNewListBySubscriptionIDPager( return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := a.srv.NewListBySubscriptionIDPager(nil) - a.newListBySubscriptionIDPager = &resp - server.PagerResponderInjectNextLinks(a.newListBySubscriptionIDPager, req, func(page *armmonitor.ActivityLogAlertsClientListBySubscriptionIDResponse, createLink func() string) { + newListBySubscriptionIDPager = &resp + a.newListBySubscriptionIDPager.add(req, newListBySubscriptionIDPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionIDPager, req, func(page *armmonitor.ActivityLogAlertsClientListBySubscriptionIDResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(a.newListBySubscriptionIDPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionIDPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListBySubscriptionIDPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListBySubscriptionIDPager) { - a.newListBySubscriptionIDPager = nil + if !server.PagerResponderMore(newListBySubscriptionIDPager) { + a.newListBySubscriptionIDPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/activitylogs_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/activitylogs_server.go index cffd902c026f..f3a6e9d69e25 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/activitylogs_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/activitylogs_server.go @@ -29,17 +29,20 @@ type ActivityLogsServer struct { } // NewActivityLogsServerTransport creates a new instance of ActivityLogsServerTransport with the provided implementation. -// The returned ActivityLogsServerTransport instance is connected to an instance of armmonitor.ActivityLogsClient by way of the -// undefined.Transporter field. +// The returned ActivityLogsServerTransport instance is connected to an instance of armmonitor.ActivityLogsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewActivityLogsServerTransport(srv *ActivityLogsServer) *ActivityLogsServerTransport { - return &ActivityLogsServerTransport{srv: srv} + return &ActivityLogsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmonitor.ActivityLogsClientListResponse]](), + } } // ActivityLogsServerTransport connects instances of armmonitor.ActivityLogsClient to instances of ActivityLogsServer. // Don't use this type directly, use NewActivityLogsServerTransport instead. type ActivityLogsServerTransport struct { srv *ActivityLogsServer - newListPager *azfake.PagerResponder[armmonitor.ActivityLogsClientListResponse] + newListPager *tracker[azfake.PagerResponder[armmonitor.ActivityLogsClientListResponse]] } // Do implements the policy.Transporter interface for ActivityLogsServerTransport. @@ -71,7 +74,8 @@ func (a *ActivityLogsServerTransport) dispatchNewListPager(req *http.Request) (* if a.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if a.newListPager == nil { + newListPager := a.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/eventtypes/management/values` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -95,20 +99,22 @@ func (a *ActivityLogsServerTransport) dispatchNewListPager(req *http.Request) (* } } resp := a.srv.NewListPager(filterUnescaped, options) - a.newListPager = &resp - server.PagerResponderInjectNextLinks(a.newListPager, req, func(page *armmonitor.ActivityLogsClientListResponse, createLink func() string) { + newListPager = &resp + a.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmonitor.ActivityLogsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(a.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListPager) { - a.newListPager = nil + if !server.PagerResponderMore(newListPager) { + a.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/alertruleincidents_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/alertruleincidents_server.go index 7fefd0a51f0d..252f6bd4f0d1 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/alertruleincidents_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/alertruleincidents_server.go @@ -33,17 +33,20 @@ type AlertRuleIncidentsServer struct { } // NewAlertRuleIncidentsServerTransport creates a new instance of AlertRuleIncidentsServerTransport with the provided implementation. -// The returned AlertRuleIncidentsServerTransport instance is connected to an instance of armmonitor.AlertRuleIncidentsClient by way of the -// undefined.Transporter field. +// The returned AlertRuleIncidentsServerTransport instance is connected to an instance of armmonitor.AlertRuleIncidentsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewAlertRuleIncidentsServerTransport(srv *AlertRuleIncidentsServer) *AlertRuleIncidentsServerTransport { - return &AlertRuleIncidentsServerTransport{srv: srv} + return &AlertRuleIncidentsServerTransport{ + srv: srv, + newListByAlertRulePager: newTracker[azfake.PagerResponder[armmonitor.AlertRuleIncidentsClientListByAlertRuleResponse]](), + } } // AlertRuleIncidentsServerTransport connects instances of armmonitor.AlertRuleIncidentsClient to instances of AlertRuleIncidentsServer. // Don't use this type directly, use NewAlertRuleIncidentsServerTransport instead. type AlertRuleIncidentsServerTransport struct { srv *AlertRuleIncidentsServer - newListByAlertRulePager *azfake.PagerResponder[armmonitor.AlertRuleIncidentsClientListByAlertRuleResponse] + newListByAlertRulePager *tracker[azfake.PagerResponder[armmonitor.AlertRuleIncidentsClientListByAlertRuleResponse]] } // Do implements the policy.Transporter interface for AlertRuleIncidentsServerTransport. @@ -114,7 +117,8 @@ func (a *AlertRuleIncidentsServerTransport) dispatchNewListByAlertRulePager(req if a.srv.NewListByAlertRulePager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByAlertRulePager not implemented")} } - if a.newListByAlertRulePager == nil { + newListByAlertRulePager := a.newListByAlertRulePager.get(req) + if newListByAlertRulePager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft.insights/alertrules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/incidents` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -130,17 +134,19 @@ func (a *AlertRuleIncidentsServerTransport) dispatchNewListByAlertRulePager(req return nil, err } resp := a.srv.NewListByAlertRulePager(resourceGroupNameUnescaped, ruleNameUnescaped, nil) - a.newListByAlertRulePager = &resp + newListByAlertRulePager = &resp + a.newListByAlertRulePager.add(req, newListByAlertRulePager) } - resp, err := server.PagerResponderNext(a.newListByAlertRulePager, req) + resp, err := server.PagerResponderNext(newListByAlertRulePager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListByAlertRulePager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListByAlertRulePager) { - a.newListByAlertRulePager = nil + if !server.PagerResponderMore(newListByAlertRulePager) { + a.newListByAlertRulePager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/alertrules_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/alertrules_server.go index dbf58aab186b..eff7ec6301ca 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/alertrules_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/alertrules_server.go @@ -49,18 +49,22 @@ type AlertRulesServer struct { } // NewAlertRulesServerTransport creates a new instance of AlertRulesServerTransport with the provided implementation. -// The returned AlertRulesServerTransport instance is connected to an instance of armmonitor.AlertRulesClient by way of the -// undefined.Transporter field. +// The returned AlertRulesServerTransport instance is connected to an instance of armmonitor.AlertRulesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewAlertRulesServerTransport(srv *AlertRulesServer) *AlertRulesServerTransport { - return &AlertRulesServerTransport{srv: srv} + return &AlertRulesServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmonitor.AlertRulesClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armmonitor.AlertRulesClientListBySubscriptionResponse]](), + } } // AlertRulesServerTransport connects instances of armmonitor.AlertRulesClient to instances of AlertRulesServer. // Don't use this type directly, use NewAlertRulesServerTransport instead. type AlertRulesServerTransport struct { srv *AlertRulesServer - newListByResourceGroupPager *azfake.PagerResponder[armmonitor.AlertRulesClientListByResourceGroupResponse] - newListBySubscriptionPager *azfake.PagerResponder[armmonitor.AlertRulesClientListBySubscriptionResponse] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armmonitor.AlertRulesClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armmonitor.AlertRulesClientListBySubscriptionResponse]] } // Do implements the policy.Transporter interface for AlertRulesServerTransport. @@ -205,7 +209,8 @@ func (a *AlertRulesServerTransport) dispatchNewListByResourceGroupPager(req *htt if a.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if a.newListByResourceGroupPager == nil { + newListByResourceGroupPager := a.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/alertrules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -217,17 +222,19 @@ func (a *AlertRulesServerTransport) dispatchNewListByResourceGroupPager(req *htt return nil, err } resp := a.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - a.newListByResourceGroupPager = &resp + newListByResourceGroupPager = &resp + a.newListByResourceGroupPager.add(req, newListByResourceGroupPager) } - resp, err := server.PagerResponderNext(a.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListByResourceGroupPager) { - a.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + a.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -236,7 +243,8 @@ func (a *AlertRulesServerTransport) dispatchNewListBySubscriptionPager(req *http if a.srv.NewListBySubscriptionPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} } - if a.newListBySubscriptionPager == nil { + newListBySubscriptionPager := a.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/alertrules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -244,17 +252,19 @@ func (a *AlertRulesServerTransport) dispatchNewListBySubscriptionPager(req *http return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := a.srv.NewListBySubscriptionPager(nil) - a.newListBySubscriptionPager = &resp + newListBySubscriptionPager = &resp + a.newListBySubscriptionPager.add(req, newListBySubscriptionPager) } - resp, err := server.PagerResponderNext(a.newListBySubscriptionPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListBySubscriptionPager) { - a.newListBySubscriptionPager = nil + if !server.PagerResponderMore(newListBySubscriptionPager) { + a.newListBySubscriptionPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/autoscalesettings_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/autoscalesettings_server.go index 1fce587ed0d5..1fddd7663ff8 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/autoscalesettings_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/autoscalesettings_server.go @@ -50,18 +50,22 @@ type AutoscaleSettingsServer struct { } // NewAutoscaleSettingsServerTransport creates a new instance of AutoscaleSettingsServerTransport with the provided implementation. -// The returned AutoscaleSettingsServerTransport instance is connected to an instance of armmonitor.AutoscaleSettingsClient by way of the -// undefined.Transporter field. +// The returned AutoscaleSettingsServerTransport instance is connected to an instance of armmonitor.AutoscaleSettingsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewAutoscaleSettingsServerTransport(srv *AutoscaleSettingsServer) *AutoscaleSettingsServerTransport { - return &AutoscaleSettingsServerTransport{srv: srv} + return &AutoscaleSettingsServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmonitor.AutoscaleSettingsClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armmonitor.AutoscaleSettingsClientListBySubscriptionResponse]](), + } } // AutoscaleSettingsServerTransport connects instances of armmonitor.AutoscaleSettingsClient to instances of AutoscaleSettingsServer. // Don't use this type directly, use NewAutoscaleSettingsServerTransport instead. type AutoscaleSettingsServerTransport struct { srv *AutoscaleSettingsServer - newListByResourceGroupPager *azfake.PagerResponder[armmonitor.AutoscaleSettingsClientListByResourceGroupResponse] - newListBySubscriptionPager *azfake.PagerResponder[armmonitor.AutoscaleSettingsClientListBySubscriptionResponse] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armmonitor.AutoscaleSettingsClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armmonitor.AutoscaleSettingsClientListBySubscriptionResponse]] } // Do implements the policy.Transporter interface for AutoscaleSettingsServerTransport. @@ -206,7 +210,8 @@ func (a *AutoscaleSettingsServerTransport) dispatchNewListByResourceGroupPager(r if a.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if a.newListByResourceGroupPager == nil { + newListByResourceGroupPager := a.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/autoscalesettings` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -218,20 +223,22 @@ func (a *AutoscaleSettingsServerTransport) dispatchNewListByResourceGroupPager(r return nil, err } resp := a.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - a.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(a.newListByResourceGroupPager, req, func(page *armmonitor.AutoscaleSettingsClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + a.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armmonitor.AutoscaleSettingsClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(a.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListByResourceGroupPager) { - a.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + a.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -240,7 +247,8 @@ func (a *AutoscaleSettingsServerTransport) dispatchNewListBySubscriptionPager(re if a.srv.NewListBySubscriptionPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} } - if a.newListBySubscriptionPager == nil { + newListBySubscriptionPager := a.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/autoscalesettings` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -248,20 +256,22 @@ func (a *AutoscaleSettingsServerTransport) dispatchNewListBySubscriptionPager(re return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := a.srv.NewListBySubscriptionPager(nil) - a.newListBySubscriptionPager = &resp - server.PagerResponderInjectNextLinks(a.newListBySubscriptionPager, req, func(page *armmonitor.AutoscaleSettingsClientListBySubscriptionResponse, createLink func() string) { + newListBySubscriptionPager = &resp + a.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armmonitor.AutoscaleSettingsClientListBySubscriptionResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(a.newListBySubscriptionPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListBySubscriptionPager) { - a.newListBySubscriptionPager = nil + if !server.PagerResponderMore(newListBySubscriptionPager) { + a.newListBySubscriptionPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/azuremonitorworkspaces_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/azuremonitorworkspaces_server.go index 5fad909c936f..3baf3ef7d702 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/azuremonitorworkspaces_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/azuremonitorworkspaces_server.go @@ -51,18 +51,22 @@ type AzureMonitorWorkspacesServer struct { } // NewAzureMonitorWorkspacesServerTransport creates a new instance of AzureMonitorWorkspacesServerTransport with the provided implementation. -// The returned AzureMonitorWorkspacesServerTransport instance is connected to an instance of armmonitor.AzureMonitorWorkspacesClient by way of the -// undefined.Transporter field. +// The returned AzureMonitorWorkspacesServerTransport instance is connected to an instance of armmonitor.AzureMonitorWorkspacesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewAzureMonitorWorkspacesServerTransport(srv *AzureMonitorWorkspacesServer) *AzureMonitorWorkspacesServerTransport { - return &AzureMonitorWorkspacesServerTransport{srv: srv} + return &AzureMonitorWorkspacesServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmonitor.AzureMonitorWorkspacesClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armmonitor.AzureMonitorWorkspacesClientListBySubscriptionResponse]](), + } } // AzureMonitorWorkspacesServerTransport connects instances of armmonitor.AzureMonitorWorkspacesClient to instances of AzureMonitorWorkspacesServer. // Don't use this type directly, use NewAzureMonitorWorkspacesServerTransport instead. type AzureMonitorWorkspacesServerTransport struct { srv *AzureMonitorWorkspacesServer - newListByResourceGroupPager *azfake.PagerResponder[armmonitor.AzureMonitorWorkspacesClientListByResourceGroupResponse] - newListBySubscriptionPager *azfake.PagerResponder[armmonitor.AzureMonitorWorkspacesClientListBySubscriptionResponse] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armmonitor.AzureMonitorWorkspacesClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armmonitor.AzureMonitorWorkspacesClientListBySubscriptionResponse]] } // Do implements the policy.Transporter interface for AzureMonitorWorkspacesServerTransport. @@ -207,7 +211,8 @@ func (a *AzureMonitorWorkspacesServerTransport) dispatchNewListByResourceGroupPa if a.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if a.newListByResourceGroupPager == nil { + newListByResourceGroupPager := a.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Monitor/accounts` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -219,20 +224,22 @@ func (a *AzureMonitorWorkspacesServerTransport) dispatchNewListByResourceGroupPa return nil, err } resp := a.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - a.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(a.newListByResourceGroupPager, req, func(page *armmonitor.AzureMonitorWorkspacesClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + a.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armmonitor.AzureMonitorWorkspacesClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(a.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListByResourceGroupPager) { - a.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + a.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -241,7 +248,8 @@ func (a *AzureMonitorWorkspacesServerTransport) dispatchNewListBySubscriptionPag if a.srv.NewListBySubscriptionPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} } - if a.newListBySubscriptionPager == nil { + newListBySubscriptionPager := a.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Monitor/accounts` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -249,20 +257,22 @@ func (a *AzureMonitorWorkspacesServerTransport) dispatchNewListBySubscriptionPag return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := a.srv.NewListBySubscriptionPager(nil) - a.newListBySubscriptionPager = &resp - server.PagerResponderInjectNextLinks(a.newListBySubscriptionPager, req, func(page *armmonitor.AzureMonitorWorkspacesClientListBySubscriptionResponse, createLink func() string) { + newListBySubscriptionPager = &resp + a.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armmonitor.AzureMonitorWorkspacesClientListBySubscriptionResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(a.newListBySubscriptionPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListBySubscriptionPager) { - a.newListBySubscriptionPager = nil + if !server.PagerResponderMore(newListBySubscriptionPager) { + a.newListBySubscriptionPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/baselines_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/baselines_server.go index f576b60fc089..96af88007a3d 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/baselines_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/baselines_server.go @@ -28,17 +28,20 @@ type BaselinesServer struct { } // NewBaselinesServerTransport creates a new instance of BaselinesServerTransport with the provided implementation. -// The returned BaselinesServerTransport instance is connected to an instance of armmonitor.BaselinesClient by way of the -// undefined.Transporter field. +// The returned BaselinesServerTransport instance is connected to an instance of armmonitor.BaselinesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewBaselinesServerTransport(srv *BaselinesServer) *BaselinesServerTransport { - return &BaselinesServerTransport{srv: srv} + return &BaselinesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmonitor.BaselinesClientListResponse]](), + } } // BaselinesServerTransport connects instances of armmonitor.BaselinesClient to instances of BaselinesServer. // Don't use this type directly, use NewBaselinesServerTransport instead. type BaselinesServerTransport struct { srv *BaselinesServer - newListPager *azfake.PagerResponder[armmonitor.BaselinesClientListResponse] + newListPager *tracker[azfake.PagerResponder[armmonitor.BaselinesClientListResponse]] } // Do implements the policy.Transporter interface for BaselinesServerTransport. @@ -70,7 +73,8 @@ func (b *BaselinesServerTransport) dispatchNewListPager(req *http.Request) (*htt if b.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if b.newListPager == nil { + newListPager := b.newListPager.get(req) + if newListPager == nil { const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/metricBaselines` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -136,17 +140,19 @@ func (b *BaselinesServerTransport) dispatchNewListPager(req *http.Request) (*htt } } resp := b.srv.NewListPager(resourceURIUnescaped, options) - b.newListPager = &resp + newListPager = &resp + b.newListPager.add(req, newListPager) } - resp, err := server.PagerResponderNext(b.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + b.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(b.newListPager) { - b.newListPager = nil + if !server.PagerResponderMore(newListPager) { + b.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/datacollectionendpoints_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/datacollectionendpoints_server.go index f49bceda070b..09b9e9aa733f 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/datacollectionendpoints_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/datacollectionendpoints_server.go @@ -51,18 +51,22 @@ type DataCollectionEndpointsServer struct { } // NewDataCollectionEndpointsServerTransport creates a new instance of DataCollectionEndpointsServerTransport with the provided implementation. -// The returned DataCollectionEndpointsServerTransport instance is connected to an instance of armmonitor.DataCollectionEndpointsClient by way of the -// undefined.Transporter field. +// The returned DataCollectionEndpointsServerTransport instance is connected to an instance of armmonitor.DataCollectionEndpointsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDataCollectionEndpointsServerTransport(srv *DataCollectionEndpointsServer) *DataCollectionEndpointsServerTransport { - return &DataCollectionEndpointsServerTransport{srv: srv} + return &DataCollectionEndpointsServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmonitor.DataCollectionEndpointsClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armmonitor.DataCollectionEndpointsClientListBySubscriptionResponse]](), + } } // DataCollectionEndpointsServerTransport connects instances of armmonitor.DataCollectionEndpointsClient to instances of DataCollectionEndpointsServer. // Don't use this type directly, use NewDataCollectionEndpointsServerTransport instead. type DataCollectionEndpointsServerTransport struct { srv *DataCollectionEndpointsServer - newListByResourceGroupPager *azfake.PagerResponder[armmonitor.DataCollectionEndpointsClientListByResourceGroupResponse] - newListBySubscriptionPager *azfake.PagerResponder[armmonitor.DataCollectionEndpointsClientListBySubscriptionResponse] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armmonitor.DataCollectionEndpointsClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armmonitor.DataCollectionEndpointsClientListBySubscriptionResponse]] } // Do implements the policy.Transporter interface for DataCollectionEndpointsServerTransport. @@ -213,7 +217,8 @@ func (d *DataCollectionEndpointsServerTransport) dispatchNewListByResourceGroupP if d.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if d.newListByResourceGroupPager == nil { + newListByResourceGroupPager := d.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/dataCollectionEndpoints` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -225,20 +230,22 @@ func (d *DataCollectionEndpointsServerTransport) dispatchNewListByResourceGroupP return nil, err } resp := d.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - d.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(d.newListByResourceGroupPager, req, func(page *armmonitor.DataCollectionEndpointsClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + d.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armmonitor.DataCollectionEndpointsClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListByResourceGroupPager) { - d.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + d.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -247,7 +254,8 @@ func (d *DataCollectionEndpointsServerTransport) dispatchNewListBySubscriptionPa if d.srv.NewListBySubscriptionPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} } - if d.newListBySubscriptionPager == nil { + newListBySubscriptionPager := d.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/dataCollectionEndpoints` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -255,20 +263,22 @@ func (d *DataCollectionEndpointsServerTransport) dispatchNewListBySubscriptionPa return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := d.srv.NewListBySubscriptionPager(nil) - d.newListBySubscriptionPager = &resp - server.PagerResponderInjectNextLinks(d.newListBySubscriptionPager, req, func(page *armmonitor.DataCollectionEndpointsClientListBySubscriptionResponse, createLink func() string) { + newListBySubscriptionPager = &resp + d.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armmonitor.DataCollectionEndpointsClientListBySubscriptionResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListBySubscriptionPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListBySubscriptionPager) { - d.newListBySubscriptionPager = nil + if !server.PagerResponderMore(newListBySubscriptionPager) { + d.newListBySubscriptionPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/datacollectionruleassociations_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/datacollectionruleassociations_server.go index a02e449821c9..cf0f0a89e8fd 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/datacollectionruleassociations_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/datacollectionruleassociations_server.go @@ -51,19 +51,24 @@ type DataCollectionRuleAssociationsServer struct { } // NewDataCollectionRuleAssociationsServerTransport creates a new instance of DataCollectionRuleAssociationsServerTransport with the provided implementation. -// The returned DataCollectionRuleAssociationsServerTransport instance is connected to an instance of armmonitor.DataCollectionRuleAssociationsClient by way of the -// undefined.Transporter field. +// The returned DataCollectionRuleAssociationsServerTransport instance is connected to an instance of armmonitor.DataCollectionRuleAssociationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDataCollectionRuleAssociationsServerTransport(srv *DataCollectionRuleAssociationsServer) *DataCollectionRuleAssociationsServerTransport { - return &DataCollectionRuleAssociationsServerTransport{srv: srv} + return &DataCollectionRuleAssociationsServerTransport{ + srv: srv, + newListByDataCollectionEndpointPager: newTracker[azfake.PagerResponder[armmonitor.DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse]](), + newListByResourcePager: newTracker[azfake.PagerResponder[armmonitor.DataCollectionRuleAssociationsClientListByResourceResponse]](), + newListByRulePager: newTracker[azfake.PagerResponder[armmonitor.DataCollectionRuleAssociationsClientListByRuleResponse]](), + } } // DataCollectionRuleAssociationsServerTransport connects instances of armmonitor.DataCollectionRuleAssociationsClient to instances of DataCollectionRuleAssociationsServer. // Don't use this type directly, use NewDataCollectionRuleAssociationsServerTransport instead. type DataCollectionRuleAssociationsServerTransport struct { srv *DataCollectionRuleAssociationsServer - newListByDataCollectionEndpointPager *azfake.PagerResponder[armmonitor.DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse] - newListByResourcePager *azfake.PagerResponder[armmonitor.DataCollectionRuleAssociationsClientListByResourceResponse] - newListByRulePager *azfake.PagerResponder[armmonitor.DataCollectionRuleAssociationsClientListByRuleResponse] + newListByDataCollectionEndpointPager *tracker[azfake.PagerResponder[armmonitor.DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse]] + newListByResourcePager *tracker[azfake.PagerResponder[armmonitor.DataCollectionRuleAssociationsClientListByResourceResponse]] + newListByRulePager *tracker[azfake.PagerResponder[armmonitor.DataCollectionRuleAssociationsClientListByRuleResponse]] } // Do implements the policy.Transporter interface for DataCollectionRuleAssociationsServerTransport. @@ -214,7 +219,8 @@ func (d *DataCollectionRuleAssociationsServerTransport) dispatchNewListByDataCol if d.srv.NewListByDataCollectionEndpointPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByDataCollectionEndpointPager not implemented")} } - if d.newListByDataCollectionEndpointPager == nil { + newListByDataCollectionEndpointPager := d.newListByDataCollectionEndpointPager.get(req) + if newListByDataCollectionEndpointPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/dataCollectionEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/associations` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -230,20 +236,22 @@ func (d *DataCollectionRuleAssociationsServerTransport) dispatchNewListByDataCol return nil, err } resp := d.srv.NewListByDataCollectionEndpointPager(resourceGroupNameUnescaped, dataCollectionEndpointNameUnescaped, nil) - d.newListByDataCollectionEndpointPager = &resp - server.PagerResponderInjectNextLinks(d.newListByDataCollectionEndpointPager, req, func(page *armmonitor.DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse, createLink func() string) { + newListByDataCollectionEndpointPager = &resp + d.newListByDataCollectionEndpointPager.add(req, newListByDataCollectionEndpointPager) + server.PagerResponderInjectNextLinks(newListByDataCollectionEndpointPager, req, func(page *armmonitor.DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListByDataCollectionEndpointPager, req) + resp, err := server.PagerResponderNext(newListByDataCollectionEndpointPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByDataCollectionEndpointPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListByDataCollectionEndpointPager) { - d.newListByDataCollectionEndpointPager = nil + if !server.PagerResponderMore(newListByDataCollectionEndpointPager) { + d.newListByDataCollectionEndpointPager.remove(req) } return resp, nil } @@ -252,7 +260,8 @@ func (d *DataCollectionRuleAssociationsServerTransport) dispatchNewListByResourc if d.srv.NewListByResourcePager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourcePager not implemented")} } - if d.newListByResourcePager == nil { + newListByResourcePager := d.newListByResourcePager.get(req) + if newListByResourcePager == nil { const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/dataCollectionRuleAssociations` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -264,20 +273,22 @@ func (d *DataCollectionRuleAssociationsServerTransport) dispatchNewListByResourc return nil, err } resp := d.srv.NewListByResourcePager(resourceURIUnescaped, nil) - d.newListByResourcePager = &resp - server.PagerResponderInjectNextLinks(d.newListByResourcePager, req, func(page *armmonitor.DataCollectionRuleAssociationsClientListByResourceResponse, createLink func() string) { + newListByResourcePager = &resp + d.newListByResourcePager.add(req, newListByResourcePager) + server.PagerResponderInjectNextLinks(newListByResourcePager, req, func(page *armmonitor.DataCollectionRuleAssociationsClientListByResourceResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListByResourcePager, req) + resp, err := server.PagerResponderNext(newListByResourcePager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByResourcePager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListByResourcePager) { - d.newListByResourcePager = nil + if !server.PagerResponderMore(newListByResourcePager) { + d.newListByResourcePager.remove(req) } return resp, nil } @@ -286,7 +297,8 @@ func (d *DataCollectionRuleAssociationsServerTransport) dispatchNewListByRulePag if d.srv.NewListByRulePager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByRulePager not implemented")} } - if d.newListByRulePager == nil { + newListByRulePager := d.newListByRulePager.get(req) + if newListByRulePager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/dataCollectionRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/associations` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -302,20 +314,22 @@ func (d *DataCollectionRuleAssociationsServerTransport) dispatchNewListByRulePag return nil, err } resp := d.srv.NewListByRulePager(resourceGroupNameUnescaped, dataCollectionRuleNameUnescaped, nil) - d.newListByRulePager = &resp - server.PagerResponderInjectNextLinks(d.newListByRulePager, req, func(page *armmonitor.DataCollectionRuleAssociationsClientListByRuleResponse, createLink func() string) { + newListByRulePager = &resp + d.newListByRulePager.add(req, newListByRulePager) + server.PagerResponderInjectNextLinks(newListByRulePager, req, func(page *armmonitor.DataCollectionRuleAssociationsClientListByRuleResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListByRulePager, req) + resp, err := server.PagerResponderNext(newListByRulePager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByRulePager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListByRulePager) { - d.newListByRulePager = nil + if !server.PagerResponderMore(newListByRulePager) { + d.newListByRulePager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/datacollectionrules_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/datacollectionrules_server.go index 8f207cb2008c..83435a4a5573 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/datacollectionrules_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/datacollectionrules_server.go @@ -51,18 +51,22 @@ type DataCollectionRulesServer struct { } // NewDataCollectionRulesServerTransport creates a new instance of DataCollectionRulesServerTransport with the provided implementation. -// The returned DataCollectionRulesServerTransport instance is connected to an instance of armmonitor.DataCollectionRulesClient by way of the -// undefined.Transporter field. +// The returned DataCollectionRulesServerTransport instance is connected to an instance of armmonitor.DataCollectionRulesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDataCollectionRulesServerTransport(srv *DataCollectionRulesServer) *DataCollectionRulesServerTransport { - return &DataCollectionRulesServerTransport{srv: srv} + return &DataCollectionRulesServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmonitor.DataCollectionRulesClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armmonitor.DataCollectionRulesClientListBySubscriptionResponse]](), + } } // DataCollectionRulesServerTransport connects instances of armmonitor.DataCollectionRulesClient to instances of DataCollectionRulesServer. // Don't use this type directly, use NewDataCollectionRulesServerTransport instead. type DataCollectionRulesServerTransport struct { srv *DataCollectionRulesServer - newListByResourceGroupPager *azfake.PagerResponder[armmonitor.DataCollectionRulesClientListByResourceGroupResponse] - newListBySubscriptionPager *azfake.PagerResponder[armmonitor.DataCollectionRulesClientListBySubscriptionResponse] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armmonitor.DataCollectionRulesClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armmonitor.DataCollectionRulesClientListBySubscriptionResponse]] } // Do implements the policy.Transporter interface for DataCollectionRulesServerTransport. @@ -213,7 +217,8 @@ func (d *DataCollectionRulesServerTransport) dispatchNewListByResourceGroupPager if d.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if d.newListByResourceGroupPager == nil { + newListByResourceGroupPager := d.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/dataCollectionRules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -225,20 +230,22 @@ func (d *DataCollectionRulesServerTransport) dispatchNewListByResourceGroupPager return nil, err } resp := d.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - d.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(d.newListByResourceGroupPager, req, func(page *armmonitor.DataCollectionRulesClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + d.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armmonitor.DataCollectionRulesClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListByResourceGroupPager) { - d.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + d.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -247,7 +254,8 @@ func (d *DataCollectionRulesServerTransport) dispatchNewListBySubscriptionPager( if d.srv.NewListBySubscriptionPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} } - if d.newListBySubscriptionPager == nil { + newListBySubscriptionPager := d.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/dataCollectionRules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -255,20 +263,22 @@ func (d *DataCollectionRulesServerTransport) dispatchNewListBySubscriptionPager( return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := d.srv.NewListBySubscriptionPager(nil) - d.newListBySubscriptionPager = &resp - server.PagerResponderInjectNextLinks(d.newListBySubscriptionPager, req, func(page *armmonitor.DataCollectionRulesClientListBySubscriptionResponse, createLink func() string) { + newListBySubscriptionPager = &resp + d.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armmonitor.DataCollectionRulesClientListBySubscriptionResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListBySubscriptionPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListBySubscriptionPager) { - d.newListBySubscriptionPager = nil + if !server.PagerResponderMore(newListBySubscriptionPager) { + d.newListBySubscriptionPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/diagnosticsettings_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/diagnosticsettings_server.go index 59c0f3979ee0..6779f3c661b3 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/diagnosticsettings_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/diagnosticsettings_server.go @@ -41,17 +41,20 @@ type DiagnosticSettingsServer struct { } // NewDiagnosticSettingsServerTransport creates a new instance of DiagnosticSettingsServerTransport with the provided implementation. -// The returned DiagnosticSettingsServerTransport instance is connected to an instance of armmonitor.DiagnosticSettingsClient by way of the -// undefined.Transporter field. +// The returned DiagnosticSettingsServerTransport instance is connected to an instance of armmonitor.DiagnosticSettingsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDiagnosticSettingsServerTransport(srv *DiagnosticSettingsServer) *DiagnosticSettingsServerTransport { - return &DiagnosticSettingsServerTransport{srv: srv} + return &DiagnosticSettingsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmonitor.DiagnosticSettingsClientListResponse]](), + } } // DiagnosticSettingsServerTransport connects instances of armmonitor.DiagnosticSettingsClient to instances of DiagnosticSettingsServer. // Don't use this type directly, use NewDiagnosticSettingsServerTransport instead. type DiagnosticSettingsServerTransport struct { srv *DiagnosticSettingsServer - newListPager *azfake.PagerResponder[armmonitor.DiagnosticSettingsClientListResponse] + newListPager *tracker[azfake.PagerResponder[armmonitor.DiagnosticSettingsClientListResponse]] } // Do implements the policy.Transporter interface for DiagnosticSettingsServerTransport. @@ -192,7 +195,8 @@ func (d *DiagnosticSettingsServerTransport) dispatchNewListPager(req *http.Reque if d.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if d.newListPager == nil { + newListPager := d.newListPager.get(req) + if newListPager == nil { const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/diagnosticSettings` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -204,17 +208,19 @@ func (d *DiagnosticSettingsServerTransport) dispatchNewListPager(req *http.Reque return nil, err } resp := d.srv.NewListPager(resourceURIUnescaped, nil) - d.newListPager = &resp + newListPager = &resp + d.newListPager.add(req, newListPager) } - resp, err := server.PagerResponderNext(d.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListPager) { - d.newListPager = nil + if !server.PagerResponderMore(newListPager) { + d.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/diagnosticsettingscategory_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/diagnosticsettingscategory_server.go index 67bc032c7ef9..5bbd9ba00959 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/diagnosticsettingscategory_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/diagnosticsettingscategory_server.go @@ -33,17 +33,20 @@ type DiagnosticSettingsCategoryServer struct { } // NewDiagnosticSettingsCategoryServerTransport creates a new instance of DiagnosticSettingsCategoryServerTransport with the provided implementation. -// The returned DiagnosticSettingsCategoryServerTransport instance is connected to an instance of armmonitor.DiagnosticSettingsCategoryClient by way of the -// undefined.Transporter field. +// The returned DiagnosticSettingsCategoryServerTransport instance is connected to an instance of armmonitor.DiagnosticSettingsCategoryClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDiagnosticSettingsCategoryServerTransport(srv *DiagnosticSettingsCategoryServer) *DiagnosticSettingsCategoryServerTransport { - return &DiagnosticSettingsCategoryServerTransport{srv: srv} + return &DiagnosticSettingsCategoryServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmonitor.DiagnosticSettingsCategoryClientListResponse]](), + } } // DiagnosticSettingsCategoryServerTransport connects instances of armmonitor.DiagnosticSettingsCategoryClient to instances of DiagnosticSettingsCategoryServer. // Don't use this type directly, use NewDiagnosticSettingsCategoryServerTransport instead. type DiagnosticSettingsCategoryServerTransport struct { srv *DiagnosticSettingsCategoryServer - newListPager *azfake.PagerResponder[armmonitor.DiagnosticSettingsCategoryClientListResponse] + newListPager *tracker[azfake.PagerResponder[armmonitor.DiagnosticSettingsCategoryClientListResponse]] } // Do implements the policy.Transporter interface for DiagnosticSettingsCategoryServerTransport. @@ -110,7 +113,8 @@ func (d *DiagnosticSettingsCategoryServerTransport) dispatchNewListPager(req *ht if d.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if d.newListPager == nil { + newListPager := d.newListPager.get(req) + if newListPager == nil { const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/diagnosticSettingsCategories` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -122,17 +126,19 @@ func (d *DiagnosticSettingsCategoryServerTransport) dispatchNewListPager(req *ht return nil, err } resp := d.srv.NewListPager(resourceURIUnescaped, nil) - d.newListPager = &resp + newListPager = &resp + d.newListPager.add(req, newListPager) } - resp, err := server.PagerResponderNext(d.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListPager) { - d.newListPager = nil + if !server.PagerResponderMore(newListPager) { + d.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/eventcategories_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/eventcategories_server.go index f3637146e8c4..a7e0402664b4 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/eventcategories_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/eventcategories_server.go @@ -26,17 +26,20 @@ type EventCategoriesServer struct { } // NewEventCategoriesServerTransport creates a new instance of EventCategoriesServerTransport with the provided implementation. -// The returned EventCategoriesServerTransport instance is connected to an instance of armmonitor.EventCategoriesClient by way of the -// undefined.Transporter field. +// The returned EventCategoriesServerTransport instance is connected to an instance of armmonitor.EventCategoriesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewEventCategoriesServerTransport(srv *EventCategoriesServer) *EventCategoriesServerTransport { - return &EventCategoriesServerTransport{srv: srv} + return &EventCategoriesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmonitor.EventCategoriesClientListResponse]](), + } } // EventCategoriesServerTransport connects instances of armmonitor.EventCategoriesClient to instances of EventCategoriesServer. // Don't use this type directly, use NewEventCategoriesServerTransport instead. type EventCategoriesServerTransport struct { srv *EventCategoriesServer - newListPager *azfake.PagerResponder[armmonitor.EventCategoriesClientListResponse] + newListPager *tracker[azfake.PagerResponder[armmonitor.EventCategoriesClientListResponse]] } // Do implements the policy.Transporter interface for EventCategoriesServerTransport. @@ -68,19 +71,22 @@ func (e *EventCategoriesServerTransport) dispatchNewListPager(req *http.Request) if e.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if e.newListPager == nil { + newListPager := e.newListPager.get(req) + if newListPager == nil { resp := e.srv.NewListPager(nil) - e.newListPager = &resp + newListPager = &resp + e.newListPager.add(req, newListPager) } - resp, err := server.PagerResponderNext(e.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + e.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(e.newListPager) { - e.newListPager = nil + if !server.PagerResponderMore(newListPager) { + e.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/internal.go b/sdk/resourcemanager/monitor/armmonitor/fake/internal.go index e9c8222f2199..03b635903572 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/internal.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/internal.go @@ -12,6 +12,9 @@ import ( "io" "net/http" "reflect" + "regexp" + "strings" + "sync" ) type nonRetriableError struct { @@ -76,3 +79,45 @@ func contains[T comparable](s []T, v T) bool { } return false } + +func newTracker[T any]() *tracker[T] { + return &tracker[T]{ + items: map[string]*T{}, + } +} + +type tracker[T any] struct { + items map[string]*T + mu sync.Mutex +} + +func (p *tracker[T]) key(req *http.Request) string { + path := req.URL.Path + if match, _ := regexp.Match(`/page_\d+$`, []byte(path)); match { + path = path[:strings.LastIndex(path, "/")] + } else if strings.HasSuffix(path, "/get/fake/status") { + path = path[:len(path)-16] + } + return path +} + +func (p *tracker[T]) get(req *http.Request) *T { + p.mu.Lock() + defer p.mu.Unlock() + if item, ok := p.items[p.key(req)]; ok { + return item + } + return nil +} + +func (p *tracker[T]) add(req *http.Request, item *T) { + p.mu.Lock() + defer p.mu.Unlock() + p.items[p.key(req)] = item +} + +func (p *tracker[T]) remove(req *http.Request) { + p.mu.Lock() + defer p.mu.Unlock() + delete(p.items, p.key(req)) +} diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/logprofiles_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/logprofiles_server.go index 5db796fef7f3..1839c6156822 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/logprofiles_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/logprofiles_server.go @@ -45,17 +45,20 @@ type LogProfilesServer struct { } // NewLogProfilesServerTransport creates a new instance of LogProfilesServerTransport with the provided implementation. -// The returned LogProfilesServerTransport instance is connected to an instance of armmonitor.LogProfilesClient by way of the -// undefined.Transporter field. +// The returned LogProfilesServerTransport instance is connected to an instance of armmonitor.LogProfilesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewLogProfilesServerTransport(srv *LogProfilesServer) *LogProfilesServerTransport { - return &LogProfilesServerTransport{srv: srv} + return &LogProfilesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmonitor.LogProfilesClientListResponse]](), + } } // LogProfilesServerTransport connects instances of armmonitor.LogProfilesClient to instances of LogProfilesServer. // Don't use this type directly, use NewLogProfilesServerTransport instead. type LogProfilesServerTransport struct { srv *LogProfilesServer - newListPager *azfake.PagerResponder[armmonitor.LogProfilesClientListResponse] + newListPager *tracker[azfake.PagerResponder[armmonitor.LogProfilesClientListResponse]] } // Do implements the policy.Transporter interface for LogProfilesServerTransport. @@ -186,7 +189,8 @@ func (l *LogProfilesServerTransport) dispatchNewListPager(req *http.Request) (*h if l.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if l.newListPager == nil { + newListPager := l.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/logprofiles` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -194,17 +198,19 @@ func (l *LogProfilesServerTransport) dispatchNewListPager(req *http.Request) (*h return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := l.srv.NewListPager(nil) - l.newListPager = &resp + newListPager = &resp + l.newListPager.add(req, newListPager) } - resp, err := server.PagerResponderNext(l.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + l.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(l.newListPager) { - l.newListPager = nil + if !server.PagerResponderMore(newListPager) { + l.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/metricalerts_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/metricalerts_server.go index 8deacec590c6..db36d54008b4 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/metricalerts_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/metricalerts_server.go @@ -49,18 +49,22 @@ type MetricAlertsServer struct { } // NewMetricAlertsServerTransport creates a new instance of MetricAlertsServerTransport with the provided implementation. -// The returned MetricAlertsServerTransport instance is connected to an instance of armmonitor.MetricAlertsClient by way of the -// undefined.Transporter field. +// The returned MetricAlertsServerTransport instance is connected to an instance of armmonitor.MetricAlertsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewMetricAlertsServerTransport(srv *MetricAlertsServer) *MetricAlertsServerTransport { - return &MetricAlertsServerTransport{srv: srv} + return &MetricAlertsServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmonitor.MetricAlertsClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armmonitor.MetricAlertsClientListBySubscriptionResponse]](), + } } // MetricAlertsServerTransport connects instances of armmonitor.MetricAlertsClient to instances of MetricAlertsServer. // Don't use this type directly, use NewMetricAlertsServerTransport instead. type MetricAlertsServerTransport struct { srv *MetricAlertsServer - newListByResourceGroupPager *azfake.PagerResponder[armmonitor.MetricAlertsClientListByResourceGroupResponse] - newListBySubscriptionPager *azfake.PagerResponder[armmonitor.MetricAlertsClientListBySubscriptionResponse] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armmonitor.MetricAlertsClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armmonitor.MetricAlertsClientListBySubscriptionResponse]] } // Do implements the policy.Transporter interface for MetricAlertsServerTransport. @@ -205,7 +209,8 @@ func (m *MetricAlertsServerTransport) dispatchNewListByResourceGroupPager(req *h if m.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if m.newListByResourceGroupPager == nil { + newListByResourceGroupPager := m.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/metricAlerts` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -217,17 +222,19 @@ func (m *MetricAlertsServerTransport) dispatchNewListByResourceGroupPager(req *h return nil, err } resp := m.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - m.newListByResourceGroupPager = &resp + newListByResourceGroupPager = &resp + m.newListByResourceGroupPager.add(req, newListByResourceGroupPager) } - resp, err := server.PagerResponderNext(m.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(m.newListByResourceGroupPager) { - m.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + m.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -236,7 +243,8 @@ func (m *MetricAlertsServerTransport) dispatchNewListBySubscriptionPager(req *ht if m.srv.NewListBySubscriptionPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} } - if m.newListBySubscriptionPager == nil { + newListBySubscriptionPager := m.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/metricAlerts` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -244,17 +252,19 @@ func (m *MetricAlertsServerTransport) dispatchNewListBySubscriptionPager(req *ht return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := m.srv.NewListBySubscriptionPager(nil) - m.newListBySubscriptionPager = &resp + newListBySubscriptionPager = &resp + m.newListBySubscriptionPager.add(req, newListBySubscriptionPager) } - resp, err := server.PagerResponderNext(m.newListBySubscriptionPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(m.newListBySubscriptionPager) { - m.newListBySubscriptionPager = nil + if !server.PagerResponderMore(newListBySubscriptionPager) { + m.newListBySubscriptionPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/metricalertsstatus_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/metricalertsstatus_server.go index 33c57d2e8470..b46efc3bdb06 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/metricalertsstatus_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/metricalertsstatus_server.go @@ -33,8 +33,8 @@ type MetricAlertsStatusServer struct { } // NewMetricAlertsStatusServerTransport creates a new instance of MetricAlertsStatusServerTransport with the provided implementation. -// The returned MetricAlertsStatusServerTransport instance is connected to an instance of armmonitor.MetricAlertsStatusClient by way of the -// undefined.Transporter field. +// The returned MetricAlertsStatusServerTransport instance is connected to an instance of armmonitor.MetricAlertsStatusClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewMetricAlertsStatusServerTransport(srv *MetricAlertsStatusServer) *MetricAlertsStatusServerTransport { return &MetricAlertsStatusServerTransport{srv: srv} } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/metricdefinitions_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/metricdefinitions_server.go index 7fb85aba0e15..d3d10d95597a 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/metricdefinitions_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/metricdefinitions_server.go @@ -32,18 +32,22 @@ type MetricDefinitionsServer struct { } // NewMetricDefinitionsServerTransport creates a new instance of MetricDefinitionsServerTransport with the provided implementation. -// The returned MetricDefinitionsServerTransport instance is connected to an instance of armmonitor.MetricDefinitionsClient by way of the -// undefined.Transporter field. +// The returned MetricDefinitionsServerTransport instance is connected to an instance of armmonitor.MetricDefinitionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewMetricDefinitionsServerTransport(srv *MetricDefinitionsServer) *MetricDefinitionsServerTransport { - return &MetricDefinitionsServerTransport{srv: srv} + return &MetricDefinitionsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmonitor.MetricDefinitionsClientListResponse]](), + newListAtSubscriptionScopePager: newTracker[azfake.PagerResponder[armmonitor.MetricDefinitionsClientListAtSubscriptionScopeResponse]](), + } } // MetricDefinitionsServerTransport connects instances of armmonitor.MetricDefinitionsClient to instances of MetricDefinitionsServer. // Don't use this type directly, use NewMetricDefinitionsServerTransport instead. type MetricDefinitionsServerTransport struct { srv *MetricDefinitionsServer - newListPager *azfake.PagerResponder[armmonitor.MetricDefinitionsClientListResponse] - newListAtSubscriptionScopePager *azfake.PagerResponder[armmonitor.MetricDefinitionsClientListAtSubscriptionScopeResponse] + newListPager *tracker[azfake.PagerResponder[armmonitor.MetricDefinitionsClientListResponse]] + newListAtSubscriptionScopePager *tracker[azfake.PagerResponder[armmonitor.MetricDefinitionsClientListAtSubscriptionScopeResponse]] } // Do implements the policy.Transporter interface for MetricDefinitionsServerTransport. @@ -77,7 +81,8 @@ func (m *MetricDefinitionsServerTransport) dispatchNewListPager(req *http.Reques if m.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if m.newListPager == nil { + newListPager := m.newListPager.get(req) + if newListPager == nil { const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/metricDefinitions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -101,17 +106,19 @@ func (m *MetricDefinitionsServerTransport) dispatchNewListPager(req *http.Reques } } resp := m.srv.NewListPager(resourceURIUnescaped, options) - m.newListPager = &resp + newListPager = &resp + m.newListPager.add(req, newListPager) } - resp, err := server.PagerResponderNext(m.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(m.newListPager) { - m.newListPager = nil + if !server.PagerResponderMore(newListPager) { + m.newListPager.remove(req) } return resp, nil } @@ -120,7 +127,8 @@ func (m *MetricDefinitionsServerTransport) dispatchNewListAtSubscriptionScopePag if m.srv.NewListAtSubscriptionScopePager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListAtSubscriptionScopePager not implemented")} } - if m.newListAtSubscriptionScopePager == nil { + newListAtSubscriptionScopePager := m.newListAtSubscriptionScopePager.get(req) + if newListAtSubscriptionScopePager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/metricDefinitions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -144,17 +152,19 @@ func (m *MetricDefinitionsServerTransport) dispatchNewListAtSubscriptionScopePag } } resp := m.srv.NewListAtSubscriptionScopePager(regionUnescaped, options) - m.newListAtSubscriptionScopePager = &resp + newListAtSubscriptionScopePager = &resp + m.newListAtSubscriptionScopePager.add(req, newListAtSubscriptionScopePager) } - resp, err := server.PagerResponderNext(m.newListAtSubscriptionScopePager, req) + resp, err := server.PagerResponderNext(newListAtSubscriptionScopePager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListAtSubscriptionScopePager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(m.newListAtSubscriptionScopePager) { - m.newListAtSubscriptionScopePager = nil + if !server.PagerResponderMore(newListAtSubscriptionScopePager) { + m.newListAtSubscriptionScopePager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/metricnamespaces_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/metricnamespaces_server.go index fd41555370ac..e11f0f54e7bf 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/metricnamespaces_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/metricnamespaces_server.go @@ -28,17 +28,20 @@ type MetricNamespacesServer struct { } // NewMetricNamespacesServerTransport creates a new instance of MetricNamespacesServerTransport with the provided implementation. -// The returned MetricNamespacesServerTransport instance is connected to an instance of armmonitor.MetricNamespacesClient by way of the -// undefined.Transporter field. +// The returned MetricNamespacesServerTransport instance is connected to an instance of armmonitor.MetricNamespacesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewMetricNamespacesServerTransport(srv *MetricNamespacesServer) *MetricNamespacesServerTransport { - return &MetricNamespacesServerTransport{srv: srv} + return &MetricNamespacesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmonitor.MetricNamespacesClientListResponse]](), + } } // MetricNamespacesServerTransport connects instances of armmonitor.MetricNamespacesClient to instances of MetricNamespacesServer. // Don't use this type directly, use NewMetricNamespacesServerTransport instead. type MetricNamespacesServerTransport struct { srv *MetricNamespacesServer - newListPager *azfake.PagerResponder[armmonitor.MetricNamespacesClientListResponse] + newListPager *tracker[azfake.PagerResponder[armmonitor.MetricNamespacesClientListResponse]] } // Do implements the policy.Transporter interface for MetricNamespacesServerTransport. @@ -70,7 +73,8 @@ func (m *MetricNamespacesServerTransport) dispatchNewListPager(req *http.Request if m.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if m.newListPager == nil { + newListPager := m.newListPager.get(req) + if newListPager == nil { const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft.insights/metricNamespaces` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -94,17 +98,19 @@ func (m *MetricNamespacesServerTransport) dispatchNewListPager(req *http.Request } } resp := m.srv.NewListPager(resourceURIUnescaped, options) - m.newListPager = &resp + newListPager = &resp + m.newListPager.add(req, newListPager) } - resp, err := server.PagerResponderNext(m.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(m.newListPager) { - m.newListPager = nil + if !server.PagerResponderMore(newListPager) { + m.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/metrics_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/metrics_server.go index cd27c8930105..7cc9e4c20e62 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/metrics_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/metrics_server.go @@ -39,8 +39,8 @@ type MetricsServer struct { } // NewMetricsServerTransport creates a new instance of MetricsServerTransport with the provided implementation. -// The returned MetricsServerTransport instance is connected to an instance of armmonitor.MetricsClient by way of the -// undefined.Transporter field. +// The returned MetricsServerTransport instance is connected to an instance of armmonitor.MetricsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewMetricsServerTransport(srv *MetricsServer) *MetricsServerTransport { return &MetricsServerTransport{srv: srv} } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/operations_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/operations_server.go index 7e3d29649852..3f4ae743691f 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/operations_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/operations_server.go @@ -27,8 +27,8 @@ type OperationsServer struct { } // NewOperationsServerTransport creates a new instance of OperationsServerTransport with the provided implementation. -// The returned OperationsServerTransport instance is connected to an instance of armmonitor.OperationsClient by way of the -// undefined.Transporter field. +// The returned OperationsServerTransport instance is connected to an instance of armmonitor.OperationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewOperationsServerTransport(srv *OperationsServer) *OperationsServerTransport { return &OperationsServerTransport{srv: srv} } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/operationsformonitor_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/operationsformonitor_server.go index f7031a3c17b9..7139e7b074ac 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/operationsformonitor_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/operationsformonitor_server.go @@ -27,17 +27,20 @@ type OperationsForMonitorServer struct { } // NewOperationsForMonitorServerTransport creates a new instance of OperationsForMonitorServerTransport with the provided implementation. -// The returned OperationsForMonitorServerTransport instance is connected to an instance of armmonitor.OperationsForMonitorClient by way of the -// undefined.Transporter field. +// The returned OperationsForMonitorServerTransport instance is connected to an instance of armmonitor.OperationsForMonitorClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewOperationsForMonitorServerTransport(srv *OperationsForMonitorServer) *OperationsForMonitorServerTransport { - return &OperationsForMonitorServerTransport{srv: srv} + return &OperationsForMonitorServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmonitor.OperationsForMonitorClientListResponse]](), + } } // OperationsForMonitorServerTransport connects instances of armmonitor.OperationsForMonitorClient to instances of OperationsForMonitorServer. // Don't use this type directly, use NewOperationsForMonitorServerTransport instead. type OperationsForMonitorServerTransport struct { srv *OperationsForMonitorServer - newListPager *azfake.PagerResponder[armmonitor.OperationsForMonitorClientListResponse] + newListPager *tracker[azfake.PagerResponder[armmonitor.OperationsForMonitorClientListResponse]] } // Do implements the policy.Transporter interface for OperationsForMonitorServerTransport. @@ -69,22 +72,25 @@ func (o *OperationsForMonitorServerTransport) dispatchNewListPager(req *http.Req if o.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if o.newListPager == nil { + newListPager := o.newListPager.get(req) + if newListPager == nil { resp := o.srv.NewListPager(nil) - o.newListPager = &resp - server.PagerResponderInjectNextLinks(o.newListPager, req, func(page *armmonitor.OperationsForMonitorClientListResponse, createLink func() string) { + newListPager = &resp + o.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmonitor.OperationsForMonitorClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(o.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + o.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(o.newListPager) { - o.newListPager = nil + if !server.PagerResponderMore(newListPager) { + o.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/predictivemetric_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/predictivemetric_server.go index 31d5c850c60b..1e413b3577ff 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/predictivemetric_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/predictivemetric_server.go @@ -29,8 +29,8 @@ type PredictiveMetricServer struct { } // NewPredictiveMetricServerTransport creates a new instance of PredictiveMetricServerTransport with the provided implementation. -// The returned PredictiveMetricServerTransport instance is connected to an instance of armmonitor.PredictiveMetricClient by way of the -// undefined.Transporter field. +// The returned PredictiveMetricServerTransport instance is connected to an instance of armmonitor.PredictiveMetricClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewPredictiveMetricServerTransport(srv *PredictiveMetricServer) *PredictiveMetricServerTransport { return &PredictiveMetricServerTransport{srv: srv} } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/privateendpointconnections_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/privateendpointconnections_server.go index fd9039822faa..91857163ee28 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/privateendpointconnections_server.go @@ -41,18 +41,22 @@ type PrivateEndpointConnectionsServer struct { } // NewPrivateEndpointConnectionsServerTransport creates a new instance of PrivateEndpointConnectionsServerTransport with the provided implementation. -// The returned PrivateEndpointConnectionsServerTransport instance is connected to an instance of armmonitor.PrivateEndpointConnectionsClient by way of the -// undefined.Transporter field. +// The returned PrivateEndpointConnectionsServerTransport instance is connected to an instance of armmonitor.PrivateEndpointConnectionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewPrivateEndpointConnectionsServerTransport(srv *PrivateEndpointConnectionsServer) *PrivateEndpointConnectionsServerTransport { - return &PrivateEndpointConnectionsServerTransport{srv: srv} + return &PrivateEndpointConnectionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmonitor.PrivateEndpointConnectionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmonitor.PrivateEndpointConnectionsClientDeleteResponse]](), + } } // PrivateEndpointConnectionsServerTransport connects instances of armmonitor.PrivateEndpointConnectionsClient to instances of PrivateEndpointConnectionsServer. // Don't use this type directly, use NewPrivateEndpointConnectionsServerTransport instead. type PrivateEndpointConnectionsServerTransport struct { srv *PrivateEndpointConnectionsServer - beginCreateOrUpdate *azfake.PollerResponder[armmonitor.PrivateEndpointConnectionsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armmonitor.PrivateEndpointConnectionsClientDeleteResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmonitor.PrivateEndpointConnectionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmonitor.PrivateEndpointConnectionsClientDeleteResponse]] } // Do implements the policy.Transporter interface for PrivateEndpointConnectionsServerTransport. @@ -90,7 +94,8 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginCreateOrUpdate( if p.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if p.beginCreateOrUpdate == nil { + beginCreateOrUpdate := p.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/privateLinkScopes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -117,19 +122,21 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginCreateOrUpdate( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - p.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + p.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(p.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + p.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(p.beginCreateOrUpdate) { - p.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + p.beginCreateOrUpdate.remove(req) } return resp, nil @@ -139,7 +146,8 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginDelete(req *htt if p.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if p.beginDelete == nil { + beginDelete := p.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/privateLinkScopes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -162,19 +170,21 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginDelete(req *htt if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - p.beginDelete = &respr + beginDelete = &respr + p.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(p.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(p.beginDelete) { - p.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + p.beginDelete.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkresources_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkresources_server.go index 7cadc84a3788..f571f0418adf 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkresources_server.go @@ -33,8 +33,8 @@ type PrivateLinkResourcesServer struct { } // NewPrivateLinkResourcesServerTransport creates a new instance of PrivateLinkResourcesServerTransport with the provided implementation. -// The returned PrivateLinkResourcesServerTransport instance is connected to an instance of armmonitor.PrivateLinkResourcesClient by way of the -// undefined.Transporter field. +// The returned PrivateLinkResourcesServerTransport instance is connected to an instance of armmonitor.PrivateLinkResourcesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewPrivateLinkResourcesServerTransport(srv *PrivateLinkResourcesServer) *PrivateLinkResourcesServerTransport { return &PrivateLinkResourcesServerTransport{srv: srv} } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkscopedresources_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkscopedresources_server.go index a186a47a8b2d..28ee87e695b4 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkscopedresources_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkscopedresources_server.go @@ -42,19 +42,24 @@ type PrivateLinkScopedResourcesServer struct { } // NewPrivateLinkScopedResourcesServerTransport creates a new instance of PrivateLinkScopedResourcesServerTransport with the provided implementation. -// The returned PrivateLinkScopedResourcesServerTransport instance is connected to an instance of armmonitor.PrivateLinkScopedResourcesClient by way of the -// undefined.Transporter field. +// The returned PrivateLinkScopedResourcesServerTransport instance is connected to an instance of armmonitor.PrivateLinkScopedResourcesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewPrivateLinkScopedResourcesServerTransport(srv *PrivateLinkScopedResourcesServer) *PrivateLinkScopedResourcesServerTransport { - return &PrivateLinkScopedResourcesServerTransport{srv: srv} + return &PrivateLinkScopedResourcesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmonitor.PrivateLinkScopedResourcesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmonitor.PrivateLinkScopedResourcesClientDeleteResponse]](), + newListByPrivateLinkScopePager: newTracker[azfake.PagerResponder[armmonitor.PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse]](), + } } // PrivateLinkScopedResourcesServerTransport connects instances of armmonitor.PrivateLinkScopedResourcesClient to instances of PrivateLinkScopedResourcesServer. // Don't use this type directly, use NewPrivateLinkScopedResourcesServerTransport instead. type PrivateLinkScopedResourcesServerTransport struct { srv *PrivateLinkScopedResourcesServer - beginCreateOrUpdate *azfake.PollerResponder[armmonitor.PrivateLinkScopedResourcesClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armmonitor.PrivateLinkScopedResourcesClientDeleteResponse] - newListByPrivateLinkScopePager *azfake.PagerResponder[armmonitor.PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmonitor.PrivateLinkScopedResourcesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmonitor.PrivateLinkScopedResourcesClientDeleteResponse]] + newListByPrivateLinkScopePager *tracker[azfake.PagerResponder[armmonitor.PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse]] } // Do implements the policy.Transporter interface for PrivateLinkScopedResourcesServerTransport. @@ -92,7 +97,8 @@ func (p *PrivateLinkScopedResourcesServerTransport) dispatchBeginCreateOrUpdate( if p.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if p.beginCreateOrUpdate == nil { + beginCreateOrUpdate := p.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/privateLinkScopes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/scopedResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -119,19 +125,21 @@ func (p *PrivateLinkScopedResourcesServerTransport) dispatchBeginCreateOrUpdate( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - p.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + p.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(p.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + p.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(p.beginCreateOrUpdate) { - p.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + p.beginCreateOrUpdate.remove(req) } return resp, nil @@ -141,7 +149,8 @@ func (p *PrivateLinkScopedResourcesServerTransport) dispatchBeginDelete(req *htt if p.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if p.beginDelete == nil { + beginDelete := p.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/privateLinkScopes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/scopedResources/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -164,19 +173,21 @@ func (p *PrivateLinkScopedResourcesServerTransport) dispatchBeginDelete(req *htt if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - p.beginDelete = &respr + beginDelete = &respr + p.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(p.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(p.beginDelete) { - p.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + p.beginDelete.remove(req) } return resp, nil @@ -223,7 +234,8 @@ func (p *PrivateLinkScopedResourcesServerTransport) dispatchNewListByPrivateLink if p.srv.NewListByPrivateLinkScopePager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByPrivateLinkScopePager not implemented")} } - if p.newListByPrivateLinkScopePager == nil { + newListByPrivateLinkScopePager := p.newListByPrivateLinkScopePager.get(req) + if newListByPrivateLinkScopePager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/privateLinkScopes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/scopedResources` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -239,20 +251,22 @@ func (p *PrivateLinkScopedResourcesServerTransport) dispatchNewListByPrivateLink return nil, err } resp := p.srv.NewListByPrivateLinkScopePager(resourceGroupNameUnescaped, scopeNameUnescaped, nil) - p.newListByPrivateLinkScopePager = &resp - server.PagerResponderInjectNextLinks(p.newListByPrivateLinkScopePager, req, func(page *armmonitor.PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse, createLink func() string) { + newListByPrivateLinkScopePager = &resp + p.newListByPrivateLinkScopePager.add(req, newListByPrivateLinkScopePager) + server.PagerResponderInjectNextLinks(newListByPrivateLinkScopePager, req, func(page *armmonitor.PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(p.newListByPrivateLinkScopePager, req) + resp, err := server.PagerResponderNext(newListByPrivateLinkScopePager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListByPrivateLinkScopePager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(p.newListByPrivateLinkScopePager) { - p.newListByPrivateLinkScopePager = nil + if !server.PagerResponderMore(newListByPrivateLinkScopePager) { + p.newListByPrivateLinkScopePager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkscopeoperationstatus_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkscopeoperationstatus_server.go index 9be5c8c7360a..9c3058a9b1c7 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkscopeoperationstatus_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkscopeoperationstatus_server.go @@ -29,8 +29,8 @@ type PrivateLinkScopeOperationStatusServer struct { } // NewPrivateLinkScopeOperationStatusServerTransport creates a new instance of PrivateLinkScopeOperationStatusServerTransport with the provided implementation. -// The returned PrivateLinkScopeOperationStatusServerTransport instance is connected to an instance of armmonitor.PrivateLinkScopeOperationStatusClient by way of the -// undefined.Transporter field. +// The returned PrivateLinkScopeOperationStatusServerTransport instance is connected to an instance of armmonitor.PrivateLinkScopeOperationStatusClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewPrivateLinkScopeOperationStatusServerTransport(srv *PrivateLinkScopeOperationStatusServer) *PrivateLinkScopeOperationStatusServerTransport { return &PrivateLinkScopeOperationStatusServerTransport{srv: srv} } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkscopes_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkscopes_server.go index b738c7a9f9cd..dd6debd3b31f 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkscopes_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/privatelinkscopes_server.go @@ -50,19 +50,24 @@ type PrivateLinkScopesServer struct { } // NewPrivateLinkScopesServerTransport creates a new instance of PrivateLinkScopesServerTransport with the provided implementation. -// The returned PrivateLinkScopesServerTransport instance is connected to an instance of armmonitor.PrivateLinkScopesClient by way of the -// undefined.Transporter field. +// The returned PrivateLinkScopesServerTransport instance is connected to an instance of armmonitor.PrivateLinkScopesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewPrivateLinkScopesServerTransport(srv *PrivateLinkScopesServer) *PrivateLinkScopesServerTransport { - return &PrivateLinkScopesServerTransport{srv: srv} + return &PrivateLinkScopesServerTransport{ + srv: srv, + beginDelete: newTracker[azfake.PollerResponder[armmonitor.PrivateLinkScopesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmonitor.PrivateLinkScopesClientListResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmonitor.PrivateLinkScopesClientListByResourceGroupResponse]](), + } } // PrivateLinkScopesServerTransport connects instances of armmonitor.PrivateLinkScopesClient to instances of PrivateLinkScopesServer. // Don't use this type directly, use NewPrivateLinkScopesServerTransport instead. type PrivateLinkScopesServerTransport struct { srv *PrivateLinkScopesServer - beginDelete *azfake.PollerResponder[armmonitor.PrivateLinkScopesClientDeleteResponse] - newListPager *azfake.PagerResponder[armmonitor.PrivateLinkScopesClientListResponse] - newListByResourceGroupPager *azfake.PagerResponder[armmonitor.PrivateLinkScopesClientListByResourceGroupResponse] + beginDelete *tracker[azfake.PollerResponder[armmonitor.PrivateLinkScopesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmonitor.PrivateLinkScopesClientListResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armmonitor.PrivateLinkScopesClientListByResourceGroupResponse]] } // Do implements the policy.Transporter interface for PrivateLinkScopesServerTransport. @@ -141,7 +146,8 @@ func (p *PrivateLinkScopesServerTransport) dispatchBeginDelete(req *http.Request if p.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if p.beginDelete == nil { + beginDelete := p.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft.insights/privateLinkScopes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -160,19 +166,21 @@ func (p *PrivateLinkScopesServerTransport) dispatchBeginDelete(req *http.Request if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - p.beginDelete = &respr + beginDelete = &respr + p.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(p.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(p.beginDelete) { - p.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + p.beginDelete.remove(req) } return resp, nil @@ -215,7 +223,8 @@ func (p *PrivateLinkScopesServerTransport) dispatchNewListPager(req *http.Reques if p.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if p.newListPager == nil { + newListPager := p.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft.insights/privateLinkScopes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -223,20 +232,22 @@ func (p *PrivateLinkScopesServerTransport) dispatchNewListPager(req *http.Reques return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := p.srv.NewListPager(nil) - p.newListPager = &resp - server.PagerResponderInjectNextLinks(p.newListPager, req, func(page *armmonitor.PrivateLinkScopesClientListResponse, createLink func() string) { + newListPager = &resp + p.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmonitor.PrivateLinkScopesClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(p.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(p.newListPager) { - p.newListPager = nil + if !server.PagerResponderMore(newListPager) { + p.newListPager.remove(req) } return resp, nil } @@ -245,7 +256,8 @@ func (p *PrivateLinkScopesServerTransport) dispatchNewListByResourceGroupPager(r if p.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if p.newListByResourceGroupPager == nil { + newListByResourceGroupPager := p.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/microsoft.insights/privateLinkScopes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -257,20 +269,22 @@ func (p *PrivateLinkScopesServerTransport) dispatchNewListByResourceGroupPager(r return nil, err } resp := p.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - p.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(p.newListByResourceGroupPager, req, func(page *armmonitor.PrivateLinkScopesClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + p.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armmonitor.PrivateLinkScopesClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(p.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(p.newListByResourceGroupPager) { - p.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + p.newListByResourceGroupPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/scheduledqueryrules_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/scheduledqueryrules_server.go index 9c6466487b67..a729bc5a02ed 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/scheduledqueryrules_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/scheduledqueryrules_server.go @@ -50,18 +50,22 @@ type ScheduledQueryRulesServer struct { } // NewScheduledQueryRulesServerTransport creates a new instance of ScheduledQueryRulesServerTransport with the provided implementation. -// The returned ScheduledQueryRulesServerTransport instance is connected to an instance of armmonitor.ScheduledQueryRulesClient by way of the -// undefined.Transporter field. +// The returned ScheduledQueryRulesServerTransport instance is connected to an instance of armmonitor.ScheduledQueryRulesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewScheduledQueryRulesServerTransport(srv *ScheduledQueryRulesServer) *ScheduledQueryRulesServerTransport { - return &ScheduledQueryRulesServerTransport{srv: srv} + return &ScheduledQueryRulesServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmonitor.ScheduledQueryRulesClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armmonitor.ScheduledQueryRulesClientListBySubscriptionResponse]](), + } } // ScheduledQueryRulesServerTransport connects instances of armmonitor.ScheduledQueryRulesClient to instances of ScheduledQueryRulesServer. // Don't use this type directly, use NewScheduledQueryRulesServerTransport instead. type ScheduledQueryRulesServerTransport struct { srv *ScheduledQueryRulesServer - newListByResourceGroupPager *azfake.PagerResponder[armmonitor.ScheduledQueryRulesClientListByResourceGroupResponse] - newListBySubscriptionPager *azfake.PagerResponder[armmonitor.ScheduledQueryRulesClientListBySubscriptionResponse] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armmonitor.ScheduledQueryRulesClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armmonitor.ScheduledQueryRulesClientListBySubscriptionResponse]] } // Do implements the policy.Transporter interface for ScheduledQueryRulesServerTransport. @@ -206,7 +210,8 @@ func (s *ScheduledQueryRulesServerTransport) dispatchNewListByResourceGroupPager if s.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if s.newListByResourceGroupPager == nil { + newListByResourceGroupPager := s.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/scheduledQueryRules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -218,20 +223,22 @@ func (s *ScheduledQueryRulesServerTransport) dispatchNewListByResourceGroupPager return nil, err } resp := s.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - s.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(s.newListByResourceGroupPager, req, func(page *armmonitor.ScheduledQueryRulesClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + s.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armmonitor.ScheduledQueryRulesClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(s.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(s.newListByResourceGroupPager) { - s.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + s.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -240,7 +247,8 @@ func (s *ScheduledQueryRulesServerTransport) dispatchNewListBySubscriptionPager( if s.srv.NewListBySubscriptionPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} } - if s.newListBySubscriptionPager == nil { + newListBySubscriptionPager := s.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/scheduledQueryRules` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -248,20 +256,22 @@ func (s *ScheduledQueryRulesServerTransport) dispatchNewListBySubscriptionPager( return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := s.srv.NewListBySubscriptionPager(nil) - s.newListBySubscriptionPager = &resp - server.PagerResponderInjectNextLinks(s.newListBySubscriptionPager, req, func(page *armmonitor.ScheduledQueryRulesClientListBySubscriptionResponse, createLink func() string) { + newListBySubscriptionPager = &resp + s.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armmonitor.ScheduledQueryRulesClientListBySubscriptionResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(s.newListBySubscriptionPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(s.newListBySubscriptionPager) { - s.newListBySubscriptionPager = nil + if !server.PagerResponderMore(newListBySubscriptionPager) { + s.newListBySubscriptionPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/tenantactiongroups_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/tenantactiongroups_server.go index aba30e35b75b..7832d39bcf25 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/tenantactiongroups_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/tenantactiongroups_server.go @@ -45,17 +45,20 @@ type TenantActionGroupsServer struct { } // NewTenantActionGroupsServerTransport creates a new instance of TenantActionGroupsServerTransport with the provided implementation. -// The returned TenantActionGroupsServerTransport instance is connected to an instance of armmonitor.TenantActionGroupsClient by way of the -// undefined.Transporter field. +// The returned TenantActionGroupsServerTransport instance is connected to an instance of armmonitor.TenantActionGroupsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewTenantActionGroupsServerTransport(srv *TenantActionGroupsServer) *TenantActionGroupsServerTransport { - return &TenantActionGroupsServerTransport{srv: srv} + return &TenantActionGroupsServerTransport{ + srv: srv, + newListByManagementGroupIDPager: newTracker[azfake.PagerResponder[armmonitor.TenantActionGroupsClientListByManagementGroupIDResponse]](), + } } // TenantActionGroupsServerTransport connects instances of armmonitor.TenantActionGroupsClient to instances of TenantActionGroupsServer. // Don't use this type directly, use NewTenantActionGroupsServerTransport instead. type TenantActionGroupsServerTransport struct { srv *TenantActionGroupsServer - newListByManagementGroupIDPager *azfake.PagerResponder[armmonitor.TenantActionGroupsClientListByManagementGroupIDResponse] + newListByManagementGroupIDPager *tracker[azfake.PagerResponder[armmonitor.TenantActionGroupsClientListByManagementGroupIDResponse]] } // Do implements the policy.Transporter interface for TenantActionGroupsServerTransport. @@ -198,7 +201,8 @@ func (t *TenantActionGroupsServerTransport) dispatchNewListByManagementGroupIDPa if t.srv.NewListByManagementGroupIDPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByManagementGroupIDPager not implemented")} } - if t.newListByManagementGroupIDPager == nil { + newListByManagementGroupIDPager := t.newListByManagementGroupIDPager.get(req) + if newListByManagementGroupIDPager == nil { const regexStr = `/providers/Microsoft.Management/managementGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Insights/tenantActionGroups` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -210,17 +214,19 @@ func (t *TenantActionGroupsServerTransport) dispatchNewListByManagementGroupIDPa return nil, err } resp := t.srv.NewListByManagementGroupIDPager(managementGroupIDUnescaped, getHeaderValue(req.Header, "x-ms-client-tenant-id"), nil) - t.newListByManagementGroupIDPager = &resp + newListByManagementGroupIDPager = &resp + t.newListByManagementGroupIDPager.add(req, newListByManagementGroupIDPager) } - resp, err := server.PagerResponderNext(t.newListByManagementGroupIDPager, req) + resp, err := server.PagerResponderNext(newListByManagementGroupIDPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + t.newListByManagementGroupIDPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(t.newListByManagementGroupIDPager) { - t.newListByManagementGroupIDPager = nil + if !server.PagerResponderMore(newListByManagementGroupIDPager) { + t.newListByManagementGroupIDPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/tenantactivitylogs_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/tenantactivitylogs_server.go index 35ed0931ebea..f8ea81901bf1 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/tenantactivitylogs_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/tenantactivitylogs_server.go @@ -28,17 +28,20 @@ type TenantActivityLogsServer struct { } // NewTenantActivityLogsServerTransport creates a new instance of TenantActivityLogsServerTransport with the provided implementation. -// The returned TenantActivityLogsServerTransport instance is connected to an instance of armmonitor.TenantActivityLogsClient by way of the -// undefined.Transporter field. +// The returned TenantActivityLogsServerTransport instance is connected to an instance of armmonitor.TenantActivityLogsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewTenantActivityLogsServerTransport(srv *TenantActivityLogsServer) *TenantActivityLogsServerTransport { - return &TenantActivityLogsServerTransport{srv: srv} + return &TenantActivityLogsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmonitor.TenantActivityLogsClientListResponse]](), + } } // TenantActivityLogsServerTransport connects instances of armmonitor.TenantActivityLogsClient to instances of TenantActivityLogsServer. // Don't use this type directly, use NewTenantActivityLogsServerTransport instead. type TenantActivityLogsServerTransport struct { srv *TenantActivityLogsServer - newListPager *azfake.PagerResponder[armmonitor.TenantActivityLogsClientListResponse] + newListPager *tracker[azfake.PagerResponder[armmonitor.TenantActivityLogsClientListResponse]] } // Do implements the policy.Transporter interface for TenantActivityLogsServerTransport. @@ -70,7 +73,8 @@ func (t *TenantActivityLogsServerTransport) dispatchNewListPager(req *http.Reque if t.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if t.newListPager == nil { + newListPager := t.newListPager.get(req) + if newListPager == nil { qp := req.URL.Query() filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) if err != nil { @@ -90,20 +94,22 @@ func (t *TenantActivityLogsServerTransport) dispatchNewListPager(req *http.Reque } } resp := t.srv.NewListPager(options) - t.newListPager = &resp - server.PagerResponderInjectNextLinks(t.newListPager, req, func(page *armmonitor.TenantActivityLogsClientListResponse, createLink func() string) { + newListPager = &resp + t.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmonitor.TenantActivityLogsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(t.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + t.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(t.newListPager) { - t.newListPager = nil + if !server.PagerResponderMore(newListPager) { + t.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/monitor/armmonitor/fake/vminsights_server.go b/sdk/resourcemanager/monitor/armmonitor/fake/vminsights_server.go index 15225b40bdf4..da67600d857e 100644 --- a/sdk/resourcemanager/monitor/armmonitor/fake/vminsights_server.go +++ b/sdk/resourcemanager/monitor/armmonitor/fake/vminsights_server.go @@ -29,8 +29,8 @@ type VMInsightsServer struct { } // NewVMInsightsServerTransport creates a new instance of VMInsightsServerTransport with the provided implementation. -// The returned VMInsightsServerTransport instance is connected to an instance of armmonitor.VMInsightsClient by way of the -// undefined.Transporter field. +// The returned VMInsightsServerTransport instance is connected to an instance of armmonitor.VMInsightsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVMInsightsServerTransport(srv *VMInsightsServer) *VMInsightsServerTransport { return &VMInsightsServerTransport{srv: srv} } diff --git a/sdk/resourcemanager/monitor/armmonitor/interfaces.go b/sdk/resourcemanager/monitor/armmonitor/interfaces.go new file mode 100644 index 000000000000..df55091d31a6 --- /dev/null +++ b/sdk/resourcemanager/monitor/armmonitor/interfaces.go @@ -0,0 +1,55 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmonitor + +// MetricAlertCriteriaClassification provides polymorphic access to related types. +// Call the interface's GetMetricAlertCriteria() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *MetricAlertCriteria, *MetricAlertMultipleResourceMultipleMetricCriteria, *MetricAlertSingleResourceMultipleMetricCriteria, +// - *WebtestLocationAvailabilityCriteria +type MetricAlertCriteriaClassification interface { + // GetMetricAlertCriteria returns the MetricAlertCriteria content of the underlying type. + GetMetricAlertCriteria() *MetricAlertCriteria +} + +// MultiMetricCriteriaClassification provides polymorphic access to related types. +// Call the interface's GetMultiMetricCriteria() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DynamicMetricCriteria, *MetricCriteria, *MultiMetricCriteria +type MultiMetricCriteriaClassification interface { + // GetMultiMetricCriteria returns the MultiMetricCriteria content of the underlying type. + GetMultiMetricCriteria() *MultiMetricCriteria +} + +// RuleActionClassification provides polymorphic access to related types. +// Call the interface's GetRuleAction() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *RuleAction, *RuleEmailAction, *RuleWebhookAction +type RuleActionClassification interface { + // GetRuleAction returns the RuleAction content of the underlying type. + GetRuleAction() *RuleAction +} + +// RuleConditionClassification provides polymorphic access to related types. +// Call the interface's GetRuleCondition() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *LocationThresholdRuleCondition, *ManagementEventRuleCondition, *RuleCondition, *ThresholdRuleCondition +type RuleConditionClassification interface { + // GetRuleCondition returns the RuleCondition content of the underlying type. + GetRuleCondition() *RuleCondition +} + +// RuleDataSourceClassification provides polymorphic access to related types. +// Call the interface's GetRuleDataSource() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *RuleDataSource, *RuleManagementEventDataSource, *RuleMetricDataSource +type RuleDataSourceClassification interface { + // GetRuleDataSource returns the RuleDataSource content of the underlying type. + GetRuleDataSource() *RuleDataSource +} diff --git a/sdk/resourcemanager/monitor/armmonitor/models.go b/sdk/resourcemanager/monitor/armmonitor/models.go index cea5edc1ab16..5857358098d6 100644 --- a/sdk/resourcemanager/monitor/armmonitor/models.go +++ b/sdk/resourcemanager/monitor/armmonitor/models.go @@ -176,56 +176,6 @@ type ActionGroupResource struct { Type *string } -// ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions contains the optional parameters for the ActionGroupsClient.BeginCreateNotificationsAtActionGroupResourceLevel -// method. -type ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ActionGroupsClientCreateOrUpdateOptions contains the optional parameters for the ActionGroupsClient.CreateOrUpdate method. -type ActionGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ActionGroupsClientDeleteOptions contains the optional parameters for the ActionGroupsClient.Delete method. -type ActionGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ActionGroupsClientEnableReceiverOptions contains the optional parameters for the ActionGroupsClient.EnableReceiver method. -type ActionGroupsClientEnableReceiverOptions struct { - // placeholder for future optional parameters -} - -// ActionGroupsClientGetOptions contains the optional parameters for the ActionGroupsClient.Get method. -type ActionGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelOptions contains the optional parameters for the ActionGroupsClient.GetTestNotificationsAtActionGroupResourceLevel -// method. -type ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelOptions struct { - // placeholder for future optional parameters -} - -// ActionGroupsClientListByResourceGroupOptions contains the optional parameters for the ActionGroupsClient.NewListByResourceGroupPager -// method. -type ActionGroupsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ActionGroupsClientListBySubscriptionIDOptions contains the optional parameters for the ActionGroupsClient.NewListBySubscriptionIDPager -// method. -type ActionGroupsClientListBySubscriptionIDOptions struct { - // placeholder for future optional parameters -} - -// ActionGroupsClientUpdateOptions contains the optional parameters for the ActionGroupsClient.Update method. -type ActionGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // ActionList - A list of Activity Log Alert rule actions. type ActionList struct { // The list of the Action Groups. @@ -263,49 +213,6 @@ type ActivityLogAlertResource struct { Type *string } -// ActivityLogAlertsClientCreateOrUpdateOptions contains the optional parameters for the ActivityLogAlertsClient.CreateOrUpdate -// method. -type ActivityLogAlertsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ActivityLogAlertsClientDeleteOptions contains the optional parameters for the ActivityLogAlertsClient.Delete method. -type ActivityLogAlertsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ActivityLogAlertsClientGetOptions contains the optional parameters for the ActivityLogAlertsClient.Get method. -type ActivityLogAlertsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ActivityLogAlertsClientListByResourceGroupOptions contains the optional parameters for the ActivityLogAlertsClient.NewListByResourceGroupPager -// method. -type ActivityLogAlertsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ActivityLogAlertsClientListBySubscriptionIDOptions contains the optional parameters for the ActivityLogAlertsClient.NewListBySubscriptionIDPager -// method. -type ActivityLogAlertsClientListBySubscriptionIDOptions struct { - // placeholder for future optional parameters -} - -// ActivityLogAlertsClientUpdateOptions contains the optional parameters for the ActivityLogAlertsClient.Update method. -type ActivityLogAlertsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// ActivityLogsClientListOptions contains the optional parameters for the ActivityLogsClient.NewListPager method. -type ActivityLogsClientListOptions struct { - // Used to fetch events with only the given properties. - // The $select argument is a comma separated list of property names to be returned. Possible values are: authorization, claims, - // correlationId, description, eventDataId, eventName, eventTimestamp, - // httpRequest, level, operationId, operationName, properties, resourceGroupName, resourceProviderName, resourceId, status, - // submissionTimestamp, subStatus, subscriptionId - Select *string -} - // AlertRule - An alert rule. type AlertRule struct { // REQUIRED; the condition that results in the alert rule being activated. @@ -363,17 +270,6 @@ type AlertRuleAnyOfOrLeafCondition struct { Field *string } -// AlertRuleIncidentsClientGetOptions contains the optional parameters for the AlertRuleIncidentsClient.Get method. -type AlertRuleIncidentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AlertRuleIncidentsClientListByAlertRuleOptions contains the optional parameters for the AlertRuleIncidentsClient.NewListByAlertRulePager -// method. -type AlertRuleIncidentsClientListByAlertRuleOptions struct { - // placeholder for future optional parameters -} - // AlertRuleLeafCondition - An Activity Log Alert rule condition that is met by comparing the field and value of an Activity // Log event. This condition must contain 'field' and either 'equals' or 'containsAny'. type AlertRuleLeafCondition struct { @@ -472,38 +368,6 @@ type AlertRuleResourcePatch struct { Tags map[string]*string } -// AlertRulesClientCreateOrUpdateOptions contains the optional parameters for the AlertRulesClient.CreateOrUpdate method. -type AlertRulesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AlertRulesClientDeleteOptions contains the optional parameters for the AlertRulesClient.Delete method. -type AlertRulesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AlertRulesClientGetOptions contains the optional parameters for the AlertRulesClient.Get method. -type AlertRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// AlertRulesClientListByResourceGroupOptions contains the optional parameters for the AlertRulesClient.NewListByResourceGroupPager -// method. -type AlertRulesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// AlertRulesClientListBySubscriptionOptions contains the optional parameters for the AlertRulesClient.NewListBySubscriptionPager -// method. -type AlertRulesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// AlertRulesClientUpdateOptions contains the optional parameters for the AlertRulesClient.Update method. -type AlertRulesClientUpdateOptions struct { - // placeholder for future optional parameters -} - // ArmRoleReceiver - An arm role receiver. type ArmRoleReceiver struct { // REQUIRED; The name of the arm role receiver. Names must be unique across all receivers within an action group. @@ -665,39 +529,6 @@ type AutoscaleSettingResourcePatch struct { Tags map[string]*string } -// AutoscaleSettingsClientCreateOrUpdateOptions contains the optional parameters for the AutoscaleSettingsClient.CreateOrUpdate -// method. -type AutoscaleSettingsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AutoscaleSettingsClientDeleteOptions contains the optional parameters for the AutoscaleSettingsClient.Delete method. -type AutoscaleSettingsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AutoscaleSettingsClientGetOptions contains the optional parameters for the AutoscaleSettingsClient.Get method. -type AutoscaleSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AutoscaleSettingsClientListByResourceGroupOptions contains the optional parameters for the AutoscaleSettingsClient.NewListByResourceGroupPager -// method. -type AutoscaleSettingsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// AutoscaleSettingsClientListBySubscriptionOptions contains the optional parameters for the AutoscaleSettingsClient.NewListBySubscriptionPager -// method. -type AutoscaleSettingsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// AutoscaleSettingsClientUpdateOptions contains the optional parameters for the AutoscaleSettingsClient.Update method. -type AutoscaleSettingsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // AzureAppPushReceiver - The Azure mobile App push notification receiver. type AzureAppPushReceiver struct { // REQUIRED; The email address registered for the Azure mobile app. @@ -880,42 +711,6 @@ type AzureMonitorWorkspaceResourceProperties struct { ProvisioningState *ProvisioningState } -// AzureMonitorWorkspacesClientCreateOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Create -// method. -type AzureMonitorWorkspacesClientCreateOptions struct { - // placeholder for future optional parameters -} - -// AzureMonitorWorkspacesClientDeleteOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Delete -// method. -type AzureMonitorWorkspacesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AzureMonitorWorkspacesClientGetOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Get method. -type AzureMonitorWorkspacesClientGetOptions struct { - // placeholder for future optional parameters -} - -// AzureMonitorWorkspacesClientListByResourceGroupOptions contains the optional parameters for the AzureMonitorWorkspacesClient.NewListByResourceGroupPager -// method. -type AzureMonitorWorkspacesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// AzureMonitorWorkspacesClientListBySubscriptionOptions contains the optional parameters for the AzureMonitorWorkspacesClient.NewListBySubscriptionPager -// method. -type AzureMonitorWorkspacesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// AzureMonitorWorkspacesClientUpdateOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Update -// method. -type AzureMonitorWorkspacesClientUpdateOptions struct { - // The payload - AzureMonitorWorkspaceProperties *AzureMonitorWorkspaceResourceForUpdate -} - // AzureResource - An azure resource object type AzureResource struct { // REQUIRED; Resource location @@ -962,36 +757,6 @@ type BaselineMetadata struct { Value *string } -// BaselinesClientListOptions contains the optional parameters for the BaselinesClient.NewListPager method. -type BaselinesClientListOptions struct { - // The list of aggregation types (comma separated) to retrieve. - Aggregation *string - // The $filter is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all - // time series of C where A = a1 and B = b1 or b2 $filter=A eq 'a1' and B eq 'b1' - // or B eq 'b2' and C eq '' - Invalid variant: $filter=A eq 'a1' and B eq 'b1' and C eq '' or B = 'b2' This is invalid because - // the logical or operator cannot separate two different metadata names. - - // Return all time series where A = a1, B = b1 and C = c1: $filter=A eq 'a1' and B eq 'b1' and C eq 'c1' - Return all time - // series where A = a1 $filter=A eq 'a1' and B eq '' and C eq ''. Special case: - // When dimension name or dimension value uses round brackets. Eg: When dimension name is dim (test) 1 Instead of using $filter= - // "dim (test) 1 eq '' " use $filter= "dim %2528test%2529 1 eq '' " When - // dimension name is dim (test) 3 and dimension value is dim3 (test) val Instead of using $filter= "dim (test) 3 eq 'dim3 - // (test) val' " use $filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' " - Filter *string - // The interval (i.e. timegrain) of the query. - Interval *string - // The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use - // %2 to indicate it. Eg: 'Metric,Name1' should be 'Metric%2Name1' - Metricnames *string - // Metric namespace to query metric definitions for. - Metricnamespace *string - // Allows retrieving only metadata of the baseline. On data request all information is retrieved. - ResultType *ResultType - // The list of sensitivities (comma separated) to retrieve. - Sensitivities *string - // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. - Timespan *string -} - // ColumnDefinition - Definition of custom data column. type ColumnDefinition struct { // The name of the column. @@ -1253,43 +1018,6 @@ type DataCollectionEndpointResourceSystemData struct { LastModifiedByType *CreatedByType } -// DataCollectionEndpointsClientCreateOptions contains the optional parameters for the DataCollectionEndpointsClient.Create -// method. -type DataCollectionEndpointsClientCreateOptions struct { - // The payload - Body *DataCollectionEndpointResource -} - -// DataCollectionEndpointsClientDeleteOptions contains the optional parameters for the DataCollectionEndpointsClient.Delete -// method. -type DataCollectionEndpointsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DataCollectionEndpointsClientGetOptions contains the optional parameters for the DataCollectionEndpointsClient.Get method. -type DataCollectionEndpointsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DataCollectionEndpointsClientListByResourceGroupOptions contains the optional parameters for the DataCollectionEndpointsClient.NewListByResourceGroupPager -// method. -type DataCollectionEndpointsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DataCollectionEndpointsClientListBySubscriptionOptions contains the optional parameters for the DataCollectionEndpointsClient.NewListBySubscriptionPager -// method. -type DataCollectionEndpointsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// DataCollectionEndpointsClientUpdateOptions contains the optional parameters for the DataCollectionEndpointsClient.Update -// method. -type DataCollectionEndpointsClientUpdateOptions struct { - // The payload - Body *ResourceForUpdate -} - // DataCollectionRule - Definition of what monitoring data to collect and where that data should be sent. type DataCollectionRule struct { // The resource ID of the data collection endpoint that this rule can be used with. @@ -1418,43 +1146,6 @@ type DataCollectionRuleAssociationProxyOnlyResourceSystemData struct { LastModifiedByType *CreatedByType } -// DataCollectionRuleAssociationsClientCreateOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Create -// method. -type DataCollectionRuleAssociationsClientCreateOptions struct { - // The payload - Body *DataCollectionRuleAssociationProxyOnlyResource -} - -// DataCollectionRuleAssociationsClientDeleteOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Delete -// method. -type DataCollectionRuleAssociationsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DataCollectionRuleAssociationsClientGetOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Get -// method. -type DataCollectionRuleAssociationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DataCollectionRuleAssociationsClientListByDataCollectionEndpointOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByDataCollectionEndpointPager -// method. -type DataCollectionRuleAssociationsClientListByDataCollectionEndpointOptions struct { - // placeholder for future optional parameters -} - -// DataCollectionRuleAssociationsClientListByResourceOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByResourcePager -// method. -type DataCollectionRuleAssociationsClientListByResourceOptions struct { - // placeholder for future optional parameters -} - -// DataCollectionRuleAssociationsClientListByRuleOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByRulePager -// method. -type DataCollectionRuleAssociationsClientListByRuleOptions struct { - // placeholder for future optional parameters -} - // DataCollectionRuleDataSources - The specification of data sources. This property is optional and can be omitted if the // rule is meant to be used via direct calls to the provisioned endpoint. type DataCollectionRuleDataSources struct { @@ -1639,40 +1330,6 @@ type DataCollectionRuleResourceSystemData struct { LastModifiedByType *CreatedByType } -// DataCollectionRulesClientCreateOptions contains the optional parameters for the DataCollectionRulesClient.Create method. -type DataCollectionRulesClientCreateOptions struct { - // The payload - Body *DataCollectionRuleResource -} - -// DataCollectionRulesClientDeleteOptions contains the optional parameters for the DataCollectionRulesClient.Delete method. -type DataCollectionRulesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DataCollectionRulesClientGetOptions contains the optional parameters for the DataCollectionRulesClient.Get method. -type DataCollectionRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DataCollectionRulesClientListByResourceGroupOptions contains the optional parameters for the DataCollectionRulesClient.NewListByResourceGroupPager -// method. -type DataCollectionRulesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DataCollectionRulesClientListBySubscriptionOptions contains the optional parameters for the DataCollectionRulesClient.NewListBySubscriptionPager -// method. -type DataCollectionRulesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// DataCollectionRulesClientUpdateOptions contains the optional parameters for the DataCollectionRulesClient.Update method. -type DataCollectionRulesClientUpdateOptions struct { - // The payload - Body *ResourceForUpdate -} - // DataContainer - Information about a container with data for a given resource. type DataContainer struct { // REQUIRED; Log Analytics workspace information. @@ -1837,18 +1494,6 @@ type DiagnosticSettingsCategory struct { CategoryType *CategoryType } -// DiagnosticSettingsCategoryClientGetOptions contains the optional parameters for the DiagnosticSettingsCategoryClient.Get -// method. -type DiagnosticSettingsCategoryClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiagnosticSettingsCategoryClientListOptions contains the optional parameters for the DiagnosticSettingsCategoryClient.NewListPager -// method. -type DiagnosticSettingsCategoryClientListOptions struct { - // placeholder for future optional parameters -} - // DiagnosticSettingsCategoryResource - The diagnostic settings category resource. type DiagnosticSettingsCategoryResource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -1873,27 +1518,6 @@ type DiagnosticSettingsCategoryResourceCollection struct { Value []*DiagnosticSettingsCategoryResource } -// DiagnosticSettingsClientCreateOrUpdateOptions contains the optional parameters for the DiagnosticSettingsClient.CreateOrUpdate -// method. -type DiagnosticSettingsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DiagnosticSettingsClientDeleteOptions contains the optional parameters for the DiagnosticSettingsClient.Delete method. -type DiagnosticSettingsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DiagnosticSettingsClientGetOptions contains the optional parameters for the DiagnosticSettingsClient.Get method. -type DiagnosticSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiagnosticSettingsClientListOptions contains the optional parameters for the DiagnosticSettingsClient.NewListPager method. -type DiagnosticSettingsClientListOptions struct { - // placeholder for future optional parameters -} - // DiagnosticSettingsResource - The diagnostic setting resource. type DiagnosticSettingsResource struct { // Properties of a Diagnostic Settings Resource. @@ -1974,14 +1598,14 @@ type DynamicMetricCriteria struct { // GetMultiMetricCriteria implements the MultiMetricCriteriaClassification interface for type DynamicMetricCriteria. func (d *DynamicMetricCriteria) GetMultiMetricCriteria() *MultiMetricCriteria { return &MultiMetricCriteria{ + AdditionalProperties: d.AdditionalProperties, CriterionType: d.CriterionType, - Name: d.Name, + Dimensions: d.Dimensions, MetricName: d.MetricName, MetricNamespace: d.MetricNamespace, - TimeAggregation: d.TimeAggregation, - Dimensions: d.Dimensions, + Name: d.Name, SkipMetricValidation: d.SkipMetricValidation, - AdditionalProperties: d.AdditionalProperties, + TimeAggregation: d.TimeAggregation, } } @@ -2171,11 +1795,6 @@ type ErrorResponseDetails struct { Target *string } -// EventCategoriesClientListOptions contains the optional parameters for the EventCategoriesClient.NewListPager method. -type EventCategoriesClientListOptions struct { - // placeholder for future optional parameters -} - // EventCategoryCollection - A collection of event categories. Currently possible values are: Administrative, Security, ServiceHealth, // Alert, Recommendation, Policy. type EventCategoryCollection struct { @@ -2495,8 +2114,8 @@ type LocationThresholdRuleCondition struct { // GetRuleCondition implements the RuleConditionClassification interface for type LocationThresholdRuleCondition. func (l *LocationThresholdRuleCondition) GetRuleCondition() *RuleCondition { return &RuleCondition{ - ODataType: l.ODataType, DataSource: l.DataSource, + ODataType: l.ODataType, } } @@ -2615,31 +2234,6 @@ type LogProfileResourcePatch struct { Tags map[string]*string } -// LogProfilesClientCreateOrUpdateOptions contains the optional parameters for the LogProfilesClient.CreateOrUpdate method. -type LogProfilesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// LogProfilesClientDeleteOptions contains the optional parameters for the LogProfilesClient.Delete method. -type LogProfilesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// LogProfilesClientGetOptions contains the optional parameters for the LogProfilesClient.Get method. -type LogProfilesClientGetOptions struct { - // placeholder for future optional parameters -} - -// LogProfilesClientListOptions contains the optional parameters for the LogProfilesClient.NewListPager method. -type LogProfilesClientListOptions struct { - // placeholder for future optional parameters -} - -// LogProfilesClientUpdateOptions contains the optional parameters for the LogProfilesClient.Update method. -type LogProfilesClientUpdateOptions struct { - // placeholder for future optional parameters -} - // LogSettings - Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log. type LogSettings struct { // REQUIRED; a value indicating whether this log is enabled. @@ -2731,8 +2325,8 @@ type ManagementEventRuleCondition struct { // GetRuleCondition implements the RuleConditionClassification interface for type ManagementEventRuleCondition. func (m *ManagementEventRuleCondition) GetRuleCondition() *RuleCondition { return &RuleCondition{ - ODataType: m.ODataType, DataSource: m.DataSource, + ODataType: m.ODataType, } } @@ -2790,16 +2384,6 @@ type MetricAlertAction struct { WebHookProperties map[string]*string } -// MetricAlertCriteriaClassification provides polymorphic access to related types. -// Call the interface's GetMetricAlertCriteria() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *MetricAlertCriteria, *MetricAlertMultipleResourceMultipleMetricCriteria, *MetricAlertSingleResourceMultipleMetricCriteria, -// - *WebtestLocationAvailabilityCriteria -type MetricAlertCriteriaClassification interface { - // GetMetricAlertCriteria returns the MetricAlertCriteria content of the underlying type. - GetMetricAlertCriteria() *MetricAlertCriteria -} - // MetricAlertCriteria - The rule criteria that defines the conditions of the alert rule. type MetricAlertCriteria struct { // REQUIRED; specifies the type of the alert criteria. @@ -2828,8 +2412,8 @@ type MetricAlertMultipleResourceMultipleMetricCriteria struct { // GetMetricAlertCriteria implements the MetricAlertCriteriaClassification interface for type MetricAlertMultipleResourceMultipleMetricCriteria. func (m *MetricAlertMultipleResourceMultipleMetricCriteria) GetMetricAlertCriteria() *MetricAlertCriteria { return &MetricAlertCriteria{ - ODataType: m.ODataType, AdditionalProperties: m.AdditionalProperties, + ODataType: m.ODataType, } } @@ -2971,8 +2555,8 @@ type MetricAlertSingleResourceMultipleMetricCriteria struct { // GetMetricAlertCriteria implements the MetricAlertCriteriaClassification interface for type MetricAlertSingleResourceMultipleMetricCriteria. func (m *MetricAlertSingleResourceMultipleMetricCriteria) GetMetricAlertCriteria() *MetricAlertCriteria { return &MetricAlertCriteria{ - ODataType: m.ODataType, AdditionalProperties: m.AdditionalProperties, + ODataType: m.ODataType, } } @@ -3009,49 +2593,6 @@ type MetricAlertStatusProperties struct { Timestamp *time.Time } -// MetricAlertsClientCreateOrUpdateOptions contains the optional parameters for the MetricAlertsClient.CreateOrUpdate method. -type MetricAlertsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// MetricAlertsClientDeleteOptions contains the optional parameters for the MetricAlertsClient.Delete method. -type MetricAlertsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// MetricAlertsClientGetOptions contains the optional parameters for the MetricAlertsClient.Get method. -type MetricAlertsClientGetOptions struct { - // placeholder for future optional parameters -} - -// MetricAlertsClientListByResourceGroupOptions contains the optional parameters for the MetricAlertsClient.NewListByResourceGroupPager -// method. -type MetricAlertsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// MetricAlertsClientListBySubscriptionOptions contains the optional parameters for the MetricAlertsClient.NewListBySubscriptionPager -// method. -type MetricAlertsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// MetricAlertsClientUpdateOptions contains the optional parameters for the MetricAlertsClient.Update method. -type MetricAlertsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// MetricAlertsStatusClientListByNameOptions contains the optional parameters for the MetricAlertsStatusClient.ListByName -// method. -type MetricAlertsStatusClientListByNameOptions struct { - // placeholder for future optional parameters -} - -// MetricAlertsStatusClientListOptions contains the optional parameters for the MetricAlertsStatusClient.List method. -type MetricAlertsStatusClientListOptions struct { - // placeholder for future optional parameters -} - // MetricAvailability - Metric availability specifies the time grain (aggregation interval or frequency) and the retention // period for that time grain. type MetricAvailability struct { @@ -3123,14 +2664,14 @@ type MetricCriteria struct { // GetMultiMetricCriteria implements the MultiMetricCriteriaClassification interface for type MetricCriteria. func (m *MetricCriteria) GetMultiMetricCriteria() *MultiMetricCriteria { return &MultiMetricCriteria{ + AdditionalProperties: m.AdditionalProperties, CriterionType: m.CriterionType, - Name: m.Name, + Dimensions: m.Dimensions, MetricName: m.MetricName, MetricNamespace: m.MetricNamespace, - TimeAggregation: m.TimeAggregation, - Dimensions: m.Dimensions, + Name: m.Name, SkipMetricValidation: m.SkipMetricValidation, - AdditionalProperties: m.AdditionalProperties, + TimeAggregation: m.TimeAggregation, } } @@ -3182,19 +2723,6 @@ type MetricDefinitionCollection struct { Value []*MetricDefinition } -// MetricDefinitionsClientListAtSubscriptionScopeOptions contains the optional parameters for the MetricDefinitionsClient.NewListAtSubscriptionScopePager -// method. -type MetricDefinitionsClientListAtSubscriptionScopeOptions struct { - // Metric namespace where the metrics you want reside. - Metricnamespace *string -} - -// MetricDefinitionsClientListOptions contains the optional parameters for the MetricDefinitionsClient.NewListPager method. -type MetricDefinitionsClientListOptions struct { - // Metric namespace where the metrics you want reside. - Metricnamespace *string -} - // MetricDimension - Specifies a metric dimension. type MetricDimension struct { // REQUIRED; Name of the dimension. @@ -3237,12 +2765,6 @@ type MetricNamespaceName struct { MetricNamespaceName *string } -// MetricNamespacesClientListOptions contains the optional parameters for the MetricNamespacesClient.NewListPager method. -type MetricNamespacesClientListOptions struct { - // The ISO 8601 conform Date start time from which to query for metric namespaces. - StartTime *string -} - // MetricSettings - Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric. type MetricSettings struct { // REQUIRED; a value indicating whether this category is enabled. @@ -3341,133 +2863,6 @@ type Metrics struct { PrometheusQueryEndpoint *string } -// MetricsClientListAtSubscriptionScopeOptions contains the optional parameters for the MetricsClient.ListAtSubscriptionScope -// method. -type MetricsClientListAtSubscriptionScopeOptions struct { - // The list of aggregation types (comma separated) to retrieve. - Aggregation *string - // When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest - // supported timespan. When set to false, an error is returned for invalid - // timespan parameters. Defaults to false. - AutoAdjustTimegrain *bool - // The $filter is used to reduce the set of metric data returned. - // Example: - // Metric contains metadata A, B and C. - // - Return all time series of C where A = a1 and B = b1 or b2 - // $filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘’ - // - Invalid variant: - // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘’ or B = ‘b2’ - // This is invalid because the logical or operator cannot separate two different metadata names. - // - Return all time series where A = a1, B = b1 and C = c1: - // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’ - // - Return all time series where A = a1 - // $filter=A eq ‘a1’ and B eq ‘’ and C eq ‘’. - Filter *string - // The interval (i.e. timegrain) of the query. - Interval *string - // The names of the metrics (comma separated) to retrieve. - Metricnames *string - // Metric namespace where the metrics you want reside. - Metricnamespace *string - // The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum - // asc. - Orderby *string - // Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. - ResultType *MetricResultType - // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. - Timespan *string - // The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. - Top *int32 - // When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid - // filter parameters. Defaults to true. - ValidateDimensions *bool -} - -// MetricsClientListAtSubscriptionScopePostOptions contains the optional parameters for the MetricsClient.ListAtSubscriptionScopePost -// method. -type MetricsClientListAtSubscriptionScopePostOptions struct { - // The list of aggregation types (comma separated) to retrieve. - Aggregation *string - // When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest - // supported timespan. When set to false, an error is returned for invalid - // timespan parameters. Defaults to false. - AutoAdjustTimegrain *bool - // Parameters serialized in the body - Body *SubscriptionScopeMetricsRequestBodyParameters - // The $filter is used to reduce the set of metric data returned. - // Example: - // Metric contains metadata A, B and C. - // - Return all time series of C where A = a1 and B = b1 or b2 - // $filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘’ - // - Invalid variant: - // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘’ or B = ‘b2’ - // This is invalid because the logical or operator cannot separate two different metadata names. - // - Return all time series where A = a1, B = b1 and C = c1: - // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’ - // - Return all time series where A = a1 - // $filter=A eq ‘a1’ and B eq ‘’ and C eq ‘’. - Filter *string - // The interval (i.e. timegrain) of the query. - Interval *string - // The names of the metrics (comma separated) to retrieve. - Metricnames *string - // Metric namespace where the metrics you want reside. - Metricnamespace *string - // The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum - // asc. - Orderby *string - // Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. - ResultType *MetricResultType - // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. - Timespan *string - // The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. - Top *int32 - // When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid - // filter parameters. Defaults to true. - ValidateDimensions *bool -} - -// MetricsClientListOptions contains the optional parameters for the MetricsClient.List method. -type MetricsClientListOptions struct { - // The list of aggregation types (comma separated) to retrieve. - Aggregation *string - // When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest - // supported timespan. When set to false, an error is returned for invalid - // timespan parameters. Defaults to false. - AutoAdjustTimegrain *bool - // The $filter is used to reduce the set of metric data returned. - // Example: - // Metric contains metadata A, B and C. - // - Return all time series of C where A = a1 and B = b1 or b2 - // $filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘’ - // - Invalid variant: - // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘’ or B = ‘b2’ - // This is invalid because the logical or operator cannot separate two different metadata names. - // - Return all time series where A = a1, B = b1 and C = c1: - // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’ - // - Return all time series where A = a1 - // $filter=A eq ‘a1’ and B eq ‘’ and C eq ‘’. - Filter *string - // The interval (i.e. timegrain) of the query. - Interval *string - // The names of the metrics (comma separated) to retrieve. - Metricnames *string - // Metric namespace where the metrics you want reside. - Metricnamespace *string - // The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum - // asc. - Orderby *string - // Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. - ResultType *ResultType - // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. - Timespan *string - // The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. - Top *int32 - // When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid - // filter parameters. Defaults to true. - ValidateDimensions *bool -} - // MetricsIngestionEndpointSpec - Definition of the endpoint used for ingesting metrics. type MetricsIngestionEndpointSpec struct { // READ-ONLY; The endpoint. This property is READ-ONLY. @@ -3487,15 +2882,6 @@ type MonitoringAccountDestination struct { AccountID *string } -// MultiMetricCriteriaClassification provides polymorphic access to related types. -// Call the interface's GetMultiMetricCriteria() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DynamicMetricCriteria, *MetricCriteria, *MultiMetricCriteria -type MultiMetricCriteriaClassification interface { - // GetMultiMetricCriteria returns the MultiMetricCriteria content of the underlying type. - GetMultiMetricCriteria() *MultiMetricCriteria -} - // MultiMetricCriteria - The types of conditions for a multi resource alert. type MultiMetricCriteria struct { // REQUIRED; Specifies the type of threshold criteria @@ -3675,17 +3061,6 @@ type OperationStatus struct { Status *string } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - -// OperationsForMonitorClientListOptions contains the optional parameters for the OperationsForMonitorClient.NewListPager -// method. -type OperationsForMonitorClientListOptions struct { - // placeholder for future optional parameters -} - // PerfCounterDataSource - Definition of which performance counters will be collected and how they will be collected by this // data collection rule. Collected from both Windows and Linux machines where the counter is present. type PerfCounterDataSource struct { @@ -3726,11 +3101,6 @@ type PredictiveAutoscalePolicy struct { ScaleLookAheadTime *string } -// PredictiveMetricClientGetOptions contains the optional parameters for the PredictiveMetricClient.Get method. -type PredictiveMetricClientGetOptions struct { - // placeholder for future optional parameters -} - // PredictiveResponse - The response to a metrics query. type PredictiveResponse struct { // the value of the collection. @@ -3801,32 +3171,6 @@ type PrivateEndpointConnectionProperties struct { ProvisioningState *PrivateEndpointConnectionProvisioningState } -// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate -// method. -type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete -// method. -type PrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. -type PrivateEndpointConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByPrivateLinkScope -// method. -type PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions struct { - // placeholder for future optional parameters -} - // PrivateLinkResource - A private link resource type PrivateLinkResource struct { // Resource properties. @@ -3860,23 +3204,6 @@ type PrivateLinkResourceProperties struct { RequiredMembers []*string } -// PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method. -type PrivateLinkResourcesClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByPrivateLinkScope -// method. -type PrivateLinkResourcesClientListByPrivateLinkScopeOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopeOperationStatusClientGetOptions contains the optional parameters for the PrivateLinkScopeOperationStatusClient.Get -// method. -type PrivateLinkScopeOperationStatusClientGetOptions struct { - // placeholder for future optional parameters -} - type PrivateLinkScopedResource struct { // The resourceId of the Azure Monitor Private Link Scope Scoped Resource through which this DCE is associated with a Azure // Monitor Private Link Scope. @@ -3886,66 +3213,6 @@ type PrivateLinkScopedResource struct { ScopeID *string } -// PrivateLinkScopedResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.BeginCreateOrUpdate -// method. -type PrivateLinkScopedResourcesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateLinkScopedResourcesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.BeginDelete -// method. -type PrivateLinkScopedResourcesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateLinkScopedResourcesClientGetOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.Get -// method. -type PrivateLinkScopedResourcesClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopedResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.NewListByPrivateLinkScopePager -// method. -type PrivateLinkScopedResourcesClientListByPrivateLinkScopeOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopesClient.BeginDelete -// method. -type PrivateLinkScopesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateLinkScopesClientCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopesClient.CreateOrUpdate -// method. -type PrivateLinkScopesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopesClientGetOptions contains the optional parameters for the PrivateLinkScopesClient.Get method. -type PrivateLinkScopesClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopesClientListByResourceGroupOptions contains the optional parameters for the PrivateLinkScopesClient.NewListByResourceGroupPager -// method. -type PrivateLinkScopesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopesClientListOptions contains the optional parameters for the PrivateLinkScopesClient.NewListPager method. -type PrivateLinkScopesClientListOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkScopesClientUpdateTagsOptions contains the optional parameters for the PrivateLinkScopesClient.UpdateTags method. -type PrivateLinkScopesClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer // and provider. type PrivateLinkServiceConnectionState struct { @@ -4224,15 +3491,6 @@ type RetentionPolicy struct { Enabled *bool } -// RuleActionClassification provides polymorphic access to related types. -// Call the interface's GetRuleAction() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *RuleAction, *RuleEmailAction, *RuleWebhookAction -type RuleActionClassification interface { - // GetRuleAction returns the RuleAction content of the underlying type. - GetRuleAction() *RuleAction -} - // RuleAction - The action that is performed when the alert rule becomes active, and when an alert condition is resolved. type RuleAction struct { // REQUIRED; specifies the type of the action. There are two types of actions: RuleEmailAction and RuleWebhookAction. @@ -4242,15 +3500,6 @@ type RuleAction struct { // GetRuleAction implements the RuleActionClassification interface for type RuleAction. func (r *RuleAction) GetRuleAction() *RuleAction { return r } -// RuleConditionClassification provides polymorphic access to related types. -// Call the interface's GetRuleCondition() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *LocationThresholdRuleCondition, *ManagementEventRuleCondition, *RuleCondition, *ThresholdRuleCondition -type RuleConditionClassification interface { - // GetRuleCondition returns the RuleCondition content of the underlying type. - GetRuleCondition() *RuleCondition -} - // RuleCondition - The condition that results in the alert rule being activated. type RuleCondition struct { // REQUIRED; specifies the type of condition. This can be one of three types: ManagementEventRuleCondition (occurrences of @@ -4265,15 +3514,6 @@ type RuleCondition struct { // GetRuleCondition implements the RuleConditionClassification interface for type RuleCondition. func (r *RuleCondition) GetRuleCondition() *RuleCondition { return r } -// RuleDataSourceClassification provides polymorphic access to related types. -// Call the interface's GetRuleDataSource() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *RuleDataSource, *RuleManagementEventDataSource, *RuleMetricDataSource -type RuleDataSourceClassification interface { - // GetRuleDataSource returns the RuleDataSource content of the underlying type. - GetRuleDataSource() *RuleDataSource -} - // RuleDataSource - The resource from which the rule collects its data. type RuleDataSource struct { // REQUIRED; specifies the type of data source. There are two types of rule data sources: RuleMetricDataSource and RuleManagementEventDataSource @@ -4372,11 +3612,11 @@ type RuleManagementEventDataSource struct { // GetRuleDataSource implements the RuleDataSourceClassification interface for type RuleManagementEventDataSource. func (r *RuleManagementEventDataSource) GetRuleDataSource() *RuleDataSource { return &RuleDataSource{ - ODataType: r.ODataType, - ResourceURI: r.ResourceURI, LegacyResourceID: r.LegacyResourceID, - ResourceLocation: r.ResourceLocation, MetricNamespace: r.MetricNamespace, + ODataType: r.ODataType, + ResourceLocation: r.ResourceLocation, + ResourceURI: r.ResourceURI, } } @@ -4405,11 +3645,11 @@ type RuleMetricDataSource struct { // GetRuleDataSource implements the RuleDataSourceClassification interface for type RuleMetricDataSource. func (r *RuleMetricDataSource) GetRuleDataSource() *RuleDataSource { return &RuleDataSource{ - ODataType: r.ODataType, - ResourceURI: r.ResourceURI, LegacyResourceID: r.LegacyResourceID, - ResourceLocation: r.ResourceLocation, MetricNamespace: r.MetricNamespace, + ODataType: r.ODataType, + ResourceLocation: r.ResourceLocation, + ResourceURI: r.ResourceURI, } } @@ -4634,39 +3874,6 @@ type ScheduledQueryRuleResourcePatch struct { Tags map[string]*string } -// ScheduledQueryRulesClientCreateOrUpdateOptions contains the optional parameters for the ScheduledQueryRulesClient.CreateOrUpdate -// method. -type ScheduledQueryRulesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ScheduledQueryRulesClientDeleteOptions contains the optional parameters for the ScheduledQueryRulesClient.Delete method. -type ScheduledQueryRulesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ScheduledQueryRulesClientGetOptions contains the optional parameters for the ScheduledQueryRulesClient.Get method. -type ScheduledQueryRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ScheduledQueryRulesClientListByResourceGroupOptions contains the optional parameters for the ScheduledQueryRulesClient.NewListByResourceGroupPager -// method. -type ScheduledQueryRulesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ScheduledQueryRulesClientListBySubscriptionOptions contains the optional parameters for the ScheduledQueryRulesClient.NewListBySubscriptionPager -// method. -type ScheduledQueryRulesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// ScheduledQueryRulesClientUpdateOptions contains the optional parameters for the ScheduledQueryRulesClient.Update method. -type ScheduledQueryRulesClientUpdateOptions struct { - // placeholder for future optional parameters -} - // ScopedResource - A private link scoped resource type ScopedResource struct { // Resource properties. @@ -5061,57 +4268,6 @@ type TenantActionGroupResource struct { Type *string } -// TenantActionGroupsClientCreateOrUpdateOptions contains the optional parameters for the TenantActionGroupsClient.CreateOrUpdate -// method. -type TenantActionGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// TenantActionGroupsClientDeleteOptions contains the optional parameters for the TenantActionGroupsClient.Delete method. -type TenantActionGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// TenantActionGroupsClientGetOptions contains the optional parameters for the TenantActionGroupsClient.Get method. -type TenantActionGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// TenantActionGroupsClientListByManagementGroupIDOptions contains the optional parameters for the TenantActionGroupsClient.NewListByManagementGroupIDPager -// method. -type TenantActionGroupsClientListByManagementGroupIDOptions struct { - // placeholder for future optional parameters -} - -// TenantActionGroupsClientUpdateOptions contains the optional parameters for the TenantActionGroupsClient.Update method. -type TenantActionGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// TenantActivityLogsClientListOptions contains the optional parameters for the TenantActivityLogsClient.NewListPager method. -type TenantActivityLogsClientListOptions struct { - // Reduces the set of data collected. - // The $filter is very restricted and allows only the following patterns. - // - List events for a resource group: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, - // Operation' and resourceGroupName eq ''. - // - List events for resource: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' - // and resourceUri eq ''. - // - List events for a subscription: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation'. - // - List events for a resource provider: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, - // Operation' and resourceProvider eq ''. - // - List events for a correlation Id: api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - // eventTimestamp le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, - // Operation' and correlationId eq ''. - // NOTE: No other syntax is allowed. - Filter *string - // Used to fetch events with only the given properties. - // The $select argument is a comma separated list of property names to be returned. Possible values are: authorization, claims, - // correlationId, description, eventDataId, eventName, eventTimestamp, - // httpRequest, level, operationId, operationName, properties, resourceGroupName, resourceProviderName, resourceId, status, - // submissionTimestamp, subStatus, subscriptionId - Select *string -} - // TestNotificationDetailsResponse - The details of the test notification results. type TestNotificationDetailsResponse struct { // REQUIRED; The overall state @@ -5158,8 +4314,8 @@ type ThresholdRuleCondition struct { // GetRuleCondition implements the RuleConditionClassification interface for type ThresholdRuleCondition. func (t *ThresholdRuleCondition) GetRuleCondition() *RuleCondition { return &RuleCondition{ - ODataType: t.ODataType, DataSource: t.DataSource, + ODataType: t.ODataType, } } @@ -5288,12 +4444,6 @@ type UserIdentityProperties struct { PrincipalID *string } -// VMInsightsClientGetOnboardingStatusOptions contains the optional parameters for the VMInsightsClient.GetOnboardingStatus -// method. -type VMInsightsClientGetOnboardingStatusOptions struct { - // placeholder for future optional parameters -} - // VMInsightsOnboardingStatus - VM Insights onboarding status for a resource. type VMInsightsOnboardingStatus struct { // Resource properties. @@ -5428,8 +4578,8 @@ type WebtestLocationAvailabilityCriteria struct { // GetMetricAlertCriteria implements the MetricAlertCriteriaClassification interface for type WebtestLocationAvailabilityCriteria. func (w *WebtestLocationAvailabilityCriteria) GetMetricAlertCriteria() *MetricAlertCriteria { return &MetricAlertCriteria{ - ODataType: w.ODataType, AdditionalProperties: w.AdditionalProperties, + ODataType: w.ODataType, } } diff --git a/sdk/resourcemanager/monitor/armmonitor/options.go b/sdk/resourcemanager/monitor/armmonitor/options.go new file mode 100644 index 000000000000..b737f70d4922 --- /dev/null +++ b/sdk/resourcemanager/monitor/armmonitor/options.go @@ -0,0 +1,852 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmonitor + +// ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions contains the optional parameters for the ActionGroupsClient.BeginCreateNotificationsAtActionGroupResourceLevel +// method. +type ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ActionGroupsClientCreateOrUpdateOptions contains the optional parameters for the ActionGroupsClient.CreateOrUpdate method. +type ActionGroupsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ActionGroupsClientDeleteOptions contains the optional parameters for the ActionGroupsClient.Delete method. +type ActionGroupsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ActionGroupsClientEnableReceiverOptions contains the optional parameters for the ActionGroupsClient.EnableReceiver method. +type ActionGroupsClientEnableReceiverOptions struct { + // placeholder for future optional parameters +} + +// ActionGroupsClientGetOptions contains the optional parameters for the ActionGroupsClient.Get method. +type ActionGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelOptions contains the optional parameters for the ActionGroupsClient.GetTestNotificationsAtActionGroupResourceLevel +// method. +type ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelOptions struct { + // placeholder for future optional parameters +} + +// ActionGroupsClientListByResourceGroupOptions contains the optional parameters for the ActionGroupsClient.NewListByResourceGroupPager +// method. +type ActionGroupsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ActionGroupsClientListBySubscriptionIDOptions contains the optional parameters for the ActionGroupsClient.NewListBySubscriptionIDPager +// method. +type ActionGroupsClientListBySubscriptionIDOptions struct { + // placeholder for future optional parameters +} + +// ActionGroupsClientUpdateOptions contains the optional parameters for the ActionGroupsClient.Update method. +type ActionGroupsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ActivityLogAlertsClientCreateOrUpdateOptions contains the optional parameters for the ActivityLogAlertsClient.CreateOrUpdate +// method. +type ActivityLogAlertsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ActivityLogAlertsClientDeleteOptions contains the optional parameters for the ActivityLogAlertsClient.Delete method. +type ActivityLogAlertsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ActivityLogAlertsClientGetOptions contains the optional parameters for the ActivityLogAlertsClient.Get method. +type ActivityLogAlertsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ActivityLogAlertsClientListByResourceGroupOptions contains the optional parameters for the ActivityLogAlertsClient.NewListByResourceGroupPager +// method. +type ActivityLogAlertsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ActivityLogAlertsClientListBySubscriptionIDOptions contains the optional parameters for the ActivityLogAlertsClient.NewListBySubscriptionIDPager +// method. +type ActivityLogAlertsClientListBySubscriptionIDOptions struct { + // placeholder for future optional parameters +} + +// ActivityLogAlertsClientUpdateOptions contains the optional parameters for the ActivityLogAlertsClient.Update method. +type ActivityLogAlertsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ActivityLogsClientListOptions contains the optional parameters for the ActivityLogsClient.NewListPager method. +type ActivityLogsClientListOptions struct { + // Used to fetch events with only the given properties. + // The $select argument is a comma separated list of property names to be returned. Possible values are: authorization, claims, + // correlationId, description, eventDataId, eventName, eventTimestamp, + // httpRequest, level, operationId, operationName, properties, resourceGroupName, resourceProviderName, resourceId, status, + // submissionTimestamp, subStatus, subscriptionId + Select *string +} + +// AlertRuleIncidentsClientGetOptions contains the optional parameters for the AlertRuleIncidentsClient.Get method. +type AlertRuleIncidentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AlertRuleIncidentsClientListByAlertRuleOptions contains the optional parameters for the AlertRuleIncidentsClient.NewListByAlertRulePager +// method. +type AlertRuleIncidentsClientListByAlertRuleOptions struct { + // placeholder for future optional parameters +} + +// AlertRulesClientCreateOrUpdateOptions contains the optional parameters for the AlertRulesClient.CreateOrUpdate method. +type AlertRulesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AlertRulesClientDeleteOptions contains the optional parameters for the AlertRulesClient.Delete method. +type AlertRulesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AlertRulesClientGetOptions contains the optional parameters for the AlertRulesClient.Get method. +type AlertRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// AlertRulesClientListByResourceGroupOptions contains the optional parameters for the AlertRulesClient.NewListByResourceGroupPager +// method. +type AlertRulesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// AlertRulesClientListBySubscriptionOptions contains the optional parameters for the AlertRulesClient.NewListBySubscriptionPager +// method. +type AlertRulesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// AlertRulesClientUpdateOptions contains the optional parameters for the AlertRulesClient.Update method. +type AlertRulesClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// AutoscaleSettingsClientCreateOrUpdateOptions contains the optional parameters for the AutoscaleSettingsClient.CreateOrUpdate +// method. +type AutoscaleSettingsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AutoscaleSettingsClientDeleteOptions contains the optional parameters for the AutoscaleSettingsClient.Delete method. +type AutoscaleSettingsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AutoscaleSettingsClientGetOptions contains the optional parameters for the AutoscaleSettingsClient.Get method. +type AutoscaleSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AutoscaleSettingsClientListByResourceGroupOptions contains the optional parameters for the AutoscaleSettingsClient.NewListByResourceGroupPager +// method. +type AutoscaleSettingsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// AutoscaleSettingsClientListBySubscriptionOptions contains the optional parameters for the AutoscaleSettingsClient.NewListBySubscriptionPager +// method. +type AutoscaleSettingsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// AutoscaleSettingsClientUpdateOptions contains the optional parameters for the AutoscaleSettingsClient.Update method. +type AutoscaleSettingsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// AzureMonitorWorkspacesClientCreateOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Create +// method. +type AzureMonitorWorkspacesClientCreateOptions struct { + // placeholder for future optional parameters +} + +// AzureMonitorWorkspacesClientDeleteOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Delete +// method. +type AzureMonitorWorkspacesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AzureMonitorWorkspacesClientGetOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Get method. +type AzureMonitorWorkspacesClientGetOptions struct { + // placeholder for future optional parameters +} + +// AzureMonitorWorkspacesClientListByResourceGroupOptions contains the optional parameters for the AzureMonitorWorkspacesClient.NewListByResourceGroupPager +// method. +type AzureMonitorWorkspacesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// AzureMonitorWorkspacesClientListBySubscriptionOptions contains the optional parameters for the AzureMonitorWorkspacesClient.NewListBySubscriptionPager +// method. +type AzureMonitorWorkspacesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// AzureMonitorWorkspacesClientUpdateOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Update +// method. +type AzureMonitorWorkspacesClientUpdateOptions struct { + // The payload + AzureMonitorWorkspaceProperties *AzureMonitorWorkspaceResourceForUpdate +} + +// BaselinesClientListOptions contains the optional parameters for the BaselinesClient.NewListPager method. +type BaselinesClientListOptions struct { + // The list of aggregation types (comma separated) to retrieve. + Aggregation *string + + // The $filter is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all + // time series of C where A = a1 and B = b1 or b2 $filter=A eq 'a1' and B eq 'b1' + // or B eq 'b2' and C eq '' - Invalid variant: $filter=A eq 'a1' and B eq 'b1' and C eq '' or B = 'b2' This is invalid because + // the logical or operator cannot separate two different metadata names. - + // Return all time series where A = a1, B = b1 and C = c1: $filter=A eq 'a1' and B eq 'b1' and C eq 'c1' - Return all time + // series where A = a1 $filter=A eq 'a1' and B eq '' and C eq ''. Special case: + // When dimension name or dimension value uses round brackets. Eg: When dimension name is dim (test) 1 Instead of using $filter= + // "dim (test) 1 eq '' " use $filter= "dim %2528test%2529 1 eq '' " When + // dimension name is dim (test) 3 and dimension value is dim3 (test) val Instead of using $filter= "dim (test) 3 eq 'dim3 + // (test) val' " use $filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' " + Filter *string + + // The interval (i.e. timegrain) of the query. + Interval *string + + // The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use + // %2 to indicate it. Eg: 'Metric,Name1' should be 'Metric%2Name1' + Metricnames *string + + // Metric namespace to query metric definitions for. + Metricnamespace *string + + // Allows retrieving only metadata of the baseline. On data request all information is retrieved. + ResultType *ResultType + + // The list of sensitivities (comma separated) to retrieve. + Sensitivities *string + + // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. + Timespan *string +} + +// DataCollectionEndpointsClientCreateOptions contains the optional parameters for the DataCollectionEndpointsClient.Create +// method. +type DataCollectionEndpointsClientCreateOptions struct { + // The payload + Body *DataCollectionEndpointResource +} + +// DataCollectionEndpointsClientDeleteOptions contains the optional parameters for the DataCollectionEndpointsClient.Delete +// method. +type DataCollectionEndpointsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionEndpointsClientGetOptions contains the optional parameters for the DataCollectionEndpointsClient.Get method. +type DataCollectionEndpointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionEndpointsClientListByResourceGroupOptions contains the optional parameters for the DataCollectionEndpointsClient.NewListByResourceGroupPager +// method. +type DataCollectionEndpointsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionEndpointsClientListBySubscriptionOptions contains the optional parameters for the DataCollectionEndpointsClient.NewListBySubscriptionPager +// method. +type DataCollectionEndpointsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionEndpointsClientUpdateOptions contains the optional parameters for the DataCollectionEndpointsClient.Update +// method. +type DataCollectionEndpointsClientUpdateOptions struct { + // The payload + Body *ResourceForUpdate +} + +// DataCollectionRuleAssociationsClientCreateOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Create +// method. +type DataCollectionRuleAssociationsClientCreateOptions struct { + // The payload + Body *DataCollectionRuleAssociationProxyOnlyResource +} + +// DataCollectionRuleAssociationsClientDeleteOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Delete +// method. +type DataCollectionRuleAssociationsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionRuleAssociationsClientGetOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Get +// method. +type DataCollectionRuleAssociationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionRuleAssociationsClientListByDataCollectionEndpointOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByDataCollectionEndpointPager +// method. +type DataCollectionRuleAssociationsClientListByDataCollectionEndpointOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionRuleAssociationsClientListByResourceOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByResourcePager +// method. +type DataCollectionRuleAssociationsClientListByResourceOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionRuleAssociationsClientListByRuleOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByRulePager +// method. +type DataCollectionRuleAssociationsClientListByRuleOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionRulesClientCreateOptions contains the optional parameters for the DataCollectionRulesClient.Create method. +type DataCollectionRulesClientCreateOptions struct { + // The payload + Body *DataCollectionRuleResource +} + +// DataCollectionRulesClientDeleteOptions contains the optional parameters for the DataCollectionRulesClient.Delete method. +type DataCollectionRulesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionRulesClientGetOptions contains the optional parameters for the DataCollectionRulesClient.Get method. +type DataCollectionRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionRulesClientListByResourceGroupOptions contains the optional parameters for the DataCollectionRulesClient.NewListByResourceGroupPager +// method. +type DataCollectionRulesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionRulesClientListBySubscriptionOptions contains the optional parameters for the DataCollectionRulesClient.NewListBySubscriptionPager +// method. +type DataCollectionRulesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// DataCollectionRulesClientUpdateOptions contains the optional parameters for the DataCollectionRulesClient.Update method. +type DataCollectionRulesClientUpdateOptions struct { + // The payload + Body *ResourceForUpdate +} + +// DiagnosticSettingsCategoryClientGetOptions contains the optional parameters for the DiagnosticSettingsCategoryClient.Get +// method. +type DiagnosticSettingsCategoryClientGetOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticSettingsCategoryClientListOptions contains the optional parameters for the DiagnosticSettingsCategoryClient.NewListPager +// method. +type DiagnosticSettingsCategoryClientListOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticSettingsClientCreateOrUpdateOptions contains the optional parameters for the DiagnosticSettingsClient.CreateOrUpdate +// method. +type DiagnosticSettingsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticSettingsClientDeleteOptions contains the optional parameters for the DiagnosticSettingsClient.Delete method. +type DiagnosticSettingsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticSettingsClientGetOptions contains the optional parameters for the DiagnosticSettingsClient.Get method. +type DiagnosticSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticSettingsClientListOptions contains the optional parameters for the DiagnosticSettingsClient.NewListPager method. +type DiagnosticSettingsClientListOptions struct { + // placeholder for future optional parameters +} + +// EventCategoriesClientListOptions contains the optional parameters for the EventCategoriesClient.NewListPager method. +type EventCategoriesClientListOptions struct { + // placeholder for future optional parameters +} + +// LogProfilesClientCreateOrUpdateOptions contains the optional parameters for the LogProfilesClient.CreateOrUpdate method. +type LogProfilesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// LogProfilesClientDeleteOptions contains the optional parameters for the LogProfilesClient.Delete method. +type LogProfilesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// LogProfilesClientGetOptions contains the optional parameters for the LogProfilesClient.Get method. +type LogProfilesClientGetOptions struct { + // placeholder for future optional parameters +} + +// LogProfilesClientListOptions contains the optional parameters for the LogProfilesClient.NewListPager method. +type LogProfilesClientListOptions struct { + // placeholder for future optional parameters +} + +// LogProfilesClientUpdateOptions contains the optional parameters for the LogProfilesClient.Update method. +type LogProfilesClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// MetricAlertsClientCreateOrUpdateOptions contains the optional parameters for the MetricAlertsClient.CreateOrUpdate method. +type MetricAlertsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// MetricAlertsClientDeleteOptions contains the optional parameters for the MetricAlertsClient.Delete method. +type MetricAlertsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// MetricAlertsClientGetOptions contains the optional parameters for the MetricAlertsClient.Get method. +type MetricAlertsClientGetOptions struct { + // placeholder for future optional parameters +} + +// MetricAlertsClientListByResourceGroupOptions contains the optional parameters for the MetricAlertsClient.NewListByResourceGroupPager +// method. +type MetricAlertsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// MetricAlertsClientListBySubscriptionOptions contains the optional parameters for the MetricAlertsClient.NewListBySubscriptionPager +// method. +type MetricAlertsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// MetricAlertsClientUpdateOptions contains the optional parameters for the MetricAlertsClient.Update method. +type MetricAlertsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// MetricAlertsStatusClientListByNameOptions contains the optional parameters for the MetricAlertsStatusClient.ListByName +// method. +type MetricAlertsStatusClientListByNameOptions struct { + // placeholder for future optional parameters +} + +// MetricAlertsStatusClientListOptions contains the optional parameters for the MetricAlertsStatusClient.List method. +type MetricAlertsStatusClientListOptions struct { + // placeholder for future optional parameters +} + +// MetricDefinitionsClientListAtSubscriptionScopeOptions contains the optional parameters for the MetricDefinitionsClient.NewListAtSubscriptionScopePager +// method. +type MetricDefinitionsClientListAtSubscriptionScopeOptions struct { + // Metric namespace where the metrics you want reside. + Metricnamespace *string +} + +// MetricDefinitionsClientListOptions contains the optional parameters for the MetricDefinitionsClient.NewListPager method. +type MetricDefinitionsClientListOptions struct { + // Metric namespace where the metrics you want reside. + Metricnamespace *string +} + +// MetricNamespacesClientListOptions contains the optional parameters for the MetricNamespacesClient.NewListPager method. +type MetricNamespacesClientListOptions struct { + // The ISO 8601 conform Date start time from which to query for metric namespaces. + StartTime *string +} + +// MetricsClientListAtSubscriptionScopeOptions contains the optional parameters for the MetricsClient.ListAtSubscriptionScope +// method. +type MetricsClientListAtSubscriptionScopeOptions struct { + // The list of aggregation types (comma separated) to retrieve. + Aggregation *string + + // When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest + // supported timespan. When set to false, an error is returned for invalid + // timespan parameters. Defaults to false. + AutoAdjustTimegrain *bool + + // The $filter is used to reduce the set of metric data returned. + // Example: + // Metric contains metadata A, B and C. + // - Return all time series of C where A = a1 and B = b1 or b2 + // $filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘’ + // - Invalid variant: + // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘’ or B = ‘b2’ + // This is invalid because the logical or operator cannot separate two different metadata names. + // - Return all time series where A = a1, B = b1 and C = c1: + // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’ + // - Return all time series where A = a1 + // $filter=A eq ‘a1’ and B eq ‘’ and C eq ‘’. + Filter *string + + // The interval (i.e. timegrain) of the query. + Interval *string + + // The names of the metrics (comma separated) to retrieve. + Metricnames *string + + // Metric namespace where the metrics you want reside. + Metricnamespace *string + + // The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum + // asc. + Orderby *string + + // Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. + ResultType *MetricResultType + + // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. + Timespan *string + + // The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. + Top *int32 + + // When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid + // filter parameters. Defaults to true. + ValidateDimensions *bool +} + +// MetricsClientListAtSubscriptionScopePostOptions contains the optional parameters for the MetricsClient.ListAtSubscriptionScopePost +// method. +type MetricsClientListAtSubscriptionScopePostOptions struct { + // The list of aggregation types (comma separated) to retrieve. + Aggregation *string + + // When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest + // supported timespan. When set to false, an error is returned for invalid + // timespan parameters. Defaults to false. + AutoAdjustTimegrain *bool + + // Parameters serialized in the body + Body *SubscriptionScopeMetricsRequestBodyParameters + + // The $filter is used to reduce the set of metric data returned. + // Example: + // Metric contains metadata A, B and C. + // - Return all time series of C where A = a1 and B = b1 or b2 + // $filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘’ + // - Invalid variant: + // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘’ or B = ‘b2’ + // This is invalid because the logical or operator cannot separate two different metadata names. + // - Return all time series where A = a1, B = b1 and C = c1: + // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’ + // - Return all time series where A = a1 + // $filter=A eq ‘a1’ and B eq ‘’ and C eq ‘’. + Filter *string + + // The interval (i.e. timegrain) of the query. + Interval *string + + // The names of the metrics (comma separated) to retrieve. + Metricnames *string + + // Metric namespace where the metrics you want reside. + Metricnamespace *string + + // The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum + // asc. + Orderby *string + + // Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. + ResultType *MetricResultType + + // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. + Timespan *string + + // The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. + Top *int32 + + // When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid + // filter parameters. Defaults to true. + ValidateDimensions *bool +} + +// MetricsClientListOptions contains the optional parameters for the MetricsClient.List method. +type MetricsClientListOptions struct { + // The list of aggregation types (comma separated) to retrieve. + Aggregation *string + + // When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest + // supported timespan. When set to false, an error is returned for invalid + // timespan parameters. Defaults to false. + AutoAdjustTimegrain *bool + + // The $filter is used to reduce the set of metric data returned. + // Example: + // Metric contains metadata A, B and C. + // - Return all time series of C where A = a1 and B = b1 or b2 + // $filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘’ + // - Invalid variant: + // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘’ or B = ‘b2’ + // This is invalid because the logical or operator cannot separate two different metadata names. + // - Return all time series where A = a1, B = b1 and C = c1: + // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’ + // - Return all time series where A = a1 + // $filter=A eq ‘a1’ and B eq ‘’ and C eq ‘’. + Filter *string + + // The interval (i.e. timegrain) of the query. + Interval *string + + // The names of the metrics (comma separated) to retrieve. + Metricnames *string + + // Metric namespace where the metrics you want reside. + Metricnamespace *string + + // The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum + // asc. + Orderby *string + + // Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. + ResultType *ResultType + + // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. + Timespan *string + + // The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. + Top *int32 + + // When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid + // filter parameters. Defaults to true. + ValidateDimensions *bool +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// OperationsForMonitorClientListOptions contains the optional parameters for the OperationsForMonitorClient.NewListPager +// method. +type OperationsForMonitorClientListOptions struct { + // placeholder for future optional parameters +} + +// PredictiveMetricClientGetOptions contains the optional parameters for the PredictiveMetricClient.Get method. +type PredictiveMetricClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. +type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +type PrivateEndpointConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +type PrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByPrivateLinkScope +// method. +type PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method. +type PrivateLinkResourcesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByPrivateLinkScope +// method. +type PrivateLinkResourcesClientListByPrivateLinkScopeOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopeOperationStatusClientGetOptions contains the optional parameters for the PrivateLinkScopeOperationStatusClient.Get +// method. +type PrivateLinkScopeOperationStatusClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopedResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.BeginCreateOrUpdate +// method. +type PrivateLinkScopedResourcesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateLinkScopedResourcesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.BeginDelete +// method. +type PrivateLinkScopedResourcesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateLinkScopedResourcesClientGetOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.Get +// method. +type PrivateLinkScopedResourcesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopedResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.NewListByPrivateLinkScopePager +// method. +type PrivateLinkScopedResourcesClientListByPrivateLinkScopeOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopesClient.BeginDelete +// method. +type PrivateLinkScopesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateLinkScopesClientCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopesClient.CreateOrUpdate +// method. +type PrivateLinkScopesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopesClientGetOptions contains the optional parameters for the PrivateLinkScopesClient.Get method. +type PrivateLinkScopesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopesClientListByResourceGroupOptions contains the optional parameters for the PrivateLinkScopesClient.NewListByResourceGroupPager +// method. +type PrivateLinkScopesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopesClientListOptions contains the optional parameters for the PrivateLinkScopesClient.NewListPager method. +type PrivateLinkScopesClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkScopesClientUpdateTagsOptions contains the optional parameters for the PrivateLinkScopesClient.UpdateTags method. +type PrivateLinkScopesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// ScheduledQueryRulesClientCreateOrUpdateOptions contains the optional parameters for the ScheduledQueryRulesClient.CreateOrUpdate +// method. +type ScheduledQueryRulesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ScheduledQueryRulesClientDeleteOptions contains the optional parameters for the ScheduledQueryRulesClient.Delete method. +type ScheduledQueryRulesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ScheduledQueryRulesClientGetOptions contains the optional parameters for the ScheduledQueryRulesClient.Get method. +type ScheduledQueryRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ScheduledQueryRulesClientListByResourceGroupOptions contains the optional parameters for the ScheduledQueryRulesClient.NewListByResourceGroupPager +// method. +type ScheduledQueryRulesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ScheduledQueryRulesClientListBySubscriptionOptions contains the optional parameters for the ScheduledQueryRulesClient.NewListBySubscriptionPager +// method. +type ScheduledQueryRulesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// ScheduledQueryRulesClientUpdateOptions contains the optional parameters for the ScheduledQueryRulesClient.Update method. +type ScheduledQueryRulesClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// TenantActionGroupsClientCreateOrUpdateOptions contains the optional parameters for the TenantActionGroupsClient.CreateOrUpdate +// method. +type TenantActionGroupsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// TenantActionGroupsClientDeleteOptions contains the optional parameters for the TenantActionGroupsClient.Delete method. +type TenantActionGroupsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// TenantActionGroupsClientGetOptions contains the optional parameters for the TenantActionGroupsClient.Get method. +type TenantActionGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// TenantActionGroupsClientListByManagementGroupIDOptions contains the optional parameters for the TenantActionGroupsClient.NewListByManagementGroupIDPager +// method. +type TenantActionGroupsClientListByManagementGroupIDOptions struct { + // placeholder for future optional parameters +} + +// TenantActionGroupsClientUpdateOptions contains the optional parameters for the TenantActionGroupsClient.Update method. +type TenantActionGroupsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// TenantActivityLogsClientListOptions contains the optional parameters for the TenantActivityLogsClient.NewListPager method. +type TenantActivityLogsClientListOptions struct { + // Reduces the set of data collected. + // The $filter is very restricted and allows only the following patterns. + // - List events for a resource group: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, + // Operation' and resourceGroupName eq ''. + // - List events for resource: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' + // and resourceUri eq ''. + // - List events for a subscription: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation'. + // - List events for a resource provider: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, + // Operation' and resourceProvider eq ''. + // - List events for a correlation Id: api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and + // eventTimestamp le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, + // Operation' and correlationId eq ''. + // NOTE: No other syntax is allowed. + Filter *string + + // Used to fetch events with only the given properties. + // The $select argument is a comma separated list of property names to be returned. Possible values are: authorization, claims, + // correlationId, description, eventDataId, eventName, eventTimestamp, + // httpRequest, level, operationId, operationName, properties, resourceGroupName, resourceProviderName, resourceId, status, + // submissionTimestamp, subStatus, subscriptionId + Select *string +} + +// VMInsightsClientGetOnboardingStatusOptions contains the optional parameters for the VMInsightsClient.GetOnboardingStatus +// method. +type VMInsightsClientGetOnboardingStatusOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/monitor/armmonitor/response_types.go b/sdk/resourcemanager/monitor/armmonitor/response_types.go index 98c4f4b6c1d4..812a8e44cf92 100644 --- a/sdk/resourcemanager/monitor/armmonitor/response_types.go +++ b/sdk/resourcemanager/monitor/armmonitor/response_types.go @@ -10,11 +10,13 @@ package armmonitor // ActionGroupsClientCreateNotificationsAtActionGroupResourceLevelResponse contains the response from method ActionGroupsClient.BeginCreateNotificationsAtActionGroupResourceLevel. type ActionGroupsClientCreateNotificationsAtActionGroupResourceLevelResponse struct { + // The details of the test notification results. TestNotificationDetailsResponse } // ActionGroupsClientCreateOrUpdateResponse contains the response from method ActionGroupsClient.CreateOrUpdate. type ActionGroupsClientCreateOrUpdateResponse struct { + // An action group resource. ActionGroupResource } @@ -30,31 +32,37 @@ type ActionGroupsClientEnableReceiverResponse struct { // ActionGroupsClientGetResponse contains the response from method ActionGroupsClient.Get. type ActionGroupsClientGetResponse struct { + // An action group resource. ActionGroupResource } // ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelResponse contains the response from method ActionGroupsClient.GetTestNotificationsAtActionGroupResourceLevel. type ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelResponse struct { + // The details of the test notification results. TestNotificationDetailsResponse } // ActionGroupsClientListByResourceGroupResponse contains the response from method ActionGroupsClient.NewListByResourceGroupPager. type ActionGroupsClientListByResourceGroupResponse struct { + // A list of action groups. ActionGroupList } // ActionGroupsClientListBySubscriptionIDResponse contains the response from method ActionGroupsClient.NewListBySubscriptionIDPager. type ActionGroupsClientListBySubscriptionIDResponse struct { + // A list of action groups. ActionGroupList } // ActionGroupsClientUpdateResponse contains the response from method ActionGroupsClient.Update. type ActionGroupsClientUpdateResponse struct { + // An action group resource. ActionGroupResource } // ActivityLogAlertsClientCreateOrUpdateResponse contains the response from method ActivityLogAlertsClient.CreateOrUpdate. type ActivityLogAlertsClientCreateOrUpdateResponse struct { + // An Activity Log Alert rule resource. ActivityLogAlertResource } @@ -65,41 +73,49 @@ type ActivityLogAlertsClientDeleteResponse struct { // ActivityLogAlertsClientGetResponse contains the response from method ActivityLogAlertsClient.Get. type ActivityLogAlertsClientGetResponse struct { + // An Activity Log Alert rule resource. ActivityLogAlertResource } // ActivityLogAlertsClientListByResourceGroupResponse contains the response from method ActivityLogAlertsClient.NewListByResourceGroupPager. type ActivityLogAlertsClientListByResourceGroupResponse struct { + // A list of Activity Log Alert rules. AlertRuleList } // ActivityLogAlertsClientListBySubscriptionIDResponse contains the response from method ActivityLogAlertsClient.NewListBySubscriptionIDPager. type ActivityLogAlertsClientListBySubscriptionIDResponse struct { + // A list of Activity Log Alert rules. AlertRuleList } // ActivityLogAlertsClientUpdateResponse contains the response from method ActivityLogAlertsClient.Update. type ActivityLogAlertsClientUpdateResponse struct { + // An Activity Log Alert rule resource. ActivityLogAlertResource } // ActivityLogsClientListResponse contains the response from method ActivityLogsClient.NewListPager. type ActivityLogsClientListResponse struct { + // Represents collection of events. EventDataCollection } // AlertRuleIncidentsClientGetResponse contains the response from method AlertRuleIncidentsClient.Get. type AlertRuleIncidentsClientGetResponse struct { + // An alert incident indicates the activation status of an alert rule. Incident } // AlertRuleIncidentsClientListByAlertRuleResponse contains the response from method AlertRuleIncidentsClient.NewListByAlertRulePager. type AlertRuleIncidentsClientListByAlertRuleResponse struct { + // The List incidents operation response. IncidentListResult } // AlertRulesClientCreateOrUpdateResponse contains the response from method AlertRulesClient.CreateOrUpdate. type AlertRulesClientCreateOrUpdateResponse struct { + // The alert rule resource. AlertRuleResource } @@ -110,26 +126,31 @@ type AlertRulesClientDeleteResponse struct { // AlertRulesClientGetResponse contains the response from method AlertRulesClient.Get. type AlertRulesClientGetResponse struct { + // The alert rule resource. AlertRuleResource } // AlertRulesClientListByResourceGroupResponse contains the response from method AlertRulesClient.NewListByResourceGroupPager. type AlertRulesClientListByResourceGroupResponse struct { + // Represents a collection of alert rule resources. AlertRuleResourceCollection } // AlertRulesClientListBySubscriptionResponse contains the response from method AlertRulesClient.NewListBySubscriptionPager. type AlertRulesClientListBySubscriptionResponse struct { + // Represents a collection of alert rule resources. AlertRuleResourceCollection } // AlertRulesClientUpdateResponse contains the response from method AlertRulesClient.Update. type AlertRulesClientUpdateResponse struct { + // The alert rule resource. AlertRuleResource } // AutoscaleSettingsClientCreateOrUpdateResponse contains the response from method AutoscaleSettingsClient.CreateOrUpdate. type AutoscaleSettingsClientCreateOrUpdateResponse struct { + // The autoscale setting resource. AutoscaleSettingResource } @@ -140,26 +161,31 @@ type AutoscaleSettingsClientDeleteResponse struct { // AutoscaleSettingsClientGetResponse contains the response from method AutoscaleSettingsClient.Get. type AutoscaleSettingsClientGetResponse struct { + // The autoscale setting resource. AutoscaleSettingResource } // AutoscaleSettingsClientListByResourceGroupResponse contains the response from method AutoscaleSettingsClient.NewListByResourceGroupPager. type AutoscaleSettingsClientListByResourceGroupResponse struct { + // Represents a collection of autoscale setting resources. AutoscaleSettingResourceCollection } // AutoscaleSettingsClientListBySubscriptionResponse contains the response from method AutoscaleSettingsClient.NewListBySubscriptionPager. type AutoscaleSettingsClientListBySubscriptionResponse struct { + // Represents a collection of autoscale setting resources. AutoscaleSettingResourceCollection } // AutoscaleSettingsClientUpdateResponse contains the response from method AutoscaleSettingsClient.Update. type AutoscaleSettingsClientUpdateResponse struct { + // The autoscale setting resource. AutoscaleSettingResource } // AzureMonitorWorkspacesClientCreateResponse contains the response from method AzureMonitorWorkspacesClient.Create. type AzureMonitorWorkspacesClientCreateResponse struct { + // An Azure Monitor Workspace definition AzureMonitorWorkspaceResource } @@ -170,31 +196,37 @@ type AzureMonitorWorkspacesClientDeleteResponse struct { // AzureMonitorWorkspacesClientGetResponse contains the response from method AzureMonitorWorkspacesClient.Get. type AzureMonitorWorkspacesClientGetResponse struct { + // An Azure Monitor Workspace definition AzureMonitorWorkspaceResource } // AzureMonitorWorkspacesClientListByResourceGroupResponse contains the response from method AzureMonitorWorkspacesClient.NewListByResourceGroupPager. type AzureMonitorWorkspacesClientListByResourceGroupResponse struct { + // A pageable list of resources AzureMonitorWorkspaceResourceListResult } // AzureMonitorWorkspacesClientListBySubscriptionResponse contains the response from method AzureMonitorWorkspacesClient.NewListBySubscriptionPager. type AzureMonitorWorkspacesClientListBySubscriptionResponse struct { + // A pageable list of resources AzureMonitorWorkspaceResourceListResult } // AzureMonitorWorkspacesClientUpdateResponse contains the response from method AzureMonitorWorkspacesClient.Update. type AzureMonitorWorkspacesClientUpdateResponse struct { + // An Azure Monitor Workspace definition AzureMonitorWorkspaceResource } // BaselinesClientListResponse contains the response from method BaselinesClient.NewListPager. type BaselinesClientListResponse struct { + // A list of metric baselines. MetricBaselinesResponse } // DataCollectionEndpointsClientCreateResponse contains the response from method DataCollectionEndpointsClient.Create. type DataCollectionEndpointsClientCreateResponse struct { + // Definition of ARM tracked top level resource. DataCollectionEndpointResource } @@ -205,26 +237,31 @@ type DataCollectionEndpointsClientDeleteResponse struct { // DataCollectionEndpointsClientGetResponse contains the response from method DataCollectionEndpointsClient.Get. type DataCollectionEndpointsClientGetResponse struct { + // Definition of ARM tracked top level resource. DataCollectionEndpointResource } // DataCollectionEndpointsClientListByResourceGroupResponse contains the response from method DataCollectionEndpointsClient.NewListByResourceGroupPager. type DataCollectionEndpointsClientListByResourceGroupResponse struct { + // A pageable list of resources. DataCollectionEndpointResourceListResult } // DataCollectionEndpointsClientListBySubscriptionResponse contains the response from method DataCollectionEndpointsClient.NewListBySubscriptionPager. type DataCollectionEndpointsClientListBySubscriptionResponse struct { + // A pageable list of resources. DataCollectionEndpointResourceListResult } // DataCollectionEndpointsClientUpdateResponse contains the response from method DataCollectionEndpointsClient.Update. type DataCollectionEndpointsClientUpdateResponse struct { + // Definition of ARM tracked top level resource. DataCollectionEndpointResource } // DataCollectionRuleAssociationsClientCreateResponse contains the response from method DataCollectionRuleAssociationsClient.Create. type DataCollectionRuleAssociationsClientCreateResponse struct { + // Definition of generic ARM proxy resource. DataCollectionRuleAssociationProxyOnlyResource } @@ -235,26 +272,31 @@ type DataCollectionRuleAssociationsClientDeleteResponse struct { // DataCollectionRuleAssociationsClientGetResponse contains the response from method DataCollectionRuleAssociationsClient.Get. type DataCollectionRuleAssociationsClientGetResponse struct { + // Definition of generic ARM proxy resource. DataCollectionRuleAssociationProxyOnlyResource } // DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse contains the response from method DataCollectionRuleAssociationsClient.NewListByDataCollectionEndpointPager. type DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse struct { + // A pageable list of resources. DataCollectionRuleAssociationProxyOnlyResourceListResult } // DataCollectionRuleAssociationsClientListByResourceResponse contains the response from method DataCollectionRuleAssociationsClient.NewListByResourcePager. type DataCollectionRuleAssociationsClientListByResourceResponse struct { + // A pageable list of resources. DataCollectionRuleAssociationProxyOnlyResourceListResult } // DataCollectionRuleAssociationsClientListByRuleResponse contains the response from method DataCollectionRuleAssociationsClient.NewListByRulePager. type DataCollectionRuleAssociationsClientListByRuleResponse struct { + // A pageable list of resources. DataCollectionRuleAssociationProxyOnlyResourceListResult } // DataCollectionRulesClientCreateResponse contains the response from method DataCollectionRulesClient.Create. type DataCollectionRulesClientCreateResponse struct { + // Definition of ARM tracked top level resource. DataCollectionRuleResource } @@ -265,36 +307,43 @@ type DataCollectionRulesClientDeleteResponse struct { // DataCollectionRulesClientGetResponse contains the response from method DataCollectionRulesClient.Get. type DataCollectionRulesClientGetResponse struct { + // Definition of ARM tracked top level resource. DataCollectionRuleResource } // DataCollectionRulesClientListByResourceGroupResponse contains the response from method DataCollectionRulesClient.NewListByResourceGroupPager. type DataCollectionRulesClientListByResourceGroupResponse struct { + // A pageable list of resources. DataCollectionRuleResourceListResult } // DataCollectionRulesClientListBySubscriptionResponse contains the response from method DataCollectionRulesClient.NewListBySubscriptionPager. type DataCollectionRulesClientListBySubscriptionResponse struct { + // A pageable list of resources. DataCollectionRuleResourceListResult } // DataCollectionRulesClientUpdateResponse contains the response from method DataCollectionRulesClient.Update. type DataCollectionRulesClientUpdateResponse struct { + // Definition of ARM tracked top level resource. DataCollectionRuleResource } // DiagnosticSettingsCategoryClientGetResponse contains the response from method DiagnosticSettingsCategoryClient.Get. type DiagnosticSettingsCategoryClientGetResponse struct { + // The diagnostic settings category resource. DiagnosticSettingsCategoryResource } // DiagnosticSettingsCategoryClientListResponse contains the response from method DiagnosticSettingsCategoryClient.NewListPager. type DiagnosticSettingsCategoryClientListResponse struct { + // Represents a collection of diagnostic setting category resources. DiagnosticSettingsCategoryResourceCollection } // DiagnosticSettingsClientCreateOrUpdateResponse contains the response from method DiagnosticSettingsClient.CreateOrUpdate. type DiagnosticSettingsClientCreateOrUpdateResponse struct { + // The diagnostic setting resource. DiagnosticSettingsResource } @@ -305,21 +354,26 @@ type DiagnosticSettingsClientDeleteResponse struct { // DiagnosticSettingsClientGetResponse contains the response from method DiagnosticSettingsClient.Get. type DiagnosticSettingsClientGetResponse struct { + // The diagnostic setting resource. DiagnosticSettingsResource } // DiagnosticSettingsClientListResponse contains the response from method DiagnosticSettingsClient.NewListPager. type DiagnosticSettingsClientListResponse struct { + // Represents a collection of alert rule resources. DiagnosticSettingsResourceCollection } // EventCategoriesClientListResponse contains the response from method EventCategoriesClient.NewListPager. type EventCategoriesClientListResponse struct { + // A collection of event categories. Currently possible values are: Administrative, Security, ServiceHealth, Alert, Recommendation, + // Policy. EventCategoryCollection } // LogProfilesClientCreateOrUpdateResponse contains the response from method LogProfilesClient.CreateOrUpdate. type LogProfilesClientCreateOrUpdateResponse struct { + // The log profile resource. LogProfileResource } @@ -330,21 +384,25 @@ type LogProfilesClientDeleteResponse struct { // LogProfilesClientGetResponse contains the response from method LogProfilesClient.Get. type LogProfilesClientGetResponse struct { + // The log profile resource. LogProfileResource } // LogProfilesClientListResponse contains the response from method LogProfilesClient.NewListPager. type LogProfilesClientListResponse struct { + // Represents a collection of log profiles. LogProfileCollection } // LogProfilesClientUpdateResponse contains the response from method LogProfilesClient.Update. type LogProfilesClientUpdateResponse struct { + // The log profile resource. LogProfileResource } // MetricAlertsClientCreateOrUpdateResponse contains the response from method MetricAlertsClient.CreateOrUpdate. type MetricAlertsClientCreateOrUpdateResponse struct { + // The metric alert resource. MetricAlertResource } @@ -355,81 +413,98 @@ type MetricAlertsClientDeleteResponse struct { // MetricAlertsClientGetResponse contains the response from method MetricAlertsClient.Get. type MetricAlertsClientGetResponse struct { + // The metric alert resource. MetricAlertResource } // MetricAlertsClientListByResourceGroupResponse contains the response from method MetricAlertsClient.NewListByResourceGroupPager. type MetricAlertsClientListByResourceGroupResponse struct { + // Represents a collection of alert rule resources. MetricAlertResourceCollection } // MetricAlertsClientListBySubscriptionResponse contains the response from method MetricAlertsClient.NewListBySubscriptionPager. type MetricAlertsClientListBySubscriptionResponse struct { + // Represents a collection of alert rule resources. MetricAlertResourceCollection } // MetricAlertsClientUpdateResponse contains the response from method MetricAlertsClient.Update. type MetricAlertsClientUpdateResponse struct { + // The metric alert resource. MetricAlertResource } // MetricAlertsStatusClientListByNameResponse contains the response from method MetricAlertsStatusClient.ListByName. type MetricAlertsStatusClientListByNameResponse struct { + // Represents a collection of alert rule resources. MetricAlertStatusCollection } // MetricAlertsStatusClientListResponse contains the response from method MetricAlertsStatusClient.List. type MetricAlertsStatusClientListResponse struct { + // Represents a collection of alert rule resources. MetricAlertStatusCollection } // MetricDefinitionsClientListAtSubscriptionScopeResponse contains the response from method MetricDefinitionsClient.NewListAtSubscriptionScopePager. type MetricDefinitionsClientListAtSubscriptionScopeResponse struct { + // Represents collection of metric definitions. SubscriptionScopeMetricDefinitionCollection } // MetricDefinitionsClientListResponse contains the response from method MetricDefinitionsClient.NewListPager. type MetricDefinitionsClientListResponse struct { + // Represents collection of metric definitions. MetricDefinitionCollection } // MetricNamespacesClientListResponse contains the response from method MetricNamespacesClient.NewListPager. type MetricNamespacesClientListResponse struct { + // Represents collection of metric namespaces. MetricNamespaceCollection } // MetricsClientListAtSubscriptionScopePostResponse contains the response from method MetricsClient.ListAtSubscriptionScopePost. type MetricsClientListAtSubscriptionScopePostResponse struct { + // The response to a subscription scope metrics query. SubscriptionScopeMetricResponse } // MetricsClientListAtSubscriptionScopeResponse contains the response from method MetricsClient.ListAtSubscriptionScope. type MetricsClientListAtSubscriptionScopeResponse struct { + // The response to a subscription scope metrics query. SubscriptionScopeMetricResponse } // MetricsClientListResponse contains the response from method MetricsClient.List. type MetricsClientListResponse struct { + // The response to a metrics query. Response } // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { + // Result of the request to list Microsoft.Insights operations. It contains a list of operations and a URL link to get the + // next set of results. OperationListResult } // OperationsForMonitorClientListResponse contains the response from method OperationsForMonitorClient.NewListPager. type OperationsForMonitorClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResultAutoGenerated } // PredictiveMetricClientGetResponse contains the response from method PredictiveMetricClient.Get. type PredictiveMetricClientGetResponse struct { + // The response to a metrics query. PredictiveResponse } // PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate. type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnection } @@ -440,31 +515,37 @@ type PrivateEndpointConnectionsClientDeleteResponse struct { // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnection } // PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse contains the response from method PrivateEndpointConnectionsClient.ListByPrivateLinkScope. type PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse struct { + // List of private endpoint connection associated with the specified storage account PrivateEndpointConnectionListResult } // PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get. type PrivateLinkResourcesClientGetResponse struct { + // A private link resource PrivateLinkResource } // PrivateLinkResourcesClientListByPrivateLinkScopeResponse contains the response from method PrivateLinkResourcesClient.ListByPrivateLinkScope. type PrivateLinkResourcesClientListByPrivateLinkScopeResponse struct { + // A list of private link resources PrivateLinkResourceListResult } // PrivateLinkScopeOperationStatusClientGetResponse contains the response from method PrivateLinkScopeOperationStatusClient.Get. type PrivateLinkScopeOperationStatusClientGetResponse struct { + // The status of operation. OperationStatus } // PrivateLinkScopedResourcesClientCreateOrUpdateResponse contains the response from method PrivateLinkScopedResourcesClient.BeginCreateOrUpdate. type PrivateLinkScopedResourcesClientCreateOrUpdateResponse struct { + // A private link scoped resource ScopedResource } @@ -475,16 +556,19 @@ type PrivateLinkScopedResourcesClientDeleteResponse struct { // PrivateLinkScopedResourcesClientGetResponse contains the response from method PrivateLinkScopedResourcesClient.Get. type PrivateLinkScopedResourcesClientGetResponse struct { + // A private link scoped resource ScopedResource } // PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse contains the response from method PrivateLinkScopedResourcesClient.NewListByPrivateLinkScopePager. type PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse struct { + // A list of scoped resources in a private link scope. ScopedResourceListResult } // PrivateLinkScopesClientCreateOrUpdateResponse contains the response from method PrivateLinkScopesClient.CreateOrUpdate. type PrivateLinkScopesClientCreateOrUpdateResponse struct { + // An Azure Monitor PrivateLinkScope definition. AzureMonitorPrivateLinkScope } @@ -495,26 +579,31 @@ type PrivateLinkScopesClientDeleteResponse struct { // PrivateLinkScopesClientGetResponse contains the response from method PrivateLinkScopesClient.Get. type PrivateLinkScopesClientGetResponse struct { + // An Azure Monitor PrivateLinkScope definition. AzureMonitorPrivateLinkScope } // PrivateLinkScopesClientListByResourceGroupResponse contains the response from method PrivateLinkScopesClient.NewListByResourceGroupPager. type PrivateLinkScopesClientListByResourceGroupResponse struct { + // Describes the list of Azure Monitor PrivateLinkScope resources. AzureMonitorPrivateLinkScopeListResult } // PrivateLinkScopesClientListResponse contains the response from method PrivateLinkScopesClient.NewListPager. type PrivateLinkScopesClientListResponse struct { + // Describes the list of Azure Monitor PrivateLinkScope resources. AzureMonitorPrivateLinkScopeListResult } // PrivateLinkScopesClientUpdateTagsResponse contains the response from method PrivateLinkScopesClient.UpdateTags. type PrivateLinkScopesClientUpdateTagsResponse struct { + // An Azure Monitor PrivateLinkScope definition. AzureMonitorPrivateLinkScope } // ScheduledQueryRulesClientCreateOrUpdateResponse contains the response from method ScheduledQueryRulesClient.CreateOrUpdate. type ScheduledQueryRulesClientCreateOrUpdateResponse struct { + // The scheduled query rule resource. ScheduledQueryRuleResource } @@ -525,26 +614,31 @@ type ScheduledQueryRulesClientDeleteResponse struct { // ScheduledQueryRulesClientGetResponse contains the response from method ScheduledQueryRulesClient.Get. type ScheduledQueryRulesClientGetResponse struct { + // The scheduled query rule resource. ScheduledQueryRuleResource } // ScheduledQueryRulesClientListByResourceGroupResponse contains the response from method ScheduledQueryRulesClient.NewListByResourceGroupPager. type ScheduledQueryRulesClientListByResourceGroupResponse struct { + // Represents a collection of scheduled query rule resources. ScheduledQueryRuleResourceCollection } // ScheduledQueryRulesClientListBySubscriptionResponse contains the response from method ScheduledQueryRulesClient.NewListBySubscriptionPager. type ScheduledQueryRulesClientListBySubscriptionResponse struct { + // Represents a collection of scheduled query rule resources. ScheduledQueryRuleResourceCollection } // ScheduledQueryRulesClientUpdateResponse contains the response from method ScheduledQueryRulesClient.Update. type ScheduledQueryRulesClientUpdateResponse struct { + // The scheduled query rule resource. ScheduledQueryRuleResource } // TenantActionGroupsClientCreateOrUpdateResponse contains the response from method TenantActionGroupsClient.CreateOrUpdate. type TenantActionGroupsClientCreateOrUpdateResponse struct { + // A tenant action group resource. TenantActionGroupResource } @@ -555,25 +649,30 @@ type TenantActionGroupsClientDeleteResponse struct { // TenantActionGroupsClientGetResponse contains the response from method TenantActionGroupsClient.Get. type TenantActionGroupsClientGetResponse struct { + // A tenant action group resource. TenantActionGroupResource } // TenantActionGroupsClientListByManagementGroupIDResponse contains the response from method TenantActionGroupsClient.NewListByManagementGroupIDPager. type TenantActionGroupsClientListByManagementGroupIDResponse struct { + // A list of tenant action groups. TenantActionGroupList } // TenantActionGroupsClientUpdateResponse contains the response from method TenantActionGroupsClient.Update. type TenantActionGroupsClientUpdateResponse struct { + // A tenant action group resource. TenantActionGroupResource } // TenantActivityLogsClientListResponse contains the response from method TenantActivityLogsClient.NewListPager. type TenantActivityLogsClientListResponse struct { + // Represents collection of events. EventDataCollection } // VMInsightsClientGetOnboardingStatusResponse contains the response from method VMInsightsClient.GetOnboardingStatus. type VMInsightsClientGetOnboardingStatusResponse struct { + // VM Insights onboarding status for a resource. VMInsightsOnboardingStatus }