diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/CHANGELOG.md b/sdk/resourcemanager/databoxedge/armdataboxedge/CHANGELOG.md index ef11b143791e..330f16fcc433 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/CHANGELOG.md +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/CHANGELOG.md @@ -1,5 +1,812 @@ # Release History +## 0.3.0 (2022-04-11) +### Breaking Changes + +- Function `*AlertsClient.ListByDataBoxEdgeDevice` return value(s) have been changed from `(*AlertsClientListByDataBoxEdgeDevicePager)` to `(*runtime.Pager[AlertsClientListByDataBoxEdgeDeviceResponse])` +- Function `*ContainersClient.BeginCreateOrUpdate` return value(s) have been changed from `(ContainersClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[ContainersClientCreateOrUpdateResponse], error)` +- Function `NewMonitoringConfigClient` return value(s) have been changed from `(*MonitoringConfigClient)` to `(*MonitoringConfigClient, error)` +- Function `*NodesClient.ListByDataBoxEdgeDevice` return value(s) have been changed from `(*NodesClientListByDataBoxEdgeDevicePager)` to `(*runtime.Pager[NodesClientListByDataBoxEdgeDeviceResponse])` +- Function `*TriggersClient.ListByDataBoxEdgeDevice` return value(s) have been changed from `(*TriggersClientListByDataBoxEdgeDevicePager)` to `(*runtime.Pager[TriggersClientListByDataBoxEdgeDeviceResponse])` +- Function `*MonitoringConfigClient.BeginDelete` return value(s) have been changed from `(MonitoringConfigClientDeletePollerResponse, error)` to `(*armruntime.Poller[MonitoringConfigClientDeleteResponse], error)` +- Function `*AvailableSKUsClient.List` return value(s) have been changed from `(*AvailableSKUsClientListPager)` to `(*runtime.Pager[AvailableSKUsClientListResponse])` +- Function `*ContainersClient.BeginDelete` return value(s) have been changed from `(ContainersClientDeletePollerResponse, error)` to `(*armruntime.Poller[ContainersClientDeleteResponse], error)` +- Function `NewDevicesClient` return value(s) have been changed from `(*DevicesClient)` to `(*DevicesClient, error)` +- Function `*TriggersClient.BeginCreateOrUpdate` return value(s) have been changed from `(TriggersClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[TriggersClientCreateOrUpdateResponse], error)` +- Function `*RolesClient.BeginDelete` return value(s) have been changed from `(RolesClientDeletePollerResponse, error)` to `(*armruntime.Poller[RolesClientDeleteResponse], error)` +- Function `*BandwidthSchedulesClient.BeginDelete` return value(s) have been changed from `(BandwidthSchedulesClientDeletePollerResponse, error)` to `(*armruntime.Poller[BandwidthSchedulesClientDeleteResponse], error)` +- Function `NewNodesClient` return value(s) have been changed from `(*NodesClient)` to `(*NodesClient, error)` +- Function `*RolesClient.ListByDataBoxEdgeDevice` return value(s) have been changed from `(*RolesClientListByDataBoxEdgeDevicePager)` to `(*runtime.Pager[RolesClientListByDataBoxEdgeDeviceResponse])` +- Function `*StorageAccountCredentialsClient.BeginCreateOrUpdate` return value(s) have been changed from `(StorageAccountCredentialsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[StorageAccountCredentialsClientCreateOrUpdateResponse], error)` +- Function `*DevicesClient.ListByResourceGroup` return value(s) have been changed from `(*DevicesClientListByResourceGroupPager)` to `(*runtime.Pager[DevicesClientListByResourceGroupResponse])` +- Function `*MonitoringConfigClient.List` return value(s) have been changed from `(*MonitoringConfigClientListPager)` to `(*runtime.Pager[MonitoringConfigClientListResponse])` +- Function `*DevicesClient.BeginDelete` return value(s) have been changed from `(DevicesClientDeletePollerResponse, error)` to `(*armruntime.Poller[DevicesClientDeleteResponse], error)` +- Function `NewOperationsStatusClient` return value(s) have been changed from `(*OperationsStatusClient)` to `(*OperationsStatusClient, error)` +- Function `*AddonsClient.ListByRole` return value(s) have been changed from `(*AddonsClientListByRolePager)` to `(*runtime.Pager[AddonsClientListByRoleResponse])` +- Function `NewAddonsClient` return value(s) have been changed from `(*AddonsClient)` to `(*AddonsClient, error)` +- Function `*BandwidthSchedulesClient.ListByDataBoxEdgeDevice` return value(s) have been changed from `(*BandwidthSchedulesClientListByDataBoxEdgeDevicePager)` to `(*runtime.Pager[BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse])` +- Function `NewJobsClient` return value(s) have been changed from `(*JobsClient)` to `(*JobsClient, error)` +- Function `*DevicesClient.BeginCreateOrUpdateSecuritySettings` return value(s) have been changed from `(DevicesClientCreateOrUpdateSecuritySettingsPollerResponse, error)` to `(*armruntime.Poller[DevicesClientCreateOrUpdateSecuritySettingsResponse], error)` +- Function `*DevicesClient.BeginInstallUpdates` return value(s) have been changed from `(DevicesClientInstallUpdatesPollerResponse, error)` to `(*armruntime.Poller[DevicesClientInstallUpdatesResponse], error)` +- Function `*OperationsClient.List` return value(s) have been changed from `(*OperationsClientListPager)` to `(*runtime.Pager[OperationsClientListResponse])` +- Function `*DevicesClient.BeginScanForUpdates` return value(s) have been changed from `(DevicesClientScanForUpdatesPollerResponse, error)` to `(*armruntime.Poller[DevicesClientScanForUpdatesResponse], error)` +- Function `*DevicesClient.ListBySubscription` return value(s) have been changed from `(*DevicesClientListBySubscriptionPager)` to `(*runtime.Pager[DevicesClientListBySubscriptionResponse])` +- Function `*RolesClient.BeginCreateOrUpdate` return value(s) have been changed from `(RolesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[RolesClientCreateOrUpdateResponse], error)` +- Function `NewSupportPackagesClient` return value(s) have been changed from `(*SupportPackagesClient)` to `(*SupportPackagesClient, error)` +- Function `*UsersClient.ListByDataBoxEdgeDevice` return value(s) have been changed from `(*UsersClientListByDataBoxEdgeDevicePager)` to `(*runtime.Pager[UsersClientListByDataBoxEdgeDeviceResponse])` +- Function `NewAvailableSKUsClient` return value(s) have been changed from `(*AvailableSKUsClient)` to `(*AvailableSKUsClient, error)` +- Function `*SharesClient.BeginCreateOrUpdate` return value(s) have been changed from `(SharesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[SharesClientCreateOrUpdateResponse], error)` +- Function `NewOrdersClient` return value(s) have been changed from `(*OrdersClient)` to `(*OrdersClient, error)` +- Function `*UsersClient.BeginDelete` return value(s) have been changed from `(UsersClientDeletePollerResponse, error)` to `(*armruntime.Poller[UsersClientDeleteResponse], error)` +- Function `NewSharesClient` return value(s) have been changed from `(*SharesClient)` to `(*SharesClient, error)` +- Function `*ContainersClient.ListByStorageAccount` return value(s) have been changed from `(*ContainersClientListByStorageAccountPager)` to `(*runtime.Pager[ContainersClientListByStorageAccountResponse])` +- Function `*ContainersClient.BeginRefresh` return value(s) have been changed from `(ContainersClientRefreshPollerResponse, error)` to `(*armruntime.Poller[ContainersClientRefreshResponse], error)` +- Function `*MonitoringConfigClient.BeginCreateOrUpdate` return value(s) have been changed from `(MonitoringConfigClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[MonitoringConfigClientCreateOrUpdateResponse], error)` +- Function `*OrdersClient.BeginDelete` return value(s) have been changed from `(OrdersClientDeletePollerResponse, error)` to `(*armruntime.Poller[OrdersClientDeleteResponse], error)` +- Function `NewDiagnosticSettingsClient` return value(s) have been changed from `(*DiagnosticSettingsClient)` to `(*DiagnosticSettingsClient, error)` +- Function `*OrdersClient.BeginCreateOrUpdate` return value(s) have been changed from `(OrdersClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[OrdersClientCreateOrUpdateResponse], error)` +- Function `*StorageAccountCredentialsClient.BeginDelete` return value(s) have been changed from `(StorageAccountCredentialsClientDeletePollerResponse, error)` to `(*armruntime.Poller[StorageAccountCredentialsClientDeleteResponse], error)` +- Function `*BandwidthSchedulesClient.BeginCreateOrUpdate` return value(s) have been changed from `(BandwidthSchedulesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[BandwidthSchedulesClientCreateOrUpdateResponse], error)` +- Function `*DevicesClient.BeginDownloadUpdates` return value(s) have been changed from `(DevicesClientDownloadUpdatesPollerResponse, error)` to `(*armruntime.Poller[DevicesClientDownloadUpdatesResponse], error)` +- Function `*SharesClient.ListByDataBoxEdgeDevice` return value(s) have been changed from `(*SharesClientListByDataBoxEdgeDevicePager)` to `(*runtime.Pager[SharesClientListByDataBoxEdgeDeviceResponse])` +- Function `*StorageAccountsClient.BeginCreateOrUpdate` return value(s) have been changed from `(StorageAccountsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[StorageAccountsClientCreateOrUpdateResponse], error)` +- Function `NewStorageAccountsClient` return value(s) have been changed from `(*StorageAccountsClient)` to `(*StorageAccountsClient, error)` +- Function `*AddonsClient.BeginCreateOrUpdate` return value(s) have been changed from `(AddonsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[AddonsClientCreateOrUpdateResponse], error)` +- Function `*StorageAccountsClient.BeginDelete` return value(s) have been changed from `(StorageAccountsClientDeletePollerResponse, error)` to `(*armruntime.Poller[StorageAccountsClientDeleteResponse], error)` +- Function `NewRolesClient` return value(s) have been changed from `(*RolesClient)` to `(*RolesClient, error)` +- Function `*AddonsClient.BeginDelete` return value(s) have been changed from `(AddonsClientDeletePollerResponse, error)` to `(*armruntime.Poller[AddonsClientDeleteResponse], error)` +- Function `*TriggersClient.BeginDelete` return value(s) have been changed from `(TriggersClientDeletePollerResponse, error)` to `(*armruntime.Poller[TriggersClientDeleteResponse], error)` +- Function `NewUsersClient` return value(s) have been changed from `(*UsersClient)` to `(*UsersClient, error)` +- Function `*OrdersClient.ListByDataBoxEdgeDevice` return value(s) have been changed from `(*OrdersClientListByDataBoxEdgeDevicePager)` to `(*runtime.Pager[OrdersClientListByDataBoxEdgeDeviceResponse])` +- Function `*UsersClient.BeginCreateOrUpdate` return value(s) have been changed from `(UsersClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[UsersClientCreateOrUpdateResponse], error)` +- Function `NewStorageAccountCredentialsClient` return value(s) have been changed from `(*StorageAccountCredentialsClient)` to `(*StorageAccountCredentialsClient, error)` +- Function `*SharesClient.BeginDelete` return value(s) have been changed from `(SharesClientDeletePollerResponse, error)` to `(*armruntime.Poller[SharesClientDeleteResponse], error)` +- Function `*SupportPackagesClient.BeginTriggerSupportPackage` return value(s) have been changed from `(SupportPackagesClientTriggerSupportPackagePollerResponse, error)` to `(*armruntime.Poller[SupportPackagesClientTriggerSupportPackageResponse], error)` +- Function `NewAlertsClient` return value(s) have been changed from `(*AlertsClient)` to `(*AlertsClient, error)` +- Function `NewContainersClient` return value(s) have been changed from `(*ContainersClient)` to `(*ContainersClient, error)` +- Function `NewTriggersClient` return value(s) have been changed from `(*TriggersClient)` to `(*TriggersClient, error)` +- Function `NewBandwidthSchedulesClient` return value(s) have been changed from `(*BandwidthSchedulesClient)` to `(*BandwidthSchedulesClient, error)` +- Function `*StorageAccountsClient.ListByDataBoxEdgeDevice` return value(s) have been changed from `(*StorageAccountsClientListByDataBoxEdgeDevicePager)` to `(*runtime.Pager[StorageAccountsClientListByDataBoxEdgeDeviceResponse])` +- Function `*SharesClient.BeginRefresh` return value(s) have been changed from `(SharesClientRefreshPollerResponse, error)` to `(*armruntime.Poller[SharesClientRefreshResponse], error)` +- Function `*StorageAccountCredentialsClient.ListByDataBoxEdgeDevice` return value(s) have been changed from `(*StorageAccountCredentialsClientListByDataBoxEdgeDevicePager)` to `(*runtime.Pager[StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse])` +- Function `*DiagnosticSettingsClient.BeginUpdateDiagnosticProactiveLogCollectionSettings` return value(s) have been changed from `(DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse, error)` to `(*armruntime.Poller[DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse], error)` +- Function `*DiagnosticSettingsClient.BeginUpdateDiagnosticRemoteSupportSettings` return value(s) have been changed from `(DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse, error)` to `(*armruntime.Poller[DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse], error)` +- Function `NewOperationsClient` return value(s) have been changed from `(*OperationsClient)` to `(*OperationsClient, error)` +- Function `*TriggersClientDeletePoller.Done` has been removed +- Function `*StorageAccountsClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `JobType.ToPtr` has been removed +- Function `*ContainersClientDeletePollerResponse.Resume` has been removed +- Function `*MonitoringConfigClientDeletePoller.FinalResponse` has been removed +- Function `AccessLevel.ToPtr` has been removed +- Function `DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse.PollUntilDone` has been removed +- Function `*SharesClientRefreshPoller.FinalResponse` has been removed +- Function `*RolesClientDeletePoller.Poll` has been removed +- Function `ContainersClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*UsersClientDeletePoller.Done` has been removed +- Function `RoleStatus.ToPtr` has been removed +- Function `*BandwidthSchedulesClientDeletePoller.FinalResponse` has been removed +- Function `*DevicesClientListBySubscriptionPager.NextPage` has been removed +- Function `ClientPermissionType.ToPtr` has been removed +- Function `*OperationsClientListPager.NextPage` has been removed +- Function `*DevicesClientDownloadUpdatesPoller.Poll` has been removed +- Function `*DevicesClientScanForUpdatesPoller.Done` has been removed +- Function `*OrdersClientListByDataBoxEdgeDevicePager.Err` has been removed +- Function `*SupportPackagesClientTriggerSupportPackagePoller.Done` has been removed +- Function `StorageAccountStatus.ToPtr` has been removed +- Function `MonitoringConfigClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*StorageAccountCredentialsClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*RolesClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*StorageAccountsClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `SubscriptionState.ToPtr` has been removed +- Function `*DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller.Done` has been removed +- Function `*TriggersClientGetResult.UnmarshalJSON` has been removed +- Function `*RolesClientListByDataBoxEdgeDevicePager.NextPage` has been removed +- Function `*AlertsClientListByDataBoxEdgeDevicePager.NextPage` has been removed +- Function `*MonitoringConfigClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*DevicesClientDeletePoller.ResumeToken` has been removed +- Function `DataPolicy.ToPtr` has been removed +- Function `*AddonsClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*SupportPackagesClientTriggerSupportPackagePoller.FinalResponse` has been removed +- Function `*MonitoringConfigClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*OperationsClientListPager.Err` has been removed +- Function `*StorageAccountsClientDeletePoller.FinalResponse` has been removed +- Function `*UsersClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `TriggersClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*StorageAccountsClientCreateOrUpdatePoller.Done` has been removed +- Function `*UsersClientDeletePollerResponse.Resume` has been removed +- Function `*StorageAccountCredentialsClientDeletePoller.FinalResponse` has been removed +- Function `*MonitoringConfigClientDeletePollerResponse.Resume` has been removed +- Function `*DevicesClientDownloadUpdatesPoller.FinalResponse` has been removed +- Function `*TriggersClientCreateOrUpdatePoller.Done` has been removed +- Function `MsiIdentityType.ToPtr` has been removed +- Function `UpdateType.ToPtr` has been removed +- Function `*UsersClientCreateOrUpdatePoller.Poll` has been removed +- Function `*SharesClientDeletePoller.FinalResponse` has been removed +- Function `*DevicesClientDownloadUpdatesPoller.ResumeToken` has been removed +- Function `*TriggersClientListByDataBoxEdgeDevicePager.Err` has been removed +- Function `*StorageAccountsClientDeletePollerResponse.Resume` has been removed +- Function `*ContainersClientRefreshPoller.Poll` has been removed +- Function `NodeStatus.ToPtr` has been removed +- Function `OrderState.ToPtr` has been removed +- Function `*ContainersClientRefreshPollerResponse.Resume` has been removed +- Function `*SharesClientDeletePoller.Poll` has been removed +- Function `*StorageAccountCredentialsClientDeletePoller.Poll` has been removed +- Function `UserType.ToPtr` has been removed +- Function `*TriggersClientCreateOrUpdatePoller.Poll` has been removed +- Function `ContainerStatus.ToPtr` has been removed +- Function `*RolesClientListByDataBoxEdgeDevicePager.PageResponse` has been removed +- Function `RolesClientDeletePollerResponse.PollUntilDone` has been removed +- Function `StorageAccountCredentialsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `DevicesClientInstallUpdatesPollerResponse.PollUntilDone` has been removed +- Function `*DevicesClientInstallUpdatesPoller.Done` has been removed +- Function `*OrdersClientDeletePollerResponse.Resume` has been removed +- Function `StorageAccountCredentialsClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*StorageAccountsClientDeletePoller.ResumeToken` has been removed +- Function `MetricAggregationType.ToPtr` has been removed +- Function `EncryptionAlgorithm.ToPtr` has been removed +- Function `*AvailableSKUsClientListPager.Err` has been removed +- Function `*DevicesClientListByResourceGroupPager.Err` has been removed +- Function `*OrdersClientCreateOrUpdatePoller.Poll` has been removed +- Function `*OrdersClientListByDataBoxEdgeDevicePager.NextPage` has been removed +- Function `*UsersClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*NodesClientListByDataBoxEdgeDevicePager.Err` has been removed +- Function `ShareAccessType.ToPtr` has been removed +- Function `UsersClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*SharesClientListByDataBoxEdgeDevicePager.Err` has been removed +- Function `*BandwidthSchedulesClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `UpdateOperationStage.ToPtr` has been removed +- Function `*AddonsClientCreateOrUpdatePoller.Poll` has been removed +- Function `*AvailableSKUsClientListPager.PageResponse` has been removed +- Function `*StorageAccountsClientListByDataBoxEdgeDevicePager.Err` has been removed +- Function `*StorageAccountsClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `InstallRebootBehavior.ToPtr` has been removed +- Function `*NodesClientListByDataBoxEdgeDevicePager.PageResponse` has been removed +- Function `*OperationsClientListPager.PageResponse` has been removed +- Function `TriggersClientDeletePollerResponse.PollUntilDone` has been removed +- Function `ShareStatus.ToPtr` has been removed +- Function `*OrdersClientListByDataBoxEdgeDevicePager.PageResponse` has been removed +- Function `*TriggersClientDeletePoller.FinalResponse` has been removed +- Function `OrdersClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*ContainersClientRefreshPoller.FinalResponse` has been removed +- Function `*DevicesClientDeletePollerResponse.Resume` has been removed +- Function `SSLStatus.ToPtr` has been removed +- Function `*RolesClientCreateOrUpdateResult.UnmarshalJSON` has been removed +- Function `RemoteApplicationType.ToPtr` has been removed +- Function `*DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller.Poll` has been removed +- Function `DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse.PollUntilDone` has been removed +- Function `SKUAvailability.ToPtr` has been removed +- Function `StorageAccountsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*RolesClientGetResult.UnmarshalJSON` has been removed +- Function `*DevicesClientInstallUpdatesPoller.FinalResponse` has been removed +- Function `*UsersClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*TriggersClientCreateOrUpdateResult.UnmarshalJSON` has been removed +- Function `*RolesClientDeletePoller.FinalResponse` has been removed +- Function `SKUName.ToPtr` has been removed +- Function `*DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller.ResumeToken` has been removed +- Function `*NodesClientListByDataBoxEdgeDevicePager.NextPage` has been removed +- Function `*StorageAccountsClientListByDataBoxEdgeDevicePager.PageResponse` has been removed +- Function `*BandwidthSchedulesClientListByDataBoxEdgeDevicePager.NextPage` has been removed +- Function `*DevicesClientCreateOrUpdateSecuritySettingsPollerResponse.Resume` has been removed +- Function `*SharesClientListByDataBoxEdgeDevicePager.PageResponse` has been removed +- Function `InstallationImpact.ToPtr` has been removed +- Function `*AlertsClientListByDataBoxEdgeDevicePager.PageResponse` has been removed +- Function `AlertSeverity.ToPtr` has been removed +- Function `*TriggersClientDeletePoller.ResumeToken` has been removed +- Function `*StorageAccountCredentialsClientListByDataBoxEdgeDevicePager.PageResponse` has been removed +- Function `TriggerEventType.ToPtr` has been removed +- Function `*BandwidthSchedulesClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*OrdersClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller.Done` has been removed +- Function `*MonitoringConfigClientListPager.PageResponse` has been removed +- Function `*SupportPackagesClientTriggerSupportPackagePollerResponse.Resume` has been removed +- Function `*MonitoringConfigClientDeletePoller.ResumeToken` has been removed +- Function `*UsersClientListByDataBoxEdgeDevicePager.Err` has been removed +- Function `*MonitoringConfigClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*BandwidthSchedulesClientListByDataBoxEdgeDevicePager.Err` has been removed +- Function `NetworkAdapterDHCPStatus.ToPtr` has been removed +- Function `AzureContainerDataFormat.ToPtr` has been removed +- Function `*DevicesClientDownloadUpdatesPollerResponse.Resume` has been removed +- Function `ResourceMoveStatus.ToPtr` has been removed +- Function `NetworkAdapterRDMAStatus.ToPtr` has been removed +- Function `*ContainersClientCreateOrUpdatePoller.Done` has been removed +- Function `DevicesClientCreateOrUpdateSecuritySettingsPollerResponse.PollUntilDone` has been removed +- Function `SKUVersion.ToPtr` has been removed +- Function `*AddonsClientDeletePoller.ResumeToken` has been removed +- Function `OrdersClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*SharesClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `AuthenticationType.ToPtr` has been removed +- Function `*OrdersClientDeletePoller.Done` has been removed +- Function `*MonitoringConfigClientListPager.NextPage` has been removed +- Function `MonitoringStatus.ToPtr` has been removed +- Function `*RolesClientDeletePollerResponse.Resume` has been removed +- Function `*StorageAccountCredentialsClientCreateOrUpdatePoller.Poll` has been removed +- Function `*AddonsClientDeletePoller.Done` has been removed +- Function `StorageAccountsClientDeletePollerResponse.PollUntilDone` has been removed +- Function `MonitoringConfigClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*AvailableSKUsClientListPager.NextPage` has been removed +- Function `*DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller.FinalResponse` has been removed +- Function `MountType.ToPtr` has been removed +- Function `*DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller.ResumeToken` has been removed +- Function `PosixComplianceStatus.ToPtr` has been removed +- Function `*DevicesClientDeletePoller.Poll` has been removed +- Function `*SharesClientListByDataBoxEdgeDevicePager.NextPage` has been removed +- Function `*TriggersClientDeletePollerResponse.Resume` has been removed +- Function `*AddonsClientCreateOrUpdateResult.UnmarshalJSON` has been removed +- Function `*RolesClientCreateOrUpdatePoller.Done` has been removed +- Function `*SharesClientCreateOrUpdatePoller.Done` has been removed +- Function `*StorageAccountCredentialsClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*StorageAccountCredentialsClientDeletePollerResponse.Resume` has been removed +- Function `ContainersClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*DevicesClientListByResourceGroupPager.NextPage` has been removed +- Function `*DevicesClientScanForUpdatesPoller.FinalResponse` has been removed +- Function `*UsersClientDeletePoller.ResumeToken` has been removed +- Function `*DevicesClientScanForUpdatesPollerResponse.Resume` has been removed +- Function `*BandwidthSchedulesClientDeletePollerResponse.Resume` has been removed +- Function `SKUSignupOption.ToPtr` has been removed +- Function `*RolesClientDeletePoller.Done` has been removed +- Function `*DevicesClientInstallUpdatesPollerResponse.Resume` has been removed +- Function `*RolesClientListByDataBoxEdgeDevicePager.Err` has been removed +- Function `*UsersClientDeletePoller.Poll` has been removed +- Function `*RolesClientCreateOrUpdatePoller.Poll` has been removed +- Function `*DevicesClientListBySubscriptionPager.Err` has been removed +- Function `*DevicesClientListByResourceGroupPager.PageResponse` has been removed +- Function `*StorageAccountCredentialsClientDeletePoller.ResumeToken` has been removed +- Function `*ContainersClientDeletePoller.FinalResponse` has been removed +- Function `*AddonsClientDeletePoller.FinalResponse` has been removed +- Function `JobStatus.ToPtr` has been removed +- Function `ContainersClientRefreshPollerResponse.PollUntilDone` has been removed +- Function `*AlertsClientListByDataBoxEdgeDevicePager.Err` has been removed +- Function `*UsersClientListByDataBoxEdgeDevicePager.PageResponse` has been removed +- Function `*ContainersClientCreateOrUpdatePoller.Poll` has been removed +- Function `*SharesClientDeletePollerResponse.Resume` has been removed +- Function `*RolesClientDeletePoller.ResumeToken` has been removed +- Function `*DevicesClientScanForUpdatesPoller.Poll` has been removed +- Function `*StorageAccountsClientDeletePoller.Done` has been removed +- Function `*TriggersClientListByDataBoxEdgeDevicePager.PageResponse` has been removed +- Function `*DevicesClientCreateOrUpdateSecuritySettingsPoller.FinalResponse` has been removed +- Function `*AddonsClientListByRolePager.PageResponse` has been removed +- Function `*OrdersClientDeletePoller.FinalResponse` has been removed +- Function `DataResidencyType.ToPtr` has been removed +- Function `*StorageAccountCredentialsClientListByDataBoxEdgeDevicePager.Err` has been removed +- Function `SharesClientDeletePollerResponse.PollUntilDone` has been removed +- Function `ShipmentType.ToPtr` has been removed +- Function `*DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller.Poll` has been removed +- Function `*TriggersClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*DevicesClientListBySubscriptionPager.PageResponse` has been removed +- Function `*ContainersClientRefreshPoller.ResumeToken` has been removed +- Function `BandwidthSchedulesClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*MonitoringConfigClientCreateOrUpdatePoller.Poll` has been removed +- Function `*BandwidthSchedulesClientDeletePoller.Done` has been removed +- Function `*MonitoringConfigClientDeletePoller.Poll` has been removed +- Function `*DevicesClientScanForUpdatesPoller.ResumeToken` has been removed +- Function `*AddonsClientListByRolePager.NextPage` has been removed +- Function `KubernetesState.ToPtr` has been removed +- Function `*ContainersClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*StorageAccountCredentialsClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*SharesClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*SharesClientDeletePoller.Done` has been removed +- Function `*SharesClientRefreshPollerResponse.Resume` has been removed +- Function `NetworkAdapterStatus.ToPtr` has been removed +- Function `SupportPackagesClientTriggerSupportPackagePollerResponse.PollUntilDone` has been removed +- Function `*ContainersClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*ContainersClientDeletePoller.Poll` has been removed +- Function `SharesClientRefreshPollerResponse.PollUntilDone` has been removed +- Function `*ContainersClientListByStorageAccountPager.NextPage` has been removed +- Function `AccountType.ToPtr` has been removed +- Function `HostPlatformType.ToPtr` has been removed +- Function `DevicesClientDeletePollerResponse.PollUntilDone` has been removed +- Function `BandwidthSchedulesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*BandwidthSchedulesClientDeletePoller.ResumeToken` has been removed +- Function `*UsersClientListByDataBoxEdgeDevicePager.NextPage` has been removed +- Function `*ContainersClientListByStorageAccountPager.PageResponse` has been removed +- Function `*SharesClientCreateOrUpdatePoller.Poll` has been removed +- Function `AddonType.ToPtr` has been removed +- Function `*BandwidthSchedulesClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `TimeGrain.ToPtr` has been removed +- Function `*AddonsClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `DownloadPhase.ToPtr` has been removed +- Function `*TriggersClientDeletePoller.Poll` has been removed +- Function `RoleTypes.ToPtr` has been removed +- Function `DayOfWeek.ToPtr` has been removed +- Function `*ContainersClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*AddonsClientListByRolePager.Err` has been removed +- Function `*TriggersClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `NetworkGroup.ToPtr` has been removed +- Function `*SharesClientDeletePoller.ResumeToken` has been removed +- Function `*DevicesClientInstallUpdatesPoller.Poll` has been removed +- Function `*SharesClientRefreshPoller.ResumeToken` has been removed +- Function `*BandwidthSchedulesClientDeletePoller.Poll` has been removed +- Function `UpdateOperation.ToPtr` has been removed +- Function `*DevicesClientCreateOrUpdateSecuritySettingsPoller.Poll` has been removed +- Function `AddonState.ToPtr` has been removed +- Function `*TriggersClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*SharesClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `ProactiveDiagnosticsConsent.ToPtr` has been removed +- Function `*StorageAccountsClientListByDataBoxEdgeDevicePager.NextPage` has been removed +- Function `SharesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `MetricUnit.ToPtr` has been removed +- Function `*AddonsClientDeletePollerResponse.Resume` has been removed +- Function `*AddonsClientGetResult.UnmarshalJSON` has been removed +- Function `UpdateStatus.ToPtr` has been removed +- Function `AddonsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*SupportPackagesClientTriggerSupportPackagePoller.Poll` has been removed +- Function `DevicesClientDownloadUpdatesPollerResponse.PollUntilDone` has been removed +- Function `MetricCategory.ToPtr` has been removed +- Function `ShareAccessProtocol.ToPtr` has been removed +- Function `*BandwidthSchedulesClientCreateOrUpdatePoller.Done` has been removed +- Function `*OrdersClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `PlatformType.ToPtr` has been removed +- Function `*AddonsClientDeletePoller.Poll` has been removed +- Function `*OrdersClientDeletePoller.Poll` has been removed +- Function `*SupportPackagesClientTriggerSupportPackagePoller.ResumeToken` has been removed +- Function `KubernetesNodeType.ToPtr` has been removed +- Function `*SharesClientRefreshPoller.Done` has been removed +- Function `*DevicesClientDownloadUpdatesPoller.Done` has been removed +- Function `*BandwidthSchedulesClientListByDataBoxEdgeDevicePager.PageResponse` has been removed +- Function `*StorageAccountsClientCreateOrUpdatePoller.Poll` has been removed +- Function `AddonsClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*ContainersClientDeletePoller.ResumeToken` has been removed +- Function `*DevicesClientDeletePoller.Done` has been removed +- Function `*MonitoringConfigClientDeletePoller.Done` has been removed +- Function `KeyVaultSyncStatus.ToPtr` has been removed +- Function `DeviceType.ToPtr` has been removed +- Function `*DevicesClientCreateOrUpdateSecuritySettingsPoller.Done` has been removed +- Function `RolesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*DevicesClientDeletePoller.FinalResponse` has been removed +- Function `*TriggersClientListByDataBoxEdgeDevicePager.NextPage` has been removed +- Function `*ContainersClientRefreshPoller.Done` has been removed +- Function `CreatedByType.ToPtr` has been removed +- Function `*RolesClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*OrdersClientDeletePoller.ResumeToken` has been removed +- Function `*StorageAccountCredentialsClientDeletePoller.Done` has been removed +- Function `*ContainersClientListByStorageAccountPager.Err` has been removed +- Function `*ContainersClientDeletePoller.Done` has been removed +- Function `*MonitoringConfigClientListPager.Err` has been removed +- Function `*AddonsClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*AddonsClientCreateOrUpdatePoller.Done` has been removed +- Function `*DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse.Resume` has been removed +- Function `*DevicesClientInstallUpdatesPoller.ResumeToken` has been removed +- Function `*DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller.FinalResponse` has been removed +- Function `DataBoxEdgeDeviceKind.ToPtr` has been removed +- Function `*UsersClientDeletePoller.FinalResponse` has been removed +- Function `*OrdersClientCreateOrUpdatePoller.Done` has been removed +- Function `*StorageAccountCredentialsClientCreateOrUpdatePoller.Done` has been removed +- Function `SKUTier.ToPtr` has been removed +- Function `*StorageAccountsClientDeletePoller.Poll` has been removed +- Function `*UsersClientCreateOrUpdatePoller.Done` has been removed +- Function `*StorageAccountCredentialsClientListByDataBoxEdgeDevicePager.NextPage` has been removed +- Function `UsersClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `DevicesClientScanForUpdatesPollerResponse.PollUntilDone` has been removed +- Function `*BandwidthSchedulesClientCreateOrUpdatePoller.Poll` has been removed +- Function `*SharesClientRefreshPoller.Poll` has been removed +- Function `DataBoxEdgeDeviceStatus.ToPtr` has been removed +- Function `*OrdersClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*DevicesClientCreateOrUpdateSecuritySettingsPoller.ResumeToken` has been removed +- Function `*MonitoringConfigClientCreateOrUpdatePoller.Done` has been removed +- Function `*RolesClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse.Resume` has been removed +- Struct `AddonsClientCreateOrUpdatePoller` has been removed +- Struct `AddonsClientCreateOrUpdatePollerResponse` has been removed +- Struct `AddonsClientCreateOrUpdateResult` has been removed +- Struct `AddonsClientDeletePoller` has been removed +- Struct `AddonsClientDeletePollerResponse` has been removed +- Struct `AddonsClientGetResult` has been removed +- Struct `AddonsClientListByRolePager` has been removed +- Struct `AddonsClientListByRoleResult` has been removed +- Struct `AlertsClientGetResult` has been removed +- Struct `AlertsClientListByDataBoxEdgeDevicePager` has been removed +- Struct `AlertsClientListByDataBoxEdgeDeviceResult` has been removed +- Struct `AvailableSKUsClientListPager` has been removed +- Struct `AvailableSKUsClientListResult` has been removed +- Struct `BandwidthSchedulesClientCreateOrUpdatePoller` has been removed +- Struct `BandwidthSchedulesClientCreateOrUpdatePollerResponse` has been removed +- Struct `BandwidthSchedulesClientCreateOrUpdateResult` has been removed +- Struct `BandwidthSchedulesClientDeletePoller` has been removed +- Struct `BandwidthSchedulesClientDeletePollerResponse` has been removed +- Struct `BandwidthSchedulesClientGetResult` has been removed +- Struct `BandwidthSchedulesClientListByDataBoxEdgeDevicePager` has been removed +- Struct `BandwidthSchedulesClientListByDataBoxEdgeDeviceResult` has been removed +- Struct `ContainersClientCreateOrUpdatePoller` has been removed +- Struct `ContainersClientCreateOrUpdatePollerResponse` has been removed +- Struct `ContainersClientCreateOrUpdateResult` has been removed +- Struct `ContainersClientDeletePoller` has been removed +- Struct `ContainersClientDeletePollerResponse` has been removed +- Struct `ContainersClientGetResult` has been removed +- Struct `ContainersClientListByStorageAccountPager` has been removed +- Struct `ContainersClientListByStorageAccountResult` has been removed +- Struct `ContainersClientRefreshPoller` has been removed +- Struct `ContainersClientRefreshPollerResponse` has been removed +- Struct `DevicesClientCreateOrUpdateResult` has been removed +- Struct `DevicesClientCreateOrUpdateSecuritySettingsPoller` has been removed +- Struct `DevicesClientCreateOrUpdateSecuritySettingsPollerResponse` has been removed +- Struct `DevicesClientDeletePoller` has been removed +- Struct `DevicesClientDeletePollerResponse` has been removed +- Struct `DevicesClientDownloadUpdatesPoller` has been removed +- Struct `DevicesClientDownloadUpdatesPollerResponse` has been removed +- Struct `DevicesClientGenerateCertificateResult` has been removed +- Struct `DevicesClientGetExtendedInformationResult` has been removed +- Struct `DevicesClientGetNetworkSettingsResult` has been removed +- Struct `DevicesClientGetResult` has been removed +- Struct `DevicesClientGetUpdateSummaryResult` has been removed +- Struct `DevicesClientInstallUpdatesPoller` has been removed +- Struct `DevicesClientInstallUpdatesPollerResponse` has been removed +- Struct `DevicesClientListByResourceGroupPager` has been removed +- Struct `DevicesClientListByResourceGroupResult` has been removed +- Struct `DevicesClientListBySubscriptionPager` has been removed +- Struct `DevicesClientListBySubscriptionResult` has been removed +- Struct `DevicesClientScanForUpdatesPoller` has been removed +- Struct `DevicesClientScanForUpdatesPollerResponse` has been removed +- Struct `DevicesClientUpdateExtendedInformationResult` has been removed +- Struct `DevicesClientUpdateResult` has been removed +- Struct `DevicesClientUploadCertificateResult` has been removed +- Struct `DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResult` has been removed +- Struct `DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResult` has been removed +- Struct `DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller` has been removed +- Struct `DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse` has been removed +- Struct `DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResult` has been removed +- Struct `DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller` has been removed +- Struct `DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse` has been removed +- Struct `DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResult` has been removed +- Struct `JobsClientGetResult` has been removed +- Struct `MonitoringConfigClientCreateOrUpdatePoller` has been removed +- Struct `MonitoringConfigClientCreateOrUpdatePollerResponse` has been removed +- Struct `MonitoringConfigClientCreateOrUpdateResult` has been removed +- Struct `MonitoringConfigClientDeletePoller` has been removed +- Struct `MonitoringConfigClientDeletePollerResponse` has been removed +- Struct `MonitoringConfigClientGetResult` has been removed +- Struct `MonitoringConfigClientListPager` has been removed +- Struct `MonitoringConfigClientListResult` has been removed +- Struct `NodesClientListByDataBoxEdgeDevicePager` has been removed +- Struct `NodesClientListByDataBoxEdgeDeviceResult` has been removed +- Struct `OperationsClientListPager` has been removed +- Struct `OperationsClientListResult` has been removed +- Struct `OperationsStatusClientGetResult` has been removed +- Struct `OrdersClientCreateOrUpdatePoller` has been removed +- Struct `OrdersClientCreateOrUpdatePollerResponse` has been removed +- Struct `OrdersClientCreateOrUpdateResult` has been removed +- Struct `OrdersClientDeletePoller` has been removed +- Struct `OrdersClientDeletePollerResponse` has been removed +- Struct `OrdersClientGetResult` has been removed +- Struct `OrdersClientListByDataBoxEdgeDevicePager` has been removed +- Struct `OrdersClientListByDataBoxEdgeDeviceResult` has been removed +- Struct `OrdersClientListDCAccessCodeResult` has been removed +- Struct `RolesClientCreateOrUpdatePoller` has been removed +- Struct `RolesClientCreateOrUpdatePollerResponse` has been removed +- Struct `RolesClientCreateOrUpdateResult` has been removed +- Struct `RolesClientDeletePoller` has been removed +- Struct `RolesClientDeletePollerResponse` has been removed +- Struct `RolesClientGetResult` has been removed +- Struct `RolesClientListByDataBoxEdgeDevicePager` has been removed +- Struct `RolesClientListByDataBoxEdgeDeviceResult` has been removed +- Struct `SharesClientCreateOrUpdatePoller` has been removed +- Struct `SharesClientCreateOrUpdatePollerResponse` has been removed +- Struct `SharesClientCreateOrUpdateResult` has been removed +- Struct `SharesClientDeletePoller` has been removed +- Struct `SharesClientDeletePollerResponse` has been removed +- Struct `SharesClientGetResult` has been removed +- Struct `SharesClientListByDataBoxEdgeDevicePager` has been removed +- Struct `SharesClientListByDataBoxEdgeDeviceResult` has been removed +- Struct `SharesClientRefreshPoller` has been removed +- Struct `SharesClientRefreshPollerResponse` has been removed +- Struct `StorageAccountCredentialsClientCreateOrUpdatePoller` has been removed +- Struct `StorageAccountCredentialsClientCreateOrUpdatePollerResponse` has been removed +- Struct `StorageAccountCredentialsClientCreateOrUpdateResult` has been removed +- Struct `StorageAccountCredentialsClientDeletePoller` has been removed +- Struct `StorageAccountCredentialsClientDeletePollerResponse` has been removed +- Struct `StorageAccountCredentialsClientGetResult` has been removed +- Struct `StorageAccountCredentialsClientListByDataBoxEdgeDevicePager` has been removed +- Struct `StorageAccountCredentialsClientListByDataBoxEdgeDeviceResult` has been removed +- Struct `StorageAccountsClientCreateOrUpdatePoller` has been removed +- Struct `StorageAccountsClientCreateOrUpdatePollerResponse` has been removed +- Struct `StorageAccountsClientCreateOrUpdateResult` has been removed +- Struct `StorageAccountsClientDeletePoller` has been removed +- Struct `StorageAccountsClientDeletePollerResponse` has been removed +- Struct `StorageAccountsClientGetResult` has been removed +- Struct `StorageAccountsClientListByDataBoxEdgeDevicePager` has been removed +- Struct `StorageAccountsClientListByDataBoxEdgeDeviceResult` has been removed +- Struct `SupportPackagesClientTriggerSupportPackagePoller` has been removed +- Struct `SupportPackagesClientTriggerSupportPackagePollerResponse` has been removed +- Struct `TriggersClientCreateOrUpdatePoller` has been removed +- Struct `TriggersClientCreateOrUpdatePollerResponse` has been removed +- Struct `TriggersClientCreateOrUpdateResult` has been removed +- Struct `TriggersClientDeletePoller` has been removed +- Struct `TriggersClientDeletePollerResponse` has been removed +- Struct `TriggersClientGetResult` has been removed +- Struct `TriggersClientListByDataBoxEdgeDevicePager` has been removed +- Struct `TriggersClientListByDataBoxEdgeDeviceResult` has been removed +- Struct `UsersClientCreateOrUpdatePoller` has been removed +- Struct `UsersClientCreateOrUpdatePollerResponse` has been removed +- Struct `UsersClientCreateOrUpdateResult` has been removed +- Struct `UsersClientDeletePoller` has been removed +- Struct `UsersClientDeletePollerResponse` has been removed +- Struct `UsersClientGetResult` has been removed +- Struct `UsersClientListByDataBoxEdgeDevicePager` has been removed +- Struct `UsersClientListByDataBoxEdgeDeviceResult` has been removed +- Field `DevicesClientGetExtendedInformationResult` of struct `DevicesClientGetExtendedInformationResponse` has been removed +- Field `RawResponse` of struct `DevicesClientGetExtendedInformationResponse` has been removed +- Field `TriggersClientCreateOrUpdateResult` of struct `TriggersClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `TriggersClientCreateOrUpdateResponse` has been removed +- Field `BandwidthSchedulesClientGetResult` of struct `BandwidthSchedulesClientGetResponse` has been removed +- Field `RawResponse` of struct `BandwidthSchedulesClientGetResponse` has been removed +- Field `DevicesClientGetResult` of struct `DevicesClientGetResponse` has been removed +- Field `RawResponse` of struct `DevicesClientGetResponse` has been removed +- Field `OrdersClientListDCAccessCodeResult` of struct `OrdersClientListDCAccessCodeResponse` has been removed +- Field `RawResponse` of struct `OrdersClientListDCAccessCodeResponse` has been removed +- Field `DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResult` of struct `DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResponse` has been removed +- Field `RawResponse` of struct `DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResponse` has been removed +- Field `DevicesClientGetNetworkSettingsResult` of struct `DevicesClientGetNetworkSettingsResponse` has been removed +- Field `RawResponse` of struct `DevicesClientGetNetworkSettingsResponse` has been removed +- Field `DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResult` of struct `DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse` has been removed +- Field `RawResponse` of struct `DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse` has been removed +- Field `OperationsStatusClientGetResult` of struct `OperationsStatusClientGetResponse` has been removed +- Field `RawResponse` of struct `OperationsStatusClientGetResponse` has been removed +- Field `StorageAccountsClientListByDataBoxEdgeDeviceResult` of struct `StorageAccountsClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `StorageAccountsClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `NodesClientListByDataBoxEdgeDeviceResult` of struct `NodesClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `NodesClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `DevicesClientUpdateResult` of struct `DevicesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `DevicesClientUpdateResponse` has been removed +- Field `BandwidthSchedulesClientCreateOrUpdateResult` of struct `BandwidthSchedulesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `BandwidthSchedulesClientCreateOrUpdateResponse` has been removed +- Field `DevicesClientUpdateExtendedInformationResult` of struct `DevicesClientUpdateExtendedInformationResponse` has been removed +- Field `RawResponse` of struct `DevicesClientUpdateExtendedInformationResponse` has been removed +- Field `SharesClientCreateOrUpdateResult` of struct `SharesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `SharesClientCreateOrUpdateResponse` has been removed +- Field `AvailableSKUsClientListResult` of struct `AvailableSKUsClientListResponse` has been removed +- Field `RawResponse` of struct `AvailableSKUsClientListResponse` has been removed +- Field `RawResponse` of struct `MonitoringConfigClientDeleteResponse` has been removed +- Field `RawResponse` of struct `StorageAccountCredentialsClientDeleteResponse` has been removed +- Field `RawResponse` of struct `TriggersClientDeleteResponse` has been removed +- Field `UsersClientGetResult` of struct `UsersClientGetResponse` has been removed +- Field `RawResponse` of struct `UsersClientGetResponse` has been removed +- Field `MonitoringConfigClientCreateOrUpdateResult` of struct `MonitoringConfigClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `MonitoringConfigClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `AddonsClientDeleteResponse` has been removed +- Field `RawResponse` of struct `DevicesClientScanForUpdatesResponse` has been removed +- Field `AlertsClientListByDataBoxEdgeDeviceResult` of struct `AlertsClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `AlertsClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `ContainersClientCreateOrUpdateResult` of struct `ContainersClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ContainersClientCreateOrUpdateResponse` has been removed +- Field `DevicesClientGetUpdateSummaryResult` of struct `DevicesClientGetUpdateSummaryResponse` has been removed +- Field `RawResponse` of struct `DevicesClientGetUpdateSummaryResponse` has been removed +- Field `RawResponse` of struct `OrdersClientDeleteResponse` has been removed +- Field `DevicesClientCreateOrUpdateResult` of struct `DevicesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `DevicesClientCreateOrUpdateResponse` has been removed +- Field `ContainersClientGetResult` of struct `ContainersClientGetResponse` has been removed +- Field `RawResponse` of struct `ContainersClientGetResponse` has been removed +- Field `UsersClientCreateOrUpdateResult` of struct `UsersClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `UsersClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `SharesClientDeleteResponse` has been removed +- Field `UsersClientListByDataBoxEdgeDeviceResult` of struct `UsersClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `UsersClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `TriggersClientGetResult` of struct `TriggersClientGetResponse` has been removed +- Field `RawResponse` of struct `TriggersClientGetResponse` has been removed +- Field `OrdersClientCreateOrUpdateResult` of struct `OrdersClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `OrdersClientCreateOrUpdateResponse` has been removed +- Field `DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResult` of struct `DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse` has been removed +- Field `RawResponse` of struct `DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse` has been removed +- Field `RawResponse` of struct `SharesClientRefreshResponse` has been removed +- Field `DevicesClientListBySubscriptionResult` of struct `DevicesClientListBySubscriptionResponse` has been removed +- Field `RawResponse` of struct `DevicesClientListBySubscriptionResponse` has been removed +- Field `OrdersClientListByDataBoxEdgeDeviceResult` of struct `OrdersClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `OrdersClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `StorageAccountsClientDeleteResponse` has been removed +- Field `AlertsClientGetResult` of struct `AlertsClientGetResponse` has been removed +- Field `RawResponse` of struct `AlertsClientGetResponse` has been removed +- Field `TriggersClientListByDataBoxEdgeDeviceResult` of struct `TriggersClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `TriggersClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `StorageAccountCredentialsClientListByDataBoxEdgeDeviceResult` of struct `StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `StorageAccountsClientCreateOrUpdateResult` of struct `StorageAccountsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `StorageAccountsClientCreateOrUpdateResponse` has been removed +- Field `OrdersClientGetResult` of struct `OrdersClientGetResponse` has been removed +- Field `RawResponse` of struct `OrdersClientGetResponse` has been removed +- Field `RawResponse` of struct `DevicesClientDownloadUpdatesResponse` has been removed +- Field `RawResponse` of struct `ContainersClientRefreshResponse` has been removed +- Field `SharesClientGetResult` of struct `SharesClientGetResponse` has been removed +- Field `RawResponse` of struct `SharesClientGetResponse` has been removed +- Field `RolesClientCreateOrUpdateResult` of struct `RolesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `RolesClientCreateOrUpdateResponse` has been removed +- Field `RolesClientListByDataBoxEdgeDeviceResult` of struct `RolesClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `RolesClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `DevicesClientCreateOrUpdateSecuritySettingsResponse` has been removed +- Field `RawResponse` of struct `SupportPackagesClientTriggerSupportPackageResponse` has been removed +- Field `StorageAccountCredentialsClientCreateOrUpdateResult` of struct `StorageAccountCredentialsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `StorageAccountCredentialsClientCreateOrUpdateResponse` has been removed +- Field `DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResult` of struct `DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResponse` has been removed +- Field `RawResponse` of struct `DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResponse` has been removed +- Field `RawResponse` of struct `UsersClientDeleteResponse` has been removed +- Field `AddonsClientCreateOrUpdateResult` of struct `AddonsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `AddonsClientCreateOrUpdateResponse` has been removed +- Field `DevicesClientListByResourceGroupResult` of struct `DevicesClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `DevicesClientListByResourceGroupResponse` has been removed +- Field `JobsClientGetResult` of struct `JobsClientGetResponse` has been removed +- Field `RawResponse` of struct `JobsClientGetResponse` has been removed +- Field `ContainersClientListByStorageAccountResult` of struct `ContainersClientListByStorageAccountResponse` has been removed +- Field `RawResponse` of struct `ContainersClientListByStorageAccountResponse` has been removed +- Field `StorageAccountCredentialsClientGetResult` of struct `StorageAccountCredentialsClientGetResponse` has been removed +- Field `RawResponse` of struct `StorageAccountCredentialsClientGetResponse` has been removed +- Field `RawResponse` of struct `DevicesClientInstallUpdatesResponse` has been removed +- Field `OperationsClientListResult` of struct `OperationsClientListResponse` has been removed +- Field `RawResponse` of struct `OperationsClientListResponse` has been removed +- Field `DevicesClientGenerateCertificateResult` of struct `DevicesClientGenerateCertificateResponse` has been removed +- Field `RawResponse` of struct `DevicesClientGenerateCertificateResponse` has been removed +- Field `StorageAccountsClientGetResult` of struct `StorageAccountsClientGetResponse` has been removed +- Field `RawResponse` of struct `StorageAccountsClientGetResponse` has been removed +- Field `AddonsClientGetResult` of struct `AddonsClientGetResponse` has been removed +- Field `RawResponse` of struct `AddonsClientGetResponse` has been removed +- Field `MonitoringConfigClientListResult` of struct `MonitoringConfigClientListResponse` has been removed +- Field `RawResponse` of struct `MonitoringConfigClientListResponse` has been removed +- Field `SharesClientListByDataBoxEdgeDeviceResult` of struct `SharesClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `SharesClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `ContainersClientDeleteResponse` has been removed +- Field `BandwidthSchedulesClientListByDataBoxEdgeDeviceResult` of struct `BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse` has been removed +- Field `RawResponse` of struct `BandwidthSchedulesClientDeleteResponse` has been removed +- Field `RawResponse` of struct `DevicesClientDeleteResponse` has been removed +- Field `RolesClientGetResult` of struct `RolesClientGetResponse` has been removed +- Field `RawResponse` of struct `RolesClientGetResponse` has been removed +- Field `RawResponse` of struct `RolesClientDeleteResponse` has been removed +- Field `AddonsClientListByRoleResult` of struct `AddonsClientListByRoleResponse` has been removed +- Field `RawResponse` of struct `AddonsClientListByRoleResponse` has been removed +- Field `DevicesClientUploadCertificateResult` of struct `DevicesClientUploadCertificateResponse` has been removed +- Field `RawResponse` of struct `DevicesClientUploadCertificateResponse` has been removed +- Field `MonitoringConfigClientGetResult` of struct `MonitoringConfigClientGetResponse` has been removed +- Field `RawResponse` of struct `MonitoringConfigClientGetResponse` has been removed + +### Features Added + +- New const `ClusterWitnessTypeNone` +- New const `ClusterWitnessTypeCloud` +- New const `ClusterWitnessTypeFileShare` +- New const `SKUNameEdgeMRTCP` +- New const `SKUNameEP2256GPU2Mx1` +- New const `SKUNameEP2128GPU1Mx1W` +- New const `SKUNameEP264Mx1W` +- New function `*DeviceCapacityInfoClient.GetDeviceCapacityInfo(context.Context, string, string, *DeviceCapacityInfoClientGetDeviceCapacityInfoOptions) (DeviceCapacityInfoClientGetDeviceCapacityInfoResponse, error)` +- New function `*RolesClientCreateOrUpdateResponse.UnmarshalJSON([]byte) error` +- New function `*ClusterCapacityViewData.UnmarshalJSON([]byte) error` +- New function `DeviceCapacityRequestInfoProperties.MarshalJSON() ([]byte, error)` +- New function `*TriggersClientGetResponse.UnmarshalJSON([]byte) error` +- New function `MoveRequest.MarshalJSON() ([]byte, error)` +- New function `*DeviceCapacityCheckClient.BeginCheckResourceCreationFeasibility(context.Context, string, string, DeviceCapacityRequestInfo, *DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions) (*armruntime.Poller[DeviceCapacityCheckClientCheckResourceCreationFeasibilityResponse], error)` +- New function `ClusterCapacityViewData.MarshalJSON() ([]byte, error)` +- New function `*TriggersClientCreateOrUpdateResponse.UnmarshalJSON([]byte) error` +- New function `VMPlacementRequestResult.MarshalJSON() ([]byte, error)` +- New function `*RolesClientGetResponse.UnmarshalJSON([]byte) error` +- New function `DeviceCapacityInfoProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleClusterWitnessTypeValues() []ClusterWitnessType` +- New function `*DeviceCapacityInfoProperties.UnmarshalJSON([]byte) error` +- New function `SystemDataAutoGenerated.MarshalJSON() ([]byte, error)` +- New function `*SystemDataAutoGenerated.UnmarshalJSON([]byte) error` +- New function `HostCapacity.MarshalJSON() ([]byte, error)` +- New function `*AddonsClientGetResponse.UnmarshalJSON([]byte) error` +- New function `NumaNodeData.MarshalJSON() ([]byte, error)` +- New function `*AddonsClientCreateOrUpdateResponse.UnmarshalJSON([]byte) error` +- New function `CloudErrorBody.MarshalJSON() ([]byte, error)` +- New function `NewDeviceCapacityCheckClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DeviceCapacityCheckClient, error)` +- New function `NewDeviceCapacityInfoClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DeviceCapacityInfoClient, error)` +- New struct `CloudError` +- New struct `CloudErrorBody` +- New struct `ClusterCapacityViewData` +- New struct `ClusterGpuCapacity` +- New struct `ClusterMemoryCapacity` +- New struct `ClusterStorageViewData` +- New struct `DeviceCapacityCheckClient` +- New struct `DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions` +- New struct `DeviceCapacityCheckClientCheckResourceCreationFeasibilityResponse` +- New struct `DeviceCapacityInfo` +- New struct `DeviceCapacityInfoClient` +- New struct `DeviceCapacityInfoClientGetDeviceCapacityInfoOptions` +- New struct `DeviceCapacityInfoClientGetDeviceCapacityInfoResponse` +- New struct `DeviceCapacityInfoProperties` +- New struct `DeviceCapacityRequestInfo` +- New struct `DeviceCapacityRequestInfoProperties` +- New struct `HostCapacity` +- New struct `MoveRequest` +- New struct `NumaNodeData` +- New struct `SystemDataAutoGenerated` +- New struct `VMMemory` +- New struct `VMPlacementRequestResult` +- New anonymous field `DeviceExtendedInfo` in struct `DevicesClientUpdateExtendedInformationResponse` +- New field `ResumeToken` in struct `RolesClientBeginCreateOrUpdateOptions` +- New anonymous field `BandwidthSchedule` in struct `BandwidthSchedulesClientCreateOrUpdateResponse` +- New anonymous field `DeviceExtendedInfo` in struct `DevicesClientGetExtendedInformationResponse` +- New anonymous field `Device` in struct `DevicesClientGetResponse` +- New field `ResumeToken` in struct `MonitoringConfigClientBeginCreateOrUpdateOptions` +- New anonymous field `GenerateCertResponse` in struct `DevicesClientGenerateCertificateResponse` +- New anonymous field `DCAccessCode` in struct `OrdersClientListDCAccessCodeResponse` +- New field `ResumeToken` in struct `RolesClientBeginDeleteOptions` +- New anonymous field `Device` in struct `DevicesClientUpdateResponse` +- New anonymous field `UpdateSummary` in struct `DevicesClientGetUpdateSummaryResponse` +- New anonymous field `Device` in struct `DevicesClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `DevicesClientBeginDeleteOptions` +- New anonymous field `Order` in struct `OrdersClientCreateOrUpdateResponse` +- New anonymous field `NetworkSettings` in struct `DevicesClientGetNetworkSettingsResponse` +- New anonymous field `StorageAccountList` in struct `StorageAccountsClientListByDataBoxEdgeDeviceResponse` +- New field `ResumeToken` in struct `DevicesClientBeginCreateOrUpdateSecuritySettingsOptions` +- New anonymous field `ContainerList` in struct `ContainersClientListByStorageAccountResponse` +- New anonymous field `DeviceList` in struct `DevicesClientListByResourceGroupResponse` +- New field `CloudWitnessContainerName` in struct `DeviceExtendedInfoProperties` +- New field `CloudWitnessStorageAccountName` in struct `DeviceExtendedInfoProperties` +- New field `FileShareWitnessUsername` in struct `DeviceExtendedInfoProperties` +- New field `CloudWitnessStorageEndpoint` in struct `DeviceExtendedInfoProperties` +- New field `ClusterWitnessType` in struct `DeviceExtendedInfoProperties` +- New field `FileShareWitnessLocation` in struct `DeviceExtendedInfoProperties` +- New field `OrderID` in struct `OrderProperties` +- New field `ResumeToken` in struct `DiagnosticSettingsClientBeginUpdateDiagnosticProactiveLogCollectionSettingsOptions` +- New anonymous field `User` in struct `UsersClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `DevicesClientBeginDownloadUpdatesOptions` +- New anonymous field `MonitoringMetricConfiguration` in struct `MonitoringConfigClientGetResponse` +- New anonymous field `UserList` in struct `UsersClientListByDataBoxEdgeDeviceResponse` +- New anonymous field `Job` in struct `JobsClientGetResponse` +- New field `ResumeToken` in struct `BandwidthSchedulesClientBeginCreateOrUpdateOptions` +- New anonymous field `OrderList` in struct `OrdersClientListByDataBoxEdgeDeviceResponse` +- New field `ResumeToken` in struct `SharesClientBeginCreateOrUpdateOptions` +- New anonymous field `Container` in struct `ContainersClientCreateOrUpdateResponse` +- New anonymous field `StorageAccount` in struct `StorageAccountsClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `StorageAccountsClientBeginDeleteOptions` +- New field `ResumeToken` in struct `MonitoringConfigClientBeginDeleteOptions` +- New anonymous field `TriggerList` in struct `TriggersClientListByDataBoxEdgeDeviceResponse` +- New field `ResumeToken` in struct `ContainersClientBeginCreateOrUpdateOptions` +- New anonymous field `Share` in struct `SharesClientGetResponse` +- New anonymous field `AddonList` in struct `AddonsClientListByRoleResponse` +- New anonymous field `OperationsList` in struct `OperationsClientListResponse` +- New anonymous field `RoleClassification` in struct `RolesClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `StorageAccountCredentialsClientBeginCreateOrUpdateOptions` +- New anonymous field `Job` in struct `OperationsStatusClientGetResponse` +- New anonymous field `DeviceList` in struct `DevicesClientListBySubscriptionResponse` +- New field `ResumeToken` in struct `StorageAccountsClientBeginCreateOrUpdateOptions` +- New anonymous field `User` in struct `UsersClientGetResponse` +- New anonymous field `Alert` in struct `AlertsClientGetResponse` +- New field `ResumeToken` in struct `UsersClientBeginDeleteOptions` +- New anonymous field `SKUList` in struct `AvailableSKUsClientListResponse` +- New anonymous field `StorageAccountCredential` in struct `StorageAccountCredentialsClientCreateOrUpdateResponse` +- New anonymous field `TriggerClassification` in struct `TriggersClientGetResponse` +- New field `Kind` in struct `Order` +- New field `ResumeToken` in struct `UsersClientBeginCreateOrUpdateOptions` +- New anonymous field `DiagnosticRemoteSupportSettings` in struct `DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse` +- New anonymous field `UploadCertificateResponse` in struct `DevicesClientUploadCertificateResponse` +- New anonymous field `Share` in struct `SharesClientCreateOrUpdateResponse` +- New anonymous field `StorageAccountCredentialList` in struct `StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse` +- New anonymous field `Order` in struct `OrdersClientGetResponse` +- New anonymous field `BandwidthSchedulesList` in struct `BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse` +- New anonymous field `NodeList` in struct `NodesClientListByDataBoxEdgeDeviceResponse` +- New anonymous field `DiagnosticProactiveLogCollectionSettings` in struct `DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse` +- New anonymous field `StorageAccountCredential` in struct `StorageAccountCredentialsClientGetResponse` +- New field `ResumeToken` in struct `SharesClientBeginDeleteOptions` +- New anonymous field `DiagnosticRemoteSupportSettings` in struct `DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResponse` +- New anonymous field `StorageAccount` in struct `StorageAccountsClientGetResponse` +- New field `ResumeToken` in struct `AddonsClientBeginCreateOrUpdateOptions` +- New field `ResumeToken` in struct `OrdersClientBeginCreateOrUpdateOptions` +- New anonymous field `TriggerClassification` in struct `TriggersClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `ContainersClientBeginRefreshOptions` +- New field `ResumeToken` in struct `StorageAccountCredentialsClientBeginDeleteOptions` +- New anonymous field `BandwidthSchedule` in struct `BandwidthSchedulesClientGetResponse` +- New field `ResumeToken` in struct `DevicesClientBeginInstallUpdatesOptions` +- New anonymous field `ShareList` in struct `SharesClientListByDataBoxEdgeDeviceResponse` +- New field `ResumeToken` in struct `OrdersClientBeginDeleteOptions` +- New anonymous field `MonitoringMetricConfiguration` in struct `MonitoringConfigClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `DiagnosticSettingsClientBeginUpdateDiagnosticRemoteSupportSettingsOptions` +- New anonymous field `Container` in struct `ContainersClientGetResponse` +- New field `ResumeToken` in struct `BandwidthSchedulesClientBeginDeleteOptions` +- New anonymous field `AddonClassification` in struct `AddonsClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `ContainersClientBeginDeleteOptions` +- New field `ResumeToken` in struct `TriggersClientBeginDeleteOptions` +- New anonymous field `RoleClassification` in struct `RolesClientGetResponse` +- New anonymous field `RoleList` in struct `RolesClientListByDataBoxEdgeDeviceResponse` +- New field `ResumeToken` in struct `DevicesClientBeginScanForUpdatesOptions` +- New anonymous field `DiagnosticProactiveLogCollectionSettings` in struct `DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResponse` +- New anonymous field `MonitoringMetricConfigurationList` in struct `MonitoringConfigClientListResponse` +- New field `ResumeToken` in struct `SharesClientBeginRefreshOptions` +- New field `ResumeToken` in struct `SupportPackagesClientBeginTriggerSupportPackageOptions` +- New anonymous field `AddonClassification` in struct `AddonsClientGetResponse` +- New anonymous field `AlertList` in struct `AlertsClientListByDataBoxEdgeDeviceResponse` +- New field `ResumeToken` in struct `TriggersClientBeginCreateOrUpdateOptions` +- New field `ResumeToken` in struct `AddonsClientBeginDeleteOptions` +- New field `SystemData` in struct `DeviceExtendedInfo` + + ## 0.2.1 (2022-02-22) ### Other Changes diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/autorest.md b/sdk/resourcemanager/databoxedge/armdataboxedge/autorest.md index 10cc1ca05de9..be321a89315a 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/autorest.md +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/cf47fa91b882618a1043e3aeb5803b3a7397cd08/specification/databoxedge/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/cf47fa91b882618a1043e3aeb5803b3a7397cd08/specification/databoxedge/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/databoxedge/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/databoxedge/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.2.1 +module-version: 0.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/go.mod b/sdk/resourcemanager/databoxedge/armdataboxedge/go.mod index 94aa766d5327..dcdbc15d5b00 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/go.mod +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/go.mod @@ -1,8 +1,11 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge -go 1.16 +go 1.18 + +require github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 + github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect + golang.org/x/text v0.3.6 // indirect ) diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/go.sum b/sdk/resourcemanager/databoxedge/armdataboxedge/go.sum index 2ce51d3b8174..a7eaa30576c1 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/go.sum +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/go.sum @@ -1,26 +1,11 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -28,32 +13,20 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_addons_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_addons_client_test.go deleted file mode 100644 index 7e463d88465e..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_addons_client_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/RoleListAddOns.json -func ExampleAddonsClient_ListByRole() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewAddonsClient("", cred, nil) - pager := client.ListByRole("", - "", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/GetAddons.json -func ExampleAddonsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewAddonsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AddonsClientGetResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/PutAddons.json -func ExampleAddonsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewAddonsClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - "", - &armdataboxedge.ArcAddon{ - Kind: armdataboxedge.AddonType("ArcForKubernetes").ToPtr(), - Properties: &armdataboxedge.ArcAddonProperties{ - ResourceGroupName: to.StringPtr(""), - ResourceLocation: to.StringPtr(""), - ResourceName: to.StringPtr(""), - SubscriptionID: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AddonsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/DeleteAddons.json -func ExampleAddonsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewAddonsClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_alerts_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_alerts_client_test.go deleted file mode 100644 index e1423e7c162a..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_alerts_client_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/AlertGetAllInDevice.json -func ExampleAlertsClient_ListByDataBoxEdgeDevice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewAlertsClient("", cred, nil) - pager := client.ListByDataBoxEdgeDevice("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/AlertGet.json -func ExampleAlertsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewAlertsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AlertsClientGetResult) -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_availableskus_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_availableskus_client_test.go deleted file mode 100644 index b4c14b63161d..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_availableskus_client_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/AvailableSkusList.json -func ExampleAvailableSKUsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewAvailableSKUsClient("", cred, nil) - pager := client.List(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_bandwidthschedules_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_bandwidthschedules_client_test.go deleted file mode 100644 index 899ef118c462..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_bandwidthschedules_client_test.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/BandwidthScheduleGetAllInDevice.json -func ExampleBandwidthSchedulesClient_ListByDataBoxEdgeDevice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewBandwidthSchedulesClient("", cred, nil) - pager := client.ListByDataBoxEdgeDevice("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/BandwidthScheduleGet.json -func ExampleBandwidthSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewBandwidthSchedulesClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.BandwidthSchedulesClientGetResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/BandwidthSchedulePut.json -func ExampleBandwidthSchedulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewBandwidthSchedulesClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armdataboxedge.BandwidthSchedule{ - Properties: &armdataboxedge.BandwidthScheduleProperties{ - Days: []*armdataboxedge.DayOfWeek{ - armdataboxedge.DayOfWeek("Sunday").ToPtr(), - armdataboxedge.DayOfWeek("Monday").ToPtr()}, - RateInMbps: to.Int32Ptr(100), - Start: to.StringPtr(""), - Stop: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.BandwidthSchedulesClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/BandwidthScheduleDelete.json -func ExampleBandwidthSchedulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewBandwidthSchedulesClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_containers_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_containers_client_test.go deleted file mode 100644 index de751ce1f8d4..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_containers_client_test.go +++ /dev/null @@ -1,140 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/ContainerListAllInDevice.json -func ExampleContainersClient_ListByStorageAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewContainersClient("", cred, nil) - pager := client.ListByStorageAccount("", - "", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/ContainerGet.json -func ExampleContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewContainersClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ContainersClientGetResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/ContainerPut.json -func ExampleContainersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewContainersClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - "", - armdataboxedge.Container{ - Properties: &armdataboxedge.ContainerProperties{ - DataFormat: armdataboxedge.AzureContainerDataFormat("BlockBlob").ToPtr(), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ContainersClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/ContainerDelete.json -func ExampleContainersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewContainersClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/ContainerRefresh.json -func ExampleContainersClient_BeginRefresh() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewContainersClient("", cred, nil) - poller, err := client.BeginRefresh(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_devices_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_devices_client_test.go deleted file mode 100644 index 8bd787fc9713..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_devices_client_test.go +++ /dev/null @@ -1,366 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/DataBoxEdgeDeviceGetBySubscription.json -func ExampleDevicesClient_ListBySubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - pager := client.ListBySubscription(&armdataboxedge.DevicesClientListBySubscriptionOptions{Expand: nil}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/DataBoxEdgeDeviceGetByResourceGroup.json -func ExampleDevicesClient_ListByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - pager := client.ListByResourceGroup("", - &armdataboxedge.DevicesClientListByResourceGroupOptions{Expand: nil}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/DataBoxEdgeDeviceGetByName.json -func ExampleDevicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DevicesClientGetResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/DataBoxEdgeDevicePut.json -func ExampleDevicesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "", - "", - armdataboxedge.Device{ - Location: to.StringPtr(""), - SKU: &armdataboxedge.SKUInfo{ - Name: armdataboxedge.SKUName("Edge").ToPtr(), - Tier: armdataboxedge.SKUTier("Standard").ToPtr(), - }, - Tags: map[string]*string{}, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DevicesClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/DataBoxEdgeDeviceDelete.json -func ExampleDevicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/DataBoxEdgeDevicePatch.json -func ExampleDevicesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - res, err := client.Update(ctx, - "", - "", - armdataboxedge.DevicePatch{ - Properties: &armdataboxedge.DevicePropertiesPatch{ - EdgeProfile: &armdataboxedge.EdgeProfilePatch{ - Subscription: &armdataboxedge.EdgeProfileSubscriptionPatch{ - ID: to.StringPtr(""), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DevicesClientUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/DownloadUpdatesPost.json -func ExampleDevicesClient_BeginDownloadUpdates() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - poller, err := client.BeginDownloadUpdates(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/GenerateCertificate.json -func ExampleDevicesClient_GenerateCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - res, err := client.GenerateCertificate(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DevicesClientGenerateCertificateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/ExtendedInfoPost.json -func ExampleDevicesClient_GetExtendedInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - res, err := client.GetExtendedInformation(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DevicesClientGetExtendedInformationResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/InstallUpdatesPost.json -func ExampleDevicesClient_BeginInstallUpdates() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - poller, err := client.BeginInstallUpdates(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/NetworkSettingsGet.json -func ExampleDevicesClient_GetNetworkSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - res, err := client.GetNetworkSettings(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DevicesClientGetNetworkSettingsResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/ScanForUpdatesPost.json -func ExampleDevicesClient_BeginScanForUpdates() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - poller, err := client.BeginScanForUpdates(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/SecuritySettingsUpdatePost.json -func ExampleDevicesClient_BeginCreateOrUpdateSecuritySettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - poller, err := client.BeginCreateOrUpdateSecuritySettings(ctx, - "", - "", - armdataboxedge.SecuritySettings{ - Properties: &armdataboxedge.SecuritySettingsProperties{ - DeviceAdminPassword: &armdataboxedge.AsymmetricEncryptedSecret{ - EncryptionAlgorithm: armdataboxedge.EncryptionAlgorithm("AES256").ToPtr(), - EncryptionCertThumbprint: to.StringPtr(""), - Value: to.StringPtr(""), - }, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/GetUpdateExtendedInfo.json -func ExampleDevicesClient_UpdateExtendedInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - res, err := client.UpdateExtendedInformation(ctx, - "", - "", - armdataboxedge.DeviceExtendedInfoPatch{}, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DevicesClientUpdateExtendedInformationResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/UpdateSummaryGet.json -func ExampleDevicesClient_GetUpdateSummary() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - res, err := client.GetUpdateSummary(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DevicesClientGetUpdateSummaryResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/UploadCertificatePost.json -func ExampleDevicesClient_UploadCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDevicesClient("", cred, nil) - res, err := client.UploadCertificate(ctx, - "", - "", - armdataboxedge.UploadCertificateRequest{ - Properties: &armdataboxedge.RawCertificateData{ - Certificate: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DevicesClientUploadCertificateResult) -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_diagnosticsettings_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_diagnosticsettings_client_test.go deleted file mode 100644 index cc6b56403082..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_diagnosticsettings_client_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/GetDiagnosticProactiveLogCollectionSettings.json -func ExampleDiagnosticSettingsClient_GetDiagnosticProactiveLogCollectionSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDiagnosticSettingsClient("", cred, nil) - res, err := client.GetDiagnosticProactiveLogCollectionSettings(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/UpdateDiagnosticProactiveLogCollectionSettings.json -func ExampleDiagnosticSettingsClient_BeginUpdateDiagnosticProactiveLogCollectionSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDiagnosticSettingsClient("", cred, nil) - poller, err := client.BeginUpdateDiagnosticProactiveLogCollectionSettings(ctx, - "", - "", - armdataboxedge.DiagnosticProactiveLogCollectionSettings{ - Properties: &armdataboxedge.ProactiveLogCollectionSettingsProperties{ - UserConsent: armdataboxedge.ProactiveDiagnosticsConsent("Enabled").ToPtr(), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/GetDiagnosticRemoteSupportSettings.json -func ExampleDiagnosticSettingsClient_GetDiagnosticRemoteSupportSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDiagnosticSettingsClient("", cred, nil) - res, err := client.GetDiagnosticRemoteSupportSettings(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/UpdateDiagnosticRemoteSupportSettings.json -func ExampleDiagnosticSettingsClient_BeginUpdateDiagnosticRemoteSupportSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewDiagnosticSettingsClient("", cred, nil) - poller, err := client.BeginUpdateDiagnosticRemoteSupportSettings(ctx, - "", - "", - armdataboxedge.DiagnosticRemoteSupportSettings{ - Properties: &armdataboxedge.DiagnosticRemoteSupportSettingsProperties{ - RemoteSupportSettingsList: []*armdataboxedge.RemoteSupportSettings{ - { - AccessLevel: armdataboxedge.AccessLevel("ReadWrite").ToPtr(), - ExpirationTimeStampInUTC: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-07T00:00:00+00:00"); return t }()), - RemoteApplicationType: armdataboxedge.RemoteApplicationType("Powershell").ToPtr(), - }}, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResult) -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_jobs_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_jobs_client_test.go deleted file mode 100644 index 01a948aa2aeb..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_jobs_client_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/JobsGet.json -func ExampleJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewJobsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.JobsClientGetResult) -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_monitoringconfig_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_monitoringconfig_client_test.go deleted file mode 100644 index 68c876d1654f..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_monitoringconfig_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/ListMonitoringConfig.json -func ExampleMonitoringConfigClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewMonitoringConfigClient("", cred, nil) - pager := client.List("", - "", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/GetMonitoringConfig.json -func ExampleMonitoringConfigClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewMonitoringConfigClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.MonitoringConfigClientGetResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/PutMonitoringConfig.json -func ExampleMonitoringConfigClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewMonitoringConfigClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armdataboxedge.MonitoringMetricConfiguration{ - Properties: &armdataboxedge.MonitoringMetricConfigurationProperties{ - MetricConfigurations: []*armdataboxedge.MetricConfiguration{ - { - CounterSets: []*armdataboxedge.MetricCounterSet{ - { - Counters: []*armdataboxedge.MetricCounter{ - { - Name: to.StringPtr(""), - }}, - }}, - MdmAccount: to.StringPtr(""), - MetricNameSpace: to.StringPtr(""), - ResourceID: to.StringPtr(""), - }}, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.MonitoringConfigClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/DeleteMonitoringConfig.json -func ExampleMonitoringConfigClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewMonitoringConfigClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_nodes_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_nodes_client_test.go deleted file mode 100644 index 98d81d5bebb0..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_nodes_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/NodeGetAllInDevice.json -func ExampleNodesClient_ListByDataBoxEdgeDevice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewNodesClient("", cred, nil) - pager := client.ListByDataBoxEdgeDevice("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_operations_client_test.go deleted file mode 100644 index 2333ffd99895..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/OperationsGet.json -func ExampleOperationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewOperationsClient(cred, nil) - pager := client.List(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_operationsstatus_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_operationsstatus_client_test.go deleted file mode 100644 index 73465eff4821..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_operationsstatus_client_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/OperationsStatusGet.json -func ExampleOperationsStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewOperationsStatusClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.OperationsStatusClientGetResult) -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_orders_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_orders_client_test.go deleted file mode 100644 index 423ffef92ef9..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_orders_client_test.go +++ /dev/null @@ -1,144 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/OrderGetAllInDevice.json -func ExampleOrdersClient_ListByDataBoxEdgeDevice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewOrdersClient("", cred, nil) - pager := client.ListByDataBoxEdgeDevice("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/OrderGet.json -func ExampleOrdersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewOrdersClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.OrdersClientGetResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/OrderPut.json -func ExampleOrdersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewOrdersClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - armdataboxedge.Order{ - Properties: &armdataboxedge.OrderProperties{ - ContactInformation: &armdataboxedge.ContactDetails{ - CompanyName: to.StringPtr(""), - ContactPerson: to.StringPtr(""), - EmailList: []*string{ - to.StringPtr("john@microsoft.com")}, - Phone: to.StringPtr(""), - }, - ShippingAddress: &armdataboxedge.Address{ - AddressLine1: to.StringPtr(""), - AddressLine2: to.StringPtr(""), - AddressLine3: to.StringPtr(""), - City: to.StringPtr(""), - Country: to.StringPtr(""), - PostalCode: to.StringPtr(""), - State: to.StringPtr(""), - }, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.OrdersClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/OrderDelete.json -func ExampleOrdersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewOrdersClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/GetDCAccessCode.json -func ExampleOrdersClient_ListDCAccessCode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewOrdersClient("", cred, nil) - res, err := client.ListDCAccessCode(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.OrdersClientListDCAccessCodeResult) -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_roles_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_roles_client_test.go deleted file mode 100644 index 8b0f9f83da91..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_roles_client_test.go +++ /dev/null @@ -1,143 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/RoleGetAllInDevice.json -func ExampleRolesClient_ListByDataBoxEdgeDevice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewRolesClient("", cred, nil) - pager := client.ListByDataBoxEdgeDevice("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/RoleGet.json -func ExampleRolesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewRolesClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.RolesClientGetResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/RolePut.json -func ExampleRolesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewRolesClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - &armdataboxedge.IoTRole{ - Kind: armdataboxedge.RoleTypes("IOT").ToPtr(), - Properties: &armdataboxedge.IoTRoleProperties{ - HostPlatform: armdataboxedge.PlatformType("Linux").ToPtr(), - IoTDeviceDetails: &armdataboxedge.IoTDeviceInfo{ - Authentication: &armdataboxedge.Authentication{ - SymmetricKey: &armdataboxedge.SymmetricKey{ - ConnectionString: &armdataboxedge.AsymmetricEncryptedSecret{ - EncryptionAlgorithm: armdataboxedge.EncryptionAlgorithm("AES256").ToPtr(), - EncryptionCertThumbprint: to.StringPtr(""), - Value: to.StringPtr(""), - }, - }, - }, - DeviceID: to.StringPtr(""), - IoTHostHub: to.StringPtr(""), - }, - IoTEdgeDeviceDetails: &armdataboxedge.IoTDeviceInfo{ - Authentication: &armdataboxedge.Authentication{ - SymmetricKey: &armdataboxedge.SymmetricKey{ - ConnectionString: &armdataboxedge.AsymmetricEncryptedSecret{ - EncryptionAlgorithm: armdataboxedge.EncryptionAlgorithm("AES256").ToPtr(), - EncryptionCertThumbprint: to.StringPtr(""), - Value: to.StringPtr(""), - }, - }, - }, - DeviceID: to.StringPtr(""), - IoTHostHub: to.StringPtr(""), - }, - RoleStatus: armdataboxedge.RoleStatus("Enabled").ToPtr(), - ShareMappings: []*armdataboxedge.MountPointMap{}, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.RolesClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/RoleDelete.json -func ExampleRolesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewRolesClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_shares_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_shares_client_test.go deleted file mode 100644 index c3780cb7a83e..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_shares_client_test.go +++ /dev/null @@ -1,150 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/ShareGetAllInDevice.json -func ExampleSharesClient_ListByDataBoxEdgeDevice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewSharesClient("", cred, nil) - pager := client.ListByDataBoxEdgeDevice("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/ShareGet.json -func ExampleSharesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewSharesClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.SharesClientGetResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/SharePut.json -func ExampleSharesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewSharesClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armdataboxedge.Share{ - Properties: &armdataboxedge.ShareProperties{ - Description: to.StringPtr(""), - AccessProtocol: armdataboxedge.ShareAccessProtocol("SMB").ToPtr(), - AzureContainerInfo: &armdataboxedge.AzureContainerInfo{ - ContainerName: to.StringPtr(""), - DataFormat: armdataboxedge.AzureContainerDataFormat("BlockBlob").ToPtr(), - StorageAccountCredentialID: to.StringPtr(""), - }, - DataPolicy: armdataboxedge.DataPolicy("Cloud").ToPtr(), - MonitoringStatus: armdataboxedge.MonitoringStatus("Enabled").ToPtr(), - ShareStatus: armdataboxedge.ShareStatus("Online").ToPtr(), - UserAccessRights: []*armdataboxedge.UserAccessRight{ - { - AccessType: armdataboxedge.ShareAccessType("Change").ToPtr(), - UserID: to.StringPtr(""), - }}, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.SharesClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/ShareDelete.json -func ExampleSharesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewSharesClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/ShareRefreshPost.json -func ExampleSharesClient_BeginRefresh() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewSharesClient("", cred, nil) - poller, err := client.BeginRefresh(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_storageaccountcredentials_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_storageaccountcredentials_client_test.go deleted file mode 100644 index e7d1bb31e118..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_storageaccountcredentials_client_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/SACGetAllInDevice.json -func ExampleStorageAccountCredentialsClient_ListByDataBoxEdgeDevice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewStorageAccountCredentialsClient("", cred, nil) - pager := client.ListByDataBoxEdgeDevice("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/SACGet.json -func ExampleStorageAccountCredentialsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewStorageAccountCredentialsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.StorageAccountCredentialsClientGetResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/SACPut.json -func ExampleStorageAccountCredentialsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewStorageAccountCredentialsClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armdataboxedge.StorageAccountCredential{ - Properties: &armdataboxedge.StorageAccountCredentialProperties{ - AccountKey: &armdataboxedge.AsymmetricEncryptedSecret{ - EncryptionAlgorithm: armdataboxedge.EncryptionAlgorithm("AES256").ToPtr(), - EncryptionCertThumbprint: to.StringPtr(""), - Value: to.StringPtr(""), - }, - AccountType: armdataboxedge.AccountType("BlobStorage").ToPtr(), - Alias: to.StringPtr(""), - SSLStatus: armdataboxedge.SSLStatus("Disabled").ToPtr(), - UserName: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.StorageAccountCredentialsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/SACDelete.json -func ExampleStorageAccountCredentialsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewStorageAccountCredentialsClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_storageaccounts_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_storageaccounts_client_test.go deleted file mode 100644 index 64baee584b29..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_storageaccounts_client_test.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/StorageAccountGetAllInDevice.json -func ExampleStorageAccountsClient_ListByDataBoxEdgeDevice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewStorageAccountsClient("", cred, nil) - pager := client.ListByDataBoxEdgeDevice("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/StorageAccountGet.json -func ExampleStorageAccountsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewStorageAccountsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.StorageAccountsClientGetResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/StorageAccountPut.json -func ExampleStorageAccountsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewStorageAccountsClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armdataboxedge.StorageAccount{ - Properties: &armdataboxedge.StorageAccountProperties{ - Description: to.StringPtr(""), - DataPolicy: armdataboxedge.DataPolicy("Cloud").ToPtr(), - StorageAccountCredentialID: to.StringPtr(""), - StorageAccountStatus: armdataboxedge.StorageAccountStatus("OK").ToPtr(), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.StorageAccountsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/StorageAccountDelete.json -func ExampleStorageAccountsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewStorageAccountsClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_supportpackages_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_supportpackages_client_test.go deleted file mode 100644 index c3b55ef8a19b..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_supportpackages_client_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/TriggerSupportPackage.json -func ExampleSupportPackagesClient_BeginTriggerSupportPackage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewSupportPackagesClient("", cred, nil) - poller, err := client.BeginTriggerSupportPackage(ctx, - "", - "", - armdataboxedge.TriggerSupportPackageRequest{ - Properties: &armdataboxedge.SupportPackageRequestProperties{ - Include: to.StringPtr(""), - MaximumTimeStamp: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-18T02:19:51.4270267Z"); return t }()), - MinimumTimeStamp: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-18T02:18:51.4270267Z"); return t }()), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_triggers_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_triggers_client_test.go deleted file mode 100644 index a4273de92bad..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_triggers_client_test.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/TriggerGetAllInDevice.json -func ExampleTriggersClient_ListByDataBoxEdgeDevice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewTriggersClient("", cred, nil) - pager := client.ListByDataBoxEdgeDevice("", - "", - &armdataboxedge.TriggersClientListByDataBoxEdgeDeviceOptions{Filter: nil}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/TriggerGet.json -func ExampleTriggersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewTriggersClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.TriggersClientGetResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/TriggerPut.json -func ExampleTriggersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewTriggersClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - &armdataboxedge.FileEventTrigger{ - Kind: armdataboxedge.TriggerEventType("FileEvent").ToPtr(), - Properties: &armdataboxedge.FileTriggerProperties{ - CustomContextTag: to.StringPtr(""), - SinkInfo: &armdataboxedge.RoleSinkInfo{ - RoleID: to.StringPtr(""), - }, - SourceInfo: &armdataboxedge.FileSourceInfo{ - ShareID: to.StringPtr(""), - }, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.TriggersClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/TriggerDelete.json -func ExampleTriggersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewTriggersClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_users_client_test.go b/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_users_client_test.go deleted file mode 100644 index 06922231505d..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/ze_generated_example_users_client_test.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databoxedge/armdataboxedge" -) - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/UserGetAllInDevice.json -func ExampleUsersClient_ListByDataBoxEdgeDevice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewUsersClient("", cred, nil) - pager := client.ListByDataBoxEdgeDevice("", - "", - &armdataboxedge.UsersClientListByDataBoxEdgeDeviceOptions{Filter: nil}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/UserGet.json -func ExampleUsersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewUsersClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.UsersClientGetResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/UserPut.json -func ExampleUsersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewUsersClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armdataboxedge.User{ - Properties: &armdataboxedge.UserProperties{ - EncryptedPassword: &armdataboxedge.AsymmetricEncryptedSecret{ - EncryptionAlgorithm: armdataboxedge.EncryptionAlgorithm("None").ToPtr(), - EncryptionCertThumbprint: to.StringPtr(""), - Value: to.StringPtr(""), - }, - UserType: armdataboxedge.UserType("Share").ToPtr(), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.UsersClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2021-06-01/examples/UserDelete.json -func ExampleUsersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armdataboxedge.NewUsersClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_addons_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_addons_client.go index 8551db0f9eb5..49103b9f2a1e 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_addons_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_addons_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type AddonsClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewAddonsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AddonsClient { +func NewAddonsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AddonsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &AddonsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Create or update a addon. @@ -58,22 +63,16 @@ func NewAddonsClient(subscriptionID string, credential azcore.TokenCredential, o // addon - The addon properties. // options - AddonsClientBeginCreateOrUpdateOptions contains the optional parameters for the AddonsClient.BeginCreateOrUpdate // method. -func (client *AddonsClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, roleName string, addonName string, resourceGroupName string, addon AddonClassification, options *AddonsClientBeginCreateOrUpdateOptions) (AddonsClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, deviceName, roleName, addonName, resourceGroupName, addon, options) - if err != nil { - return AddonsClientCreateOrUpdatePollerResponse{}, err - } - result := AddonsClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("AddonsClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return AddonsClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &AddonsClientCreateOrUpdatePoller{ - pt: pt, +func (client *AddonsClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, roleName string, addonName string, resourceGroupName string, addon AddonClassification, options *AddonsClientBeginCreateOrUpdateOptions) (*armruntime.Poller[AddonsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, deviceName, roleName, addonName, resourceGroupName, addon, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[AddonsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[AddonsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // CreateOrUpdate - Create or update a addon. @@ -121,7 +120,7 @@ func (client *AddonsClient) createOrUpdateCreateRequest(ctx context.Context, dev return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, addon) @@ -134,22 +133,16 @@ func (client *AddonsClient) createOrUpdateCreateRequest(ctx context.Context, dev // addonName - The addon name. // resourceGroupName - The resource group name. // options - AddonsClientBeginDeleteOptions contains the optional parameters for the AddonsClient.BeginDelete method. -func (client *AddonsClient) BeginDelete(ctx context.Context, deviceName string, roleName string, addonName string, resourceGroupName string, options *AddonsClientBeginDeleteOptions) (AddonsClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, deviceName, roleName, addonName, resourceGroupName, options) - if err != nil { - return AddonsClientDeletePollerResponse{}, err - } - result := AddonsClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("AddonsClient.Delete", "", resp, client.pl) - if err != nil { - return AddonsClientDeletePollerResponse{}, err - } - result.Poller = &AddonsClientDeletePoller{ - pt: pt, +func (client *AddonsClient) BeginDelete(ctx context.Context, deviceName string, roleName string, addonName string, resourceGroupName string, options *AddonsClientBeginDeleteOptions) (*armruntime.Poller[AddonsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, deviceName, roleName, addonName, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[AddonsClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[AddonsClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - Deletes the addon on the device. @@ -197,7 +190,7 @@ func (client *AddonsClient) deleteCreateRequest(ctx context.Context, deviceName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -253,7 +246,7 @@ func (client *AddonsClient) getCreateRequest(ctx context.Context, deviceName str return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -261,7 +254,7 @@ func (client *AddonsClient) getCreateRequest(ctx context.Context, deviceName str // getHandleResponse handles the Get response. func (client *AddonsClient) getHandleResponse(resp *http.Response) (AddonsClientGetResponse, error) { - result := AddonsClientGetResponse{RawResponse: resp} + result := AddonsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return AddonsClientGetResponse{}, err } @@ -274,16 +267,32 @@ func (client *AddonsClient) getHandleResponse(resp *http.Response) (AddonsClient // roleName - The role name. // resourceGroupName - The resource group name. // options - AddonsClientListByRoleOptions contains the optional parameters for the AddonsClient.ListByRole method. -func (client *AddonsClient) ListByRole(deviceName string, roleName string, resourceGroupName string, options *AddonsClientListByRoleOptions) *AddonsClientListByRolePager { - return &AddonsClientListByRolePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByRoleCreateRequest(ctx, deviceName, roleName, resourceGroupName, options) +func (client *AddonsClient) ListByRole(deviceName string, roleName string, resourceGroupName string, options *AddonsClientListByRoleOptions) *runtime.Pager[AddonsClientListByRoleResponse] { + return runtime.NewPager(runtime.PageProcessor[AddonsClientListByRoleResponse]{ + More: func(page AddonsClientListByRoleResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AddonsClientListByRoleResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AddonList.NextLink) + Fetcher: func(ctx context.Context, page *AddonsClientListByRoleResponse) (AddonsClientListByRoleResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByRoleCreateRequest(ctx, deviceName, roleName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AddonsClientListByRoleResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AddonsClientListByRoleResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AddonsClientListByRoleResponse{}, runtime.NewResponseError(resp) + } + return client.listByRoleHandleResponse(resp) }, - } + }) } // listByRoleCreateRequest creates the ListByRole request. @@ -310,7 +319,7 @@ func (client *AddonsClient) listByRoleCreateRequest(ctx context.Context, deviceN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -318,7 +327,7 @@ func (client *AddonsClient) listByRoleCreateRequest(ctx context.Context, deviceN // listByRoleHandleResponse handles the ListByRole response. func (client *AddonsClient) listByRoleHandleResponse(resp *http.Response) (AddonsClientListByRoleResponse, error) { - result := AddonsClientListByRoleResponse{RawResponse: resp} + result := AddonsClientListByRoleResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AddonList); err != nil { return AddonsClientListByRoleResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_alerts_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_alerts_client.go index 0540e6827a8e..075dec43aa93 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_alerts_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_alerts_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type AlertsClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewAlertsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AlertsClient { +func NewAlertsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &AlertsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Get - Gets an alert by name. @@ -94,7 +99,7 @@ func (client *AlertsClient) getCreateRequest(ctx context.Context, deviceName str return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -102,7 +107,7 @@ func (client *AlertsClient) getCreateRequest(ctx context.Context, deviceName str // getHandleResponse handles the Get response. func (client *AlertsClient) getHandleResponse(resp *http.Response) (AlertsClientGetResponse, error) { - result := AlertsClientGetResponse{RawResponse: resp} + result := AlertsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Alert); err != nil { return AlertsClientGetResponse{}, err } @@ -115,16 +120,32 @@ func (client *AlertsClient) getHandleResponse(resp *http.Response) (AlertsClient // resourceGroupName - The resource group name. // options - AlertsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the AlertsClient.ListByDataBoxEdgeDevice // method. -func (client *AlertsClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *AlertsClientListByDataBoxEdgeDeviceOptions) *AlertsClientListByDataBoxEdgeDevicePager { - return &AlertsClientListByDataBoxEdgeDevicePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) +func (client *AlertsClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *AlertsClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[AlertsClientListByDataBoxEdgeDeviceResponse] { + return runtime.NewPager(runtime.PageProcessor[AlertsClientListByDataBoxEdgeDeviceResponse]{ + More: func(page AlertsClientListByDataBoxEdgeDeviceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AlertsClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AlertList.NextLink) + Fetcher: func(ctx context.Context, page *AlertsClientListByDataBoxEdgeDeviceResponse) (AlertsClientListByDataBoxEdgeDeviceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AlertsClientListByDataBoxEdgeDeviceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AlertsClientListByDataBoxEdgeDeviceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AlertsClientListByDataBoxEdgeDeviceResponse{}, runtime.NewResponseError(resp) + } + return client.listByDataBoxEdgeDeviceHandleResponse(resp) }, - } + }) } // listByDataBoxEdgeDeviceCreateRequest creates the ListByDataBoxEdgeDevice request. @@ -147,7 +168,7 @@ func (client *AlertsClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -155,7 +176,7 @@ func (client *AlertsClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.Con // listByDataBoxEdgeDeviceHandleResponse handles the ListByDataBoxEdgeDevice response. func (client *AlertsClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Response) (AlertsClientListByDataBoxEdgeDeviceResponse, error) { - result := AlertsClientListByDataBoxEdgeDeviceResponse{RawResponse: resp} + result := AlertsClientListByDataBoxEdgeDeviceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AlertList); err != nil { return AlertsClientListByDataBoxEdgeDeviceResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_availableskus_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_availableskus_client.go index 601d3f684bc0..5e0f807fc3f0 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_availableskus_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_availableskus_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,35 +34,55 @@ type AvailableSKUsClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewAvailableSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AvailableSKUsClient { +func NewAvailableSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableSKUsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &AvailableSKUsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // List - List all the available Skus and information related to them. // If the operation fails it returns an *azcore.ResponseError type. // options - AvailableSKUsClientListOptions contains the optional parameters for the AvailableSKUsClient.List method. -func (client *AvailableSKUsClient) List(options *AvailableSKUsClientListOptions) *AvailableSKUsClientListPager { - return &AvailableSKUsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) +func (client *AvailableSKUsClient) List(options *AvailableSKUsClientListOptions) *runtime.Pager[AvailableSKUsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[AvailableSKUsClientListResponse]{ + More: func(page AvailableSKUsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AvailableSKUsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.SKUList.NextLink) + Fetcher: func(ctx context.Context, page *AvailableSKUsClientListResponse) (AvailableSKUsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AvailableSKUsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AvailableSKUsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AvailableSKUsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -76,7 +97,7 @@ func (client *AvailableSKUsClient) listCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -84,7 +105,7 @@ func (client *AvailableSKUsClient) listCreateRequest(ctx context.Context, option // listHandleResponse handles the List response. func (client *AvailableSKUsClient) listHandleResponse(resp *http.Response) (AvailableSKUsClientListResponse, error) { - result := AvailableSKUsClientListResponse{RawResponse: resp} + result := AvailableSKUsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SKUList); err != nil { return AvailableSKUsClientListResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_bandwidthschedules_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_bandwidthschedules_client.go index 7475b07c2b78..8950bb735766 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_bandwidthschedules_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_bandwidthschedules_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type BandwidthSchedulesClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewBandwidthSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *BandwidthSchedulesClient { +func NewBandwidthSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BandwidthSchedulesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &BandwidthSchedulesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Creates or updates a bandwidth schedule. @@ -57,22 +62,16 @@ func NewBandwidthSchedulesClient(subscriptionID string, credential azcore.TokenC // parameters - The bandwidth schedule to be added or updated. // options - BandwidthSchedulesClientBeginCreateOrUpdateOptions contains the optional parameters for the BandwidthSchedulesClient.BeginCreateOrUpdate // method. -func (client *BandwidthSchedulesClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, parameters BandwidthSchedule, options *BandwidthSchedulesClientBeginCreateOrUpdateOptions) (BandwidthSchedulesClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, parameters, options) - if err != nil { - return BandwidthSchedulesClientCreateOrUpdatePollerResponse{}, err - } - result := BandwidthSchedulesClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("BandwidthSchedulesClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return BandwidthSchedulesClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &BandwidthSchedulesClientCreateOrUpdatePoller{ - pt: pt, +func (client *BandwidthSchedulesClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, parameters BandwidthSchedule, options *BandwidthSchedulesClientBeginCreateOrUpdateOptions) (*armruntime.Poller[BandwidthSchedulesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, parameters, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[BandwidthSchedulesClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[BandwidthSchedulesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // CreateOrUpdate - Creates or updates a bandwidth schedule. @@ -116,7 +115,7 @@ func (client *BandwidthSchedulesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -129,22 +128,16 @@ func (client *BandwidthSchedulesClient) createOrUpdateCreateRequest(ctx context. // resourceGroupName - The resource group name. // options - BandwidthSchedulesClientBeginDeleteOptions contains the optional parameters for the BandwidthSchedulesClient.BeginDelete // method. -func (client *BandwidthSchedulesClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *BandwidthSchedulesClientBeginDeleteOptions) (BandwidthSchedulesClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) - if err != nil { - return BandwidthSchedulesClientDeletePollerResponse{}, err - } - result := BandwidthSchedulesClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("BandwidthSchedulesClient.Delete", "", resp, client.pl) - if err != nil { - return BandwidthSchedulesClientDeletePollerResponse{}, err - } - result.Poller = &BandwidthSchedulesClientDeletePoller{ - pt: pt, +func (client *BandwidthSchedulesClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *BandwidthSchedulesClientBeginDeleteOptions) (*armruntime.Poller[BandwidthSchedulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[BandwidthSchedulesClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[BandwidthSchedulesClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - Deletes the specified bandwidth schedule. @@ -188,7 +181,7 @@ func (client *BandwidthSchedulesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -239,7 +232,7 @@ func (client *BandwidthSchedulesClient) getCreateRequest(ctx context.Context, de return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -247,7 +240,7 @@ func (client *BandwidthSchedulesClient) getCreateRequest(ctx context.Context, de // getHandleResponse handles the Get response. func (client *BandwidthSchedulesClient) getHandleResponse(resp *http.Response) (BandwidthSchedulesClientGetResponse, error) { - result := BandwidthSchedulesClientGetResponse{RawResponse: resp} + result := BandwidthSchedulesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.BandwidthSchedule); err != nil { return BandwidthSchedulesClientGetResponse{}, err } @@ -260,16 +253,32 @@ func (client *BandwidthSchedulesClient) getHandleResponse(resp *http.Response) ( // resourceGroupName - The resource group name. // options - BandwidthSchedulesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the BandwidthSchedulesClient.ListByDataBoxEdgeDevice // method. -func (client *BandwidthSchedulesClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *BandwidthSchedulesClientListByDataBoxEdgeDeviceOptions) *BandwidthSchedulesClientListByDataBoxEdgeDevicePager { - return &BandwidthSchedulesClientListByDataBoxEdgeDevicePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) +func (client *BandwidthSchedulesClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *BandwidthSchedulesClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse] { + return runtime.NewPager(runtime.PageProcessor[BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse]{ + More: func(page BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.BandwidthSchedulesList.NextLink) + Fetcher: func(ctx context.Context, page *BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse) (BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse{}, runtime.NewResponseError(resp) + } + return client.listByDataBoxEdgeDeviceHandleResponse(resp) }, - } + }) } // listByDataBoxEdgeDeviceCreateRequest creates the ListByDataBoxEdgeDevice request. @@ -292,7 +301,7 @@ func (client *BandwidthSchedulesClient) listByDataBoxEdgeDeviceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -300,7 +309,7 @@ func (client *BandwidthSchedulesClient) listByDataBoxEdgeDeviceCreateRequest(ctx // listByDataBoxEdgeDeviceHandleResponse handles the ListByDataBoxEdgeDevice response. func (client *BandwidthSchedulesClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Response) (BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse, error) { - result := BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse{RawResponse: resp} + result := BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.BandwidthSchedulesList); err != nil { return BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_constants.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_constants.go index 8ef6a8874190..cd86efdfef11 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_constants.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_constants.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -10,7 +10,7 @@ package armdataboxedge const ( moduleName = "armdataboxedge" - moduleVersion = "v0.2.1" + moduleVersion = "v0.3.0" ) // AccessLevel - Access level allowed for this remote application type @@ -33,11 +33,6 @@ func PossibleAccessLevelValues() []AccessLevel { } } -// ToPtr returns a *AccessLevel pointing to the current value. -func (c AccessLevel) ToPtr() *AccessLevel { - return &c -} - // AccountType - Type of storage accessed on the storage account. type AccountType string @@ -54,11 +49,6 @@ func PossibleAccountTypeValues() []AccountType { } } -// ToPtr returns a *AccountType pointing to the current value. -func (c AccountType) ToPtr() *AccountType { - return &c -} - // AddonState - Addon Provisioning State type AddonState string @@ -85,11 +75,6 @@ func PossibleAddonStateValues() []AddonState { } } -// ToPtr returns a *AddonState pointing to the current value. -func (c AddonState) ToPtr() *AddonState { - return &c -} - // AddonType - Addon type. type AddonType string @@ -106,11 +91,6 @@ func PossibleAddonTypeValues() []AddonType { } } -// ToPtr returns a *AddonType pointing to the current value. -func (c AddonType) ToPtr() *AddonType { - return &c -} - // AlertSeverity - Severity of the alert. type AlertSeverity string @@ -129,11 +109,6 @@ func PossibleAlertSeverityValues() []AlertSeverity { } } -// ToPtr returns a *AlertSeverity pointing to the current value. -func (c AlertSeverity) ToPtr() *AlertSeverity { - return &c -} - // AuthenticationType - The authentication type. type AuthenticationType string @@ -150,11 +125,6 @@ func PossibleAuthenticationTypeValues() []AuthenticationType { } } -// ToPtr returns a *AuthenticationType pointing to the current value. -func (c AuthenticationType) ToPtr() *AuthenticationType { - return &c -} - // AzureContainerDataFormat - Storage format used for the file represented by the share. type AzureContainerDataFormat string @@ -173,11 +143,6 @@ func PossibleAzureContainerDataFormatValues() []AzureContainerDataFormat { } } -// ToPtr returns a *AzureContainerDataFormat pointing to the current value. -func (c AzureContainerDataFormat) ToPtr() *AzureContainerDataFormat { - return &c -} - // ClientPermissionType - Type of access to be allowed for the client. type ClientPermissionType string @@ -196,9 +161,22 @@ func PossibleClientPermissionTypeValues() []ClientPermissionType { } } -// ToPtr returns a *ClientPermissionType pointing to the current value. -func (c ClientPermissionType) ToPtr() *ClientPermissionType { - return &c +// ClusterWitnessType - Cluster Witness Type +type ClusterWitnessType string + +const ( + ClusterWitnessTypeCloud ClusterWitnessType = "Cloud" + ClusterWitnessTypeFileShare ClusterWitnessType = "FileShare" + ClusterWitnessTypeNone ClusterWitnessType = "None" +) + +// PossibleClusterWitnessTypeValues returns the possible values for the ClusterWitnessType const type. +func PossibleClusterWitnessTypeValues() []ClusterWitnessType { + return []ClusterWitnessType{ + ClusterWitnessTypeCloud, + ClusterWitnessTypeFileShare, + ClusterWitnessTypeNone, + } } // ContainerStatus - Current status of the container. @@ -223,11 +201,6 @@ func PossibleContainerStatusValues() []ContainerStatus { } } -// ToPtr returns a *ContainerStatus pointing to the current value. -func (c ContainerStatus) ToPtr() *ContainerStatus { - return &c -} - // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -248,11 +221,6 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// ToPtr returns a *CreatedByType pointing to the current value. -func (c CreatedByType) ToPtr() *CreatedByType { - return &c -} - // DataBoxEdgeDeviceKind - The kind of the device. type DataBoxEdgeDeviceKind string @@ -273,11 +241,6 @@ func PossibleDataBoxEdgeDeviceKindValues() []DataBoxEdgeDeviceKind { } } -// ToPtr returns a *DataBoxEdgeDeviceKind pointing to the current value. -func (c DataBoxEdgeDeviceKind) ToPtr() *DataBoxEdgeDeviceKind { - return &c -} - // DataBoxEdgeDeviceStatus - The status of the Data Box Edge/Gateway device. type DataBoxEdgeDeviceStatus string @@ -304,11 +267,6 @@ func PossibleDataBoxEdgeDeviceStatusValues() []DataBoxEdgeDeviceStatus { } } -// ToPtr returns a *DataBoxEdgeDeviceStatus pointing to the current value. -func (c DataBoxEdgeDeviceStatus) ToPtr() *DataBoxEdgeDeviceStatus { - return &c -} - // DataPolicy - Data policy of the share. type DataPolicy string @@ -325,11 +283,6 @@ func PossibleDataPolicyValues() []DataPolicy { } } -// ToPtr returns a *DataPolicy pointing to the current value. -func (c DataPolicy) ToPtr() *DataPolicy { - return &c -} - // DataResidencyType - DataResidencyType enum type DataResidencyType string @@ -346,11 +299,6 @@ func PossibleDataResidencyTypeValues() []DataResidencyType { } } -// ToPtr returns a *DataResidencyType pointing to the current value. -func (c DataResidencyType) ToPtr() *DataResidencyType { - return &c -} - type DayOfWeek string const ( @@ -376,11 +324,6 @@ func PossibleDayOfWeekValues() []DayOfWeek { } } -// ToPtr returns a *DayOfWeek pointing to the current value. -func (c DayOfWeek) ToPtr() *DayOfWeek { - return &c -} - // DeviceType - The type of the Data Box Edge/Gateway device. type DeviceType string @@ -395,11 +338,6 @@ func PossibleDeviceTypeValues() []DeviceType { } } -// ToPtr returns a *DeviceType pointing to the current value. -func (c DeviceType) ToPtr() *DeviceType { - return &c -} - // DownloadPhase - The download phase. type DownloadPhase string @@ -420,11 +358,6 @@ func PossibleDownloadPhaseValues() []DownloadPhase { } } -// ToPtr returns a *DownloadPhase pointing to the current value. -func (c DownloadPhase) ToPtr() *DownloadPhase { - return &c -} - // EncryptionAlgorithm - The algorithm used to encrypt "Value". type EncryptionAlgorithm string @@ -443,11 +376,6 @@ func PossibleEncryptionAlgorithmValues() []EncryptionAlgorithm { } } -// ToPtr returns a *EncryptionAlgorithm pointing to the current value. -func (c EncryptionAlgorithm) ToPtr() *EncryptionAlgorithm { - return &c -} - // HostPlatformType - Platform where the runtime is hosted. type HostPlatformType string @@ -464,11 +392,6 @@ func PossibleHostPlatformTypeValues() []HostPlatformType { } } -// ToPtr returns a *HostPlatformType pointing to the current value. -func (c HostPlatformType) ToPtr() *HostPlatformType { - return &c -} - // InstallRebootBehavior - Indicates if updates are available and at least one of the updates needs a reboot. type InstallRebootBehavior string @@ -487,11 +410,6 @@ func PossibleInstallRebootBehaviorValues() []InstallRebootBehavior { } } -// ToPtr returns a *InstallRebootBehavior pointing to the current value. -func (c InstallRebootBehavior) ToPtr() *InstallRebootBehavior { - return &c -} - // InstallationImpact - Impact of Installing an updateType type InstallationImpact string @@ -510,11 +428,6 @@ func PossibleInstallationImpactValues() []InstallationImpact { } } -// ToPtr returns a *InstallationImpact pointing to the current value. -func (c InstallationImpact) ToPtr() *InstallationImpact { - return &c -} - // JobStatus - The current status of the job. type JobStatus string @@ -541,11 +454,6 @@ func PossibleJobStatusValues() []JobStatus { } } -// ToPtr returns a *JobStatus pointing to the current value. -func (c JobStatus) ToPtr() *JobStatus { - return &c -} - // JobType - The type of the job. type JobType string @@ -576,11 +484,6 @@ func PossibleJobTypeValues() []JobType { } } -// ToPtr returns a *JobType pointing to the current value. -func (c JobType) ToPtr() *JobType { - return &c -} - // KeyVaultSyncStatus - For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of // the status will not be applicable. type KeyVaultSyncStatus string @@ -606,11 +509,6 @@ func PossibleKeyVaultSyncStatusValues() []KeyVaultSyncStatus { } } -// ToPtr returns a *KeyVaultSyncStatus pointing to the current value. -func (c KeyVaultSyncStatus) ToPtr() *KeyVaultSyncStatus { - return &c -} - // KubernetesNodeType - Node type - Master/Worker type KubernetesNodeType string @@ -629,11 +527,6 @@ func PossibleKubernetesNodeTypeValues() []KubernetesNodeType { } } -// ToPtr returns a *KubernetesNodeType pointing to the current value. -func (c KubernetesNodeType) ToPtr() *KubernetesNodeType { - return &c -} - // KubernetesState - State of Kubernetes deployment type KubernetesState string @@ -660,11 +553,6 @@ func PossibleKubernetesStateValues() []KubernetesState { } } -// ToPtr returns a *KubernetesState pointing to the current value. -func (c KubernetesState) ToPtr() *KubernetesState { - return &c -} - // MetricAggregationType - Metric aggregation type. type MetricAggregationType string @@ -691,11 +579,6 @@ func PossibleMetricAggregationTypeValues() []MetricAggregationType { } } -// ToPtr returns a *MetricAggregationType pointing to the current value. -func (c MetricAggregationType) ToPtr() *MetricAggregationType { - return &c -} - // MetricCategory - Metric category. type MetricCategory string @@ -712,11 +595,6 @@ func PossibleMetricCategoryValues() []MetricCategory { } } -// ToPtr returns a *MetricCategory pointing to the current value. -func (c MetricCategory) ToPtr() *MetricCategory { - return &c -} - // MetricUnit - Metric units. type MetricUnit string @@ -745,11 +623,6 @@ func PossibleMetricUnitValues() []MetricUnit { } } -// ToPtr returns a *MetricUnit pointing to the current value. -func (c MetricUnit) ToPtr() *MetricUnit { - return &c -} - // MonitoringStatus - Current monitoring status of the share. type MonitoringStatus string @@ -766,11 +639,6 @@ func PossibleMonitoringStatusValues() []MonitoringStatus { } } -// ToPtr returns a *MonitoringStatus pointing to the current value. -func (c MonitoringStatus) ToPtr() *MonitoringStatus { - return &c -} - // MountType - Mounting type. type MountType string @@ -787,11 +655,6 @@ func PossibleMountTypeValues() []MountType { } } -// ToPtr returns a *MountType pointing to the current value. -func (c MountType) ToPtr() *MountType { - return &c -} - // MsiIdentityType - Identity type type MsiIdentityType string @@ -810,11 +673,6 @@ func PossibleMsiIdentityTypeValues() []MsiIdentityType { } } -// ToPtr returns a *MsiIdentityType pointing to the current value. -func (c MsiIdentityType) ToPtr() *MsiIdentityType { - return &c -} - // NetworkAdapterDHCPStatus - Value indicating whether this adapter has DHCP enabled. type NetworkAdapterDHCPStatus string @@ -831,11 +689,6 @@ func PossibleNetworkAdapterDHCPStatusValues() []NetworkAdapterDHCPStatus { } } -// ToPtr returns a *NetworkAdapterDHCPStatus pointing to the current value. -func (c NetworkAdapterDHCPStatus) ToPtr() *NetworkAdapterDHCPStatus { - return &c -} - // NetworkAdapterRDMAStatus - Value indicating whether this adapter is RDMA capable. type NetworkAdapterRDMAStatus string @@ -852,11 +705,6 @@ func PossibleNetworkAdapterRDMAStatusValues() []NetworkAdapterRDMAStatus { } } -// ToPtr returns a *NetworkAdapterRDMAStatus pointing to the current value. -func (c NetworkAdapterRDMAStatus) ToPtr() *NetworkAdapterRDMAStatus { - return &c -} - // NetworkAdapterStatus - Value indicating whether this adapter is valid. type NetworkAdapterStatus string @@ -873,11 +721,6 @@ func PossibleNetworkAdapterStatusValues() []NetworkAdapterStatus { } } -// ToPtr returns a *NetworkAdapterStatus pointing to the current value. -func (c NetworkAdapterStatus) ToPtr() *NetworkAdapterStatus { - return &c -} - // NetworkGroup - The network group. type NetworkGroup string @@ -896,11 +739,6 @@ func PossibleNetworkGroupValues() []NetworkGroup { } } -// ToPtr returns a *NetworkGroup pointing to the current value. -func (c NetworkGroup) ToPtr() *NetworkGroup { - return &c -} - // NodeStatus - The current status of the individual node type NodeStatus string @@ -923,11 +761,6 @@ func PossibleNodeStatusValues() []NodeStatus { } } -// ToPtr returns a *NodeStatus pointing to the current value. -func (c NodeStatus) ToPtr() *NodeStatus { - return &c -} - // OrderState - Status of the order as per the allowed status types. type OrderState string @@ -974,11 +807,6 @@ func PossibleOrderStateValues() []OrderState { } } -// ToPtr returns a *OrderState pointing to the current value. -func (c OrderState) ToPtr() *OrderState { - return &c -} - // PlatformType - Host OS supported by the Arc addon. type PlatformType string @@ -995,11 +823,6 @@ func PossiblePlatformTypeValues() []PlatformType { } } -// ToPtr returns a *PlatformType pointing to the current value. -func (c PlatformType) ToPtr() *PlatformType { - return &c -} - // PosixComplianceStatus - If provisioned storage is posix compliant. type PosixComplianceStatus string @@ -1018,11 +841,6 @@ func PossiblePosixComplianceStatusValues() []PosixComplianceStatus { } } -// ToPtr returns a *PosixComplianceStatus pointing to the current value. -func (c PosixComplianceStatus) ToPtr() *PosixComplianceStatus { - return &c -} - // ProactiveDiagnosticsConsent - Proactive diagnostic collection consent flag type ProactiveDiagnosticsConsent string @@ -1039,11 +857,6 @@ func PossibleProactiveDiagnosticsConsentValues() []ProactiveDiagnosticsConsent { } } -// ToPtr returns a *ProactiveDiagnosticsConsent pointing to the current value. -func (c ProactiveDiagnosticsConsent) ToPtr() *ProactiveDiagnosticsConsent { - return &c -} - // RemoteApplicationType - Remote application type type RemoteApplicationType string @@ -1064,11 +877,6 @@ func PossibleRemoteApplicationTypeValues() []RemoteApplicationType { } } -// ToPtr returns a *RemoteApplicationType pointing to the current value. -func (c RemoteApplicationType) ToPtr() *RemoteApplicationType { - return &c -} - // ResourceMoveStatus - Denotes whether move operation is in progress type ResourceMoveStatus string @@ -1087,11 +895,6 @@ func PossibleResourceMoveStatusValues() []ResourceMoveStatus { } } -// ToPtr returns a *ResourceMoveStatus pointing to the current value. -func (c ResourceMoveStatus) ToPtr() *ResourceMoveStatus { - return &c -} - // RoleStatus - Local Edge Management Status type RoleStatus string @@ -1108,11 +911,6 @@ func PossibleRoleStatusValues() []RoleStatus { } } -// ToPtr returns a *RoleStatus pointing to the current value. -func (c RoleStatus) ToPtr() *RoleStatus { - return &c -} - type RoleTypes string const ( @@ -1138,11 +936,6 @@ func PossibleRoleTypesValues() []RoleTypes { } } -// ToPtr returns a *RoleTypes pointing to the current value. -func (c RoleTypes) ToPtr() *RoleTypes { - return &c -} - // SKUAvailability - Links to the next set of results type SKUAvailability string @@ -1159,20 +952,19 @@ func PossibleSKUAvailabilityValues() []SKUAvailability { } } -// ToPtr returns a *SKUAvailability pointing to the current value. -func (c SKUAvailability) ToPtr() *SKUAvailability { - return &c -} - // SKUName - The Sku name. type SKUName string const ( SKUNameEP21281T4Mx1W SKUName = "EP2_128_1T4_Mx1_W" + SKUNameEP2128GPU1Mx1W SKUName = "EP2_128_GPU1_Mx1_W" SKUNameEP22562T4W SKUName = "EP2_256_2T4_W" + SKUNameEP2256GPU2Mx1 SKUName = "EP2_256_GPU2_Mx1" SKUNameEP2641VPUW SKUName = "EP2_64_1VPU_W" + SKUNameEP264Mx1W SKUName = "EP2_64_Mx1_W" SKUNameEdge SKUName = "Edge" SKUNameEdgeMRMini SKUName = "EdgeMR_Mini" + SKUNameEdgeMRTCP SKUName = "EdgeMR_TCP" SKUNameEdgePBase SKUName = "EdgeP_Base" SKUNameEdgePHigh SKUName = "EdgeP_High" SKUNameEdgePRBase SKUName = "EdgePR_Base" @@ -1199,10 +991,14 @@ const ( func PossibleSKUNameValues() []SKUName { return []SKUName{ SKUNameEP21281T4Mx1W, + SKUNameEP2128GPU1Mx1W, SKUNameEP22562T4W, + SKUNameEP2256GPU2Mx1, SKUNameEP2641VPUW, + SKUNameEP264Mx1W, SKUNameEdge, SKUNameEdgeMRMini, + SKUNameEdgeMRTCP, SKUNameEdgePBase, SKUNameEdgePHigh, SKUNameEdgePRBase, @@ -1226,11 +1022,6 @@ func PossibleSKUNameValues() []SKUName { } } -// ToPtr returns a *SKUName pointing to the current value. -func (c SKUName) ToPtr() *SKUName { - return &c -} - // SKUSignupOption - Sku can be signed up by customer or not. type SKUSignupOption string @@ -1247,11 +1038,6 @@ func PossibleSKUSignupOptionValues() []SKUSignupOption { } } -// ToPtr returns a *SKUSignupOption pointing to the current value. -func (c SKUSignupOption) ToPtr() *SKUSignupOption { - return &c -} - // SKUTier - The Sku tier. type SKUTier string @@ -1266,11 +1052,6 @@ func PossibleSKUTierValues() []SKUTier { } } -// ToPtr returns a *SKUTier pointing to the current value. -func (c SKUTier) ToPtr() *SKUTier { - return &c -} - // SKUVersion - Availability of the Sku as preview/stable. type SKUVersion string @@ -1287,11 +1068,6 @@ func PossibleSKUVersionValues() []SKUVersion { } } -// ToPtr returns a *SKUVersion pointing to the current value. -func (c SKUVersion) ToPtr() *SKUVersion { - return &c -} - // SSLStatus - Signifies whether SSL needs to be enabled or not. type SSLStatus string @@ -1308,11 +1084,6 @@ func PossibleSSLStatusValues() []SSLStatus { } } -// ToPtr returns a *SSLStatus pointing to the current value. -func (c SSLStatus) ToPtr() *SSLStatus { - return &c -} - // ShareAccessProtocol - Access protocol to be used by the share. type ShareAccessProtocol string @@ -1329,11 +1100,6 @@ func PossibleShareAccessProtocolValues() []ShareAccessProtocol { } } -// ToPtr returns a *ShareAccessProtocol pointing to the current value. -func (c ShareAccessProtocol) ToPtr() *ShareAccessProtocol { - return &c -} - // ShareAccessType - Type of access to be allowed on the share for this user. type ShareAccessType string @@ -1352,11 +1118,6 @@ func PossibleShareAccessTypeValues() []ShareAccessType { } } -// ToPtr returns a *ShareAccessType pointing to the current value. -func (c ShareAccessType) ToPtr() *ShareAccessType { - return &c -} - // ShareStatus - Current status of the share. type ShareStatus string @@ -1379,11 +1140,6 @@ func PossibleShareStatusValues() []ShareStatus { } } -// ToPtr returns a *ShareStatus pointing to the current value. -func (c ShareStatus) ToPtr() *ShareStatus { - return &c -} - type ShipmentType string const ( @@ -1401,11 +1157,6 @@ func PossibleShipmentTypeValues() []ShipmentType { } } -// ToPtr returns a *ShipmentType pointing to the current value. -func (c ShipmentType) ToPtr() *ShipmentType { - return &c -} - // StorageAccountStatus - Current status of the storage account type StorageAccountStatus string @@ -1428,11 +1179,6 @@ func PossibleStorageAccountStatusValues() []StorageAccountStatus { } } -// ToPtr returns a *StorageAccountStatus pointing to the current value. -func (c StorageAccountStatus) ToPtr() *StorageAccountStatus { - return &c -} - type SubscriptionState string const ( @@ -1454,11 +1200,6 @@ func PossibleSubscriptionStateValues() []SubscriptionState { } } -// ToPtr returns a *SubscriptionState pointing to the current value. -func (c SubscriptionState) ToPtr() *SubscriptionState { - return &c -} - type TimeGrain string const ( @@ -1486,11 +1227,6 @@ func PossibleTimeGrainValues() []TimeGrain { } } -// ToPtr returns a *TimeGrain pointing to the current value. -func (c TimeGrain) ToPtr() *TimeGrain { - return &c -} - // TriggerEventType - Trigger Kind. type TriggerEventType string @@ -1507,11 +1243,6 @@ func PossibleTriggerEventTypeValues() []TriggerEventType { } } -// ToPtr returns a *TriggerEventType pointing to the current value. -func (c TriggerEventType) ToPtr() *TriggerEventType { - return &c -} - // UpdateOperation - The current update operation. type UpdateOperation string @@ -1532,11 +1263,6 @@ func PossibleUpdateOperationValues() []UpdateOperation { } } -// ToPtr returns a *UpdateOperation pointing to the current value. -func (c UpdateOperation) ToPtr() *UpdateOperation { - return &c -} - // UpdateOperationStage - Current stage of the update operation. type UpdateOperationStage string @@ -1583,11 +1309,6 @@ func PossibleUpdateOperationStageValues() []UpdateOperationStage { } } -// ToPtr returns a *UpdateOperationStage pointing to the current value. -func (c UpdateOperationStage) ToPtr() *UpdateOperationStage { - return &c -} - // UpdateStatus - Status of the update. type UpdateStatus string @@ -1610,11 +1331,6 @@ func PossibleUpdateStatusValues() []UpdateStatus { } } -// ToPtr returns a *UpdateStatus pointing to the current value. -func (c UpdateStatus) ToPtr() *UpdateStatus { - return &c -} - // UpdateType - Type of the Update type UpdateType string @@ -1633,11 +1349,6 @@ func PossibleUpdateTypeValues() []UpdateType { } } -// ToPtr returns a *UpdateType pointing to the current value. -func (c UpdateType) ToPtr() *UpdateType { - return &c -} - // UserType - Type of the user. type UserType string @@ -1655,8 +1366,3 @@ func PossibleUserTypeValues() []UserType { UserTypeShare, } } - -// ToPtr returns a *UserType pointing to the current value. -func (c UserType) ToPtr() *UserType { - return &c -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_containers_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_containers_client.go index 858eb00841b3..d5aed78b85b4 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_containers_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_containers_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type ContainersClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ContainersClient { +func NewContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainersClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &ContainersClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Creates a new container or updates an existing container on the device. @@ -58,22 +63,16 @@ func NewContainersClient(subscriptionID string, credential azcore.TokenCredentia // containerParam - The container properties. // options - ContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainersClient.BeginCreateOrUpdate // method. -func (client *ContainersClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, containerParam Container, options *ContainersClientBeginCreateOrUpdateOptions) (ContainersClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, deviceName, storageAccountName, containerName, resourceGroupName, containerParam, options) - if err != nil { - return ContainersClientCreateOrUpdatePollerResponse{}, err - } - result := ContainersClientCreateOrUpdatePollerResponse{ - RawResponse: resp, +func (client *ContainersClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, containerParam Container, options *ContainersClientBeginCreateOrUpdateOptions) (*armruntime.Poller[ContainersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, deviceName, storageAccountName, containerName, resourceGroupName, containerParam, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ContainersClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ContainersClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("ContainersClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return ContainersClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &ContainersClientCreateOrUpdatePoller{ - pt: pt, - } - return result, nil } // CreateOrUpdate - Creates a new container or updates an existing container on the device. @@ -121,7 +120,7 @@ func (client *ContainersClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, containerParam) @@ -134,22 +133,16 @@ func (client *ContainersClient) createOrUpdateCreateRequest(ctx context.Context, // containerName - The container name. // resourceGroupName - The resource group name. // options - ContainersClientBeginDeleteOptions contains the optional parameters for the ContainersClient.BeginDelete method. -func (client *ContainersClient) BeginDelete(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, options *ContainersClientBeginDeleteOptions) (ContainersClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, deviceName, storageAccountName, containerName, resourceGroupName, options) - if err != nil { - return ContainersClientDeletePollerResponse{}, err - } - result := ContainersClientDeletePollerResponse{ - RawResponse: resp, +func (client *ContainersClient) BeginDelete(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, options *ContainersClientBeginDeleteOptions) (*armruntime.Poller[ContainersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, deviceName, storageAccountName, containerName, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ContainersClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ContainersClientDeleteResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("ContainersClient.Delete", "", resp, client.pl) - if err != nil { - return ContainersClientDeletePollerResponse{}, err - } - result.Poller = &ContainersClientDeletePoller{ - pt: pt, - } - return result, nil } // Delete - Deletes the container on the Data Box Edge/Data Box Gateway device. @@ -197,7 +190,7 @@ func (client *ContainersClient) deleteCreateRequest(ctx context.Context, deviceN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -253,7 +246,7 @@ func (client *ContainersClient) getCreateRequest(ctx context.Context, deviceName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -261,7 +254,7 @@ func (client *ContainersClient) getCreateRequest(ctx context.Context, deviceName // getHandleResponse handles the Get response. func (client *ContainersClient) getHandleResponse(resp *http.Response) (ContainersClientGetResponse, error) { - result := ContainersClientGetResponse{RawResponse: resp} + result := ContainersClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Container); err != nil { return ContainersClientGetResponse{}, err } @@ -275,16 +268,32 @@ func (client *ContainersClient) getHandleResponse(resp *http.Response) (Containe // resourceGroupName - The resource group name. // options - ContainersClientListByStorageAccountOptions contains the optional parameters for the ContainersClient.ListByStorageAccount // method. -func (client *ContainersClient) ListByStorageAccount(deviceName string, storageAccountName string, resourceGroupName string, options *ContainersClientListByStorageAccountOptions) *ContainersClientListByStorageAccountPager { - return &ContainersClientListByStorageAccountPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByStorageAccountCreateRequest(ctx, deviceName, storageAccountName, resourceGroupName, options) +func (client *ContainersClient) ListByStorageAccount(deviceName string, storageAccountName string, resourceGroupName string, options *ContainersClientListByStorageAccountOptions) *runtime.Pager[ContainersClientListByStorageAccountResponse] { + return runtime.NewPager(runtime.PageProcessor[ContainersClientListByStorageAccountResponse]{ + More: func(page ContainersClientListByStorageAccountResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ContainersClientListByStorageAccountResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ContainerList.NextLink) + Fetcher: func(ctx context.Context, page *ContainersClientListByStorageAccountResponse) (ContainersClientListByStorageAccountResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByStorageAccountCreateRequest(ctx, deviceName, storageAccountName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ContainersClientListByStorageAccountResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ContainersClientListByStorageAccountResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ContainersClientListByStorageAccountResponse{}, runtime.NewResponseError(resp) + } + return client.listByStorageAccountHandleResponse(resp) }, - } + }) } // listByStorageAccountCreateRequest creates the ListByStorageAccount request. @@ -311,7 +320,7 @@ func (client *ContainersClient) listByStorageAccountCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -319,7 +328,7 @@ func (client *ContainersClient) listByStorageAccountCreateRequest(ctx context.Co // listByStorageAccountHandleResponse handles the ListByStorageAccount response. func (client *ContainersClient) listByStorageAccountHandleResponse(resp *http.Response) (ContainersClientListByStorageAccountResponse, error) { - result := ContainersClientListByStorageAccountResponse{RawResponse: resp} + result := ContainersClientListByStorageAccountResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ContainerList); err != nil { return ContainersClientListByStorageAccountResponse{}, err } @@ -333,22 +342,16 @@ func (client *ContainersClient) listByStorageAccountHandleResponse(resp *http.Re // containerName - The container name. // resourceGroupName - The resource group name. // options - ContainersClientBeginRefreshOptions contains the optional parameters for the ContainersClient.BeginRefresh method. -func (client *ContainersClient) BeginRefresh(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, options *ContainersClientBeginRefreshOptions) (ContainersClientRefreshPollerResponse, error) { - resp, err := client.refresh(ctx, deviceName, storageAccountName, containerName, resourceGroupName, options) - if err != nil { - return ContainersClientRefreshPollerResponse{}, err +func (client *ContainersClient) BeginRefresh(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, options *ContainersClientBeginRefreshOptions) (*armruntime.Poller[ContainersClientRefreshResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.refresh(ctx, deviceName, storageAccountName, containerName, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ContainersClientRefreshResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ContainersClientRefreshResponse](options.ResumeToken, client.pl, nil) } - result := ContainersClientRefreshPollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("ContainersClient.Refresh", "", resp, client.pl) - if err != nil { - return ContainersClientRefreshPollerResponse{}, err - } - result.Poller = &ContainersClientRefreshPoller{ - pt: pt, - } - return result, nil } // Refresh - Refreshes the container metadata with the data from the cloud. @@ -396,7 +399,7 @@ func (client *ContainersClient) refreshCreateRequest(ctx context.Context, device return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devicecapacitycheck_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devicecapacitycheck_client.go new file mode 100644 index 000000000000..1e68f2ba60c5 --- /dev/null +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devicecapacitycheck_client.go @@ -0,0 +1,122 @@ +//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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdataboxedge + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DeviceCapacityCheckClient contains the methods for the DeviceCapacityCheck group. +// Don't use this type directly, use NewDeviceCapacityCheckClient() instead. +type DeviceCapacityCheckClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDeviceCapacityCheckClient creates a new instance of DeviceCapacityCheckClient with the specified values. +// subscriptionID - The subscription ID. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewDeviceCapacityCheckClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeviceCapacityCheckClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DeviceCapacityCheckClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCheckResourceCreationFeasibility - Posts the device capacity request info to check feasibility. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The resource group name. +// deviceName - The device name. +// deviceCapacityRequestInfo - The device capacity request info. +// options - DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions contains the optional parameters for the +// DeviceCapacityCheckClient.BeginCheckResourceCreationFeasibility method. +func (client *DeviceCapacityCheckClient) BeginCheckResourceCreationFeasibility(ctx context.Context, resourceGroupName string, deviceName string, deviceCapacityRequestInfo DeviceCapacityRequestInfo, options *DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions) (*armruntime.Poller[DeviceCapacityCheckClientCheckResourceCreationFeasibilityResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.checkResourceCreationFeasibility(ctx, resourceGroupName, deviceName, deviceCapacityRequestInfo, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[DeviceCapacityCheckClientCheckResourceCreationFeasibilityResponse]{ + FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + }) + } else { + return armruntime.NewPollerFromResumeToken[DeviceCapacityCheckClientCheckResourceCreationFeasibilityResponse](options.ResumeToken, client.pl, nil) + } +} + +// CheckResourceCreationFeasibility - Posts the device capacity request info to check feasibility. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *DeviceCapacityCheckClient) checkResourceCreationFeasibility(ctx context.Context, resourceGroupName string, deviceName string, deviceCapacityRequestInfo DeviceCapacityRequestInfo, options *DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions) (*http.Response, error) { + req, err := client.checkResourceCreationFeasibilityCreateRequest(ctx, resourceGroupName, deviceName, deviceCapacityRequestInfo, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// checkResourceCreationFeasibilityCreateRequest creates the CheckResourceCreationFeasibility request. +func (client *DeviceCapacityCheckClient) checkResourceCreationFeasibilityCreateRequest(ctx context.Context, resourceGroupName string, deviceName string, deviceCapacityRequestInfo DeviceCapacityRequestInfo, options *DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityCheck" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if deviceName == "" { + return nil, errors.New("parameter deviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deviceName}", url.PathEscape(deviceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-01") + if options != nil && options.CapacityName != nil { + reqQP.Set("capacityName", *options.CapacityName) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, deviceCapacityRequestInfo) +} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devicecapacityinfo_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devicecapacityinfo_client.go new file mode 100644 index 000000000000..0b17b23b61dd --- /dev/null +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devicecapacityinfo_client.go @@ -0,0 +1,111 @@ +//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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdataboxedge + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DeviceCapacityInfoClient contains the methods for the DeviceCapacityInfo group. +// Don't use this type directly, use NewDeviceCapacityInfoClient() instead. +type DeviceCapacityInfoClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDeviceCapacityInfoClient creates a new instance of DeviceCapacityInfoClient with the specified values. +// subscriptionID - The subscription ID. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewDeviceCapacityInfoClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeviceCapacityInfoClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DeviceCapacityInfoClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// GetDeviceCapacityInfo - Gets the properties of the specified device capacity info. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The resource group name. +// deviceName - The device name. +// options - DeviceCapacityInfoClientGetDeviceCapacityInfoOptions contains the optional parameters for the DeviceCapacityInfoClient.GetDeviceCapacityInfo +// method. +func (client *DeviceCapacityInfoClient) GetDeviceCapacityInfo(ctx context.Context, resourceGroupName string, deviceName string, options *DeviceCapacityInfoClientGetDeviceCapacityInfoOptions) (DeviceCapacityInfoClientGetDeviceCapacityInfoResponse, error) { + req, err := client.getDeviceCapacityInfoCreateRequest(ctx, resourceGroupName, deviceName, options) + if err != nil { + return DeviceCapacityInfoClientGetDeviceCapacityInfoResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DeviceCapacityInfoClientGetDeviceCapacityInfoResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DeviceCapacityInfoClientGetDeviceCapacityInfoResponse{}, runtime.NewResponseError(resp) + } + return client.getDeviceCapacityInfoHandleResponse(resp) +} + +// getDeviceCapacityInfoCreateRequest creates the GetDeviceCapacityInfo request. +func (client *DeviceCapacityInfoClient) getDeviceCapacityInfoCreateRequest(ctx context.Context, resourceGroupName string, deviceName string, options *DeviceCapacityInfoClientGetDeviceCapacityInfoOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityInfo/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if deviceName == "" { + return nil, errors.New("parameter deviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deviceName}", url.PathEscape(deviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getDeviceCapacityInfoHandleResponse handles the GetDeviceCapacityInfo response. +func (client *DeviceCapacityInfoClient) getDeviceCapacityInfoHandleResponse(resp *http.Response) (DeviceCapacityInfoClientGetDeviceCapacityInfoResponse, error) { + result := DeviceCapacityInfoClientGetDeviceCapacityInfoResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DeviceCapacityInfo); err != nil { + return DeviceCapacityInfoClientGetDeviceCapacityInfoResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devices_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devices_client.go index 3a5d8d8efa38..dbe48245a9c0 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devices_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_devices_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type DevicesClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewDevicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DevicesClient { +func NewDevicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DevicesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &DevicesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates or updates a Data Box Edge/Data Box Gateway resource. @@ -90,7 +95,7 @@ func (client *DevicesClient) createOrUpdateCreateRequest(ctx context.Context, de return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, dataBoxEdgeDevice) @@ -98,7 +103,7 @@ func (client *DevicesClient) createOrUpdateCreateRequest(ctx context.Context, de // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *DevicesClient) createOrUpdateHandleResponse(resp *http.Response) (DevicesClientCreateOrUpdateResponse, error) { - result := DevicesClientCreateOrUpdateResponse{RawResponse: resp} + result := DevicesClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Device); err != nil { return DevicesClientCreateOrUpdateResponse{}, err } @@ -112,22 +117,16 @@ func (client *DevicesClient) createOrUpdateHandleResponse(resp *http.Response) ( // securitySettings - The security settings. // options - DevicesClientBeginCreateOrUpdateSecuritySettingsOptions contains the optional parameters for the DevicesClient.BeginCreateOrUpdateSecuritySettings // method. -func (client *DevicesClient) BeginCreateOrUpdateSecuritySettings(ctx context.Context, deviceName string, resourceGroupName string, securitySettings SecuritySettings, options *DevicesClientBeginCreateOrUpdateSecuritySettingsOptions) (DevicesClientCreateOrUpdateSecuritySettingsPollerResponse, error) { - resp, err := client.createOrUpdateSecuritySettings(ctx, deviceName, resourceGroupName, securitySettings, options) - if err != nil { - return DevicesClientCreateOrUpdateSecuritySettingsPollerResponse{}, err - } - result := DevicesClientCreateOrUpdateSecuritySettingsPollerResponse{ - RawResponse: resp, +func (client *DevicesClient) BeginCreateOrUpdateSecuritySettings(ctx context.Context, deviceName string, resourceGroupName string, securitySettings SecuritySettings, options *DevicesClientBeginCreateOrUpdateSecuritySettingsOptions) (*armruntime.Poller[DevicesClientCreateOrUpdateSecuritySettingsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdateSecuritySettings(ctx, deviceName, resourceGroupName, securitySettings, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[DevicesClientCreateOrUpdateSecuritySettingsResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[DevicesClientCreateOrUpdateSecuritySettingsResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("DevicesClient.CreateOrUpdateSecuritySettings", "", resp, client.pl) - if err != nil { - return DevicesClientCreateOrUpdateSecuritySettingsPollerResponse{}, err - } - result.Poller = &DevicesClientCreateOrUpdateSecuritySettingsPoller{ - pt: pt, - } - return result, nil } // CreateOrUpdateSecuritySettings - Updates the security settings on a Data Box Edge/Data Box Gateway device. @@ -167,7 +166,7 @@ func (client *DevicesClient) createOrUpdateSecuritySettingsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, securitySettings) @@ -178,22 +177,16 @@ func (client *DevicesClient) createOrUpdateSecuritySettingsCreateRequest(ctx con // deviceName - The device name. // resourceGroupName - The resource group name. // options - DevicesClientBeginDeleteOptions contains the optional parameters for the DevicesClient.BeginDelete method. -func (client *DevicesClient) BeginDelete(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginDeleteOptions) (DevicesClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, deviceName, resourceGroupName, options) - if err != nil { - return DevicesClientDeletePollerResponse{}, err - } - result := DevicesClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("DevicesClient.Delete", "", resp, client.pl) - if err != nil { - return DevicesClientDeletePollerResponse{}, err - } - result.Poller = &DevicesClientDeletePoller{ - pt: pt, +func (client *DevicesClient) BeginDelete(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginDeleteOptions) (*armruntime.Poller[DevicesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, deviceName, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[DevicesClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[DevicesClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - Deletes the Data Box Edge/Data Box Gateway device. @@ -233,7 +226,7 @@ func (client *DevicesClient) deleteCreateRequest(ctx context.Context, deviceName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -245,22 +238,16 @@ func (client *DevicesClient) deleteCreateRequest(ctx context.Context, deviceName // resourceGroupName - The resource group name. // options - DevicesClientBeginDownloadUpdatesOptions contains the optional parameters for the DevicesClient.BeginDownloadUpdates // method. -func (client *DevicesClient) BeginDownloadUpdates(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginDownloadUpdatesOptions) (DevicesClientDownloadUpdatesPollerResponse, error) { - resp, err := client.downloadUpdates(ctx, deviceName, resourceGroupName, options) - if err != nil { - return DevicesClientDownloadUpdatesPollerResponse{}, err +func (client *DevicesClient) BeginDownloadUpdates(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginDownloadUpdatesOptions) (*armruntime.Poller[DevicesClientDownloadUpdatesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.downloadUpdates(ctx, deviceName, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[DevicesClientDownloadUpdatesResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[DevicesClientDownloadUpdatesResponse](options.ResumeToken, client.pl, nil) } - result := DevicesClientDownloadUpdatesPollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("DevicesClient.DownloadUpdates", "", resp, client.pl) - if err != nil { - return DevicesClientDownloadUpdatesPollerResponse{}, err - } - result.Poller = &DevicesClientDownloadUpdatesPoller{ - pt: pt, - } - return result, nil } // DownloadUpdates - Downloads the updates on a Data Box Edge/Data Box Gateway device. @@ -300,7 +287,7 @@ func (client *DevicesClient) downloadUpdatesCreateRequest(ctx context.Context, d return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -347,7 +334,7 @@ func (client *DevicesClient) generateCertificateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -355,7 +342,7 @@ func (client *DevicesClient) generateCertificateCreateRequest(ctx context.Contex // generateCertificateHandleResponse handles the GenerateCertificate response. func (client *DevicesClient) generateCertificateHandleResponse(resp *http.Response) (DevicesClientGenerateCertificateResponse, error) { - result := DevicesClientGenerateCertificateResponse{RawResponse: resp} + result := DevicesClientGenerateCertificateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.GenerateCertResponse); err != nil { return DevicesClientGenerateCertificateResponse{}, err } @@ -402,7 +389,7 @@ func (client *DevicesClient) getCreateRequest(ctx context.Context, deviceName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -410,7 +397,7 @@ func (client *DevicesClient) getCreateRequest(ctx context.Context, deviceName st // getHandleResponse handles the Get response. func (client *DevicesClient) getHandleResponse(resp *http.Response) (DevicesClientGetResponse, error) { - result := DevicesClientGetResponse{RawResponse: resp} + result := DevicesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Device); err != nil { return DevicesClientGetResponse{}, err } @@ -458,7 +445,7 @@ func (client *DevicesClient) getExtendedInformationCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -466,7 +453,7 @@ func (client *DevicesClient) getExtendedInformationCreateRequest(ctx context.Con // getExtendedInformationHandleResponse handles the GetExtendedInformation response. func (client *DevicesClient) getExtendedInformationHandleResponse(resp *http.Response) (DevicesClientGetExtendedInformationResponse, error) { - result := DevicesClientGetExtendedInformationResponse{RawResponse: resp} + result := DevicesClientGetExtendedInformationResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.DeviceExtendedInfo); err != nil { return DevicesClientGetExtendedInformationResponse{}, err } @@ -514,7 +501,7 @@ func (client *DevicesClient) getNetworkSettingsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -522,7 +509,7 @@ func (client *DevicesClient) getNetworkSettingsCreateRequest(ctx context.Context // getNetworkSettingsHandleResponse handles the GetNetworkSettings response. func (client *DevicesClient) getNetworkSettingsHandleResponse(resp *http.Response) (DevicesClientGetNetworkSettingsResponse, error) { - result := DevicesClientGetNetworkSettingsResponse{RawResponse: resp} + result := DevicesClientGetNetworkSettingsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSettings); err != nil { return DevicesClientGetNetworkSettingsResponse{}, err } @@ -571,7 +558,7 @@ func (client *DevicesClient) getUpdateSummaryCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -579,7 +566,7 @@ func (client *DevicesClient) getUpdateSummaryCreateRequest(ctx context.Context, // getUpdateSummaryHandleResponse handles the GetUpdateSummary response. func (client *DevicesClient) getUpdateSummaryHandleResponse(resp *http.Response) (DevicesClientGetUpdateSummaryResponse, error) { - result := DevicesClientGetUpdateSummaryResponse{RawResponse: resp} + result := DevicesClientGetUpdateSummaryResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.UpdateSummary); err != nil { return DevicesClientGetUpdateSummaryResponse{}, err } @@ -592,22 +579,16 @@ func (client *DevicesClient) getUpdateSummaryHandleResponse(resp *http.Response) // resourceGroupName - The resource group name. // options - DevicesClientBeginInstallUpdatesOptions contains the optional parameters for the DevicesClient.BeginInstallUpdates // method. -func (client *DevicesClient) BeginInstallUpdates(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginInstallUpdatesOptions) (DevicesClientInstallUpdatesPollerResponse, error) { - resp, err := client.installUpdates(ctx, deviceName, resourceGroupName, options) - if err != nil { - return DevicesClientInstallUpdatesPollerResponse{}, err - } - result := DevicesClientInstallUpdatesPollerResponse{ - RawResponse: resp, +func (client *DevicesClient) BeginInstallUpdates(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginInstallUpdatesOptions) (*armruntime.Poller[DevicesClientInstallUpdatesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.installUpdates(ctx, deviceName, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[DevicesClientInstallUpdatesResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[DevicesClientInstallUpdatesResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("DevicesClient.InstallUpdates", "", resp, client.pl) - if err != nil { - return DevicesClientInstallUpdatesPollerResponse{}, err - } - result.Poller = &DevicesClientInstallUpdatesPoller{ - pt: pt, - } - return result, nil } // InstallUpdates - Installs the updates on the Data Box Edge/Data Box Gateway device. @@ -647,7 +628,7 @@ func (client *DevicesClient) installUpdatesCreateRequest(ctx context.Context, de return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -658,16 +639,32 @@ func (client *DevicesClient) installUpdatesCreateRequest(ctx context.Context, de // resourceGroupName - The resource group name. // options - DevicesClientListByResourceGroupOptions contains the optional parameters for the DevicesClient.ListByResourceGroup // method. -func (client *DevicesClient) ListByResourceGroup(resourceGroupName string, options *DevicesClientListByResourceGroupOptions) *DevicesClientListByResourceGroupPager { - return &DevicesClientListByResourceGroupPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) +func (client *DevicesClient) ListByResourceGroup(resourceGroupName string, options *DevicesClientListByResourceGroupOptions) *runtime.Pager[DevicesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PageProcessor[DevicesClientListByResourceGroupResponse]{ + More: func(page DevicesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp DevicesClientListByResourceGroupResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.DeviceList.NextLink) + Fetcher: func(ctx context.Context, page *DevicesClientListByResourceGroupResponse) (DevicesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DevicesClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DevicesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DevicesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) }, - } + }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. @@ -686,7 +683,7 @@ func (client *DevicesClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -697,7 +694,7 @@ func (client *DevicesClient) listByResourceGroupCreateRequest(ctx context.Contex // listByResourceGroupHandleResponse handles the ListByResourceGroup response. func (client *DevicesClient) listByResourceGroupHandleResponse(resp *http.Response) (DevicesClientListByResourceGroupResponse, error) { - result := DevicesClientListByResourceGroupResponse{RawResponse: resp} + result := DevicesClientListByResourceGroupResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.DeviceList); err != nil { return DevicesClientListByResourceGroupResponse{}, err } @@ -708,16 +705,32 @@ func (client *DevicesClient) listByResourceGroupHandleResponse(resp *http.Respon // If the operation fails it returns an *azcore.ResponseError type. // options - DevicesClientListBySubscriptionOptions contains the optional parameters for the DevicesClient.ListBySubscription // method. -func (client *DevicesClient) ListBySubscription(options *DevicesClientListBySubscriptionOptions) *DevicesClientListBySubscriptionPager { - return &DevicesClientListBySubscriptionPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) +func (client *DevicesClient) ListBySubscription(options *DevicesClientListBySubscriptionOptions) *runtime.Pager[DevicesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PageProcessor[DevicesClientListBySubscriptionResponse]{ + More: func(page DevicesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp DevicesClientListBySubscriptionResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.DeviceList.NextLink) + Fetcher: func(ctx context.Context, page *DevicesClientListBySubscriptionResponse) (DevicesClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DevicesClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DevicesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DevicesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) }, - } + }) } // listBySubscriptionCreateRequest creates the ListBySubscription request. @@ -732,7 +745,7 @@ func (client *DevicesClient) listBySubscriptionCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -743,7 +756,7 @@ func (client *DevicesClient) listBySubscriptionCreateRequest(ctx context.Context // listBySubscriptionHandleResponse handles the ListBySubscription response. func (client *DevicesClient) listBySubscriptionHandleResponse(resp *http.Response) (DevicesClientListBySubscriptionResponse, error) { - result := DevicesClientListBySubscriptionResponse{RawResponse: resp} + result := DevicesClientListBySubscriptionResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.DeviceList); err != nil { return DevicesClientListBySubscriptionResponse{}, err } @@ -756,22 +769,16 @@ func (client *DevicesClient) listBySubscriptionHandleResponse(resp *http.Respons // resourceGroupName - The resource group name. // options - DevicesClientBeginScanForUpdatesOptions contains the optional parameters for the DevicesClient.BeginScanForUpdates // method. -func (client *DevicesClient) BeginScanForUpdates(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginScanForUpdatesOptions) (DevicesClientScanForUpdatesPollerResponse, error) { - resp, err := client.scanForUpdates(ctx, deviceName, resourceGroupName, options) - if err != nil { - return DevicesClientScanForUpdatesPollerResponse{}, err - } - result := DevicesClientScanForUpdatesPollerResponse{ - RawResponse: resp, +func (client *DevicesClient) BeginScanForUpdates(ctx context.Context, deviceName string, resourceGroupName string, options *DevicesClientBeginScanForUpdatesOptions) (*armruntime.Poller[DevicesClientScanForUpdatesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.scanForUpdates(ctx, deviceName, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[DevicesClientScanForUpdatesResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[DevicesClientScanForUpdatesResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("DevicesClient.ScanForUpdates", "", resp, client.pl) - if err != nil { - return DevicesClientScanForUpdatesPollerResponse{}, err - } - result.Poller = &DevicesClientScanForUpdatesPoller{ - pt: pt, - } - return result, nil } // ScanForUpdates - Scans for updates on a Data Box Edge/Data Box Gateway device. @@ -811,7 +818,7 @@ func (client *DevicesClient) scanForUpdatesCreateRequest(ctx context.Context, de return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -858,7 +865,7 @@ func (client *DevicesClient) updateCreateRequest(ctx context.Context, deviceName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -866,7 +873,7 @@ func (client *DevicesClient) updateCreateRequest(ctx context.Context, deviceName // updateHandleResponse handles the Update response. func (client *DevicesClient) updateHandleResponse(resp *http.Response) (DevicesClientUpdateResponse, error) { - result := DevicesClientUpdateResponse{RawResponse: resp} + result := DevicesClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Device); err != nil { return DevicesClientUpdateResponse{}, err } @@ -915,7 +922,7 @@ func (client *DevicesClient) updateExtendedInformationCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -923,7 +930,7 @@ func (client *DevicesClient) updateExtendedInformationCreateRequest(ctx context. // updateExtendedInformationHandleResponse handles the UpdateExtendedInformation response. func (client *DevicesClient) updateExtendedInformationHandleResponse(resp *http.Response) (DevicesClientUpdateExtendedInformationResponse, error) { - result := DevicesClientUpdateExtendedInformationResponse{RawResponse: resp} + result := DevicesClientUpdateExtendedInformationResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.DeviceExtendedInfo); err != nil { return DevicesClientUpdateExtendedInformationResponse{}, err } @@ -972,7 +979,7 @@ func (client *DevicesClient) uploadCertificateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -980,7 +987,7 @@ func (client *DevicesClient) uploadCertificateCreateRequest(ctx context.Context, // uploadCertificateHandleResponse handles the UploadCertificate response. func (client *DevicesClient) uploadCertificateHandleResponse(resp *http.Response) (DevicesClientUploadCertificateResponse, error) { - result := DevicesClientUploadCertificateResponse{RawResponse: resp} + result := DevicesClientUploadCertificateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.UploadCertificateResponse); err != nil { return DevicesClientUploadCertificateResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_diagnosticsettings_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_diagnosticsettings_client.go index 107f15216d75..842deee7fe6c 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_diagnosticsettings_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_diagnosticsettings_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type DiagnosticSettingsClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewDiagnosticSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DiagnosticSettingsClient { +func NewDiagnosticSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiagnosticSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &DiagnosticSettingsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // GetDiagnosticProactiveLogCollectionSettings - Gets the proactive log collection settings of the specified Data Box Edge/Data @@ -91,7 +96,7 @@ func (client *DiagnosticSettingsClient) getDiagnosticProactiveLogCollectionSetti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -99,7 +104,7 @@ func (client *DiagnosticSettingsClient) getDiagnosticProactiveLogCollectionSetti // getDiagnosticProactiveLogCollectionSettingsHandleResponse handles the GetDiagnosticProactiveLogCollectionSettings response. func (client *DiagnosticSettingsClient) getDiagnosticProactiveLogCollectionSettingsHandleResponse(resp *http.Response) (DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResponse, error) { - result := DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResponse{RawResponse: resp} + result := DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticProactiveLogCollectionSettings); err != nil { return DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResponse{}, err } @@ -148,7 +153,7 @@ func (client *DiagnosticSettingsClient) getDiagnosticRemoteSupportSettingsCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -156,7 +161,7 @@ func (client *DiagnosticSettingsClient) getDiagnosticRemoteSupportSettingsCreate // getDiagnosticRemoteSupportSettingsHandleResponse handles the GetDiagnosticRemoteSupportSettings response. func (client *DiagnosticSettingsClient) getDiagnosticRemoteSupportSettingsHandleResponse(resp *http.Response) (DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResponse, error) { - result := DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResponse{RawResponse: resp} + result := DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticRemoteSupportSettings); err != nil { return DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResponse{}, err } @@ -171,22 +176,16 @@ func (client *DiagnosticSettingsClient) getDiagnosticRemoteSupportSettingsHandle // proactiveLogCollectionSettings - The proactive log collection settings. // options - DiagnosticSettingsClientBeginUpdateDiagnosticProactiveLogCollectionSettingsOptions contains the optional parameters // for the DiagnosticSettingsClient.BeginUpdateDiagnosticProactiveLogCollectionSettings method. -func (client *DiagnosticSettingsClient) BeginUpdateDiagnosticProactiveLogCollectionSettings(ctx context.Context, deviceName string, resourceGroupName string, proactiveLogCollectionSettings DiagnosticProactiveLogCollectionSettings, options *DiagnosticSettingsClientBeginUpdateDiagnosticProactiveLogCollectionSettingsOptions) (DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse, error) { - resp, err := client.updateDiagnosticProactiveLogCollectionSettings(ctx, deviceName, resourceGroupName, proactiveLogCollectionSettings, options) - if err != nil { - return DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse{}, err - } - result := DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("DiagnosticSettingsClient.UpdateDiagnosticProactiveLogCollectionSettings", "", resp, client.pl) - if err != nil { - return DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse{}, err - } - result.Poller = &DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller{ - pt: pt, +func (client *DiagnosticSettingsClient) BeginUpdateDiagnosticProactiveLogCollectionSettings(ctx context.Context, deviceName string, resourceGroupName string, proactiveLogCollectionSettings DiagnosticProactiveLogCollectionSettings, options *DiagnosticSettingsClientBeginUpdateDiagnosticProactiveLogCollectionSettingsOptions) (*armruntime.Poller[DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateDiagnosticProactiveLogCollectionSettings(ctx, deviceName, resourceGroupName, proactiveLogCollectionSettings, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // UpdateDiagnosticProactiveLogCollectionSettings - Updates the proactive log collection settings on a Data Box Edge/Data @@ -227,7 +226,7 @@ func (client *DiagnosticSettingsClient) updateDiagnosticProactiveLogCollectionSe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, proactiveLogCollectionSettings) @@ -241,22 +240,16 @@ func (client *DiagnosticSettingsClient) updateDiagnosticProactiveLogCollectionSe // diagnosticRemoteSupportSettings - The diagnostic remote support settings. // options - DiagnosticSettingsClientBeginUpdateDiagnosticRemoteSupportSettingsOptions contains the optional parameters for // the DiagnosticSettingsClient.BeginUpdateDiagnosticRemoteSupportSettings method. -func (client *DiagnosticSettingsClient) BeginUpdateDiagnosticRemoteSupportSettings(ctx context.Context, deviceName string, resourceGroupName string, diagnosticRemoteSupportSettings DiagnosticRemoteSupportSettings, options *DiagnosticSettingsClientBeginUpdateDiagnosticRemoteSupportSettingsOptions) (DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse, error) { - resp, err := client.updateDiagnosticRemoteSupportSettings(ctx, deviceName, resourceGroupName, diagnosticRemoteSupportSettings, options) - if err != nil { - return DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse{}, err +func (client *DiagnosticSettingsClient) BeginUpdateDiagnosticRemoteSupportSettings(ctx context.Context, deviceName string, resourceGroupName string, diagnosticRemoteSupportSettings DiagnosticRemoteSupportSettings, options *DiagnosticSettingsClientBeginUpdateDiagnosticRemoteSupportSettingsOptions) (*armruntime.Poller[DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateDiagnosticRemoteSupportSettings(ctx, deviceName, resourceGroupName, diagnosticRemoteSupportSettings, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse](options.ResumeToken, client.pl, nil) } - result := DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("DiagnosticSettingsClient.UpdateDiagnosticRemoteSupportSettings", "", resp, client.pl) - if err != nil { - return DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse{}, err - } - result.Poller = &DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller{ - pt: pt, - } - return result, nil } // UpdateDiagnosticRemoteSupportSettings - Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway @@ -297,7 +290,7 @@ func (client *DiagnosticSettingsClient) updateDiagnosticRemoteSupportSettingsCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, diagnosticRemoteSupportSettings) diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_jobs_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_jobs_client.go index 773ca9505c58..50ed2295af3e 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_jobs_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_jobs_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type JobsClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *JobsClient { +func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &JobsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Get - Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. @@ -94,7 +99,7 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, deviceName strin return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -102,7 +107,7 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, deviceName strin // getHandleResponse handles the Get response. func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetResponse, error) { - result := JobsClientGetResponse{RawResponse: resp} + result := JobsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Job); err != nil { return JobsClientGetResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models.go index 10a2e1ca21e4..18125f047272 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,12 +8,7 @@ package armdataboxedge -import ( - "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "time" -) +import "time" // ARMBaseModel - Represents the base class for all object models. type ARMBaseModel struct { @@ -47,16 +42,13 @@ type Addon struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Addon type + // READ-ONLY; Metadata pertaining to creation and last modification of Addon SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. Type *string `json:"type,omitempty" azure:"ro"` } -// GetAddon implements the AddonClassification interface for type Addon. -func (a *Addon) GetAddon() *Addon { return a } - // AddonList - Collection of all the Role addon on the Azure Stack Edge device. type AddonList struct { // READ-ONLY; Link to the next set of results. @@ -66,45 +58,16 @@ type AddonList struct { Value []AddonClassification `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type AddonList. -func (a AddonList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AddonList. -func (a *AddonList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, &a.NextLink) - delete(rawMsg, key) - case "value": - a.Value, err = unmarshalAddonClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AddonsClientBeginCreateOrUpdateOptions contains the optional parameters for the AddonsClient.BeginCreateOrUpdate method. type AddonsClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // AddonsClientBeginDeleteOptions contains the optional parameters for the AddonsClient.BeginDelete method. type AddonsClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // AddonsClientGetOptions contains the optional parameters for the AddonsClient.Get method. @@ -152,7 +115,7 @@ type Alert struct { // READ-ONLY; Properties of alert. Properties *AlertProperties `json:"properties,omitempty" azure:"ro"` - // READ-ONLY; Alert generated in the resource + // READ-ONLY; Metadata pertaining to creation and last modification of Alert SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -180,14 +143,6 @@ type AlertList struct { Value []*Alert `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type AlertList. -func (a AlertList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - // AlertProperties - Properties of alert. type AlertProperties struct { // READ-ONLY; Alert type. @@ -212,57 +167,6 @@ type AlertProperties struct { Title *string `json:"title,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type AlertProperties. -func (a AlertProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertType", a.AlertType) - populateTimeRFC3339(objectMap, "appearedAtDateTime", a.AppearedAtDateTime) - populate(objectMap, "detailedInformation", a.DetailedInformation) - populate(objectMap, "errorDetails", a.ErrorDetails) - populate(objectMap, "recommendation", a.Recommendation) - populate(objectMap, "severity", a.Severity) - populate(objectMap, "title", a.Title) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertProperties. -func (a *AlertProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertType": - err = unpopulate(val, &a.AlertType) - delete(rawMsg, key) - case "appearedAtDateTime": - err = unpopulateTimeRFC3339(val, &a.AppearedAtDateTime) - delete(rawMsg, key) - case "detailedInformation": - err = unpopulate(val, &a.DetailedInformation) - delete(rawMsg, key) - case "errorDetails": - err = unpopulate(val, &a.ErrorDetails) - delete(rawMsg, key) - case "recommendation": - err = unpopulate(val, &a.Recommendation) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &a.Severity) - delete(rawMsg, key) - case "title": - err = unpopulate(val, &a.Title) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AlertsClientGetOptions contains the optional parameters for the AlertsClient.Get method. type AlertsClientGetOptions struct { // placeholder for future optional parameters @@ -288,71 +192,13 @@ type ArcAddon struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Addon type + // READ-ONLY; Metadata pertaining to creation and last modification of Addon SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. Type *string `json:"type,omitempty" azure:"ro"` } -// GetAddon implements the AddonClassification interface for type ArcAddon. -func (a *ArcAddon) GetAddon() *Addon { - return &Addon{ - Kind: a.Kind, - SystemData: a.SystemData, - ID: a.ID, - Name: a.Name, - Type: a.Type, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ArcAddon. -func (a ArcAddon) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - objectMap["kind"] = AddonTypeArcForKubernetes - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ArcAddon. -func (a *ArcAddon) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ArcAddonProperties - Arc addon properties. type ArcAddonProperties struct { // REQUIRED; Arc resource group name @@ -426,7 +272,7 @@ type BandwidthSchedule struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Bandwidth object related to ASE resource + // READ-ONLY; Metadata pertaining to creation and last modification of BandwidthSchedule SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -448,26 +294,18 @@ type BandwidthScheduleProperties struct { Stop *string `json:"stop,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type BandwidthScheduleProperties. -func (b BandwidthScheduleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "days", b.Days) - populate(objectMap, "rateInMbps", b.RateInMbps) - populate(objectMap, "start", b.Start) - populate(objectMap, "stop", b.Stop) - return json.Marshal(objectMap) -} - // BandwidthSchedulesClientBeginCreateOrUpdateOptions contains the optional parameters for the BandwidthSchedulesClient.BeginCreateOrUpdate // method. type BandwidthSchedulesClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // BandwidthSchedulesClientBeginDeleteOptions contains the optional parameters for the BandwidthSchedulesClient.BeginDelete // method. type BandwidthSchedulesClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // BandwidthSchedulesClientGetOptions contains the optional parameters for the BandwidthSchedulesClient.Get method. @@ -490,14 +328,6 @@ type BandwidthSchedulesList struct { Value []*BandwidthSchedule `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type BandwidthSchedulesList. -func (b BandwidthSchedulesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) - return json.Marshal(objectMap) -} - // ClientAccessRight - The mapping between a particular client IP and the type of access client has on the NFS share. type ClientAccessRight struct { // REQUIRED; Type of access to be allowed for the client. @@ -507,7 +337,11 @@ type ClientAccessRight struct { Client *string `json:"client,omitempty"` } -// CloudEdgeManagementRole role. +// CloudEdgeManagementRole - The preview of Virtual Machine Cloud Management from the Azure supports deploying and managing +// VMs on your Azure Stack Edge device from Azure Portal. For more information, refer to: +// https://docs.microsoft.com/en-us/azure/databox-online/azure-stack-edge-gpu-virtual-machine-overview By using this feature, +// you agree to the preview legal terms. See the +// https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ for additional details. type CloudEdgeManagementRole struct { // REQUIRED; Role type. Kind *RoleTypes `json:"kind,omitempty"` @@ -521,71 +355,13 @@ type CloudEdgeManagementRole struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Role configured on ASE resource + // READ-ONLY; Metadata pertaining to creation and last modification of Role SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. Type *string `json:"type,omitempty" azure:"ro"` } -// GetRole implements the RoleClassification interface for type CloudEdgeManagementRole. -func (c *CloudEdgeManagementRole) GetRole() *Role { - return &Role{ - Kind: c.Kind, - SystemData: c.SystemData, - ID: c.ID, - Name: c.Name, - Type: c.Type, - } -} - -// MarshalJSON implements the json.Marshaller interface for type CloudEdgeManagementRole. -func (c CloudEdgeManagementRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - objectMap["kind"] = RoleTypesCloudEdgeManagement - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEdgeManagementRole. -func (c *CloudEdgeManagementRole) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &c.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &c.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &c.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // CloudEdgeManagementRoleProperties - CloudEdgeManagement Role properties. type CloudEdgeManagementRoleProperties struct { // REQUIRED; Role status. @@ -598,6 +374,99 @@ type CloudEdgeManagementRoleProperties struct { LocalManagementStatus *RoleStatus `json:"localManagementStatus,omitempty" azure:"ro"` } +// CloudError - An error response from the service. +type CloudError struct { + // The error details. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody - An error response from the service. +type CloudErrorBody struct { + // An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + + // A list of additional details about the error. + Details []*CloudErrorBody `json:"details,omitempty"` + + // A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` +} + +// ClusterCapacityViewData - Cluster Compute Data. +type ClusterCapacityViewData struct { + // The FQDN of the cluster. + Fqdn *string `json:"fqdn,omitempty"` + + // The cluster's GPU capacity. + GpuCapacity *ClusterGpuCapacity `json:"gpuCapacity,omitempty"` + + // The last time at which the ClusterCapacityViewData was set. + LastRefreshedTime *time.Time `json:"lastRefreshedTime,omitempty"` + + // The cluster's memory capacity. + MemoryCapacity *ClusterMemoryCapacity `json:"memoryCapacity,omitempty"` + + // The total # of vCPUs provisioned by non-HPN VM per appliance. + TotalProvisionedNonHpnCores *int64 `json:"totalProvisionedNonHpnCores,omitempty"` +} + +// ClusterGpuCapacity - Cluster GPU Data. +type ClusterGpuCapacity struct { + // The free GPU units count in the cluster. + GpuFreeUnitsCount *int32 `json:"gpuFreeUnitsCount,omitempty"` + + // The GPU units count reserved for failover in the cluster. + GpuReservedForFailoverUnitsCount *int32 `json:"gpuReservedForFailoverUnitsCount,omitempty"` + + // The total GPU units count in the cluster. + GpuTotalUnitsCount *int32 `json:"gpuTotalUnitsCount,omitempty"` + + // The cluster GPU Type. + GpuType *string `json:"gpuType,omitempty"` + + // The used GPU units count in the cluster. + GpuUsedUnitsCount *int32 `json:"gpuUsedUnitsCount,omitempty"` +} + +// ClusterMemoryCapacity - NodeCapacityInfo defines the required information to determine the placement of a VM. +type ClusterMemoryCapacity struct { + // The failover memory in the cluster in MB. + ClusterFailoverMemoryMb *float64 `json:"clusterFailoverMemoryMb,omitempty"` + + // The fragmentation memory in the cluster in MB. + ClusterFragmentationMemoryMb *float64 `json:"clusterFragmentationMemoryMb,omitempty"` + + // The free memory in the cluster in MB. + ClusterFreeMemoryMb *float64 `json:"clusterFreeMemoryMb,omitempty"` + + // The memory reserved for Hyper-V in the cluster in MB. + ClusterHypervReserveMemoryMb *float64 `json:"clusterHypervReserveMemoryMb,omitempty"` + + // The memory of the Infra VM in the cluster in MB. + ClusterInfraVMMemoryMb *float64 `json:"clusterInfraVmMemoryMb,omitempty"` + + // The memory used by VMs in the cluster in MB. + ClusterMemoryUsedByVMsMb *float64 `json:"clusterMemoryUsedByVmsMb,omitempty"` + + // The non-failover memory in the cluster in MB. + ClusterNonFailoverVMMb *float64 `json:"clusterNonFailoverVmMb,omitempty"` + + // The total memory in the cluster in MB. + ClusterTotalMemoryMb *float64 `json:"clusterTotalMemoryMb,omitempty"` + + // The used memory in the cluster in MB. + ClusterUsedMemoryMb *float64 `json:"clusterUsedMemoryMb,omitempty"` +} + +// ClusterStorageViewData - Cluster Storage Data. +type ClusterStorageViewData struct { + // The available or free storage on the cluster in MB. + ClusterFreeStorageMb *float64 `json:"clusterFreeStorageMb,omitempty"` + + // Total storage on the cluster in MB. + ClusterTotalStorageMb *float64 `json:"clusterTotalStorageMb,omitempty"` +} + // CniConfig - Cni configuration type CniConfig struct { // READ-ONLY; Pod Subnet @@ -637,16 +506,6 @@ type ContactDetails struct { Phone *string `json:"phone,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ContactDetails. -func (c ContactDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "companyName", c.CompanyName) - populate(objectMap, "contactPerson", c.ContactPerson) - populate(objectMap, "emailList", c.EmailList) - populate(objectMap, "phone", c.Phone) - return json.Marshal(objectMap) -} - // Container - Represents a container on the Data Box Edge/Gateway device. type Container struct { // REQUIRED; The container properties. @@ -658,7 +517,7 @@ type Container struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Container in DataBoxEdge Resource + // READ-ONLY; Metadata pertaining to creation and last modification of Container SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -674,14 +533,6 @@ type ContainerList struct { Value []*Container `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ContainerList. -func (c ContainerList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - // ContainerProperties - The container properties. type ContainerProperties struct { // REQUIRED; DataFormat for Container @@ -697,59 +548,23 @@ type ContainerProperties struct { RefreshDetails *RefreshDetails `json:"refreshDetails,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ContainerProperties. -func (c ContainerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "containerStatus", c.ContainerStatus) - populateTimeRFC3339(objectMap, "createdDateTime", c.CreatedDateTime) - populate(objectMap, "dataFormat", c.DataFormat) - populate(objectMap, "refreshDetails", c.RefreshDetails) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProperties. -func (c *ContainerProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "containerStatus": - err = unpopulate(val, &c.ContainerStatus) - delete(rawMsg, key) - case "createdDateTime": - err = unpopulateTimeRFC3339(val, &c.CreatedDateTime) - delete(rawMsg, key) - case "dataFormat": - err = unpopulate(val, &c.DataFormat) - delete(rawMsg, key) - case "refreshDetails": - err = unpopulate(val, &c.RefreshDetails) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainersClient.BeginCreateOrUpdate // method. type ContainersClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // ContainersClientBeginDeleteOptions contains the optional parameters for the ContainersClient.BeginDelete method. type ContainersClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // ContainersClientBeginRefreshOptions contains the optional parameters for the ContainersClient.BeginRefresh method. type ContainersClientBeginRefreshOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // ContainersClientGetOptions contains the optional parameters for the ContainersClient.Get method. @@ -794,9 +609,6 @@ type Device struct { // Msi identity of the resource Identity *ResourceIdentity `json:"identity,omitempty"` - // The kind of the device. - Kind *DataBoxEdgeDeviceKind `json:"kind,omitempty"` - // The properties of the Data Box Edge/Gateway device. Properties *DeviceProperties `json:"properties,omitempty"` @@ -809,6 +621,9 @@ type Device struct { // READ-ONLY; The path ID that uniquely identifies the object. ID *string `json:"id,omitempty" azure:"ro"` + // READ-ONLY; The kind of the device. + Kind *DataBoxEdgeDeviceKind `json:"kind,omitempty" azure:"ro"` + // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` @@ -819,21 +634,68 @@ type Device struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type Device. -func (d Device) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "kind", d.Kind) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) +// DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions contains the optional parameters for the DeviceCapacityCheckClient.BeginCheckResourceCreationFeasibility +// method. +type DeviceCapacityCheckClientBeginCheckResourceCreationFeasibilityOptions struct { + // The capacity name. + CapacityName *string + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeviceCapacityInfo - Object for Capturing DeviceCapacityInfo +type DeviceCapacityInfo struct { + // The device capacity properties. + Properties *DeviceCapacityInfoProperties `json:"properties,omitempty"` + + // READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The object name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to device capacity info. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DeviceCapacityInfoClientGetDeviceCapacityInfoOptions contains the optional parameters for the DeviceCapacityInfoClient.GetDeviceCapacityInfo +// method. +type DeviceCapacityInfoClientGetDeviceCapacityInfoOptions struct { + // placeholder for future optional parameters +} + +// DeviceCapacityInfoProperties - The properties of Device Capacity Info +type DeviceCapacityInfoProperties struct { + // Cluster capacity data for compute resources (Memory and GPU). + ClusterComputeCapacityInfo *ClusterCapacityViewData `json:"clusterComputeCapacityInfo,omitempty"` + + // Cluster capacity data for storage resources (CSV). + ClusterStorageCapacityInfo *ClusterStorageViewData `json:"clusterStorageCapacityInfo,omitempty"` + + // The dictionary of individual node names and node capacities in the cluster. + NodeCapacityInfos map[string]*HostCapacity `json:"nodeCapacityInfos,omitempty"` + + // Timestamp of request in UTC + TimeStamp *time.Time `json:"timeStamp,omitempty"` +} + +// DeviceCapacityRequestInfo - Object for Capturing DeviceCapacityRequestInfo +type DeviceCapacityRequestInfo struct { + // REQUIRED; The properties of the Device Capacity Request. + Properties *DeviceCapacityRequestInfoProperties `json:"properties,omitempty"` +} + +// DeviceCapacityRequestInfoProperties - Properties of Device Capacity Request Info containing VM's to be checked and their +// corresponding results. +type DeviceCapacityRequestInfoProperties struct { + // REQUIRED; Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + VMPlacementQuery [][]*string `json:"vmPlacementQuery,omitempty"` + + // Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + VMPlacementResults []*VMPlacementRequestResult `json:"vmPlacementResults,omitempty"` } // DeviceExtendedInfo - The extended Info of the Data Box Edge/Gateway device. @@ -847,6 +709,9 @@ type DeviceExtendedInfo struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of DataBoxEdgeDevice + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // READ-ONLY; The hierarchical type of the object. Type *string `json:"type,omitempty" azure:"ro"` } @@ -893,28 +758,31 @@ type DeviceExtendedInfoProperties struct { // Key vault sync status KeyVaultSyncStatus *KeyVaultSyncStatus `json:"keyVaultSyncStatus,omitempty"` + // READ-ONLY; The Container for cloud witness in the storage account. + CloudWitnessContainerName *string `json:"cloudWitnessContainerName,omitempty" azure:"ro"` + + // READ-ONLY; The Cloud Witness Storage account name. + CloudWitnessStorageAccountName *string `json:"cloudWitnessStorageAccountName,omitempty" azure:"ro"` + + // READ-ONLY; The Azure service endpoint of the cloud witness storage account. + CloudWitnessStorageEndpoint *string `json:"cloudWitnessStorageEndpoint,omitempty" azure:"ro"` + + // READ-ONLY; Cluster Witness Type + ClusterWitnessType *ClusterWitnessType `json:"clusterWitnessType,omitempty" azure:"ro"` + // READ-ONLY; Device secrets, will be returned only with ODataFilter $expand=deviceSecrets DeviceSecrets map[string]*Secret `json:"deviceSecrets,omitempty" azure:"ro"` + // READ-ONLY; The witness location of file share. + FileShareWitnessLocation *string `json:"fileShareWitnessLocation,omitempty" azure:"ro"` + + // READ-ONLY; The username of file share. + FileShareWitnessUsername *string `json:"fileShareWitnessUsername,omitempty" azure:"ro"` + // READ-ONLY; The Resource ID of the Resource. ResourceKey *string `json:"resourceKey,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type DeviceExtendedInfoProperties. -func (d DeviceExtendedInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "channelIntegrityKeyName", d.ChannelIntegrityKeyName) - populate(objectMap, "channelIntegrityKeyVersion", d.ChannelIntegrityKeyVersion) - populate(objectMap, "clientSecretStoreId", d.ClientSecretStoreID) - populate(objectMap, "clientSecretStoreUrl", d.ClientSecretStoreURL) - populate(objectMap, "deviceSecrets", d.DeviceSecrets) - populate(objectMap, "encryptionKey", d.EncryptionKey) - populate(objectMap, "encryptionKeyThumbprint", d.EncryptionKeyThumbprint) - populate(objectMap, "keyVaultSyncStatus", d.KeyVaultSyncStatus) - populate(objectMap, "resourceKey", d.ResourceKey) - return json.Marshal(objectMap) -} - // DeviceList - The collection of Data Box Edge/Gateway devices. type DeviceList struct { // READ-ONLY; Link to the next set of results. @@ -924,14 +792,6 @@ type DeviceList struct { Value []*Device `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type DeviceList. -func (d DeviceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - // DevicePatch - The Data Box Edge/Gateway device patch. type DevicePatch struct { // Msi identity of the resource @@ -944,20 +804,8 @@ type DevicePatch struct { Tags map[string]*string `json:"tags,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type DevicePatch. -func (d DevicePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - // DeviceProperties - The properties of the Data Box Edge/Gateway device. type DeviceProperties struct { - // The status of the Data Box Edge/Gateway device. - DataBoxEdgeDeviceStatus *DataBoxEdgeDeviceStatus `json:"dataBoxEdgeDeviceStatus,omitempty"` - // The details of data-residency related properties for this resource DataResidency *DataResidency `json:"dataResidency,omitempty"` @@ -967,6 +815,9 @@ type DeviceProperties struct { // READ-ONLY; The Data Box Edge/Gateway device culture. Culture *string `json:"culture,omitempty" azure:"ro"` + // READ-ONLY; The status of the Data Box Edge/Gateway device. + DataBoxEdgeDeviceStatus *DataBoxEdgeDeviceStatus `json:"dataBoxEdgeDeviceStatus,omitempty" azure:"ro"` + // READ-ONLY; The Description of the Data Box Edge/Gateway device. Description *string `json:"description,omitempty" azure:"ro"` @@ -1010,30 +861,6 @@ type DeviceProperties struct { TimeZone *string `json:"timeZone,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type DeviceProperties. -func (d DeviceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "configuredRoleTypes", d.ConfiguredRoleTypes) - populate(objectMap, "culture", d.Culture) - populate(objectMap, "dataBoxEdgeDeviceStatus", d.DataBoxEdgeDeviceStatus) - populate(objectMap, "dataResidency", d.DataResidency) - populate(objectMap, "description", d.Description) - populate(objectMap, "deviceHcsVersion", d.DeviceHcsVersion) - populate(objectMap, "deviceLocalCapacity", d.DeviceLocalCapacity) - populate(objectMap, "deviceModel", d.DeviceModel) - populate(objectMap, "deviceSoftwareVersion", d.DeviceSoftwareVersion) - populate(objectMap, "deviceType", d.DeviceType) - populate(objectMap, "edgeProfile", d.EdgeProfile) - populate(objectMap, "friendlyName", d.FriendlyName) - populate(objectMap, "modelDescription", d.ModelDescription) - populate(objectMap, "nodeCount", d.NodeCount) - populate(objectMap, "resourceMoveDetails", d.ResourceMoveDetails) - populate(objectMap, "serialNumber", d.SerialNumber) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "timeZone", d.TimeZone) - return json.Marshal(objectMap) -} - // DevicePropertiesPatch - The Data Box Edge/Gateway device properties patch. type DevicePropertiesPatch struct { // Edge Profile property of the Data Box Edge/Gateway device @@ -1043,27 +870,32 @@ type DevicePropertiesPatch struct { // DevicesClientBeginCreateOrUpdateSecuritySettingsOptions contains the optional parameters for the DevicesClient.BeginCreateOrUpdateSecuritySettings // method. type DevicesClientBeginCreateOrUpdateSecuritySettingsOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // DevicesClientBeginDeleteOptions contains the optional parameters for the DevicesClient.BeginDelete method. type DevicesClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // DevicesClientBeginDownloadUpdatesOptions contains the optional parameters for the DevicesClient.BeginDownloadUpdates method. type DevicesClientBeginDownloadUpdatesOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // DevicesClientBeginInstallUpdatesOptions contains the optional parameters for the DevicesClient.BeginInstallUpdates method. type DevicesClientBeginInstallUpdatesOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // DevicesClientBeginScanForUpdatesOptions contains the optional parameters for the DevicesClient.BeginScanForUpdates method. type DevicesClientBeginScanForUpdatesOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // DevicesClientCreateOrUpdateOptions contains the optional parameters for the DevicesClient.CreateOrUpdate method. @@ -1138,7 +970,7 @@ type DiagnosticProactiveLogCollectionSettings struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; DiagnosticProactiveLogCollectionSettings + // READ-ONLY; Metadata pertaining to creation and last modification of DiagnosticProactiveLogCollectionSettings SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -1156,7 +988,7 @@ type DiagnosticRemoteSupportSettings struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; DiagnosticRemoteSupportSettings + // READ-ONLY; Represents resource creation and updation time SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -1169,23 +1001,18 @@ type DiagnosticRemoteSupportSettingsProperties struct { RemoteSupportSettingsList []*RemoteSupportSettings `json:"remoteSupportSettingsList,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type DiagnosticRemoteSupportSettingsProperties. -func (d DiagnosticRemoteSupportSettingsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "remoteSupportSettingsList", d.RemoteSupportSettingsList) - return json.Marshal(objectMap) -} - // DiagnosticSettingsClientBeginUpdateDiagnosticProactiveLogCollectionSettingsOptions contains the optional parameters for // the DiagnosticSettingsClient.BeginUpdateDiagnosticProactiveLogCollectionSettings method. type DiagnosticSettingsClientBeginUpdateDiagnosticProactiveLogCollectionSettingsOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // DiagnosticSettingsClientBeginUpdateDiagnosticRemoteSupportSettingsOptions contains the optional parameters for the DiagnosticSettingsClient.BeginUpdateDiagnosticRemoteSupportSettings // method. type DiagnosticSettingsClientBeginUpdateDiagnosticRemoteSupportSettingsOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsOptions contains the optional parameters for the DiagnosticSettingsClient.GetDiagnosticProactiveLogCollectionSettings @@ -1254,71 +1081,13 @@ type FileEventTrigger struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Trigger in DataBoxEdge Resource + // READ-ONLY; Metadata pertaining to creation and last modification of Trigger SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. Type *string `json:"type,omitempty" azure:"ro"` } -// GetTrigger implements the TriggerClassification interface for type FileEventTrigger. -func (f *FileEventTrigger) GetTrigger() *Trigger { - return &Trigger{ - SystemData: f.SystemData, - Kind: f.Kind, - ID: f.ID, - Name: f.Name, - Type: f.Type, - } -} - -// MarshalJSON implements the json.Marshaller interface for type FileEventTrigger. -func (f FileEventTrigger) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", f.ID) - objectMap["kind"] = TriggerEventTypeFileEvent - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "systemData", f.SystemData) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FileEventTrigger. -func (f *FileEventTrigger) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &f.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &f.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &f.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &f.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &f.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // FileSourceInfo - File source details. type FileSourceInfo struct { // REQUIRED; File share ID. @@ -1351,6 +1120,27 @@ type GenerateCertResponse struct { PublicKey *string `json:"publicKey,omitempty"` } +// HostCapacity - Host Capacity Data. +type HostCapacity struct { + // The available amount of GPUs on the host to use after accounting for GPUS used by reservations on the host. + AvailableGpuCount *int32 `json:"availableGpuCount,omitempty"` + + // The available memory on the host accounting for VM placement size and any host VM reservations. + EffectiveAvailableMemoryMbOnHost *int64 `json:"effectiveAvailableMemoryMbOnHost,omitempty"` + + // The GPU type of the VM. + GpuType *string `json:"gpuType,omitempty"` + + // The name of the host. + HostName *string `json:"hostName,omitempty"` + + // The numa nodes information for Hpn VMs. + NumaNodesData []*NumaNodeData `json:"numaNodesData,omitempty"` + + // The VM used memory per VmId. + VMUsedMemory map[string]*VMMemory `json:"vmUsedMemory,omitempty"` +} + // IPv4Config - Details related to the IPv4 address configuration. type IPv4Config struct { // READ-ONLY; The IPv4 gateway of the network adapter. @@ -1401,71 +1191,13 @@ type IoTAddon struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Addon type + // READ-ONLY; Metadata pertaining to creation and last modification of Addon SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. Type *string `json:"type,omitempty" azure:"ro"` } -// GetAddon implements the AddonClassification interface for type IoTAddon. -func (i *IoTAddon) GetAddon() *Addon { - return &Addon{ - Kind: i.Kind, - SystemData: i.SystemData, - ID: i.ID, - Name: i.Name, - Type: i.Type, - } -} - -// MarshalJSON implements the json.Marshaller interface for type IoTAddon. -func (i IoTAddon) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - objectMap["kind"] = AddonTypeIotEdge - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "systemData", i.SystemData) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IoTAddon. -func (i *IoTAddon) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &i.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &i.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &i.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &i.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &i.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // IoTAddonProperties - IoT addon properties. type IoTAddonProperties struct { // REQUIRED; IoT device metadata to which appliance needs to be connected. @@ -1529,71 +1261,13 @@ type IoTRole struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Role configured on ASE resource + // READ-ONLY; Metadata pertaining to creation and last modification of Role SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. Type *string `json:"type,omitempty" azure:"ro"` } -// GetRole implements the RoleClassification interface for type IoTRole. -func (i *IoTRole) GetRole() *Role { - return &Role{ - Kind: i.Kind, - SystemData: i.SystemData, - ID: i.ID, - Name: i.Name, - Type: i.Type, - } -} - -// MarshalJSON implements the json.Marshaller interface for type IoTRole. -func (i IoTRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - objectMap["kind"] = RoleTypesIOT - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "systemData", i.SystemData) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IoTRole. -func (i *IoTRole) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &i.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &i.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &i.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &i.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &i.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // IoTRoleProperties - IoT role properties. type IoTRoleProperties struct { // REQUIRED; Host OS supported by the IoT role. @@ -1621,20 +1295,6 @@ type IoTRoleProperties struct { HostPlatformType *HostPlatformType `json:"hostPlatformType,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type IoTRoleProperties. -func (i IoTRoleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "computeResource", i.ComputeResource) - populate(objectMap, "hostPlatform", i.HostPlatform) - populate(objectMap, "hostPlatformType", i.HostPlatformType) - populate(objectMap, "ioTDeviceDetails", i.IoTDeviceDetails) - populate(objectMap, "ioTEdgeAgentInfo", i.IoTEdgeAgentInfo) - populate(objectMap, "ioTEdgeDeviceDetails", i.IoTEdgeDeviceDetails) - populate(objectMap, "roleStatus", i.RoleStatus) - populate(objectMap, "shareMappings", i.ShareMappings) - return json.Marshal(objectMap) -} - // Job - A device job. type Job struct { // READ-ONLY; The UTC date and time at which the job completed. @@ -1665,65 +1325,6 @@ type Job struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type Job. -func (j Job) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", j.EndTime) - populate(objectMap, "error", j.Error) - populate(objectMap, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "percentComplete", j.PercentComplete) - populate(objectMap, "properties", j.Properties) - populateTimeRFC3339(objectMap, "startTime", j.StartTime) - populate(objectMap, "status", j.Status) - populate(objectMap, "type", j.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Job. -func (j *Job) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, &j.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, &j.Error) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &j.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &j.Name) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, &j.PercentComplete) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &j.Properties) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, &j.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &j.Status) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &j.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // JobErrorDetails - The job error information containing the list of job errors. type JobErrorDetails struct { // READ-ONLY; The code intended for programmatic access. @@ -1736,15 +1337,6 @@ type JobErrorDetails struct { Message *string `json:"message,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type JobErrorDetails. -func (j JobErrorDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", j.Code) - populate(objectMap, "errorDetails", j.ErrorDetails) - populate(objectMap, "message", j.Message) - return json.Marshal(objectMap) -} - // JobErrorItem - The job error items. type JobErrorItem struct { // READ-ONLY; The code intended for programmatic access. @@ -1757,15 +1349,6 @@ type JobErrorItem struct { Recommendations []*string `json:"recommendations,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type JobErrorItem. -func (j JobErrorItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", j.Code) - populate(objectMap, "message", j.Message) - populate(objectMap, "recommendations", j.Recommendations) - return json.Marshal(objectMap) -} - // JobProperties - The properties for the job. type JobProperties struct { // If only subfolders need to be refreshed, then the subfolder path inside the share or container. (The path is empty if there @@ -1811,15 +1394,6 @@ type KubernetesClusterInfo struct { Nodes []*NodeInfo `json:"nodes,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type KubernetesClusterInfo. -func (k KubernetesClusterInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etcdInfo", k.EtcdInfo) - populate(objectMap, "nodes", k.Nodes) - populate(objectMap, "version", k.Version) - return json.Marshal(objectMap) -} - // KubernetesIPConfiguration - Kubernetes node IP configuration type KubernetesIPConfiguration struct { // IP address of the Kubernetes node. @@ -1829,7 +1403,18 @@ type KubernetesIPConfiguration struct { Port *string `json:"port,omitempty" azure:"ro"` } -// KubernetesRole - Kubernetes role. +// KubernetesRole - The limited preview of Kubernetes Cluster Management from the Azure supports: +// 1. Using a simple turn-key option in Azure Portal, deploy a Kubernetes cluster on your Azure Stack Edge device. +// 2. Configure Kubernetes cluster running on your device with Arc enabled Kubernetes with a click of a button in the Azure +// Portal. Azure Arc enables organizations to view, manage, and govern their +// on-premises Kubernetes clusters using the Azure Portal, command line tools, and APIs. +// 3. Easily configure Persistent Volumes using SMB and NFS shares for storing container data. For more information, refer +// to the document here: +// https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8-Cloud-Management-20210323.pdf +// Or Demo: +// https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8S-Cloud-Management-20210323.mp4 +// By using this feature, you agree to the preview legal terms. See the +// https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ type KubernetesRole struct { // REQUIRED; Role type. Kind *RoleTypes `json:"kind,omitempty"` @@ -1843,71 +1428,13 @@ type KubernetesRole struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Role configured on ASE resource + // READ-ONLY; Metadata pertaining to creation and last modification of Role SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. Type *string `json:"type,omitempty" azure:"ro"` } -// GetRole implements the RoleClassification interface for type KubernetesRole. -func (k *KubernetesRole) GetRole() *Role { - return &Role{ - Kind: k.Kind, - SystemData: k.SystemData, - ID: k.ID, - Name: k.Name, - Type: k.Type, - } -} - -// MarshalJSON implements the json.Marshaller interface for type KubernetesRole. -func (k KubernetesRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", k.ID) - objectMap["kind"] = RoleTypesKubernetes - populate(objectMap, "name", k.Name) - populate(objectMap, "properties", k.Properties) - populate(objectMap, "systemData", k.SystemData) - populate(objectMap, "type", k.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesRole. -func (k *KubernetesRole) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &k.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &k.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &k.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &k.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &k.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &k.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // KubernetesRoleCompute - Kubernetes role compute resource type KubernetesRoleCompute struct { // REQUIRED; VM profile @@ -1971,14 +1498,6 @@ type KubernetesRoleStorage struct { StorageClasses []*KubernetesRoleStorageClassInfo `json:"storageClasses,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type KubernetesRoleStorage. -func (k KubernetesRoleStorage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "endpoints", k.Endpoints) - populate(objectMap, "storageClasses", k.StorageClasses) - return json.Marshal(objectMap) -} - // KubernetesRoleStorageClassInfo - Kubernetes storage class info. type KubernetesRoleStorageClassInfo struct { // READ-ONLY; Storage class name. @@ -2014,71 +1533,13 @@ type MECRole struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Role configured on ASE resource + // READ-ONLY; Metadata pertaining to creation and last modification of Role SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. Type *string `json:"type,omitempty" azure:"ro"` } -// GetRole implements the RoleClassification interface for type MECRole. -func (m *MECRole) GetRole() *Role { - return &Role{ - Kind: m.Kind, - SystemData: m.SystemData, - ID: m.ID, - Name: m.Name, - Type: m.Type, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MECRole. -func (m MECRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - objectMap["kind"] = RoleTypesMEC - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MECRole. -func (m *MECRole) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MECRoleProperties - MEC role properties. type MECRoleProperties struct { // REQUIRED; Role status. @@ -2109,16 +1570,6 @@ type MetricConfiguration struct { MetricNameSpace *string `json:"metricNameSpace,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MetricConfiguration. -func (m MetricConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "counterSets", m.CounterSets) - populate(objectMap, "mdmAccount", m.MdmAccount) - populate(objectMap, "metricNameSpace", m.MetricNameSpace) - populate(objectMap, "resourceId", m.ResourceID) - return json.Marshal(objectMap) -} - // MetricCounter - The metric counter type MetricCounter struct { // REQUIRED; The counter name. @@ -2134,29 +1585,12 @@ type MetricCounter struct { Instance *string `json:"instance,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MetricCounter. -func (m MetricCounter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalDimensions", m.AdditionalDimensions) - populate(objectMap, "dimensionFilter", m.DimensionFilter) - populate(objectMap, "instance", m.Instance) - populate(objectMap, "name", m.Name) - return json.Marshal(objectMap) -} - // MetricCounterSet - The metric counter set type MetricCounterSet struct { // REQUIRED; The counters that should be collected in this set. Counters []*MetricCounter `json:"counters,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MetricCounterSet. -func (m MetricCounterSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "counters", m.Counters) - return json.Marshal(objectMap) -} - // MetricDimension - The metric dimension type MetricDimension struct { // REQUIRED; The dimension value. @@ -2214,32 +1648,17 @@ type MetricSpecificationV1 struct { Unit *MetricUnit `json:"unit,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MetricSpecificationV1. -func (m MetricSpecificationV1) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aggregationType", m.AggregationType) - populate(objectMap, "category", m.Category) - populate(objectMap, "dimensions", m.Dimensions) - populate(objectMap, "displayDescription", m.DisplayDescription) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "fillGapWithZero", m.FillGapWithZero) - populate(objectMap, "name", m.Name) - populate(objectMap, "resourceIdDimensionNameOverride", m.ResourceIDDimensionNameOverride) - populate(objectMap, "supportedAggregationTypes", m.SupportedAggregationTypes) - populate(objectMap, "supportedTimeGrainTypes", m.SupportedTimeGrainTypes) - populate(objectMap, "unit", m.Unit) - return json.Marshal(objectMap) -} - // MonitoringConfigClientBeginCreateOrUpdateOptions contains the optional parameters for the MonitoringConfigClient.BeginCreateOrUpdate // method. type MonitoringConfigClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // MonitoringConfigClientBeginDeleteOptions contains the optional parameters for the MonitoringConfigClient.BeginDelete method. type MonitoringConfigClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // MonitoringConfigClientGetOptions contains the optional parameters for the MonitoringConfigClient.Get method. @@ -2263,7 +1682,7 @@ type MonitoringMetricConfiguration struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; MonitoringConfiguration on ASE device + // READ-ONLY; Metadata pertaining to creation and last modification of MonitoringConfiguration SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -2279,27 +1698,12 @@ type MonitoringMetricConfigurationList struct { Value []*MonitoringMetricConfiguration `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MonitoringMetricConfigurationList. -func (m MonitoringMetricConfigurationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - // MonitoringMetricConfigurationProperties - Metrics properties type MonitoringMetricConfigurationProperties struct { // REQUIRED; The metrics configuration details MetricConfigurations []*MetricConfiguration `json:"metricConfigurations,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MonitoringMetricConfigurationProperties. -func (m MonitoringMetricConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "metricConfigurations", m.MetricConfigurations) - return json.Marshal(objectMap) -} - // MountPointMap - The share mount point. type MountPointMap struct { // REQUIRED; ID of the share mounted to the role VM. @@ -2318,6 +1722,15 @@ type MountPointMap struct { RoleType *RoleTypes `json:"roleType,omitempty" azure:"ro"` } +// MoveRequest - Resource Move details +type MoveRequest struct { + // REQUIRED; List of resources to be moved + Resources []*string `json:"resources,omitempty"` + + // REQUIRED; Target resource group ARMId + TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` +} + // NetworkAdapter - Represents the networkAdapter on a device. type NetworkAdapter struct { // Value indicating whether this adapter has DHCP enabled. @@ -2366,27 +1779,6 @@ type NetworkAdapter struct { Status *NetworkAdapterStatus `json:"status,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type NetworkAdapter. -func (n NetworkAdapter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "adapterId", n.AdapterID) - populate(objectMap, "adapterPosition", n.AdapterPosition) - populate(objectMap, "dnsServers", n.DNSServers) - populate(objectMap, "dhcpStatus", n.DhcpStatus) - populate(objectMap, "ipv4Configuration", n.IPv4Configuration) - populate(objectMap, "ipv6Configuration", n.IPv6Configuration) - populate(objectMap, "ipv6LinkLocalAddress", n.IPv6LinkLocalAddress) - populate(objectMap, "index", n.Index) - populate(objectMap, "label", n.Label) - populate(objectMap, "linkSpeed", n.LinkSpeed) - populate(objectMap, "macAddress", n.MacAddress) - populate(objectMap, "networkAdapterName", n.NetworkAdapterName) - populate(objectMap, "nodeId", n.NodeID) - populate(objectMap, "rdmaStatus", n.RdmaStatus) - populate(objectMap, "status", n.Status) - return json.Marshal(objectMap) -} - // NetworkAdapterPosition - The network adapter position. type NetworkAdapterPosition struct { // READ-ONLY; The network group. @@ -2407,7 +1799,7 @@ type NetworkSettings struct { // READ-ONLY; The properties of network settings of a device. Properties *NetworkSettingsProperties `json:"properties,omitempty" azure:"ro"` - // READ-ONLY; NetworkSettings on ASE device + // READ-ONLY; Metadata pertaining to creation and last modification of NetworkSettings SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -2420,13 +1812,6 @@ type NetworkSettingsProperties struct { NetworkAdapters []*NetworkAdapter `json:"networkAdapters,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type NetworkSettingsProperties. -func (n NetworkSettingsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkAdapters", n.NetworkAdapters) - return json.Marshal(objectMap) -} - // Node - Represents a single node in a Data box Edge/Gateway device Gateway devices, standalone Edge devices and a single // node cluster Edge device will all have 1 node Multi-node Edge devices will have more // than 1 nodes @@ -2456,15 +1841,6 @@ type NodeInfo struct { Type *KubernetesNodeType `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type NodeInfo. -func (n NodeInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ipConfiguration", n.IPConfiguration) - populate(objectMap, "name", n.Name) - populate(objectMap, "type", n.Type) - return json.Marshal(objectMap) -} - // NodeList - Collection of Nodes. type NodeList struct { // READ-ONLY; Link to the next set of results. @@ -2474,14 +1850,6 @@ type NodeList struct { Value []*Node `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type NodeList. -func (n NodeList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) - return json.Marshal(objectMap) -} - // NodeProperties - This class represents the nodes in a highly available cluster type NodeProperties struct { // READ-ONLY; Serial number of the Chassis @@ -2512,6 +1880,30 @@ type NodesClientListByDataBoxEdgeDeviceOptions struct { // placeholder for future optional parameters } +// NumaNodeData - NUMA node data. +type NumaNodeData struct { + // The effective available memory on the NUMA node in MB. + EffectiveAvailableMemoryInMb *int64 `json:"effectiveAvailableMemoryInMb,omitempty"` + + // The free VCPU indices for the Hpn VMs. + FreeVCPUIndexesForHpn []*int32 `json:"freeVCpuIndexesForHpn,omitempty"` + + // The logical cores per core count. + LogicalCoreCountPerCore *int32 `json:"logicalCoreCountPerCore,omitempty"` + + // The NUMA node index. + NumaNodeIndex *int32 `json:"numaNodeIndex,omitempty"` + + // The total memory on the NUMA node. + TotalMemoryInMb *int64 `json:"totalMemoryInMb,omitempty"` + + // The VCPU indices for Hpn VMs + VCPUIndexesForHpn []*int32 `json:"vCpuIndexesForHpn,omitempty"` + + // The VCPU indices for the root. + VCPUIndexesForRoot []*int32 `json:"vCpuIndexesForRoot,omitempty"` +} + // Operations. type Operation struct { // Properties displayed for the operation. @@ -2565,14 +1957,6 @@ type OperationsList struct { NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type OperationsList. -func (o OperationsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - // OperationsStatusClientGetOptions contains the optional parameters for the OperationsStatusClient.Get method. type OperationsStatusClientGetOptions struct { // placeholder for future optional parameters @@ -2586,10 +1970,13 @@ type Order struct { // READ-ONLY; The path ID that uniquely identifies the object. ID *string `json:"id,omitempty" azure:"ro"` + // READ-ONLY; It specify the order api version. + Kind *string `json:"kind,omitempty" azure:"ro"` + // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Order configured on ASE resource + // READ-ONLY; Metadata pertaining to creation and last modification of Order SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -2605,14 +1992,6 @@ type OrderList struct { Value []*Order `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type OrderList. -func (o OrderList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - // OrderProperties - Order properties. type OrderProperties struct { // REQUIRED; The contact details. @@ -2633,6 +2012,9 @@ type OrderProperties struct { // READ-ONLY; List of status changes in the order. OrderHistory []*OrderStatus `json:"orderHistory,omitempty" azure:"ro"` + // READ-ONLY; It specify the order resource id. + OrderID *string `json:"orderId,omitempty" azure:"ro"` + // READ-ONLY; Tracking information for the package returned from the customer whether it has an original or a replacement // device. ReturnTrackingInfo []*TrackingInfo `json:"returnTrackingInfo,omitempty" azure:"ro"` @@ -2641,20 +2023,6 @@ type OrderProperties struct { SerialNumber *string `json:"serialNumber,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type OrderProperties. -func (o OrderProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contactInformation", o.ContactInformation) - populate(objectMap, "currentStatus", o.CurrentStatus) - populate(objectMap, "deliveryTrackingInfo", o.DeliveryTrackingInfo) - populate(objectMap, "orderHistory", o.OrderHistory) - populate(objectMap, "returnTrackingInfo", o.ReturnTrackingInfo) - populate(objectMap, "serialNumber", o.SerialNumber) - populate(objectMap, "shipmentType", o.ShipmentType) - populate(objectMap, "shippingAddress", o.ShippingAddress) - return json.Marshal(objectMap) -} - // OrderStatus - Represents a single status change. type OrderStatus struct { // REQUIRED; Status of the order as per the allowed status types. @@ -2673,57 +2041,16 @@ type OrderStatus struct { UpdateDateTime *time.Time `json:"updateDateTime,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type OrderStatus. -func (o OrderStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalOrderDetails", o.AdditionalOrderDetails) - populate(objectMap, "comments", o.Comments) - populate(objectMap, "status", o.Status) - populate(objectMap, "trackingInformation", o.TrackingInformation) - populateTimeRFC3339(objectMap, "updateDateTime", o.UpdateDateTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OrderStatus. -func (o *OrderStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalOrderDetails": - err = unpopulate(val, &o.AdditionalOrderDetails) - delete(rawMsg, key) - case "comments": - err = unpopulate(val, &o.Comments) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &o.Status) - delete(rawMsg, key) - case "trackingInformation": - err = unpopulate(val, &o.TrackingInformation) - delete(rawMsg, key) - case "updateDateTime": - err = unpopulateTimeRFC3339(val, &o.UpdateDateTime) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // OrdersClientBeginCreateOrUpdateOptions contains the optional parameters for the OrdersClient.BeginCreateOrUpdate method. type OrdersClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // OrdersClientBeginDeleteOptions contains the optional parameters for the OrdersClient.BeginDelete method. type OrdersClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // OrdersClientGetOptions contains the optional parameters for the OrdersClient.Get method. @@ -2756,71 +2083,13 @@ type PeriodicTimerEventTrigger struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Trigger in DataBoxEdge Resource + // READ-ONLY; Metadata pertaining to creation and last modification of Trigger SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. Type *string `json:"type,omitempty" azure:"ro"` } -// GetTrigger implements the TriggerClassification interface for type PeriodicTimerEventTrigger. -func (p *PeriodicTimerEventTrigger) GetTrigger() *Trigger { - return &Trigger{ - SystemData: p.SystemData, - Kind: p.Kind, - ID: p.ID, - Name: p.Name, - Type: p.Type, - } -} - -// MarshalJSON implements the json.Marshaller interface for type PeriodicTimerEventTrigger. -func (p PeriodicTimerEventTrigger) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - objectMap["kind"] = TriggerEventTypePeriodicTimerEvent - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicTimerEventTrigger. -func (p *PeriodicTimerEventTrigger) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &p.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &p.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &p.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &p.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &p.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // PeriodicTimerProperties - Periodic timer trigger properties. type PeriodicTimerProperties struct { // REQUIRED; Role Sink information. @@ -2849,41 +2118,6 @@ type PeriodicTimerSourceInfo struct { Topic *string `json:"topic,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PeriodicTimerSourceInfo. -func (p PeriodicTimerSourceInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "schedule", p.Schedule) - populateTimeRFC3339(objectMap, "startTime", p.StartTime) - populate(objectMap, "topic", p.Topic) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicTimerSourceInfo. -func (p *PeriodicTimerSourceInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "schedule": - err = unpopulate(val, &p.Schedule) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, &p.StartTime) - delete(rawMsg, key) - case "topic": - err = unpopulate(val, &p.Topic) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ProactiveLogCollectionSettingsProperties - The properties of proactive log collection settings. type ProactiveLogCollectionSettingsProperties struct { // REQUIRED; Proactive diagnostic collection consent flag @@ -2918,45 +2152,6 @@ type RefreshDetails struct { LastJob *string `json:"lastJob,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type RefreshDetails. -func (r RefreshDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorManifestFile", r.ErrorManifestFile) - populate(objectMap, "inProgressRefreshJobId", r.InProgressRefreshJobID) - populateTimeRFC3339(objectMap, "lastCompletedRefreshJobTimeInUTC", r.LastCompletedRefreshJobTimeInUTC) - populate(objectMap, "lastJob", r.LastJob) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RefreshDetails. -func (r *RefreshDetails) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "errorManifestFile": - err = unpopulate(val, &r.ErrorManifestFile) - delete(rawMsg, key) - case "inProgressRefreshJobId": - err = unpopulate(val, &r.InProgressRefreshJobID) - delete(rawMsg, key) - case "lastCompletedRefreshJobTimeInUTC": - err = unpopulateTimeRFC3339(val, &r.LastCompletedRefreshJobTimeInUTC) - delete(rawMsg, key) - case "lastJob": - err = unpopulate(val, &r.LastJob) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // RemoteSupportSettings - RemoteApplicationType for which remote support settings is being modified type RemoteSupportSettings struct { // Access level allowed for this remote application type @@ -2969,41 +2164,6 @@ type RemoteSupportSettings struct { RemoteApplicationType *RemoteApplicationType `json:"remoteApplicationType,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type RemoteSupportSettings. -func (r RemoteSupportSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accessLevel", r.AccessLevel) - populateTimeRFC3339(objectMap, "expirationTimeStampInUTC", r.ExpirationTimeStampInUTC) - populate(objectMap, "remoteApplicationType", r.RemoteApplicationType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RemoteSupportSettings. -func (r *RemoteSupportSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "accessLevel": - err = unpopulate(val, &r.AccessLevel) - delete(rawMsg, key) - case "expirationTimeStampInUTC": - err = unpopulateTimeRFC3339(val, &r.ExpirationTimeStampInUTC) - delete(rawMsg, key) - case "remoteApplicationType": - err = unpopulate(val, &r.RemoteApplicationType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ResourceIdentity - Msi identity details of the resource type ResourceIdentity struct { // Identity type @@ -3025,37 +2185,6 @@ type ResourceMoveDetails struct { OperationInProgressLockTimeoutInUTC *time.Time `json:"operationInProgressLockTimeoutInUTC,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ResourceMoveDetails. -func (r ResourceMoveDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "operationInProgress", r.OperationInProgress) - populateTimeRFC3339(objectMap, "operationInProgressLockTimeoutInUTC", r.OperationInProgressLockTimeoutInUTC) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceMoveDetails. -func (r *ResourceMoveDetails) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "operationInProgress": - err = unpopulate(val, &r.OperationInProgress) - delete(rawMsg, key) - case "operationInProgressLockTimeoutInUTC": - err = unpopulateTimeRFC3339(val, &r.OperationInProgressLockTimeoutInUTC) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // RoleClassification provides polymorphic access to related types. // Call the interface's GetRole() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -3076,16 +2205,13 @@ type Role struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Role configured on ASE resource + // READ-ONLY; Metadata pertaining to creation and last modification of Role SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. Type *string `json:"type,omitempty" azure:"ro"` } -// GetRole implements the RoleClassification interface for type Role. -func (r *Role) GetRole() *Role { return r } - // RoleList - Collection of all the roles on the Data Box Edge device. type RoleList struct { // READ-ONLY; Link to the next set of results. @@ -3095,37 +2221,6 @@ type RoleList struct { Value []RoleClassification `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type RoleList. -func (r RoleList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleList. -func (r *RoleList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, &r.NextLink) - delete(rawMsg, key) - case "value": - r.Value, err = unmarshalRoleClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // RoleSinkInfo - Compute role against which events will be raised. type RoleSinkInfo struct { // REQUIRED; Compute role ID. @@ -3134,12 +2229,14 @@ type RoleSinkInfo struct { // RolesClientBeginCreateOrUpdateOptions contains the optional parameters for the RolesClient.BeginCreateOrUpdate method. type RolesClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // RolesClientBeginDeleteOptions contains the optional parameters for the RolesClient.BeginDelete method. type RolesClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // RolesClientGetOptions contains the optional parameters for the RolesClient.Get method. @@ -3201,27 +2298,6 @@ type SKU struct { Version *SKUVersion `json:"version,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SKU. -func (s SKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiVersions", s.APIVersions) - populate(objectMap, "availability", s.Availability) - populate(objectMap, "capabilities", s.Capabilities) - populate(objectMap, "costs", s.Costs) - populate(objectMap, "family", s.Family) - populate(objectMap, "kind", s.Kind) - populate(objectMap, "locationInfo", s.LocationInfo) - populate(objectMap, "locations", s.Locations) - populate(objectMap, "name", s.Name) - populate(objectMap, "resourceType", s.ResourceType) - populate(objectMap, "shipmentTypes", s.ShipmentTypes) - populate(objectMap, "signupOption", s.SignupOption) - populate(objectMap, "size", s.Size) - populate(objectMap, "tier", s.Tier) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - // SKUCapability - The metadata to describe the capability. type SKUCapability struct { // READ-ONLY; An invariant to describe the feature. @@ -3261,14 +2337,6 @@ type SKUList struct { Value []*SKU `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SKUList. -func (s SKUList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - // SKULocationInfo - The location info. type SKULocationInfo struct { // READ-ONLY; The location. @@ -3281,15 +2349,6 @@ type SKULocationInfo struct { Zones []*string `json:"zones,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SKULocationInfo. -func (s SKULocationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "location", s.Location) - populate(objectMap, "sites", s.Sites) - populate(objectMap, "zones", s.Zones) - return json.Marshal(objectMap) -} - // Secret - Holds device secret either as a KeyVault reference or as an encrypted value. type Secret struct { // Encrypted (using device public key) secret value. @@ -3328,13 +2387,6 @@ type ServiceSpecification struct { MetricSpecifications []*MetricSpecificationV1 `json:"metricSpecifications,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. -func (s ServiceSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "metricSpecifications", s.MetricSpecifications) - return json.Marshal(objectMap) -} - // Share - Represents a share on the Data Box Edge/Gateway device. type Share struct { // REQUIRED; The share properties. @@ -3346,7 +2398,7 @@ type Share struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Share on ASE device + // READ-ONLY; Metadata pertaining to creation and last modification of Share SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -3371,14 +2423,6 @@ type ShareList struct { Value []*Share `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ShareList. -func (s ShareList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - // ShareProperties - The share properties. type ShareProperties struct { // REQUIRED; Access protocol to be used by the share. @@ -3412,35 +2456,22 @@ type ShareProperties struct { ShareMappings []*MountPointMap `json:"shareMappings,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ShareProperties. -func (s ShareProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accessProtocol", s.AccessProtocol) - populate(objectMap, "azureContainerInfo", s.AzureContainerInfo) - populate(objectMap, "clientAccessRights", s.ClientAccessRights) - populate(objectMap, "dataPolicy", s.DataPolicy) - populate(objectMap, "description", s.Description) - populate(objectMap, "monitoringStatus", s.MonitoringStatus) - populate(objectMap, "refreshDetails", s.RefreshDetails) - populate(objectMap, "shareMappings", s.ShareMappings) - populate(objectMap, "shareStatus", s.ShareStatus) - populate(objectMap, "userAccessRights", s.UserAccessRights) - return json.Marshal(objectMap) -} - // SharesClientBeginCreateOrUpdateOptions contains the optional parameters for the SharesClient.BeginCreateOrUpdate method. type SharesClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // SharesClientBeginDeleteOptions contains the optional parameters for the SharesClient.BeginDelete method. type SharesClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // SharesClientBeginRefreshOptions contains the optional parameters for the SharesClient.BeginRefresh method. type SharesClientBeginRefreshOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // SharesClientGetOptions contains the optional parameters for the SharesClient.Get method. @@ -3465,7 +2496,7 @@ type StorageAccount struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; StorageAccount object on ASE device + // READ-ONLY; Metadata pertaining to creation and last modification of StorageAccount SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -3483,7 +2514,7 @@ type StorageAccountCredential struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; StorageAccountCredential object + // READ-ONLY; Metadata pertaining to creation and last modification of StorageAccountCredential SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -3499,14 +2530,6 @@ type StorageAccountCredentialList struct { Value []*StorageAccountCredential `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type StorageAccountCredentialList. -func (s StorageAccountCredentialList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - // StorageAccountCredentialProperties - The storage account credential properties. type StorageAccountCredentialProperties struct { // REQUIRED; Type of storage accessed on the storage account. @@ -3537,13 +2560,15 @@ type StorageAccountCredentialProperties struct { // StorageAccountCredentialsClientBeginCreateOrUpdateOptions contains the optional parameters for the StorageAccountCredentialsClient.BeginCreateOrUpdate // method. type StorageAccountCredentialsClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // StorageAccountCredentialsClientBeginDeleteOptions contains the optional parameters for the StorageAccountCredentialsClient.BeginDelete // method. type StorageAccountCredentialsClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // StorageAccountCredentialsClientGetOptions contains the optional parameters for the StorageAccountCredentialsClient.Get @@ -3567,14 +2592,6 @@ type StorageAccountList struct { Value []*StorageAccount `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type StorageAccountList. -func (s StorageAccountList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - // StorageAccountProperties - The storage account properties. type StorageAccountProperties struct { // REQUIRED; Data policy of the storage Account. @@ -3599,12 +2616,14 @@ type StorageAccountProperties struct { // StorageAccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the StorageAccountsClient.BeginCreateOrUpdate // method. type StorageAccountsClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // StorageAccountsClientBeginDeleteOptions contains the optional parameters for the StorageAccountsClient.BeginDelete method. type StorageAccountsClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // StorageAccountsClientGetOptions contains the optional parameters for the StorageAccountsClient.Get method. @@ -3626,17 +2645,6 @@ type SubscriptionProperties struct { TenantID *string `json:"tenantId,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type SubscriptionProperties. -func (s SubscriptionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "locationPlacementId", s.LocationPlacementID) - populate(objectMap, "quotaId", s.QuotaID) - populate(objectMap, "registeredFeatures", s.RegisteredFeatures) - populate(objectMap, "serializedDetails", s.SerializedDetails) - populate(objectMap, "tenantId", s.TenantID) - return json.Marshal(objectMap) -} - type SubscriptionRegisteredFeatures struct { Name *string `json:"name,omitempty"` State *string `json:"state,omitempty"` @@ -3648,52 +2656,18 @@ type SupportPackageRequestProperties struct { // or a comma separated list of log types that are required Include *string `json:"include,omitempty"` - // MaximumTimeStamp until where logs need to be collected + // Start of the timespan of the log collection MaximumTimeStamp *time.Time `json:"maximumTimeStamp,omitempty"` - // Start of the timespan of the log collection + // MinimumTimeStamp from where logs need to be collected MinimumTimeStamp *time.Time `json:"minimumTimeStamp,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type SupportPackageRequestProperties. -func (s SupportPackageRequestProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "include", s.Include) - populateTimeRFC3339(objectMap, "maximumTimeStamp", s.MaximumTimeStamp) - populateTimeRFC3339(objectMap, "minimumTimeStamp", s.MinimumTimeStamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SupportPackageRequestProperties. -func (s *SupportPackageRequestProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "include": - err = unpopulate(val, &s.Include) - delete(rawMsg, key) - case "maximumTimeStamp": - err = unpopulateTimeRFC3339(val, &s.MaximumTimeStamp) - delete(rawMsg, key) - case "minimumTimeStamp": - err = unpopulateTimeRFC3339(val, &s.MinimumTimeStamp) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // SupportPackagesClientBeginTriggerSupportPackageOptions contains the optional parameters for the SupportPackagesClient.BeginTriggerSupportPackage // method. type SupportPackagesClientBeginTriggerSupportPackageOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // SymmetricKey - Symmetric key for authentication. @@ -3713,7 +2687,7 @@ type SystemData struct { // The type of identity that created the resource. CreatedByType *CreatedByType `json:"createdByType,omitempty"` - // The type of identity that last modified the resource. + // The timestamp of resource last modification (UTC) LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` // The identity that last modified the resource. @@ -3723,51 +2697,25 @@ type SystemData struct { LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil +// SystemDataAutoGenerated - Metadata pertaining to creation and last modification of the resource. +type SystemDataAutoGenerated struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time `json:"createdAt,omitempty"` + + // The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // The type of identity that created the resource. + CreatedByType *CreatedByType `json:"createdByType,omitempty"` + + // The type of identity that last modified the resource. + LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + + // The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } // TrackingInfo - Tracking courier information. @@ -3805,16 +2753,13 @@ type Trigger struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Trigger in DataBoxEdge Resource + // READ-ONLY; Metadata pertaining to creation and last modification of Trigger SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. Type *string `json:"type,omitempty" azure:"ro"` } -// GetTrigger implements the TriggerClassification interface for type Trigger. -func (t *Trigger) GetTrigger() *Trigger { return t } - // TriggerList - Collection of all trigger on the data box edge device. type TriggerList struct { // READ-ONLY; Link to the next set of results. @@ -3824,37 +2769,6 @@ type TriggerList struct { Value []TriggerClassification `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type TriggerList. -func (t TriggerList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", t.NextLink) - populate(objectMap, "value", t.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerList. -func (t *TriggerList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, &t.NextLink) - delete(rawMsg, key) - case "value": - t.Value, err = unmarshalTriggerClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // TriggerSupportPackageRequest - The request object for trigger support package. type TriggerSupportPackageRequest struct { // REQUIRED; The TriggerSupportPackageRequest properties. @@ -3872,12 +2786,14 @@ type TriggerSupportPackageRequest struct { // TriggersClientBeginCreateOrUpdateOptions contains the optional parameters for the TriggersClient.BeginCreateOrUpdate method. type TriggersClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // TriggersClientBeginDeleteOptions contains the optional parameters for the TriggersClient.BeginDelete method. type TriggersClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // TriggersClientGetOptions contains the optional parameters for the TriggersClient.Get method. @@ -3966,7 +2882,7 @@ type UpdateSummary struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; UpdateSummary Result + // READ-ONLY; Metadata pertaining to creation and last modification of UpdateSummary SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -4051,129 +2967,6 @@ type UpdateSummaryProperties struct { Updates []*UpdateDetails `json:"updates,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type UpdateSummaryProperties. -func (u UpdateSummaryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "deviceLastScannedDateTime", u.DeviceLastScannedDateTime) - populate(objectMap, "deviceVersionNumber", u.DeviceVersionNumber) - populate(objectMap, "friendlyDeviceVersionName", u.FriendlyDeviceVersionName) - populate(objectMap, "inProgressDownloadJobId", u.InProgressDownloadJobID) - populateTimeRFC3339(objectMap, "inProgressDownloadJobStartedDateTime", u.InProgressDownloadJobStartedDateTime) - populate(objectMap, "inProgressInstallJobId", u.InProgressInstallJobID) - populateTimeRFC3339(objectMap, "inProgressInstallJobStartedDateTime", u.InProgressInstallJobStartedDateTime) - populateTimeRFC3339(objectMap, "lastCompletedDownloadJobDateTime", u.LastCompletedDownloadJobDateTime) - populate(objectMap, "lastCompletedDownloadJobId", u.LastCompletedDownloadJobID) - populateTimeRFC3339(objectMap, "lastCompletedInstallJobDateTime", u.LastCompletedInstallJobDateTime) - populate(objectMap, "lastCompletedInstallJobId", u.LastCompletedInstallJobID) - populateTimeRFC3339(objectMap, "lastCompletedScanJobDateTime", u.LastCompletedScanJobDateTime) - populate(objectMap, "lastDownloadJobStatus", u.LastDownloadJobStatus) - populate(objectMap, "lastInstallJobStatus", u.LastInstallJobStatus) - populateTimeRFC3339(objectMap, "lastSuccessfulInstallJobDateTime", u.LastSuccessfulInstallJobDateTime) - populateTimeRFC3339(objectMap, "lastSuccessfulScanJobTime", u.LastSuccessfulScanJobTime) - populate(objectMap, "ongoingUpdateOperation", u.OngoingUpdateOperation) - populate(objectMap, "rebootBehavior", u.RebootBehavior) - populate(objectMap, "totalNumberOfUpdatesAvailable", u.TotalNumberOfUpdatesAvailable) - populate(objectMap, "totalNumberOfUpdatesPendingDownload", u.TotalNumberOfUpdatesPendingDownload) - populate(objectMap, "totalNumberOfUpdatesPendingInstall", u.TotalNumberOfUpdatesPendingInstall) - populate(objectMap, "totalTimeInMinutes", u.TotalTimeInMinutes) - populate(objectMap, "totalUpdateSizeInBytes", u.TotalUpdateSizeInBytes) - populate(objectMap, "updateTitles", u.UpdateTitles) - populate(objectMap, "updates", u.Updates) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateSummaryProperties. -func (u *UpdateSummaryProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "deviceLastScannedDateTime": - err = unpopulateTimeRFC3339(val, &u.DeviceLastScannedDateTime) - delete(rawMsg, key) - case "deviceVersionNumber": - err = unpopulate(val, &u.DeviceVersionNumber) - delete(rawMsg, key) - case "friendlyDeviceVersionName": - err = unpopulate(val, &u.FriendlyDeviceVersionName) - delete(rawMsg, key) - case "inProgressDownloadJobId": - err = unpopulate(val, &u.InProgressDownloadJobID) - delete(rawMsg, key) - case "inProgressDownloadJobStartedDateTime": - err = unpopulateTimeRFC3339(val, &u.InProgressDownloadJobStartedDateTime) - delete(rawMsg, key) - case "inProgressInstallJobId": - err = unpopulate(val, &u.InProgressInstallJobID) - delete(rawMsg, key) - case "inProgressInstallJobStartedDateTime": - err = unpopulateTimeRFC3339(val, &u.InProgressInstallJobStartedDateTime) - delete(rawMsg, key) - case "lastCompletedDownloadJobDateTime": - err = unpopulateTimeRFC3339(val, &u.LastCompletedDownloadJobDateTime) - delete(rawMsg, key) - case "lastCompletedDownloadJobId": - err = unpopulate(val, &u.LastCompletedDownloadJobID) - delete(rawMsg, key) - case "lastCompletedInstallJobDateTime": - err = unpopulateTimeRFC3339(val, &u.LastCompletedInstallJobDateTime) - delete(rawMsg, key) - case "lastCompletedInstallJobId": - err = unpopulate(val, &u.LastCompletedInstallJobID) - delete(rawMsg, key) - case "lastCompletedScanJobDateTime": - err = unpopulateTimeRFC3339(val, &u.LastCompletedScanJobDateTime) - delete(rawMsg, key) - case "lastDownloadJobStatus": - err = unpopulate(val, &u.LastDownloadJobStatus) - delete(rawMsg, key) - case "lastInstallJobStatus": - err = unpopulate(val, &u.LastInstallJobStatus) - delete(rawMsg, key) - case "lastSuccessfulInstallJobDateTime": - err = unpopulateTimeRFC3339(val, &u.LastSuccessfulInstallJobDateTime) - delete(rawMsg, key) - case "lastSuccessfulScanJobTime": - err = unpopulateTimeRFC3339(val, &u.LastSuccessfulScanJobTime) - delete(rawMsg, key) - case "ongoingUpdateOperation": - err = unpopulate(val, &u.OngoingUpdateOperation) - delete(rawMsg, key) - case "rebootBehavior": - err = unpopulate(val, &u.RebootBehavior) - delete(rawMsg, key) - case "totalNumberOfUpdatesAvailable": - err = unpopulate(val, &u.TotalNumberOfUpdatesAvailable) - delete(rawMsg, key) - case "totalNumberOfUpdatesPendingDownload": - err = unpopulate(val, &u.TotalNumberOfUpdatesPendingDownload) - delete(rawMsg, key) - case "totalNumberOfUpdatesPendingInstall": - err = unpopulate(val, &u.TotalNumberOfUpdatesPendingInstall) - delete(rawMsg, key) - case "totalTimeInMinutes": - err = unpopulate(val, &u.TotalTimeInMinutes) - delete(rawMsg, key) - case "totalUpdateSizeInBytes": - err = unpopulate(val, &u.TotalUpdateSizeInBytes) - delete(rawMsg, key) - case "updateTitles": - err = unpopulate(val, &u.UpdateTitles) - delete(rawMsg, key) - case "updates": - err = unpopulate(val, &u.Updates) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // UploadCertificateRequest - The upload certificate request. type UploadCertificateRequest struct { // REQUIRED; The Base 64 encoded certificate raw data. @@ -4218,7 +3011,7 @@ type User struct { // READ-ONLY; The object name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; User in DataBoxEdge Resource + // READ-ONLY; Metadata pertaining to creation and last modification of User SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; The hierarchical type of the object. @@ -4243,14 +3036,6 @@ type UserList struct { Value []*User `json:"value,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type UserList. -func (u UserList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", u.NextLink) - populate(objectMap, "value", u.Value) - return json.Marshal(objectMap) -} - // UserProperties - The user properties. type UserProperties struct { // REQUIRED; Type of the user. @@ -4263,23 +3048,16 @@ type UserProperties struct { ShareAccessRights []*ShareAccessRight `json:"shareAccessRights,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type UserProperties. -func (u UserProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "encryptedPassword", u.EncryptedPassword) - populate(objectMap, "shareAccessRights", u.ShareAccessRights) - populate(objectMap, "userType", u.UserType) - return json.Marshal(objectMap) -} - // UsersClientBeginCreateOrUpdateOptions contains the optional parameters for the UsersClient.BeginCreateOrUpdate method. type UsersClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // UsersClientBeginDeleteOptions contains the optional parameters for the UsersClient.BeginDelete method. type UsersClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // UsersClientGetOptions contains the optional parameters for the UsersClient.Get method. @@ -4294,19 +3072,27 @@ type UsersClientListByDataBoxEdgeDeviceOptions struct { Filter *string } -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } +// VMMemory - VmMemory Data. +type VMMemory struct { + // The current memory used by the virtual machine. + CurrentMemoryUsageMB *int64 `json:"currentMemoryUsageMB,omitempty"` + + // The total amount of RAM in the virtual machine, as seen by the guest operating system. For a virtual machine with dynamic + // memory enabled, this represents the initial memory available at startup. + StartupMemoryMB *int64 `json:"startupMemoryMB,omitempty"` } -func unpopulate(data json.RawMessage, v interface{}) error { - if data == nil { - return nil - } - return json.Unmarshal(data, v) +// VMPlacementRequestResult - List of VM sizes being checked for creation on appliance along with corresponding result. +type VMPlacementRequestResult struct { + // Boolean value indicating if the VM(s) in VmSize can be created. + IsFeasible *bool `json:"isFeasible,omitempty"` + + // Localized message to be displayed to the user to explain the check result. + Message *string `json:"message,omitempty"` + + // MessageCode indicating reason for success or failure. + MessageCode *string `json:"messageCode,omitempty"` + + // List of VM sizes being checked. + VMSize []*string `json:"vmSize,omitempty"` } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models_serde.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models_serde.go new file mode 100644 index 000000000000..8462ce1cbc7e --- /dev/null +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_models_serde.go @@ -0,0 +1,1751 @@ +//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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdataboxedge + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// GetAddon implements the AddonClassification interface for type Addon. +func (a *Addon) GetAddon() *Addon { return a } + +// MarshalJSON implements the json.Marshaller interface for type AddonList. +func (a AddonList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AddonList. +func (a *AddonList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, &a.NextLink) + delete(rawMsg, key) + case "value": + a.Value, err = unmarshalAddonClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AlertList. +func (a AlertList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AlertProperties. +func (a AlertProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertType", a.AlertType) + populateTimeRFC3339(objectMap, "appearedAtDateTime", a.AppearedAtDateTime) + populate(objectMap, "detailedInformation", a.DetailedInformation) + populate(objectMap, "errorDetails", a.ErrorDetails) + populate(objectMap, "recommendation", a.Recommendation) + populate(objectMap, "severity", a.Severity) + populate(objectMap, "title", a.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertProperties. +func (a *AlertProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertType": + err = unpopulate(val, &a.AlertType) + delete(rawMsg, key) + case "appearedAtDateTime": + err = unpopulateTimeRFC3339(val, &a.AppearedAtDateTime) + delete(rawMsg, key) + case "detailedInformation": + err = unpopulate(val, &a.DetailedInformation) + delete(rawMsg, key) + case "errorDetails": + err = unpopulate(val, &a.ErrorDetails) + delete(rawMsg, key) + case "recommendation": + err = unpopulate(val, &a.Recommendation) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &a.Severity) + delete(rawMsg, key) + case "title": + err = unpopulate(val, &a.Title) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAddon implements the AddonClassification interface for type ArcAddon. +func (a *ArcAddon) GetAddon() *Addon { + return &Addon{ + Kind: a.Kind, + SystemData: a.SystemData, + ID: a.ID, + Name: a.Name, + Type: a.Type, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ArcAddon. +func (a ArcAddon) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + objectMap["kind"] = AddonTypeArcForKubernetes + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArcAddon. +func (a *ArcAddon) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BandwidthScheduleProperties. +func (b BandwidthScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "days", b.Days) + populate(objectMap, "rateInMbps", b.RateInMbps) + populate(objectMap, "start", b.Start) + populate(objectMap, "stop", b.Stop) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type BandwidthSchedulesList. +func (b BandwidthSchedulesList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// GetRole implements the RoleClassification interface for type CloudEdgeManagementRole. +func (c *CloudEdgeManagementRole) GetRole() *Role { + return &Role{ + Kind: c.Kind, + SystemData: c.SystemData, + ID: c.ID, + Name: c.Name, + Type: c.Type, + } +} + +// MarshalJSON implements the json.Marshaller interface for type CloudEdgeManagementRole. +func (c CloudEdgeManagementRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + objectMap["kind"] = RoleTypesCloudEdgeManagement + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEdgeManagementRole. +func (c *CloudEdgeManagementRole) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &c.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &c.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &c.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudErrorBody. +func (c CloudErrorBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", c.Code) + populate(objectMap, "details", c.Details) + populate(objectMap, "message", c.Message) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterCapacityViewData. +func (c ClusterCapacityViewData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "fqdn", c.Fqdn) + populate(objectMap, "gpuCapacity", c.GpuCapacity) + populateTimeRFC3339(objectMap, "lastRefreshedTime", c.LastRefreshedTime) + populate(objectMap, "memoryCapacity", c.MemoryCapacity) + populate(objectMap, "totalProvisionedNonHpnCores", c.TotalProvisionedNonHpnCores) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterCapacityViewData. +func (c *ClusterCapacityViewData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "fqdn": + err = unpopulate(val, &c.Fqdn) + delete(rawMsg, key) + case "gpuCapacity": + err = unpopulate(val, &c.GpuCapacity) + delete(rawMsg, key) + case "lastRefreshedTime": + err = unpopulateTimeRFC3339(val, &c.LastRefreshedTime) + delete(rawMsg, key) + case "memoryCapacity": + err = unpopulate(val, &c.MemoryCapacity) + delete(rawMsg, key) + case "totalProvisionedNonHpnCores": + err = unpopulate(val, &c.TotalProvisionedNonHpnCores) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactDetails. +func (c ContactDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "companyName", c.CompanyName) + populate(objectMap, "contactPerson", c.ContactPerson) + populate(objectMap, "emailList", c.EmailList) + populate(objectMap, "phone", c.Phone) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerList. +func (c ContainerList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerProperties. +func (c ContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "containerStatus", c.ContainerStatus) + populateTimeRFC3339(objectMap, "createdDateTime", c.CreatedDateTime) + populate(objectMap, "dataFormat", c.DataFormat) + populate(objectMap, "refreshDetails", c.RefreshDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProperties. +func (c *ContainerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "containerStatus": + err = unpopulate(val, &c.ContainerStatus) + delete(rawMsg, key) + case "createdDateTime": + err = unpopulateTimeRFC3339(val, &c.CreatedDateTime) + delete(rawMsg, key) + case "dataFormat": + err = unpopulate(val, &c.DataFormat) + delete(rawMsg, key) + case "refreshDetails": + err = unpopulate(val, &c.RefreshDetails) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Device. +func (d Device) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + populate(objectMap, "identity", d.Identity) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceCapacityInfoProperties. +func (d DeviceCapacityInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clusterComputeCapacityInfo", d.ClusterComputeCapacityInfo) + populate(objectMap, "clusterStorageCapacityInfo", d.ClusterStorageCapacityInfo) + populate(objectMap, "nodeCapacityInfos", d.NodeCapacityInfos) + populateTimeRFC3339(objectMap, "timeStamp", d.TimeStamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceCapacityInfoProperties. +func (d *DeviceCapacityInfoProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "clusterComputeCapacityInfo": + err = unpopulate(val, &d.ClusterComputeCapacityInfo) + delete(rawMsg, key) + case "clusterStorageCapacityInfo": + err = unpopulate(val, &d.ClusterStorageCapacityInfo) + delete(rawMsg, key) + case "nodeCapacityInfos": + err = unpopulate(val, &d.NodeCapacityInfos) + delete(rawMsg, key) + case "timeStamp": + err = unpopulateTimeRFC3339(val, &d.TimeStamp) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceCapacityRequestInfoProperties. +func (d DeviceCapacityRequestInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "vmPlacementQuery", d.VMPlacementQuery) + populate(objectMap, "vmPlacementResults", d.VMPlacementResults) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceExtendedInfoProperties. +func (d DeviceExtendedInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "channelIntegrityKeyName", d.ChannelIntegrityKeyName) + populate(objectMap, "channelIntegrityKeyVersion", d.ChannelIntegrityKeyVersion) + populate(objectMap, "clientSecretStoreId", d.ClientSecretStoreID) + populate(objectMap, "clientSecretStoreUrl", d.ClientSecretStoreURL) + populate(objectMap, "cloudWitnessContainerName", d.CloudWitnessContainerName) + populate(objectMap, "cloudWitnessStorageAccountName", d.CloudWitnessStorageAccountName) + populate(objectMap, "cloudWitnessStorageEndpoint", d.CloudWitnessStorageEndpoint) + populate(objectMap, "clusterWitnessType", d.ClusterWitnessType) + populate(objectMap, "deviceSecrets", d.DeviceSecrets) + populate(objectMap, "encryptionKey", d.EncryptionKey) + populate(objectMap, "encryptionKeyThumbprint", d.EncryptionKeyThumbprint) + populate(objectMap, "fileShareWitnessLocation", d.FileShareWitnessLocation) + populate(objectMap, "fileShareWitnessUsername", d.FileShareWitnessUsername) + populate(objectMap, "keyVaultSyncStatus", d.KeyVaultSyncStatus) + populate(objectMap, "resourceKey", d.ResourceKey) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceList. +func (d DeviceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type DevicePatch. +func (d DevicePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", d.Identity) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type DeviceProperties. +func (d DeviceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "configuredRoleTypes", d.ConfiguredRoleTypes) + populate(objectMap, "culture", d.Culture) + populate(objectMap, "dataBoxEdgeDeviceStatus", d.DataBoxEdgeDeviceStatus) + populate(objectMap, "dataResidency", d.DataResidency) + populate(objectMap, "description", d.Description) + populate(objectMap, "deviceHcsVersion", d.DeviceHcsVersion) + populate(objectMap, "deviceLocalCapacity", d.DeviceLocalCapacity) + populate(objectMap, "deviceModel", d.DeviceModel) + populate(objectMap, "deviceSoftwareVersion", d.DeviceSoftwareVersion) + populate(objectMap, "deviceType", d.DeviceType) + populate(objectMap, "edgeProfile", d.EdgeProfile) + populate(objectMap, "friendlyName", d.FriendlyName) + populate(objectMap, "modelDescription", d.ModelDescription) + populate(objectMap, "nodeCount", d.NodeCount) + populate(objectMap, "resourceMoveDetails", d.ResourceMoveDetails) + populate(objectMap, "serialNumber", d.SerialNumber) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "timeZone", d.TimeZone) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticRemoteSupportSettingsProperties. +func (d DiagnosticRemoteSupportSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "remoteSupportSettingsList", d.RemoteSupportSettingsList) + return json.Marshal(objectMap) +} + +// GetTrigger implements the TriggerClassification interface for type FileEventTrigger. +func (f *FileEventTrigger) GetTrigger() *Trigger { + return &Trigger{ + Kind: f.Kind, + SystemData: f.SystemData, + ID: f.ID, + Name: f.Name, + Type: f.Type, + } +} + +// MarshalJSON implements the json.Marshaller interface for type FileEventTrigger. +func (f FileEventTrigger) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", f.ID) + objectMap["kind"] = TriggerEventTypeFileEvent + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileEventTrigger. +func (f *FileEventTrigger) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &f.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &f.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &f.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostCapacity. +func (h HostCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "availableGpuCount", h.AvailableGpuCount) + populate(objectMap, "effectiveAvailableMemoryMbOnHost", h.EffectiveAvailableMemoryMbOnHost) + populate(objectMap, "gpuType", h.GpuType) + populate(objectMap, "hostName", h.HostName) + populate(objectMap, "numaNodesData", h.NumaNodesData) + populate(objectMap, "vmUsedMemory", h.VMUsedMemory) + return json.Marshal(objectMap) +} + +// GetAddon implements the AddonClassification interface for type IoTAddon. +func (i *IoTAddon) GetAddon() *Addon { + return &Addon{ + Kind: i.Kind, + SystemData: i.SystemData, + ID: i.ID, + Name: i.Name, + Type: i.Type, + } +} + +// MarshalJSON implements the json.Marshaller interface for type IoTAddon. +func (i IoTAddon) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + objectMap["kind"] = AddonTypeIotEdge + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTAddon. +func (i *IoTAddon) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &i.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &i.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetRole implements the RoleClassification interface for type IoTRole. +func (i *IoTRole) GetRole() *Role { + return &Role{ + Kind: i.Kind, + SystemData: i.SystemData, + ID: i.ID, + Name: i.Name, + Type: i.Type, + } +} + +// MarshalJSON implements the json.Marshaller interface for type IoTRole. +func (i IoTRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + objectMap["kind"] = RoleTypesIOT + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTRole. +func (i *IoTRole) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &i.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &i.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IoTRoleProperties. +func (i IoTRoleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeResource", i.ComputeResource) + populate(objectMap, "hostPlatform", i.HostPlatform) + populate(objectMap, "hostPlatformType", i.HostPlatformType) + populate(objectMap, "ioTDeviceDetails", i.IoTDeviceDetails) + populate(objectMap, "ioTEdgeAgentInfo", i.IoTEdgeAgentInfo) + populate(objectMap, "ioTEdgeDeviceDetails", i.IoTEdgeDeviceDetails) + populate(objectMap, "roleStatus", i.RoleStatus) + populate(objectMap, "shareMappings", i.ShareMappings) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", j.EndTime) + populate(objectMap, "error", j.Error) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "percentComplete", j.PercentComplete) + populate(objectMap, "properties", j.Properties) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "status", j.Status) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Job. +func (j *Job) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, &j.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, &j.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &j.Name) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, &j.PercentComplete) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &j.Properties) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &j.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &j.Status) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &j.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobErrorDetails. +func (j JobErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", j.Code) + populate(objectMap, "errorDetails", j.ErrorDetails) + populate(objectMap, "message", j.Message) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type JobErrorItem. +func (j JobErrorItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", j.Code) + populate(objectMap, "message", j.Message) + populate(objectMap, "recommendations", j.Recommendations) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesClusterInfo. +func (k KubernetesClusterInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etcdInfo", k.EtcdInfo) + populate(objectMap, "nodes", k.Nodes) + populate(objectMap, "version", k.Version) + return json.Marshal(objectMap) +} + +// GetRole implements the RoleClassification interface for type KubernetesRole. +func (k *KubernetesRole) GetRole() *Role { + return &Role{ + Kind: k.Kind, + SystemData: k.SystemData, + ID: k.ID, + Name: k.Name, + Type: k.Type, + } +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesRole. +func (k KubernetesRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", k.ID) + objectMap["kind"] = RoleTypesKubernetes + populate(objectMap, "name", k.Name) + populate(objectMap, "properties", k.Properties) + populate(objectMap, "systemData", k.SystemData) + populate(objectMap, "type", k.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesRole. +func (k *KubernetesRole) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &k.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &k.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &k.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &k.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &k.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &k.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesRoleStorage. +func (k KubernetesRoleStorage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endpoints", k.Endpoints) + populate(objectMap, "storageClasses", k.StorageClasses) + return json.Marshal(objectMap) +} + +// GetRole implements the RoleClassification interface for type MECRole. +func (m *MECRole) GetRole() *Role { + return &Role{ + Kind: m.Kind, + SystemData: m.SystemData, + ID: m.ID, + Name: m.Name, + Type: m.Type, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MECRole. +func (m MECRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + objectMap["kind"] = RoleTypesMEC + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MECRole. +func (m *MECRole) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricConfiguration. +func (m MetricConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "counterSets", m.CounterSets) + populate(objectMap, "mdmAccount", m.MdmAccount) + populate(objectMap, "metricNameSpace", m.MetricNameSpace) + populate(objectMap, "resourceId", m.ResourceID) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MetricCounter. +func (m MetricCounter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalDimensions", m.AdditionalDimensions) + populate(objectMap, "dimensionFilter", m.DimensionFilter) + populate(objectMap, "instance", m.Instance) + populate(objectMap, "name", m.Name) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MetricCounterSet. +func (m MetricCounterSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "counters", m.Counters) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MetricSpecificationV1. +func (m MetricSpecificationV1) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aggregationType", m.AggregationType) + populate(objectMap, "category", m.Category) + populate(objectMap, "dimensions", m.Dimensions) + populate(objectMap, "displayDescription", m.DisplayDescription) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "fillGapWithZero", m.FillGapWithZero) + populate(objectMap, "name", m.Name) + populate(objectMap, "resourceIdDimensionNameOverride", m.ResourceIDDimensionNameOverride) + populate(objectMap, "supportedAggregationTypes", m.SupportedAggregationTypes) + populate(objectMap, "supportedTimeGrainTypes", m.SupportedTimeGrainTypes) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringMetricConfigurationList. +func (m MonitoringMetricConfigurationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringMetricConfigurationProperties. +func (m MonitoringMetricConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metricConfigurations", m.MetricConfigurations) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MoveRequest. +func (m MoveRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "resources", m.Resources) + populate(objectMap, "targetResourceGroup", m.TargetResourceGroup) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkAdapter. +func (n NetworkAdapter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "adapterId", n.AdapterID) + populate(objectMap, "adapterPosition", n.AdapterPosition) + populate(objectMap, "dnsServers", n.DNSServers) + populate(objectMap, "dhcpStatus", n.DhcpStatus) + populate(objectMap, "ipv4Configuration", n.IPv4Configuration) + populate(objectMap, "ipv6Configuration", n.IPv6Configuration) + populate(objectMap, "ipv6LinkLocalAddress", n.IPv6LinkLocalAddress) + populate(objectMap, "index", n.Index) + populate(objectMap, "label", n.Label) + populate(objectMap, "linkSpeed", n.LinkSpeed) + populate(objectMap, "macAddress", n.MacAddress) + populate(objectMap, "networkAdapterName", n.NetworkAdapterName) + populate(objectMap, "nodeId", n.NodeID) + populate(objectMap, "rdmaStatus", n.RdmaStatus) + populate(objectMap, "status", n.Status) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSettingsProperties. +func (n NetworkSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "networkAdapters", n.NetworkAdapters) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type NodeInfo. +func (n NodeInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ipConfiguration", n.IPConfiguration) + populate(objectMap, "name", n.Name) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type NodeList. +func (n NodeList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type NumaNodeData. +func (n NumaNodeData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "effectiveAvailableMemoryInMb", n.EffectiveAvailableMemoryInMb) + populate(objectMap, "freeVCpuIndexesForHpn", n.FreeVCPUIndexesForHpn) + populate(objectMap, "logicalCoreCountPerCore", n.LogicalCoreCountPerCore) + populate(objectMap, "numaNodeIndex", n.NumaNodeIndex) + populate(objectMap, "totalMemoryInMb", n.TotalMemoryInMb) + populate(objectMap, "vCpuIndexesForHpn", n.VCPUIndexesForHpn) + populate(objectMap, "vCpuIndexesForRoot", n.VCPUIndexesForRoot) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type OperationsList. +func (o OperationsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type OrderList. +func (o OrderList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type OrderProperties. +func (o OrderProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contactInformation", o.ContactInformation) + populate(objectMap, "currentStatus", o.CurrentStatus) + populate(objectMap, "deliveryTrackingInfo", o.DeliveryTrackingInfo) + populate(objectMap, "orderHistory", o.OrderHistory) + populate(objectMap, "orderId", o.OrderID) + populate(objectMap, "returnTrackingInfo", o.ReturnTrackingInfo) + populate(objectMap, "serialNumber", o.SerialNumber) + populate(objectMap, "shipmentType", o.ShipmentType) + populate(objectMap, "shippingAddress", o.ShippingAddress) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type OrderStatus. +func (o OrderStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalOrderDetails", o.AdditionalOrderDetails) + populate(objectMap, "comments", o.Comments) + populate(objectMap, "status", o.Status) + populate(objectMap, "trackingInformation", o.TrackingInformation) + populateTimeRFC3339(objectMap, "updateDateTime", o.UpdateDateTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OrderStatus. +func (o *OrderStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalOrderDetails": + err = unpopulate(val, &o.AdditionalOrderDetails) + delete(rawMsg, key) + case "comments": + err = unpopulate(val, &o.Comments) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &o.Status) + delete(rawMsg, key) + case "trackingInformation": + err = unpopulate(val, &o.TrackingInformation) + delete(rawMsg, key) + case "updateDateTime": + err = unpopulateTimeRFC3339(val, &o.UpdateDateTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetTrigger implements the TriggerClassification interface for type PeriodicTimerEventTrigger. +func (p *PeriodicTimerEventTrigger) GetTrigger() *Trigger { + return &Trigger{ + Kind: p.Kind, + SystemData: p.SystemData, + ID: p.ID, + Name: p.Name, + Type: p.Type, + } +} + +// MarshalJSON implements the json.Marshaller interface for type PeriodicTimerEventTrigger. +func (p PeriodicTimerEventTrigger) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + objectMap["kind"] = TriggerEventTypePeriodicTimerEvent + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicTimerEventTrigger. +func (p *PeriodicTimerEventTrigger) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &p.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &p.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &p.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PeriodicTimerSourceInfo. +func (p PeriodicTimerSourceInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "schedule", p.Schedule) + populateTimeRFC3339(objectMap, "startTime", p.StartTime) + populate(objectMap, "topic", p.Topic) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicTimerSourceInfo. +func (p *PeriodicTimerSourceInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "schedule": + err = unpopulate(val, &p.Schedule) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &p.StartTime) + delete(rawMsg, key) + case "topic": + err = unpopulate(val, &p.Topic) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RefreshDetails. +func (r RefreshDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorManifestFile", r.ErrorManifestFile) + populate(objectMap, "inProgressRefreshJobId", r.InProgressRefreshJobID) + populateTimeRFC3339(objectMap, "lastCompletedRefreshJobTimeInUTC", r.LastCompletedRefreshJobTimeInUTC) + populate(objectMap, "lastJob", r.LastJob) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RefreshDetails. +func (r *RefreshDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "errorManifestFile": + err = unpopulate(val, &r.ErrorManifestFile) + delete(rawMsg, key) + case "inProgressRefreshJobId": + err = unpopulate(val, &r.InProgressRefreshJobID) + delete(rawMsg, key) + case "lastCompletedRefreshJobTimeInUTC": + err = unpopulateTimeRFC3339(val, &r.LastCompletedRefreshJobTimeInUTC) + delete(rawMsg, key) + case "lastJob": + err = unpopulate(val, &r.LastJob) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RemoteSupportSettings. +func (r RemoteSupportSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accessLevel", r.AccessLevel) + populateTimeRFC3339(objectMap, "expirationTimeStampInUTC", r.ExpirationTimeStampInUTC) + populate(objectMap, "remoteApplicationType", r.RemoteApplicationType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RemoteSupportSettings. +func (r *RemoteSupportSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "accessLevel": + err = unpopulate(val, &r.AccessLevel) + delete(rawMsg, key) + case "expirationTimeStampInUTC": + err = unpopulateTimeRFC3339(val, &r.ExpirationTimeStampInUTC) + delete(rawMsg, key) + case "remoteApplicationType": + err = unpopulate(val, &r.RemoteApplicationType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceMoveDetails. +func (r ResourceMoveDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "operationInProgress", r.OperationInProgress) + populateTimeRFC3339(objectMap, "operationInProgressLockTimeoutInUTC", r.OperationInProgressLockTimeoutInUTC) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceMoveDetails. +func (r *ResourceMoveDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "operationInProgress": + err = unpopulate(val, &r.OperationInProgress) + delete(rawMsg, key) + case "operationInProgressLockTimeoutInUTC": + err = unpopulateTimeRFC3339(val, &r.OperationInProgressLockTimeoutInUTC) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetRole implements the RoleClassification interface for type Role. +func (r *Role) GetRole() *Role { return r } + +// MarshalJSON implements the json.Marshaller interface for type RoleList. +func (r RoleList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RoleList. +func (r *RoleList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, &r.NextLink) + delete(rawMsg, key) + case "value": + r.Value, err = unmarshalRoleClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "apiVersions", s.APIVersions) + populate(objectMap, "availability", s.Availability) + populate(objectMap, "capabilities", s.Capabilities) + populate(objectMap, "costs", s.Costs) + populate(objectMap, "family", s.Family) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "locationInfo", s.LocationInfo) + populate(objectMap, "locations", s.Locations) + populate(objectMap, "name", s.Name) + populate(objectMap, "resourceType", s.ResourceType) + populate(objectMap, "shipmentTypes", s.ShipmentTypes) + populate(objectMap, "signupOption", s.SignupOption) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SKUList. +func (s SKUList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SKULocationInfo. +func (s SKULocationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "location", s.Location) + populate(objectMap, "sites", s.Sites) + populate(objectMap, "zones", s.Zones) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metricSpecifications", s.MetricSpecifications) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ShareList. +func (s ShareList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ShareProperties. +func (s ShareProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accessProtocol", s.AccessProtocol) + populate(objectMap, "azureContainerInfo", s.AzureContainerInfo) + populate(objectMap, "clientAccessRights", s.ClientAccessRights) + populate(objectMap, "dataPolicy", s.DataPolicy) + populate(objectMap, "description", s.Description) + populate(objectMap, "monitoringStatus", s.MonitoringStatus) + populate(objectMap, "refreshDetails", s.RefreshDetails) + populate(objectMap, "shareMappings", s.ShareMappings) + populate(objectMap, "shareStatus", s.ShareStatus) + populate(objectMap, "userAccessRights", s.UserAccessRights) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type StorageAccountCredentialList. +func (s StorageAccountCredentialList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type StorageAccountList. +func (s StorageAccountList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionProperties. +func (s SubscriptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "locationPlacementId", s.LocationPlacementID) + populate(objectMap, "quotaId", s.QuotaID) + populate(objectMap, "registeredFeatures", s.RegisteredFeatures) + populate(objectMap, "serializedDetails", s.SerializedDetails) + populate(objectMap, "tenantId", s.TenantID) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SupportPackageRequestProperties. +func (s SupportPackageRequestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "include", s.Include) + populateTimeRFC3339(objectMap, "maximumTimeStamp", s.MaximumTimeStamp) + populateTimeRFC3339(objectMap, "minimumTimeStamp", s.MinimumTimeStamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportPackageRequestProperties. +func (s *SupportPackageRequestProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "include": + err = unpopulate(val, &s.Include) + delete(rawMsg, key) + case "maximumTimeStamp": + err = unpopulateTimeRFC3339(val, &s.MaximumTimeStamp) + delete(rawMsg, key) + case "minimumTimeStamp": + err = unpopulateTimeRFC3339(val, &s.MinimumTimeStamp) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemDataAutoGenerated. +func (s SystemDataAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemDataAutoGenerated. +func (s *SystemDataAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetTrigger implements the TriggerClassification interface for type Trigger. +func (t *Trigger) GetTrigger() *Trigger { return t } + +// MarshalJSON implements the json.Marshaller interface for type TriggerList. +func (t TriggerList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerList. +func (t *TriggerList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, &t.NextLink) + delete(rawMsg, key) + case "value": + t.Value, err = unmarshalTriggerClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateSummaryProperties. +func (u UpdateSummaryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "deviceLastScannedDateTime", u.DeviceLastScannedDateTime) + populate(objectMap, "deviceVersionNumber", u.DeviceVersionNumber) + populate(objectMap, "friendlyDeviceVersionName", u.FriendlyDeviceVersionName) + populate(objectMap, "inProgressDownloadJobId", u.InProgressDownloadJobID) + populateTimeRFC3339(objectMap, "inProgressDownloadJobStartedDateTime", u.InProgressDownloadJobStartedDateTime) + populate(objectMap, "inProgressInstallJobId", u.InProgressInstallJobID) + populateTimeRFC3339(objectMap, "inProgressInstallJobStartedDateTime", u.InProgressInstallJobStartedDateTime) + populateTimeRFC3339(objectMap, "lastCompletedDownloadJobDateTime", u.LastCompletedDownloadJobDateTime) + populate(objectMap, "lastCompletedDownloadJobId", u.LastCompletedDownloadJobID) + populateTimeRFC3339(objectMap, "lastCompletedInstallJobDateTime", u.LastCompletedInstallJobDateTime) + populate(objectMap, "lastCompletedInstallJobId", u.LastCompletedInstallJobID) + populateTimeRFC3339(objectMap, "lastCompletedScanJobDateTime", u.LastCompletedScanJobDateTime) + populate(objectMap, "lastDownloadJobStatus", u.LastDownloadJobStatus) + populate(objectMap, "lastInstallJobStatus", u.LastInstallJobStatus) + populateTimeRFC3339(objectMap, "lastSuccessfulInstallJobDateTime", u.LastSuccessfulInstallJobDateTime) + populateTimeRFC3339(objectMap, "lastSuccessfulScanJobTime", u.LastSuccessfulScanJobTime) + populate(objectMap, "ongoingUpdateOperation", u.OngoingUpdateOperation) + populate(objectMap, "rebootBehavior", u.RebootBehavior) + populate(objectMap, "totalNumberOfUpdatesAvailable", u.TotalNumberOfUpdatesAvailable) + populate(objectMap, "totalNumberOfUpdatesPendingDownload", u.TotalNumberOfUpdatesPendingDownload) + populate(objectMap, "totalNumberOfUpdatesPendingInstall", u.TotalNumberOfUpdatesPendingInstall) + populate(objectMap, "totalTimeInMinutes", u.TotalTimeInMinutes) + populate(objectMap, "totalUpdateSizeInBytes", u.TotalUpdateSizeInBytes) + populate(objectMap, "updateTitles", u.UpdateTitles) + populate(objectMap, "updates", u.Updates) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateSummaryProperties. +func (u *UpdateSummaryProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "deviceLastScannedDateTime": + err = unpopulateTimeRFC3339(val, &u.DeviceLastScannedDateTime) + delete(rawMsg, key) + case "deviceVersionNumber": + err = unpopulate(val, &u.DeviceVersionNumber) + delete(rawMsg, key) + case "friendlyDeviceVersionName": + err = unpopulate(val, &u.FriendlyDeviceVersionName) + delete(rawMsg, key) + case "inProgressDownloadJobId": + err = unpopulate(val, &u.InProgressDownloadJobID) + delete(rawMsg, key) + case "inProgressDownloadJobStartedDateTime": + err = unpopulateTimeRFC3339(val, &u.InProgressDownloadJobStartedDateTime) + delete(rawMsg, key) + case "inProgressInstallJobId": + err = unpopulate(val, &u.InProgressInstallJobID) + delete(rawMsg, key) + case "inProgressInstallJobStartedDateTime": + err = unpopulateTimeRFC3339(val, &u.InProgressInstallJobStartedDateTime) + delete(rawMsg, key) + case "lastCompletedDownloadJobDateTime": + err = unpopulateTimeRFC3339(val, &u.LastCompletedDownloadJobDateTime) + delete(rawMsg, key) + case "lastCompletedDownloadJobId": + err = unpopulate(val, &u.LastCompletedDownloadJobID) + delete(rawMsg, key) + case "lastCompletedInstallJobDateTime": + err = unpopulateTimeRFC3339(val, &u.LastCompletedInstallJobDateTime) + delete(rawMsg, key) + case "lastCompletedInstallJobId": + err = unpopulate(val, &u.LastCompletedInstallJobID) + delete(rawMsg, key) + case "lastCompletedScanJobDateTime": + err = unpopulateTimeRFC3339(val, &u.LastCompletedScanJobDateTime) + delete(rawMsg, key) + case "lastDownloadJobStatus": + err = unpopulate(val, &u.LastDownloadJobStatus) + delete(rawMsg, key) + case "lastInstallJobStatus": + err = unpopulate(val, &u.LastInstallJobStatus) + delete(rawMsg, key) + case "lastSuccessfulInstallJobDateTime": + err = unpopulateTimeRFC3339(val, &u.LastSuccessfulInstallJobDateTime) + delete(rawMsg, key) + case "lastSuccessfulScanJobTime": + err = unpopulateTimeRFC3339(val, &u.LastSuccessfulScanJobTime) + delete(rawMsg, key) + case "ongoingUpdateOperation": + err = unpopulate(val, &u.OngoingUpdateOperation) + delete(rawMsg, key) + case "rebootBehavior": + err = unpopulate(val, &u.RebootBehavior) + delete(rawMsg, key) + case "totalNumberOfUpdatesAvailable": + err = unpopulate(val, &u.TotalNumberOfUpdatesAvailable) + delete(rawMsg, key) + case "totalNumberOfUpdatesPendingDownload": + err = unpopulate(val, &u.TotalNumberOfUpdatesPendingDownload) + delete(rawMsg, key) + case "totalNumberOfUpdatesPendingInstall": + err = unpopulate(val, &u.TotalNumberOfUpdatesPendingInstall) + delete(rawMsg, key) + case "totalTimeInMinutes": + err = unpopulate(val, &u.TotalTimeInMinutes) + delete(rawMsg, key) + case "totalUpdateSizeInBytes": + err = unpopulate(val, &u.TotalUpdateSizeInBytes) + delete(rawMsg, key) + case "updateTitles": + err = unpopulate(val, &u.UpdateTitles) + delete(rawMsg, key) + case "updates": + err = unpopulate(val, &u.Updates) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserList. +func (u UserList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type UserProperties. +func (u UserProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "encryptedPassword", u.EncryptedPassword) + populate(objectMap, "shareAccessRights", u.ShareAccessRights) + populate(objectMap, "userType", u.UserType) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type VMPlacementRequestResult. +func (v VMPlacementRequestResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "isFeasible", v.IsFeasible) + populate(objectMap, "message", v.Message) + populate(objectMap, "messageCode", v.MessageCode) + populate(objectMap, "vmSize", v.VMSize) + return json.Marshal(objectMap) +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, v interface{}) error { + if data == nil { + return nil + } + return json.Unmarshal(data, v) +} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_monitoringconfig_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_monitoringconfig_client.go index 665afe44c6f9..f5189967ba9f 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_monitoringconfig_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_monitoringconfig_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type MonitoringConfigClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewMonitoringConfigClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *MonitoringConfigClient { +func NewMonitoringConfigClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MonitoringConfigClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &MonitoringConfigClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Creates a new metric configuration or updates an existing one for a role. @@ -57,22 +62,16 @@ func NewMonitoringConfigClient(subscriptionID string, credential azcore.TokenCre // monitoringMetricConfiguration - The metric configuration. // options - MonitoringConfigClientBeginCreateOrUpdateOptions contains the optional parameters for the MonitoringConfigClient.BeginCreateOrUpdate // method. -func (client *MonitoringConfigClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, roleName string, resourceGroupName string, monitoringMetricConfiguration MonitoringMetricConfiguration, options *MonitoringConfigClientBeginCreateOrUpdateOptions) (MonitoringConfigClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, deviceName, roleName, resourceGroupName, monitoringMetricConfiguration, options) - if err != nil { - return MonitoringConfigClientCreateOrUpdatePollerResponse{}, err - } - result := MonitoringConfigClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("MonitoringConfigClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return MonitoringConfigClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &MonitoringConfigClientCreateOrUpdatePoller{ - pt: pt, +func (client *MonitoringConfigClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, roleName string, resourceGroupName string, monitoringMetricConfiguration MonitoringMetricConfiguration, options *MonitoringConfigClientBeginCreateOrUpdateOptions) (*armruntime.Poller[MonitoringConfigClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, deviceName, roleName, resourceGroupName, monitoringMetricConfiguration, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[MonitoringConfigClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[MonitoringConfigClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // CreateOrUpdate - Creates a new metric configuration or updates an existing one for a role. @@ -116,7 +115,7 @@ func (client *MonitoringConfigClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, monitoringMetricConfiguration) @@ -129,22 +128,16 @@ func (client *MonitoringConfigClient) createOrUpdateCreateRequest(ctx context.Co // resourceGroupName - The resource group name. // options - MonitoringConfigClientBeginDeleteOptions contains the optional parameters for the MonitoringConfigClient.BeginDelete // method. -func (client *MonitoringConfigClient) BeginDelete(ctx context.Context, deviceName string, roleName string, resourceGroupName string, options *MonitoringConfigClientBeginDeleteOptions) (MonitoringConfigClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, deviceName, roleName, resourceGroupName, options) - if err != nil { - return MonitoringConfigClientDeletePollerResponse{}, err - } - result := MonitoringConfigClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("MonitoringConfigClient.Delete", "", resp, client.pl) - if err != nil { - return MonitoringConfigClientDeletePollerResponse{}, err - } - result.Poller = &MonitoringConfigClientDeletePoller{ - pt: pt, +func (client *MonitoringConfigClient) BeginDelete(ctx context.Context, deviceName string, roleName string, resourceGroupName string, options *MonitoringConfigClientBeginDeleteOptions) (*armruntime.Poller[MonitoringConfigClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, deviceName, roleName, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[MonitoringConfigClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[MonitoringConfigClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - deletes a new metric configuration for a role. @@ -188,7 +181,7 @@ func (client *MonitoringConfigClient) deleteCreateRequest(ctx context.Context, d return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -239,7 +232,7 @@ func (client *MonitoringConfigClient) getCreateRequest(ctx context.Context, devi return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -247,7 +240,7 @@ func (client *MonitoringConfigClient) getCreateRequest(ctx context.Context, devi // getHandleResponse handles the Get response. func (client *MonitoringConfigClient) getHandleResponse(resp *http.Response) (MonitoringConfigClientGetResponse, error) { - result := MonitoringConfigClientGetResponse{RawResponse: resp} + result := MonitoringConfigClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MonitoringMetricConfiguration); err != nil { return MonitoringConfigClientGetResponse{}, err } @@ -260,16 +253,32 @@ func (client *MonitoringConfigClient) getHandleResponse(resp *http.Response) (Mo // roleName - The role name. // resourceGroupName - The resource group name. // options - MonitoringConfigClientListOptions contains the optional parameters for the MonitoringConfigClient.List method. -func (client *MonitoringConfigClient) List(deviceName string, roleName string, resourceGroupName string, options *MonitoringConfigClientListOptions) *MonitoringConfigClientListPager { - return &MonitoringConfigClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, deviceName, roleName, resourceGroupName, options) +func (client *MonitoringConfigClient) List(deviceName string, roleName string, resourceGroupName string, options *MonitoringConfigClientListOptions) *runtime.Pager[MonitoringConfigClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[MonitoringConfigClientListResponse]{ + More: func(page MonitoringConfigClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp MonitoringConfigClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.MonitoringMetricConfigurationList.NextLink) + Fetcher: func(ctx context.Context, page *MonitoringConfigClientListResponse) (MonitoringConfigClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, deviceName, roleName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return MonitoringConfigClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MonitoringConfigClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MonitoringConfigClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -296,7 +305,7 @@ func (client *MonitoringConfigClient) listCreateRequest(ctx context.Context, dev return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -304,7 +313,7 @@ func (client *MonitoringConfigClient) listCreateRequest(ctx context.Context, dev // listHandleResponse handles the List response. func (client *MonitoringConfigClient) listHandleResponse(resp *http.Response) (MonitoringConfigClientListResponse, error) { - result := MonitoringConfigClientListResponse{RawResponse: resp} + result := MonitoringConfigClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MonitoringMetricConfigurationList); err != nil { return MonitoringConfigClientListResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_nodes_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_nodes_client.go index d971e2d826a6..19ebe2b4a07d 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_nodes_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_nodes_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type NodesClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewNodesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *NodesClient { +func NewNodesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NodesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &NodesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // ListByDataBoxEdgeDevice - Gets all the nodes currently configured under this Data Box Edge device @@ -55,16 +60,32 @@ func NewNodesClient(subscriptionID string, credential azcore.TokenCredential, op // resourceGroupName - The resource group name. // options - NodesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the NodesClient.ListByDataBoxEdgeDevice // method. -func (client *NodesClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *NodesClientListByDataBoxEdgeDeviceOptions) *NodesClientListByDataBoxEdgeDevicePager { - return &NodesClientListByDataBoxEdgeDevicePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) +func (client *NodesClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *NodesClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[NodesClientListByDataBoxEdgeDeviceResponse] { + return runtime.NewPager(runtime.PageProcessor[NodesClientListByDataBoxEdgeDeviceResponse]{ + More: func(page NodesClientListByDataBoxEdgeDeviceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp NodesClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.NodeList.NextLink) + Fetcher: func(ctx context.Context, page *NodesClientListByDataBoxEdgeDeviceResponse) (NodesClientListByDataBoxEdgeDeviceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NodesClientListByDataBoxEdgeDeviceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return NodesClientListByDataBoxEdgeDeviceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NodesClientListByDataBoxEdgeDeviceResponse{}, runtime.NewResponseError(resp) + } + return client.listByDataBoxEdgeDeviceHandleResponse(resp) }, - } + }) } // listByDataBoxEdgeDeviceCreateRequest creates the ListByDataBoxEdgeDevice request. @@ -87,7 +108,7 @@ func (client *NodesClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -95,7 +116,7 @@ func (client *NodesClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.Cont // listByDataBoxEdgeDeviceHandleResponse handles the ListByDataBoxEdgeDevice response. func (client *NodesClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Response) (NodesClientListByDataBoxEdgeDeviceResponse, error) { - result := NodesClientListByDataBoxEdgeDeviceResponse{RawResponse: resp} + result := NodesClientListByDataBoxEdgeDeviceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.NodeList); err != nil { return NodesClientListByDataBoxEdgeDeviceResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operations_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operations_client.go index 8222e61fee26..81aaddaeea5c 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operations_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -13,6 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -28,34 +29,54 @@ type OperationsClient struct { // NewOperationsClient creates a new instance of OperationsClient with the specified values. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *OperationsClient { +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &OperationsClient{ - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // List - List all the supported operations. // If the operation fails it returns an *azcore.ResponseError type. // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -func (client *OperationsClient) List(options *OperationsClientListOptions) *OperationsClientListPager { - return &OperationsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) +func (client *OperationsClient) List(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp OperationsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.OperationsList.NextLink) + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OperationsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OperationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OperationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -66,7 +87,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -74,7 +95,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{RawResponse: resp} + result := OperationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OperationsList); err != nil { return OperationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operationsstatus_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operationsstatus_client.go index 3693ad13523d..9a70d6e4f968 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operationsstatus_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_operationsstatus_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type OperationsStatusClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewOperationsStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *OperationsStatusClient { +func NewOperationsStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsStatusClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &OperationsStatusClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Get - Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. @@ -94,7 +99,7 @@ func (client *OperationsStatusClient) getCreateRequest(ctx context.Context, devi return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -102,7 +107,7 @@ func (client *OperationsStatusClient) getCreateRequest(ctx context.Context, devi // getHandleResponse handles the Get response. func (client *OperationsStatusClient) getHandleResponse(resp *http.Response) (OperationsStatusClientGetResponse, error) { - result := OperationsStatusClientGetResponse{RawResponse: resp} + result := OperationsStatusClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Job); err != nil { return OperationsStatusClientGetResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_orders_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_orders_client.go index 62cf62565ed2..4600ee912862 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_orders_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_orders_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type OrdersClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewOrdersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *OrdersClient { +func NewOrdersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OrdersClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &OrdersClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Creates or updates an order. @@ -56,22 +61,16 @@ func NewOrdersClient(subscriptionID string, credential azcore.TokenCredential, o // order - The order to be created or updated. // options - OrdersClientBeginCreateOrUpdateOptions contains the optional parameters for the OrdersClient.BeginCreateOrUpdate // method. -func (client *OrdersClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, resourceGroupName string, order Order, options *OrdersClientBeginCreateOrUpdateOptions) (OrdersClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, deviceName, resourceGroupName, order, options) - if err != nil { - return OrdersClientCreateOrUpdatePollerResponse{}, err - } - result := OrdersClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("OrdersClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return OrdersClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &OrdersClientCreateOrUpdatePoller{ - pt: pt, +func (client *OrdersClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, resourceGroupName string, order Order, options *OrdersClientBeginCreateOrUpdateOptions) (*armruntime.Poller[OrdersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, deviceName, resourceGroupName, order, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[OrdersClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[OrdersClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // CreateOrUpdate - Creates or updates an order. @@ -111,7 +110,7 @@ func (client *OrdersClient) createOrUpdateCreateRequest(ctx context.Context, dev return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, order) @@ -122,22 +121,16 @@ func (client *OrdersClient) createOrUpdateCreateRequest(ctx context.Context, dev // deviceName - The device name. // resourceGroupName - The resource group name. // options - OrdersClientBeginDeleteOptions contains the optional parameters for the OrdersClient.BeginDelete method. -func (client *OrdersClient) BeginDelete(ctx context.Context, deviceName string, resourceGroupName string, options *OrdersClientBeginDeleteOptions) (OrdersClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, deviceName, resourceGroupName, options) - if err != nil { - return OrdersClientDeletePollerResponse{}, err - } - result := OrdersClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("OrdersClient.Delete", "", resp, client.pl) - if err != nil { - return OrdersClientDeletePollerResponse{}, err - } - result.Poller = &OrdersClientDeletePoller{ - pt: pt, +func (client *OrdersClient) BeginDelete(ctx context.Context, deviceName string, resourceGroupName string, options *OrdersClientBeginDeleteOptions) (*armruntime.Poller[OrdersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, deviceName, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[OrdersClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[OrdersClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - Deletes the order related to the device. @@ -177,7 +170,7 @@ func (client *OrdersClient) deleteCreateRequest(ctx context.Context, deviceName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -223,7 +216,7 @@ func (client *OrdersClient) getCreateRequest(ctx context.Context, deviceName str return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -231,7 +224,7 @@ func (client *OrdersClient) getCreateRequest(ctx context.Context, deviceName str // getHandleResponse handles the Get response. func (client *OrdersClient) getHandleResponse(resp *http.Response) (OrdersClientGetResponse, error) { - result := OrdersClientGetResponse{RawResponse: resp} + result := OrdersClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Order); err != nil { return OrdersClientGetResponse{}, err } @@ -244,16 +237,32 @@ func (client *OrdersClient) getHandleResponse(resp *http.Response) (OrdersClient // resourceGroupName - The resource group name. // options - OrdersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the OrdersClient.ListByDataBoxEdgeDevice // method. -func (client *OrdersClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *OrdersClientListByDataBoxEdgeDeviceOptions) *OrdersClientListByDataBoxEdgeDevicePager { - return &OrdersClientListByDataBoxEdgeDevicePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) +func (client *OrdersClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *OrdersClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[OrdersClientListByDataBoxEdgeDeviceResponse] { + return runtime.NewPager(runtime.PageProcessor[OrdersClientListByDataBoxEdgeDeviceResponse]{ + More: func(page OrdersClientListByDataBoxEdgeDeviceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp OrdersClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.OrderList.NextLink) + Fetcher: func(ctx context.Context, page *OrdersClientListByDataBoxEdgeDeviceResponse) (OrdersClientListByDataBoxEdgeDeviceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OrdersClientListByDataBoxEdgeDeviceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OrdersClientListByDataBoxEdgeDeviceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OrdersClientListByDataBoxEdgeDeviceResponse{}, runtime.NewResponseError(resp) + } + return client.listByDataBoxEdgeDeviceHandleResponse(resp) }, - } + }) } // listByDataBoxEdgeDeviceCreateRequest creates the ListByDataBoxEdgeDevice request. @@ -276,7 +285,7 @@ func (client *OrdersClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -284,7 +293,7 @@ func (client *OrdersClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.Con // listByDataBoxEdgeDeviceHandleResponse handles the ListByDataBoxEdgeDevice response. func (client *OrdersClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Response) (OrdersClientListByDataBoxEdgeDeviceResponse, error) { - result := OrdersClientListByDataBoxEdgeDeviceResponse{RawResponse: resp} + result := OrdersClientListByDataBoxEdgeDeviceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OrderList); err != nil { return OrdersClientListByDataBoxEdgeDeviceResponse{}, err } @@ -331,7 +340,7 @@ func (client *OrdersClient) listDCAccessCodeCreateRequest(ctx context.Context, d return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -339,7 +348,7 @@ func (client *OrdersClient) listDCAccessCodeCreateRequest(ctx context.Context, d // listDCAccessCodeHandleResponse handles the ListDCAccessCode response. func (client *OrdersClient) listDCAccessCodeHandleResponse(resp *http.Response) (OrdersClientListDCAccessCodeResponse, error) { - result := OrdersClientListDCAccessCodeResponse{RawResponse: resp} + result := OrdersClientListDCAccessCodeResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.DCAccessCode); err != nil { return OrdersClientListDCAccessCodeResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_pagers.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_pagers.go deleted file mode 100644 index f643bc42e8b5..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_pagers.go +++ /dev/null @@ -1,935 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "reflect" -) - -// AddonsClientListByRolePager provides operations for iterating over paged responses. -type AddonsClientListByRolePager struct { - client *AddonsClient - current AddonsClientListByRoleResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AddonsClientListByRoleResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AddonsClientListByRolePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AddonsClientListByRolePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AddonList.NextLink == nil || len(*p.current.AddonList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByRoleHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AddonsClientListByRoleResponse page. -func (p *AddonsClientListByRolePager) PageResponse() AddonsClientListByRoleResponse { - return p.current -} - -// AlertsClientListByDataBoxEdgeDevicePager provides operations for iterating over paged responses. -type AlertsClientListByDataBoxEdgeDevicePager struct { - client *AlertsClient - current AlertsClientListByDataBoxEdgeDeviceResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AlertsClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AlertsClientListByDataBoxEdgeDevicePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AlertsClientListByDataBoxEdgeDevicePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AlertList.NextLink == nil || len(*p.current.AlertList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByDataBoxEdgeDeviceHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AlertsClientListByDataBoxEdgeDeviceResponse page. -func (p *AlertsClientListByDataBoxEdgeDevicePager) PageResponse() AlertsClientListByDataBoxEdgeDeviceResponse { - return p.current -} - -// AvailableSKUsClientListPager provides operations for iterating over paged responses. -type AvailableSKUsClientListPager struct { - client *AvailableSKUsClient - current AvailableSKUsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AvailableSKUsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AvailableSKUsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AvailableSKUsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.SKUList.NextLink == nil || len(*p.current.SKUList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AvailableSKUsClientListResponse page. -func (p *AvailableSKUsClientListPager) PageResponse() AvailableSKUsClientListResponse { - return p.current -} - -// BandwidthSchedulesClientListByDataBoxEdgeDevicePager provides operations for iterating over paged responses. -type BandwidthSchedulesClientListByDataBoxEdgeDevicePager struct { - client *BandwidthSchedulesClient - current BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *BandwidthSchedulesClientListByDataBoxEdgeDevicePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *BandwidthSchedulesClientListByDataBoxEdgeDevicePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.BandwidthSchedulesList.NextLink == nil || len(*p.current.BandwidthSchedulesList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByDataBoxEdgeDeviceHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse page. -func (p *BandwidthSchedulesClientListByDataBoxEdgeDevicePager) PageResponse() BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse { - return p.current -} - -// ContainersClientListByStorageAccountPager provides operations for iterating over paged responses. -type ContainersClientListByStorageAccountPager struct { - client *ContainersClient - current ContainersClientListByStorageAccountResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ContainersClientListByStorageAccountResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ContainersClientListByStorageAccountPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ContainersClientListByStorageAccountPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ContainerList.NextLink == nil || len(*p.current.ContainerList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByStorageAccountHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ContainersClientListByStorageAccountResponse page. -func (p *ContainersClientListByStorageAccountPager) PageResponse() ContainersClientListByStorageAccountResponse { - return p.current -} - -// DevicesClientListByResourceGroupPager provides operations for iterating over paged responses. -type DevicesClientListByResourceGroupPager struct { - client *DevicesClient - current DevicesClientListByResourceGroupResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, DevicesClientListByResourceGroupResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *DevicesClientListByResourceGroupPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *DevicesClientListByResourceGroupPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.DeviceList.NextLink == nil || len(*p.current.DeviceList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByResourceGroupHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current DevicesClientListByResourceGroupResponse page. -func (p *DevicesClientListByResourceGroupPager) PageResponse() DevicesClientListByResourceGroupResponse { - return p.current -} - -// DevicesClientListBySubscriptionPager provides operations for iterating over paged responses. -type DevicesClientListBySubscriptionPager struct { - client *DevicesClient - current DevicesClientListBySubscriptionResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, DevicesClientListBySubscriptionResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *DevicesClientListBySubscriptionPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *DevicesClientListBySubscriptionPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.DeviceList.NextLink == nil || len(*p.current.DeviceList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listBySubscriptionHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current DevicesClientListBySubscriptionResponse page. -func (p *DevicesClientListBySubscriptionPager) PageResponse() DevicesClientListBySubscriptionResponse { - return p.current -} - -// MonitoringConfigClientListPager provides operations for iterating over paged responses. -type MonitoringConfigClientListPager struct { - client *MonitoringConfigClient - current MonitoringConfigClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, MonitoringConfigClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *MonitoringConfigClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *MonitoringConfigClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.MonitoringMetricConfigurationList.NextLink == nil || len(*p.current.MonitoringMetricConfigurationList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current MonitoringConfigClientListResponse page. -func (p *MonitoringConfigClientListPager) PageResponse() MonitoringConfigClientListResponse { - return p.current -} - -// NodesClientListByDataBoxEdgeDevicePager provides operations for iterating over paged responses. -type NodesClientListByDataBoxEdgeDevicePager struct { - client *NodesClient - current NodesClientListByDataBoxEdgeDeviceResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, NodesClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *NodesClientListByDataBoxEdgeDevicePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *NodesClientListByDataBoxEdgeDevicePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.NodeList.NextLink == nil || len(*p.current.NodeList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByDataBoxEdgeDeviceHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current NodesClientListByDataBoxEdgeDeviceResponse page. -func (p *NodesClientListByDataBoxEdgeDevicePager) PageResponse() NodesClientListByDataBoxEdgeDeviceResponse { - return p.current -} - -// OperationsClientListPager provides operations for iterating over paged responses. -type OperationsClientListPager struct { - client *OperationsClient - current OperationsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, OperationsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *OperationsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *OperationsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.OperationsList.NextLink == nil || len(*p.current.OperationsList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current OperationsClientListResponse page. -func (p *OperationsClientListPager) PageResponse() OperationsClientListResponse { - return p.current -} - -// OrdersClientListByDataBoxEdgeDevicePager provides operations for iterating over paged responses. -type OrdersClientListByDataBoxEdgeDevicePager struct { - client *OrdersClient - current OrdersClientListByDataBoxEdgeDeviceResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, OrdersClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *OrdersClientListByDataBoxEdgeDevicePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *OrdersClientListByDataBoxEdgeDevicePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.OrderList.NextLink == nil || len(*p.current.OrderList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByDataBoxEdgeDeviceHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current OrdersClientListByDataBoxEdgeDeviceResponse page. -func (p *OrdersClientListByDataBoxEdgeDevicePager) PageResponse() OrdersClientListByDataBoxEdgeDeviceResponse { - return p.current -} - -// RolesClientListByDataBoxEdgeDevicePager provides operations for iterating over paged responses. -type RolesClientListByDataBoxEdgeDevicePager struct { - client *RolesClient - current RolesClientListByDataBoxEdgeDeviceResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, RolesClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *RolesClientListByDataBoxEdgeDevicePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *RolesClientListByDataBoxEdgeDevicePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.RoleList.NextLink == nil || len(*p.current.RoleList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByDataBoxEdgeDeviceHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current RolesClientListByDataBoxEdgeDeviceResponse page. -func (p *RolesClientListByDataBoxEdgeDevicePager) PageResponse() RolesClientListByDataBoxEdgeDeviceResponse { - return p.current -} - -// SharesClientListByDataBoxEdgeDevicePager provides operations for iterating over paged responses. -type SharesClientListByDataBoxEdgeDevicePager struct { - client *SharesClient - current SharesClientListByDataBoxEdgeDeviceResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, SharesClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *SharesClientListByDataBoxEdgeDevicePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *SharesClientListByDataBoxEdgeDevicePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ShareList.NextLink == nil || len(*p.current.ShareList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByDataBoxEdgeDeviceHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current SharesClientListByDataBoxEdgeDeviceResponse page. -func (p *SharesClientListByDataBoxEdgeDevicePager) PageResponse() SharesClientListByDataBoxEdgeDeviceResponse { - return p.current -} - -// StorageAccountCredentialsClientListByDataBoxEdgeDevicePager provides operations for iterating over paged responses. -type StorageAccountCredentialsClientListByDataBoxEdgeDevicePager struct { - client *StorageAccountCredentialsClient - current StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *StorageAccountCredentialsClientListByDataBoxEdgeDevicePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *StorageAccountCredentialsClientListByDataBoxEdgeDevicePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.StorageAccountCredentialList.NextLink == nil || len(*p.current.StorageAccountCredentialList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByDataBoxEdgeDeviceHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse page. -func (p *StorageAccountCredentialsClientListByDataBoxEdgeDevicePager) PageResponse() StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse { - return p.current -} - -// StorageAccountsClientListByDataBoxEdgeDevicePager provides operations for iterating over paged responses. -type StorageAccountsClientListByDataBoxEdgeDevicePager struct { - client *StorageAccountsClient - current StorageAccountsClientListByDataBoxEdgeDeviceResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, StorageAccountsClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *StorageAccountsClientListByDataBoxEdgeDevicePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *StorageAccountsClientListByDataBoxEdgeDevicePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.StorageAccountList.NextLink == nil || len(*p.current.StorageAccountList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByDataBoxEdgeDeviceHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current StorageAccountsClientListByDataBoxEdgeDeviceResponse page. -func (p *StorageAccountsClientListByDataBoxEdgeDevicePager) PageResponse() StorageAccountsClientListByDataBoxEdgeDeviceResponse { - return p.current -} - -// TriggersClientListByDataBoxEdgeDevicePager provides operations for iterating over paged responses. -type TriggersClientListByDataBoxEdgeDevicePager struct { - client *TriggersClient - current TriggersClientListByDataBoxEdgeDeviceResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, TriggersClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *TriggersClientListByDataBoxEdgeDevicePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *TriggersClientListByDataBoxEdgeDevicePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.TriggerList.NextLink == nil || len(*p.current.TriggerList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByDataBoxEdgeDeviceHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current TriggersClientListByDataBoxEdgeDeviceResponse page. -func (p *TriggersClientListByDataBoxEdgeDevicePager) PageResponse() TriggersClientListByDataBoxEdgeDeviceResponse { - return p.current -} - -// UsersClientListByDataBoxEdgeDevicePager provides operations for iterating over paged responses. -type UsersClientListByDataBoxEdgeDevicePager struct { - client *UsersClient - current UsersClientListByDataBoxEdgeDeviceResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, UsersClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *UsersClientListByDataBoxEdgeDevicePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *UsersClientListByDataBoxEdgeDevicePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.UserList.NextLink == nil || len(*p.current.UserList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByDataBoxEdgeDeviceHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current UsersClientListByDataBoxEdgeDeviceResponse page. -func (p *UsersClientListByDataBoxEdgeDevicePager) PageResponse() UsersClientListByDataBoxEdgeDeviceResponse { - return p.current -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_pollers.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_pollers.go deleted file mode 100644 index ada2d2af5cbc..000000000000 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_pollers.go +++ /dev/null @@ -1,1391 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdataboxedge - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "net/http" -) - -// AddonsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type AddonsClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *AddonsClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *AddonsClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final AddonsClientCreateOrUpdateResponse will be returned. -func (p *AddonsClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (AddonsClientCreateOrUpdateResponse, error) { - respType := AddonsClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.AddonsClientCreateOrUpdateResult) - if err != nil { - return AddonsClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *AddonsClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// AddonsClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type AddonsClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *AddonsClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *AddonsClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final AddonsClientDeleteResponse will be returned. -func (p *AddonsClientDeletePoller) FinalResponse(ctx context.Context) (AddonsClientDeleteResponse, error) { - respType := AddonsClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return AddonsClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *AddonsClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// BandwidthSchedulesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type BandwidthSchedulesClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *BandwidthSchedulesClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *BandwidthSchedulesClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final BandwidthSchedulesClientCreateOrUpdateResponse will be returned. -func (p *BandwidthSchedulesClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (BandwidthSchedulesClientCreateOrUpdateResponse, error) { - respType := BandwidthSchedulesClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.BandwidthSchedule) - if err != nil { - return BandwidthSchedulesClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *BandwidthSchedulesClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// BandwidthSchedulesClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type BandwidthSchedulesClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *BandwidthSchedulesClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *BandwidthSchedulesClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final BandwidthSchedulesClientDeleteResponse will be returned. -func (p *BandwidthSchedulesClientDeletePoller) FinalResponse(ctx context.Context) (BandwidthSchedulesClientDeleteResponse, error) { - respType := BandwidthSchedulesClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return BandwidthSchedulesClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *BandwidthSchedulesClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ContainersClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type ContainersClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ContainersClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ContainersClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ContainersClientCreateOrUpdateResponse will be returned. -func (p *ContainersClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (ContainersClientCreateOrUpdateResponse, error) { - respType := ContainersClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.Container) - if err != nil { - return ContainersClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ContainersClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ContainersClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type ContainersClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ContainersClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ContainersClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ContainersClientDeleteResponse will be returned. -func (p *ContainersClientDeletePoller) FinalResponse(ctx context.Context) (ContainersClientDeleteResponse, error) { - respType := ContainersClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return ContainersClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ContainersClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ContainersClientRefreshPoller provides polling facilities until the operation reaches a terminal state. -type ContainersClientRefreshPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ContainersClientRefreshPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ContainersClientRefreshPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ContainersClientRefreshResponse will be returned. -func (p *ContainersClientRefreshPoller) FinalResponse(ctx context.Context) (ContainersClientRefreshResponse, error) { - respType := ContainersClientRefreshResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return ContainersClientRefreshResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ContainersClientRefreshPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// DevicesClientCreateOrUpdateSecuritySettingsPoller provides polling facilities until the operation reaches a terminal state. -type DevicesClientCreateOrUpdateSecuritySettingsPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *DevicesClientCreateOrUpdateSecuritySettingsPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *DevicesClientCreateOrUpdateSecuritySettingsPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final DevicesClientCreateOrUpdateSecuritySettingsResponse will be returned. -func (p *DevicesClientCreateOrUpdateSecuritySettingsPoller) FinalResponse(ctx context.Context) (DevicesClientCreateOrUpdateSecuritySettingsResponse, error) { - respType := DevicesClientCreateOrUpdateSecuritySettingsResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return DevicesClientCreateOrUpdateSecuritySettingsResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *DevicesClientCreateOrUpdateSecuritySettingsPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// DevicesClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type DevicesClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *DevicesClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *DevicesClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final DevicesClientDeleteResponse will be returned. -func (p *DevicesClientDeletePoller) FinalResponse(ctx context.Context) (DevicesClientDeleteResponse, error) { - respType := DevicesClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return DevicesClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *DevicesClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// DevicesClientDownloadUpdatesPoller provides polling facilities until the operation reaches a terminal state. -type DevicesClientDownloadUpdatesPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *DevicesClientDownloadUpdatesPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *DevicesClientDownloadUpdatesPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final DevicesClientDownloadUpdatesResponse will be returned. -func (p *DevicesClientDownloadUpdatesPoller) FinalResponse(ctx context.Context) (DevicesClientDownloadUpdatesResponse, error) { - respType := DevicesClientDownloadUpdatesResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return DevicesClientDownloadUpdatesResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *DevicesClientDownloadUpdatesPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// DevicesClientInstallUpdatesPoller provides polling facilities until the operation reaches a terminal state. -type DevicesClientInstallUpdatesPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *DevicesClientInstallUpdatesPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *DevicesClientInstallUpdatesPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final DevicesClientInstallUpdatesResponse will be returned. -func (p *DevicesClientInstallUpdatesPoller) FinalResponse(ctx context.Context) (DevicesClientInstallUpdatesResponse, error) { - respType := DevicesClientInstallUpdatesResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return DevicesClientInstallUpdatesResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *DevicesClientInstallUpdatesPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// DevicesClientScanForUpdatesPoller provides polling facilities until the operation reaches a terminal state. -type DevicesClientScanForUpdatesPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *DevicesClientScanForUpdatesPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *DevicesClientScanForUpdatesPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final DevicesClientScanForUpdatesResponse will be returned. -func (p *DevicesClientScanForUpdatesPoller) FinalResponse(ctx context.Context) (DevicesClientScanForUpdatesResponse, error) { - respType := DevicesClientScanForUpdatesResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return DevicesClientScanForUpdatesResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *DevicesClientScanForUpdatesPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller provides polling facilities until the operation reaches a terminal state. -type DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse will be returned. -func (p *DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller) FinalResponse(ctx context.Context) (DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse, error) { - respType := DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.DiagnosticProactiveLogCollectionSettings) - if err != nil { - return DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller provides polling facilities until the operation reaches a terminal state. -type DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse will be returned. -func (p *DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller) FinalResponse(ctx context.Context) (DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse, error) { - respType := DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.DiagnosticRemoteSupportSettings) - if err != nil { - return DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// MonitoringConfigClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type MonitoringConfigClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *MonitoringConfigClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *MonitoringConfigClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final MonitoringConfigClientCreateOrUpdateResponse will be returned. -func (p *MonitoringConfigClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (MonitoringConfigClientCreateOrUpdateResponse, error) { - respType := MonitoringConfigClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.MonitoringMetricConfiguration) - if err != nil { - return MonitoringConfigClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *MonitoringConfigClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// MonitoringConfigClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type MonitoringConfigClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *MonitoringConfigClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *MonitoringConfigClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final MonitoringConfigClientDeleteResponse will be returned. -func (p *MonitoringConfigClientDeletePoller) FinalResponse(ctx context.Context) (MonitoringConfigClientDeleteResponse, error) { - respType := MonitoringConfigClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return MonitoringConfigClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *MonitoringConfigClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// OrdersClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type OrdersClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *OrdersClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *OrdersClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final OrdersClientCreateOrUpdateResponse will be returned. -func (p *OrdersClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (OrdersClientCreateOrUpdateResponse, error) { - respType := OrdersClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.Order) - if err != nil { - return OrdersClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *OrdersClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// OrdersClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type OrdersClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *OrdersClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *OrdersClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final OrdersClientDeleteResponse will be returned. -func (p *OrdersClientDeletePoller) FinalResponse(ctx context.Context) (OrdersClientDeleteResponse, error) { - respType := OrdersClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return OrdersClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *OrdersClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// RolesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type RolesClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *RolesClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *RolesClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final RolesClientCreateOrUpdateResponse will be returned. -func (p *RolesClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (RolesClientCreateOrUpdateResponse, error) { - respType := RolesClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.RolesClientCreateOrUpdateResult) - if err != nil { - return RolesClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *RolesClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// RolesClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type RolesClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *RolesClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *RolesClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final RolesClientDeleteResponse will be returned. -func (p *RolesClientDeletePoller) FinalResponse(ctx context.Context) (RolesClientDeleteResponse, error) { - respType := RolesClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return RolesClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *RolesClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// SharesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type SharesClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *SharesClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *SharesClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final SharesClientCreateOrUpdateResponse will be returned. -func (p *SharesClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (SharesClientCreateOrUpdateResponse, error) { - respType := SharesClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.Share) - if err != nil { - return SharesClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *SharesClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// SharesClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type SharesClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *SharesClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *SharesClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final SharesClientDeleteResponse will be returned. -func (p *SharesClientDeletePoller) FinalResponse(ctx context.Context) (SharesClientDeleteResponse, error) { - respType := SharesClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return SharesClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *SharesClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// SharesClientRefreshPoller provides polling facilities until the operation reaches a terminal state. -type SharesClientRefreshPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *SharesClientRefreshPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *SharesClientRefreshPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final SharesClientRefreshResponse will be returned. -func (p *SharesClientRefreshPoller) FinalResponse(ctx context.Context) (SharesClientRefreshResponse, error) { - respType := SharesClientRefreshResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return SharesClientRefreshResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *SharesClientRefreshPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// StorageAccountCredentialsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type StorageAccountCredentialsClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *StorageAccountCredentialsClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *StorageAccountCredentialsClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final StorageAccountCredentialsClientCreateOrUpdateResponse will be returned. -func (p *StorageAccountCredentialsClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (StorageAccountCredentialsClientCreateOrUpdateResponse, error) { - respType := StorageAccountCredentialsClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.StorageAccountCredential) - if err != nil { - return StorageAccountCredentialsClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *StorageAccountCredentialsClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// StorageAccountCredentialsClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type StorageAccountCredentialsClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *StorageAccountCredentialsClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *StorageAccountCredentialsClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final StorageAccountCredentialsClientDeleteResponse will be returned. -func (p *StorageAccountCredentialsClientDeletePoller) FinalResponse(ctx context.Context) (StorageAccountCredentialsClientDeleteResponse, error) { - respType := StorageAccountCredentialsClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return StorageAccountCredentialsClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *StorageAccountCredentialsClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// StorageAccountsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type StorageAccountsClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *StorageAccountsClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *StorageAccountsClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final StorageAccountsClientCreateOrUpdateResponse will be returned. -func (p *StorageAccountsClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (StorageAccountsClientCreateOrUpdateResponse, error) { - respType := StorageAccountsClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.StorageAccount) - if err != nil { - return StorageAccountsClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *StorageAccountsClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// StorageAccountsClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type StorageAccountsClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *StorageAccountsClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *StorageAccountsClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final StorageAccountsClientDeleteResponse will be returned. -func (p *StorageAccountsClientDeletePoller) FinalResponse(ctx context.Context) (StorageAccountsClientDeleteResponse, error) { - respType := StorageAccountsClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return StorageAccountsClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *StorageAccountsClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// SupportPackagesClientTriggerSupportPackagePoller provides polling facilities until the operation reaches a terminal state. -type SupportPackagesClientTriggerSupportPackagePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *SupportPackagesClientTriggerSupportPackagePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *SupportPackagesClientTriggerSupportPackagePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final SupportPackagesClientTriggerSupportPackageResponse will be returned. -func (p *SupportPackagesClientTriggerSupportPackagePoller) FinalResponse(ctx context.Context) (SupportPackagesClientTriggerSupportPackageResponse, error) { - respType := SupportPackagesClientTriggerSupportPackageResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return SupportPackagesClientTriggerSupportPackageResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *SupportPackagesClientTriggerSupportPackagePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// TriggersClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type TriggersClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *TriggersClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *TriggersClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final TriggersClientCreateOrUpdateResponse will be returned. -func (p *TriggersClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (TriggersClientCreateOrUpdateResponse, error) { - respType := TriggersClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.TriggersClientCreateOrUpdateResult) - if err != nil { - return TriggersClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *TriggersClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// TriggersClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type TriggersClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *TriggersClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *TriggersClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final TriggersClientDeleteResponse will be returned. -func (p *TriggersClientDeletePoller) FinalResponse(ctx context.Context) (TriggersClientDeleteResponse, error) { - respType := TriggersClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return TriggersClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *TriggersClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// UsersClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type UsersClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *UsersClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *UsersClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final UsersClientCreateOrUpdateResponse will be returned. -func (p *UsersClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (UsersClientCreateOrUpdateResponse, error) { - respType := UsersClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.User) - if err != nil { - return UsersClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *UsersClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// UsersClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type UsersClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *UsersClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *UsersClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final UsersClientDeleteResponse will be returned. -func (p *UsersClientDeletePoller) FinalResponse(ctx context.Context) (UsersClientDeleteResponse, error) { - respType := UsersClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return UsersClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *UsersClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_polymorphic_helpers.go index d086a05091fd..50b8b424a5b0 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_polymorphic_helpers.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_response_types.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_response_types.go index 68d3efa6d252..ad75a7f87a27 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_response_types.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_response_types.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,67 +8,13 @@ package armdataboxedge -import ( - "context" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "net/http" - "time" -) - -// AddonsClientCreateOrUpdatePollerResponse contains the response from method AddonsClient.CreateOrUpdate. -type AddonsClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *AddonsClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l AddonsClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AddonsClientCreateOrUpdateResponse, error) { - respType := AddonsClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.AddonsClientCreateOrUpdateResult) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a AddonsClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *AddonsClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *AddonsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("AddonsClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &AddonsClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // AddonsClientCreateOrUpdateResponse contains the response from method AddonsClient.CreateOrUpdate. type AddonsClientCreateOrUpdateResponse struct { - AddonsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AddonsClientCreateOrUpdateResult contains the result from method AddonsClient.CreateOrUpdate. -type AddonsClientCreateOrUpdateResult struct { AddonClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type AddonsClientCreateOrUpdateResult. -func (a *AddonsClientCreateOrUpdateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AddonsClientCreateOrUpdateResponse. +func (a *AddonsClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalAddonClassification(data) if err != nil { return err @@ -77,66 +23,18 @@ func (a *AddonsClientCreateOrUpdateResult) UnmarshalJSON(data []byte) error { return nil } -// AddonsClientDeletePollerResponse contains the response from method AddonsClient.Delete. -type AddonsClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *AddonsClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l AddonsClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AddonsClientDeleteResponse, error) { - respType := AddonsClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a AddonsClientDeletePollerResponse from the provided client and resume token. -func (l *AddonsClientDeletePollerResponse) Resume(ctx context.Context, client *AddonsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("AddonsClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &AddonsClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // AddonsClientDeleteResponse contains the response from method AddonsClient.Delete. type AddonsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // AddonsClientGetResponse contains the response from method AddonsClient.Get. type AddonsClientGetResponse struct { - AddonsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AddonsClientGetResult contains the result from method AddonsClient.Get. -type AddonsClientGetResult struct { AddonClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type AddonsClientGetResult. -func (a *AddonsClientGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AddonsClientGetResponse. +func (a *AddonsClientGetResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalAddonClassification(data) if err != nil { return err @@ -147,1193 +45,251 @@ func (a *AddonsClientGetResult) UnmarshalJSON(data []byte) error { // AddonsClientListByRoleResponse contains the response from method AddonsClient.ListByRole. type AddonsClientListByRoleResponse struct { - AddonsClientListByRoleResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AddonsClientListByRoleResult contains the result from method AddonsClient.ListByRole. -type AddonsClientListByRoleResult struct { AddonList } // AlertsClientGetResponse contains the response from method AlertsClient.Get. type AlertsClientGetResponse struct { - AlertsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AlertsClientGetResult contains the result from method AlertsClient.Get. -type AlertsClientGetResult struct { Alert } // AlertsClientListByDataBoxEdgeDeviceResponse contains the response from method AlertsClient.ListByDataBoxEdgeDevice. type AlertsClientListByDataBoxEdgeDeviceResponse struct { - AlertsClientListByDataBoxEdgeDeviceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AlertsClientListByDataBoxEdgeDeviceResult contains the result from method AlertsClient.ListByDataBoxEdgeDevice. -type AlertsClientListByDataBoxEdgeDeviceResult struct { AlertList } // AvailableSKUsClientListResponse contains the response from method AvailableSKUsClient.List. type AvailableSKUsClientListResponse struct { - AvailableSKUsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AvailableSKUsClientListResult contains the result from method AvailableSKUsClient.List. -type AvailableSKUsClientListResult struct { SKUList } -// BandwidthSchedulesClientCreateOrUpdatePollerResponse contains the response from method BandwidthSchedulesClient.CreateOrUpdate. -type BandwidthSchedulesClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *BandwidthSchedulesClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l BandwidthSchedulesClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (BandwidthSchedulesClientCreateOrUpdateResponse, error) { - respType := BandwidthSchedulesClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.BandwidthSchedule) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a BandwidthSchedulesClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *BandwidthSchedulesClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *BandwidthSchedulesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("BandwidthSchedulesClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &BandwidthSchedulesClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // BandwidthSchedulesClientCreateOrUpdateResponse contains the response from method BandwidthSchedulesClient.CreateOrUpdate. type BandwidthSchedulesClientCreateOrUpdateResponse struct { - BandwidthSchedulesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// BandwidthSchedulesClientCreateOrUpdateResult contains the result from method BandwidthSchedulesClient.CreateOrUpdate. -type BandwidthSchedulesClientCreateOrUpdateResult struct { BandwidthSchedule } -// BandwidthSchedulesClientDeletePollerResponse contains the response from method BandwidthSchedulesClient.Delete. -type BandwidthSchedulesClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *BandwidthSchedulesClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l BandwidthSchedulesClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (BandwidthSchedulesClientDeleteResponse, error) { - respType := BandwidthSchedulesClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a BandwidthSchedulesClientDeletePollerResponse from the provided client and resume token. -func (l *BandwidthSchedulesClientDeletePollerResponse) Resume(ctx context.Context, client *BandwidthSchedulesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("BandwidthSchedulesClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &BandwidthSchedulesClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // BandwidthSchedulesClientDeleteResponse contains the response from method BandwidthSchedulesClient.Delete. type BandwidthSchedulesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // BandwidthSchedulesClientGetResponse contains the response from method BandwidthSchedulesClient.Get. type BandwidthSchedulesClientGetResponse struct { - BandwidthSchedulesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// BandwidthSchedulesClientGetResult contains the result from method BandwidthSchedulesClient.Get. -type BandwidthSchedulesClientGetResult struct { BandwidthSchedule } // BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse contains the response from method BandwidthSchedulesClient.ListByDataBoxEdgeDevice. type BandwidthSchedulesClientListByDataBoxEdgeDeviceResponse struct { - BandwidthSchedulesClientListByDataBoxEdgeDeviceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// BandwidthSchedulesClientListByDataBoxEdgeDeviceResult contains the result from method BandwidthSchedulesClient.ListByDataBoxEdgeDevice. -type BandwidthSchedulesClientListByDataBoxEdgeDeviceResult struct { BandwidthSchedulesList } -// ContainersClientCreateOrUpdatePollerResponse contains the response from method ContainersClient.CreateOrUpdate. -type ContainersClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *ContainersClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ContainersClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ContainersClientCreateOrUpdateResponse, error) { - respType := ContainersClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Container) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a ContainersClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *ContainersClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *ContainersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ContainersClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &ContainersClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // ContainersClientCreateOrUpdateResponse contains the response from method ContainersClient.CreateOrUpdate. type ContainersClientCreateOrUpdateResponse struct { - ContainersClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ContainersClientCreateOrUpdateResult contains the result from method ContainersClient.CreateOrUpdate. -type ContainersClientCreateOrUpdateResult struct { Container } -// ContainersClientDeletePollerResponse contains the response from method ContainersClient.Delete. -type ContainersClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *ContainersClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ContainersClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ContainersClientDeleteResponse, error) { - respType := ContainersClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a ContainersClientDeletePollerResponse from the provided client and resume token. -func (l *ContainersClientDeletePollerResponse) Resume(ctx context.Context, client *ContainersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ContainersClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &ContainersClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // ContainersClientDeleteResponse contains the response from method ContainersClient.Delete. type ContainersClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ContainersClientGetResponse contains the response from method ContainersClient.Get. type ContainersClientGetResponse struct { - ContainersClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ContainersClientGetResult contains the result from method ContainersClient.Get. -type ContainersClientGetResult struct { Container } // ContainersClientListByStorageAccountResponse contains the response from method ContainersClient.ListByStorageAccount. type ContainersClientListByStorageAccountResponse struct { - ContainersClientListByStorageAccountResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ContainersClientListByStorageAccountResult contains the result from method ContainersClient.ListByStorageAccount. -type ContainersClientListByStorageAccountResult struct { ContainerList } -// ContainersClientRefreshPollerResponse contains the response from method ContainersClient.Refresh. -type ContainersClientRefreshPollerResponse struct { - // Poller contains an initialized poller. - Poller *ContainersClientRefreshPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ContainersClientRefreshPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ContainersClientRefreshResponse, error) { - respType := ContainersClientRefreshResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil +// ContainersClientRefreshResponse contains the response from method ContainersClient.Refresh. +type ContainersClientRefreshResponse struct { + // placeholder for future response values } -// Resume rehydrates a ContainersClientRefreshPollerResponse from the provided client and resume token. -func (l *ContainersClientRefreshPollerResponse) Resume(ctx context.Context, client *ContainersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ContainersClient.Refresh", token, client.pl) - if err != nil { - return err - } - poller := &ContainersClientRefreshPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil +// DeviceCapacityCheckClientCheckResourceCreationFeasibilityResponse contains the response from method DeviceCapacityCheckClient.CheckResourceCreationFeasibility. +type DeviceCapacityCheckClientCheckResourceCreationFeasibilityResponse struct { + // placeholder for future response values } -// ContainersClientRefreshResponse contains the response from method ContainersClient.Refresh. -type ContainersClientRefreshResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response +// DeviceCapacityInfoClientGetDeviceCapacityInfoResponse contains the response from method DeviceCapacityInfoClient.GetDeviceCapacityInfo. +type DeviceCapacityInfoClientGetDeviceCapacityInfoResponse struct { + DeviceCapacityInfo } // DevicesClientCreateOrUpdateResponse contains the response from method DevicesClient.CreateOrUpdate. type DevicesClientCreateOrUpdateResponse struct { - DevicesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientCreateOrUpdateResult contains the result from method DevicesClient.CreateOrUpdate. -type DevicesClientCreateOrUpdateResult struct { Device } -// DevicesClientCreateOrUpdateSecuritySettingsPollerResponse contains the response from method DevicesClient.CreateOrUpdateSecuritySettings. -type DevicesClientCreateOrUpdateSecuritySettingsPollerResponse struct { - // Poller contains an initialized poller. - Poller *DevicesClientCreateOrUpdateSecuritySettingsPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l DevicesClientCreateOrUpdateSecuritySettingsPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (DevicesClientCreateOrUpdateSecuritySettingsResponse, error) { - respType := DevicesClientCreateOrUpdateSecuritySettingsResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a DevicesClientCreateOrUpdateSecuritySettingsPollerResponse from the provided client and resume token. -func (l *DevicesClientCreateOrUpdateSecuritySettingsPollerResponse) Resume(ctx context.Context, client *DevicesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("DevicesClient.CreateOrUpdateSecuritySettings", token, client.pl) - if err != nil { - return err - } - poller := &DevicesClientCreateOrUpdateSecuritySettingsPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // DevicesClientCreateOrUpdateSecuritySettingsResponse contains the response from method DevicesClient.CreateOrUpdateSecuritySettings. type DevicesClientCreateOrUpdateSecuritySettingsResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientDeletePollerResponse contains the response from method DevicesClient.Delete. -type DevicesClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *DevicesClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l DevicesClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (DevicesClientDeleteResponse, error) { - respType := DevicesClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a DevicesClientDeletePollerResponse from the provided client and resume token. -func (l *DevicesClientDeletePollerResponse) Resume(ctx context.Context, client *DevicesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("DevicesClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &DevicesClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil + // placeholder for future response values } // DevicesClientDeleteResponse contains the response from method DevicesClient.Delete. type DevicesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientDownloadUpdatesPollerResponse contains the response from method DevicesClient.DownloadUpdates. -type DevicesClientDownloadUpdatesPollerResponse struct { - // Poller contains an initialized poller. - Poller *DevicesClientDownloadUpdatesPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l DevicesClientDownloadUpdatesPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (DevicesClientDownloadUpdatesResponse, error) { - respType := DevicesClientDownloadUpdatesResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a DevicesClientDownloadUpdatesPollerResponse from the provided client and resume token. -func (l *DevicesClientDownloadUpdatesPollerResponse) Resume(ctx context.Context, client *DevicesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("DevicesClient.DownloadUpdates", token, client.pl) - if err != nil { - return err - } - poller := &DevicesClientDownloadUpdatesPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil + // placeholder for future response values } // DevicesClientDownloadUpdatesResponse contains the response from method DevicesClient.DownloadUpdates. type DevicesClientDownloadUpdatesResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // DevicesClientGenerateCertificateResponse contains the response from method DevicesClient.GenerateCertificate. type DevicesClientGenerateCertificateResponse struct { - DevicesClientGenerateCertificateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientGenerateCertificateResult contains the result from method DevicesClient.GenerateCertificate. -type DevicesClientGenerateCertificateResult struct { GenerateCertResponse } // DevicesClientGetExtendedInformationResponse contains the response from method DevicesClient.GetExtendedInformation. type DevicesClientGetExtendedInformationResponse struct { - DevicesClientGetExtendedInformationResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientGetExtendedInformationResult contains the result from method DevicesClient.GetExtendedInformation. -type DevicesClientGetExtendedInformationResult struct { DeviceExtendedInfo } // DevicesClientGetNetworkSettingsResponse contains the response from method DevicesClient.GetNetworkSettings. type DevicesClientGetNetworkSettingsResponse struct { - DevicesClientGetNetworkSettingsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientGetNetworkSettingsResult contains the result from method DevicesClient.GetNetworkSettings. -type DevicesClientGetNetworkSettingsResult struct { NetworkSettings } // DevicesClientGetResponse contains the response from method DevicesClient.Get. type DevicesClientGetResponse struct { - DevicesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientGetResult contains the result from method DevicesClient.Get. -type DevicesClientGetResult struct { Device } // DevicesClientGetUpdateSummaryResponse contains the response from method DevicesClient.GetUpdateSummary. type DevicesClientGetUpdateSummaryResponse struct { - DevicesClientGetUpdateSummaryResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientGetUpdateSummaryResult contains the result from method DevicesClient.GetUpdateSummary. -type DevicesClientGetUpdateSummaryResult struct { UpdateSummary } -// DevicesClientInstallUpdatesPollerResponse contains the response from method DevicesClient.InstallUpdates. -type DevicesClientInstallUpdatesPollerResponse struct { - // Poller contains an initialized poller. - Poller *DevicesClientInstallUpdatesPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l DevicesClientInstallUpdatesPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (DevicesClientInstallUpdatesResponse, error) { - respType := DevicesClientInstallUpdatesResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a DevicesClientInstallUpdatesPollerResponse from the provided client and resume token. -func (l *DevicesClientInstallUpdatesPollerResponse) Resume(ctx context.Context, client *DevicesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("DevicesClient.InstallUpdates", token, client.pl) - if err != nil { - return err - } - poller := &DevicesClientInstallUpdatesPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // DevicesClientInstallUpdatesResponse contains the response from method DevicesClient.InstallUpdates. type DevicesClientInstallUpdatesResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // DevicesClientListByResourceGroupResponse contains the response from method DevicesClient.ListByResourceGroup. type DevicesClientListByResourceGroupResponse struct { - DevicesClientListByResourceGroupResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientListByResourceGroupResult contains the result from method DevicesClient.ListByResourceGroup. -type DevicesClientListByResourceGroupResult struct { DeviceList } // DevicesClientListBySubscriptionResponse contains the response from method DevicesClient.ListBySubscription. type DevicesClientListBySubscriptionResponse struct { - DevicesClientListBySubscriptionResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientListBySubscriptionResult contains the result from method DevicesClient.ListBySubscription. -type DevicesClientListBySubscriptionResult struct { DeviceList } -// DevicesClientScanForUpdatesPollerResponse contains the response from method DevicesClient.ScanForUpdates. -type DevicesClientScanForUpdatesPollerResponse struct { - // Poller contains an initialized poller. - Poller *DevicesClientScanForUpdatesPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l DevicesClientScanForUpdatesPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (DevicesClientScanForUpdatesResponse, error) { - respType := DevicesClientScanForUpdatesResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a DevicesClientScanForUpdatesPollerResponse from the provided client and resume token. -func (l *DevicesClientScanForUpdatesPollerResponse) Resume(ctx context.Context, client *DevicesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("DevicesClient.ScanForUpdates", token, client.pl) - if err != nil { - return err - } - poller := &DevicesClientScanForUpdatesPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // DevicesClientScanForUpdatesResponse contains the response from method DevicesClient.ScanForUpdates. type DevicesClientScanForUpdatesResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // DevicesClientUpdateExtendedInformationResponse contains the response from method DevicesClient.UpdateExtendedInformation. type DevicesClientUpdateExtendedInformationResponse struct { - DevicesClientUpdateExtendedInformationResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientUpdateExtendedInformationResult contains the result from method DevicesClient.UpdateExtendedInformation. -type DevicesClientUpdateExtendedInformationResult struct { DeviceExtendedInfo } // DevicesClientUpdateResponse contains the response from method DevicesClient.Update. type DevicesClientUpdateResponse struct { - DevicesClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientUpdateResult contains the result from method DevicesClient.Update. -type DevicesClientUpdateResult struct { Device } // DevicesClientUploadCertificateResponse contains the response from method DevicesClient.UploadCertificate. type DevicesClientUploadCertificateResponse struct { - DevicesClientUploadCertificateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DevicesClientUploadCertificateResult contains the result from method DevicesClient.UploadCertificate. -type DevicesClientUploadCertificateResult struct { UploadCertificateResponse } // DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResponse contains the response from method DiagnosticSettingsClient.GetDiagnosticProactiveLogCollectionSettings. type DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResponse struct { - DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResult contains the result from method DiagnosticSettingsClient.GetDiagnosticProactiveLogCollectionSettings. -type DiagnosticSettingsClientGetDiagnosticProactiveLogCollectionSettingsResult struct { DiagnosticProactiveLogCollectionSettings } // DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResponse contains the response from method DiagnosticSettingsClient.GetDiagnosticRemoteSupportSettings. type DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResponse struct { - DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResult contains the result from method DiagnosticSettingsClient.GetDiagnosticRemoteSupportSettings. -type DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResult struct { DiagnosticRemoteSupportSettings } -// DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse contains the response from method -// DiagnosticSettingsClient.UpdateDiagnosticProactiveLogCollectionSettings. -type DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse struct { - // Poller contains an initialized poller. - Poller *DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse, error) { - respType := DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.DiagnosticProactiveLogCollectionSettings) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse from the provided -// client and resume token. -func (l *DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPollerResponse) Resume(ctx context.Context, client *DiagnosticSettingsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("DiagnosticSettingsClient.UpdateDiagnosticProactiveLogCollectionSettings", token, client.pl) - if err != nil { - return err - } - poller := &DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse contains the response from method DiagnosticSettingsClient.UpdateDiagnosticProactiveLogCollectionSettings. type DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse struct { - DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResult contains the result from method DiagnosticSettingsClient.UpdateDiagnosticProactiveLogCollectionSettings. -type DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResult struct { DiagnosticProactiveLogCollectionSettings } -// DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse contains the response from method DiagnosticSettingsClient.UpdateDiagnosticRemoteSupportSettings. -type DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse struct { - // Poller contains an initialized poller. - Poller *DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse, error) { - respType := DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.DiagnosticRemoteSupportSettings) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse from the provided client -// and resume token. -func (l *DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPollerResponse) Resume(ctx context.Context, client *DiagnosticSettingsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("DiagnosticSettingsClient.UpdateDiagnosticRemoteSupportSettings", token, client.pl) - if err != nil { - return err - } - poller := &DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse contains the response from method DiagnosticSettingsClient.UpdateDiagnosticRemoteSupportSettings. type DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse struct { - DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResult contains the result from method DiagnosticSettingsClient.UpdateDiagnosticRemoteSupportSettings. -type DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResult struct { DiagnosticRemoteSupportSettings } // JobsClientGetResponse contains the response from method JobsClient.Get. type JobsClientGetResponse struct { - JobsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// JobsClientGetResult contains the result from method JobsClient.Get. -type JobsClientGetResult struct { Job } -// MonitoringConfigClientCreateOrUpdatePollerResponse contains the response from method MonitoringConfigClient.CreateOrUpdate. -type MonitoringConfigClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *MonitoringConfigClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l MonitoringConfigClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (MonitoringConfigClientCreateOrUpdateResponse, error) { - respType := MonitoringConfigClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.MonitoringMetricConfiguration) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a MonitoringConfigClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *MonitoringConfigClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *MonitoringConfigClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("MonitoringConfigClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &MonitoringConfigClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // MonitoringConfigClientCreateOrUpdateResponse contains the response from method MonitoringConfigClient.CreateOrUpdate. type MonitoringConfigClientCreateOrUpdateResponse struct { - MonitoringConfigClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MonitoringConfigClientCreateOrUpdateResult contains the result from method MonitoringConfigClient.CreateOrUpdate. -type MonitoringConfigClientCreateOrUpdateResult struct { MonitoringMetricConfiguration } -// MonitoringConfigClientDeletePollerResponse contains the response from method MonitoringConfigClient.Delete. -type MonitoringConfigClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *MonitoringConfigClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l MonitoringConfigClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (MonitoringConfigClientDeleteResponse, error) { - respType := MonitoringConfigClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a MonitoringConfigClientDeletePollerResponse from the provided client and resume token. -func (l *MonitoringConfigClientDeletePollerResponse) Resume(ctx context.Context, client *MonitoringConfigClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("MonitoringConfigClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &MonitoringConfigClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // MonitoringConfigClientDeleteResponse contains the response from method MonitoringConfigClient.Delete. type MonitoringConfigClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // MonitoringConfigClientGetResponse contains the response from method MonitoringConfigClient.Get. type MonitoringConfigClientGetResponse struct { - MonitoringConfigClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MonitoringConfigClientGetResult contains the result from method MonitoringConfigClient.Get. -type MonitoringConfigClientGetResult struct { MonitoringMetricConfiguration } // MonitoringConfigClientListResponse contains the response from method MonitoringConfigClient.List. type MonitoringConfigClientListResponse struct { - MonitoringConfigClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MonitoringConfigClientListResult contains the result from method MonitoringConfigClient.List. -type MonitoringConfigClientListResult struct { MonitoringMetricConfigurationList } // NodesClientListByDataBoxEdgeDeviceResponse contains the response from method NodesClient.ListByDataBoxEdgeDevice. type NodesClientListByDataBoxEdgeDeviceResponse struct { - NodesClientListByDataBoxEdgeDeviceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// NodesClientListByDataBoxEdgeDeviceResult contains the result from method NodesClient.ListByDataBoxEdgeDevice. -type NodesClientListByDataBoxEdgeDeviceResult struct { NodeList } // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { - OperationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OperationsClientListResult contains the result from method OperationsClient.List. -type OperationsClientListResult struct { OperationsList } // OperationsStatusClientGetResponse contains the response from method OperationsStatusClient.Get. type OperationsStatusClientGetResponse struct { - OperationsStatusClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OperationsStatusClientGetResult contains the result from method OperationsStatusClient.Get. -type OperationsStatusClientGetResult struct { Job } -// OrdersClientCreateOrUpdatePollerResponse contains the response from method OrdersClient.CreateOrUpdate. -type OrdersClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *OrdersClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l OrdersClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (OrdersClientCreateOrUpdateResponse, error) { - respType := OrdersClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Order) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a OrdersClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *OrdersClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *OrdersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("OrdersClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &OrdersClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // OrdersClientCreateOrUpdateResponse contains the response from method OrdersClient.CreateOrUpdate. type OrdersClientCreateOrUpdateResponse struct { - OrdersClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OrdersClientCreateOrUpdateResult contains the result from method OrdersClient.CreateOrUpdate. -type OrdersClientCreateOrUpdateResult struct { Order } -// OrdersClientDeletePollerResponse contains the response from method OrdersClient.Delete. -type OrdersClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *OrdersClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l OrdersClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (OrdersClientDeleteResponse, error) { - respType := OrdersClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a OrdersClientDeletePollerResponse from the provided client and resume token. -func (l *OrdersClientDeletePollerResponse) Resume(ctx context.Context, client *OrdersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("OrdersClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &OrdersClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // OrdersClientDeleteResponse contains the response from method OrdersClient.Delete. type OrdersClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // OrdersClientGetResponse contains the response from method OrdersClient.Get. type OrdersClientGetResponse struct { - OrdersClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OrdersClientGetResult contains the result from method OrdersClient.Get. -type OrdersClientGetResult struct { Order } // OrdersClientListByDataBoxEdgeDeviceResponse contains the response from method OrdersClient.ListByDataBoxEdgeDevice. type OrdersClientListByDataBoxEdgeDeviceResponse struct { - OrdersClientListByDataBoxEdgeDeviceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OrdersClientListByDataBoxEdgeDeviceResult contains the result from method OrdersClient.ListByDataBoxEdgeDevice. -type OrdersClientListByDataBoxEdgeDeviceResult struct { OrderList } // OrdersClientListDCAccessCodeResponse contains the response from method OrdersClient.ListDCAccessCode. type OrdersClientListDCAccessCodeResponse struct { - OrdersClientListDCAccessCodeResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OrdersClientListDCAccessCodeResult contains the result from method OrdersClient.ListDCAccessCode. -type OrdersClientListDCAccessCodeResult struct { DCAccessCode } -// RolesClientCreateOrUpdatePollerResponse contains the response from method RolesClient.CreateOrUpdate. -type RolesClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *RolesClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l RolesClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (RolesClientCreateOrUpdateResponse, error) { - respType := RolesClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.RolesClientCreateOrUpdateResult) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a RolesClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *RolesClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *RolesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("RolesClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &RolesClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // RolesClientCreateOrUpdateResponse contains the response from method RolesClient.CreateOrUpdate. type RolesClientCreateOrUpdateResponse struct { - RolesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// RolesClientCreateOrUpdateResult contains the result from method RolesClient.CreateOrUpdate. -type RolesClientCreateOrUpdateResult struct { RoleClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type RolesClientCreateOrUpdateResult. -func (r *RolesClientCreateOrUpdateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RolesClientCreateOrUpdateResponse. +func (r *RolesClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalRoleClassification(data) if err != nil { return err @@ -1342,66 +298,18 @@ func (r *RolesClientCreateOrUpdateResult) UnmarshalJSON(data []byte) error { return nil } -// RolesClientDeletePollerResponse contains the response from method RolesClient.Delete. -type RolesClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *RolesClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l RolesClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (RolesClientDeleteResponse, error) { - respType := RolesClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a RolesClientDeletePollerResponse from the provided client and resume token. -func (l *RolesClientDeletePollerResponse) Resume(ctx context.Context, client *RolesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("RolesClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &RolesClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // RolesClientDeleteResponse contains the response from method RolesClient.Delete. type RolesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // RolesClientGetResponse contains the response from method RolesClient.Get. type RolesClientGetResponse struct { - RolesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// RolesClientGetResult contains the result from method RolesClient.Get. -type RolesClientGetResult struct { RoleClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type RolesClientGetResult. -func (r *RolesClientGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RolesClientGetResponse. +func (r *RolesClientGetResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalRoleClassification(data) if err != nil { return err @@ -1412,528 +320,86 @@ func (r *RolesClientGetResult) UnmarshalJSON(data []byte) error { // RolesClientListByDataBoxEdgeDeviceResponse contains the response from method RolesClient.ListByDataBoxEdgeDevice. type RolesClientListByDataBoxEdgeDeviceResponse struct { - RolesClientListByDataBoxEdgeDeviceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// RolesClientListByDataBoxEdgeDeviceResult contains the result from method RolesClient.ListByDataBoxEdgeDevice. -type RolesClientListByDataBoxEdgeDeviceResult struct { RoleList } -// SharesClientCreateOrUpdatePollerResponse contains the response from method SharesClient.CreateOrUpdate. -type SharesClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *SharesClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l SharesClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SharesClientCreateOrUpdateResponse, error) { - respType := SharesClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Share) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a SharesClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *SharesClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *SharesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("SharesClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &SharesClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // SharesClientCreateOrUpdateResponse contains the response from method SharesClient.CreateOrUpdate. type SharesClientCreateOrUpdateResponse struct { - SharesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SharesClientCreateOrUpdateResult contains the result from method SharesClient.CreateOrUpdate. -type SharesClientCreateOrUpdateResult struct { Share } -// SharesClientDeletePollerResponse contains the response from method SharesClient.Delete. -type SharesClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *SharesClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l SharesClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SharesClientDeleteResponse, error) { - respType := SharesClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a SharesClientDeletePollerResponse from the provided client and resume token. -func (l *SharesClientDeletePollerResponse) Resume(ctx context.Context, client *SharesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("SharesClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &SharesClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // SharesClientDeleteResponse contains the response from method SharesClient.Delete. type SharesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // SharesClientGetResponse contains the response from method SharesClient.Get. type SharesClientGetResponse struct { - SharesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SharesClientGetResult contains the result from method SharesClient.Get. -type SharesClientGetResult struct { Share } // SharesClientListByDataBoxEdgeDeviceResponse contains the response from method SharesClient.ListByDataBoxEdgeDevice. type SharesClientListByDataBoxEdgeDeviceResponse struct { - SharesClientListByDataBoxEdgeDeviceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SharesClientListByDataBoxEdgeDeviceResult contains the result from method SharesClient.ListByDataBoxEdgeDevice. -type SharesClientListByDataBoxEdgeDeviceResult struct { ShareList } -// SharesClientRefreshPollerResponse contains the response from method SharesClient.Refresh. -type SharesClientRefreshPollerResponse struct { - // Poller contains an initialized poller. - Poller *SharesClientRefreshPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l SharesClientRefreshPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SharesClientRefreshResponse, error) { - respType := SharesClientRefreshResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a SharesClientRefreshPollerResponse from the provided client and resume token. -func (l *SharesClientRefreshPollerResponse) Resume(ctx context.Context, client *SharesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("SharesClient.Refresh", token, client.pl) - if err != nil { - return err - } - poller := &SharesClientRefreshPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // SharesClientRefreshResponse contains the response from method SharesClient.Refresh. type SharesClientRefreshResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// StorageAccountCredentialsClientCreateOrUpdatePollerResponse contains the response from method StorageAccountCredentialsClient.CreateOrUpdate. -type StorageAccountCredentialsClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *StorageAccountCredentialsClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l StorageAccountCredentialsClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StorageAccountCredentialsClientCreateOrUpdateResponse, error) { - respType := StorageAccountCredentialsClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.StorageAccountCredential) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a StorageAccountCredentialsClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *StorageAccountCredentialsClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *StorageAccountCredentialsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("StorageAccountCredentialsClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &StorageAccountCredentialsClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil + // placeholder for future response values } // StorageAccountCredentialsClientCreateOrUpdateResponse contains the response from method StorageAccountCredentialsClient.CreateOrUpdate. type StorageAccountCredentialsClientCreateOrUpdateResponse struct { - StorageAccountCredentialsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// StorageAccountCredentialsClientCreateOrUpdateResult contains the result from method StorageAccountCredentialsClient.CreateOrUpdate. -type StorageAccountCredentialsClientCreateOrUpdateResult struct { StorageAccountCredential } -// StorageAccountCredentialsClientDeletePollerResponse contains the response from method StorageAccountCredentialsClient.Delete. -type StorageAccountCredentialsClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *StorageAccountCredentialsClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l StorageAccountCredentialsClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StorageAccountCredentialsClientDeleteResponse, error) { - respType := StorageAccountCredentialsClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a StorageAccountCredentialsClientDeletePollerResponse from the provided client and resume token. -func (l *StorageAccountCredentialsClientDeletePollerResponse) Resume(ctx context.Context, client *StorageAccountCredentialsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("StorageAccountCredentialsClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &StorageAccountCredentialsClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // StorageAccountCredentialsClientDeleteResponse contains the response from method StorageAccountCredentialsClient.Delete. type StorageAccountCredentialsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // StorageAccountCredentialsClientGetResponse contains the response from method StorageAccountCredentialsClient.Get. type StorageAccountCredentialsClientGetResponse struct { - StorageAccountCredentialsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// StorageAccountCredentialsClientGetResult contains the result from method StorageAccountCredentialsClient.Get. -type StorageAccountCredentialsClientGetResult struct { StorageAccountCredential } // StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse contains the response from method StorageAccountCredentialsClient.ListByDataBoxEdgeDevice. type StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse struct { - StorageAccountCredentialsClientListByDataBoxEdgeDeviceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// StorageAccountCredentialsClientListByDataBoxEdgeDeviceResult contains the result from method StorageAccountCredentialsClient.ListByDataBoxEdgeDevice. -type StorageAccountCredentialsClientListByDataBoxEdgeDeviceResult struct { StorageAccountCredentialList } -// StorageAccountsClientCreateOrUpdatePollerResponse contains the response from method StorageAccountsClient.CreateOrUpdate. -type StorageAccountsClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *StorageAccountsClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l StorageAccountsClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StorageAccountsClientCreateOrUpdateResponse, error) { - respType := StorageAccountsClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.StorageAccount) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a StorageAccountsClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *StorageAccountsClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *StorageAccountsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("StorageAccountsClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &StorageAccountsClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // StorageAccountsClientCreateOrUpdateResponse contains the response from method StorageAccountsClient.CreateOrUpdate. type StorageAccountsClientCreateOrUpdateResponse struct { - StorageAccountsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// StorageAccountsClientCreateOrUpdateResult contains the result from method StorageAccountsClient.CreateOrUpdate. -type StorageAccountsClientCreateOrUpdateResult struct { StorageAccount } -// StorageAccountsClientDeletePollerResponse contains the response from method StorageAccountsClient.Delete. -type StorageAccountsClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *StorageAccountsClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l StorageAccountsClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StorageAccountsClientDeleteResponse, error) { - respType := StorageAccountsClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a StorageAccountsClientDeletePollerResponse from the provided client and resume token. -func (l *StorageAccountsClientDeletePollerResponse) Resume(ctx context.Context, client *StorageAccountsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("StorageAccountsClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &StorageAccountsClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // StorageAccountsClientDeleteResponse contains the response from method StorageAccountsClient.Delete. type StorageAccountsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // StorageAccountsClientGetResponse contains the response from method StorageAccountsClient.Get. type StorageAccountsClientGetResponse struct { - StorageAccountsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// StorageAccountsClientGetResult contains the result from method StorageAccountsClient.Get. -type StorageAccountsClientGetResult struct { StorageAccount } // StorageAccountsClientListByDataBoxEdgeDeviceResponse contains the response from method StorageAccountsClient.ListByDataBoxEdgeDevice. type StorageAccountsClientListByDataBoxEdgeDeviceResponse struct { - StorageAccountsClientListByDataBoxEdgeDeviceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// StorageAccountsClientListByDataBoxEdgeDeviceResult contains the result from method StorageAccountsClient.ListByDataBoxEdgeDevice. -type StorageAccountsClientListByDataBoxEdgeDeviceResult struct { StorageAccountList } -// SupportPackagesClientTriggerSupportPackagePollerResponse contains the response from method SupportPackagesClient.TriggerSupportPackage. -type SupportPackagesClientTriggerSupportPackagePollerResponse struct { - // Poller contains an initialized poller. - Poller *SupportPackagesClientTriggerSupportPackagePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l SupportPackagesClientTriggerSupportPackagePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (SupportPackagesClientTriggerSupportPackageResponse, error) { - respType := SupportPackagesClientTriggerSupportPackageResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a SupportPackagesClientTriggerSupportPackagePollerResponse from the provided client and resume token. -func (l *SupportPackagesClientTriggerSupportPackagePollerResponse) Resume(ctx context.Context, client *SupportPackagesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("SupportPackagesClient.TriggerSupportPackage", token, client.pl) - if err != nil { - return err - } - poller := &SupportPackagesClientTriggerSupportPackagePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // SupportPackagesClientTriggerSupportPackageResponse contains the response from method SupportPackagesClient.TriggerSupportPackage. type SupportPackagesClientTriggerSupportPackageResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// TriggersClientCreateOrUpdatePollerResponse contains the response from method TriggersClient.CreateOrUpdate. -type TriggersClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *TriggersClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l TriggersClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (TriggersClientCreateOrUpdateResponse, error) { - respType := TriggersClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.TriggersClientCreateOrUpdateResult) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a TriggersClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *TriggersClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *TriggersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("TriggersClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &TriggersClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil + // placeholder for future response values } // TriggersClientCreateOrUpdateResponse contains the response from method TriggersClient.CreateOrUpdate. type TriggersClientCreateOrUpdateResponse struct { - TriggersClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// TriggersClientCreateOrUpdateResult contains the result from method TriggersClient.CreateOrUpdate. -type TriggersClientCreateOrUpdateResult struct { TriggerClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type TriggersClientCreateOrUpdateResult. -func (t *TriggersClientCreateOrUpdateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TriggersClientCreateOrUpdateResponse. +func (t *TriggersClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalTriggerClassification(data) if err != nil { return err @@ -1942,66 +408,18 @@ func (t *TriggersClientCreateOrUpdateResult) UnmarshalJSON(data []byte) error { return nil } -// TriggersClientDeletePollerResponse contains the response from method TriggersClient.Delete. -type TriggersClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *TriggersClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l TriggersClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (TriggersClientDeleteResponse, error) { - respType := TriggersClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a TriggersClientDeletePollerResponse from the provided client and resume token. -func (l *TriggersClientDeletePollerResponse) Resume(ctx context.Context, client *TriggersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("TriggersClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &TriggersClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // TriggersClientDeleteResponse contains the response from method TriggersClient.Delete. type TriggersClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // TriggersClientGetResponse contains the response from method TriggersClient.Get. type TriggersClientGetResponse struct { - TriggersClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// TriggersClientGetResult contains the result from method TriggersClient.Get. -type TriggersClientGetResult struct { TriggerClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type TriggersClientGetResult. -func (t *TriggersClientGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TriggersClientGetResponse. +func (t *TriggersClientGetResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalTriggerClassification(data) if err != nil { return err @@ -2012,134 +430,25 @@ func (t *TriggersClientGetResult) UnmarshalJSON(data []byte) error { // TriggersClientListByDataBoxEdgeDeviceResponse contains the response from method TriggersClient.ListByDataBoxEdgeDevice. type TriggersClientListByDataBoxEdgeDeviceResponse struct { - TriggersClientListByDataBoxEdgeDeviceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// TriggersClientListByDataBoxEdgeDeviceResult contains the result from method TriggersClient.ListByDataBoxEdgeDevice. -type TriggersClientListByDataBoxEdgeDeviceResult struct { TriggerList } -// UsersClientCreateOrUpdatePollerResponse contains the response from method UsersClient.CreateOrUpdate. -type UsersClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *UsersClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l UsersClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (UsersClientCreateOrUpdateResponse, error) { - respType := UsersClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.User) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a UsersClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *UsersClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *UsersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("UsersClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &UsersClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // UsersClientCreateOrUpdateResponse contains the response from method UsersClient.CreateOrUpdate. type UsersClientCreateOrUpdateResponse struct { - UsersClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// UsersClientCreateOrUpdateResult contains the result from method UsersClient.CreateOrUpdate. -type UsersClientCreateOrUpdateResult struct { User } -// UsersClientDeletePollerResponse contains the response from method UsersClient.Delete. -type UsersClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *UsersClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l UsersClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (UsersClientDeleteResponse, error) { - respType := UsersClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a UsersClientDeletePollerResponse from the provided client and resume token. -func (l *UsersClientDeletePollerResponse) Resume(ctx context.Context, client *UsersClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("UsersClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &UsersClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // UsersClientDeleteResponse contains the response from method UsersClient.Delete. type UsersClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // UsersClientGetResponse contains the response from method UsersClient.Get. type UsersClientGetResponse struct { - UsersClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// UsersClientGetResult contains the result from method UsersClient.Get. -type UsersClientGetResult struct { User } // UsersClientListByDataBoxEdgeDeviceResponse contains the response from method UsersClient.ListByDataBoxEdgeDevice. type UsersClientListByDataBoxEdgeDeviceResponse struct { - UsersClientListByDataBoxEdgeDeviceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// UsersClientListByDataBoxEdgeDeviceResult contains the result from method UsersClient.ListByDataBoxEdgeDevice. -type UsersClientListByDataBoxEdgeDeviceResult struct { UserList } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_roles_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_roles_client.go index b8346d16246c..39f61623e3e3 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_roles_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_roles_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type RolesClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewRolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *RolesClient { +func NewRolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RolesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &RolesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Create or update a role. @@ -57,22 +62,16 @@ func NewRolesClient(subscriptionID string, credential azcore.TokenCredential, op // role - The role properties. // options - RolesClientBeginCreateOrUpdateOptions contains the optional parameters for the RolesClient.BeginCreateOrUpdate // method. -func (client *RolesClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, role RoleClassification, options *RolesClientBeginCreateOrUpdateOptions) (RolesClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, role, options) - if err != nil { - return RolesClientCreateOrUpdatePollerResponse{}, err - } - result := RolesClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("RolesClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return RolesClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &RolesClientCreateOrUpdatePoller{ - pt: pt, +func (client *RolesClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, role RoleClassification, options *RolesClientBeginCreateOrUpdateOptions) (*armruntime.Poller[RolesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, role, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[RolesClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[RolesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // CreateOrUpdate - Create or update a role. @@ -116,7 +115,7 @@ func (client *RolesClient) createOrUpdateCreateRequest(ctx context.Context, devi return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, role) @@ -128,22 +127,16 @@ func (client *RolesClient) createOrUpdateCreateRequest(ctx context.Context, devi // name - The role name. // resourceGroupName - The resource group name. // options - RolesClientBeginDeleteOptions contains the optional parameters for the RolesClient.BeginDelete method. -func (client *RolesClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *RolesClientBeginDeleteOptions) (RolesClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) - if err != nil { - return RolesClientDeletePollerResponse{}, err - } - result := RolesClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("RolesClient.Delete", "", resp, client.pl) - if err != nil { - return RolesClientDeletePollerResponse{}, err - } - result.Poller = &RolesClientDeletePoller{ - pt: pt, +func (client *RolesClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *RolesClientBeginDeleteOptions) (*armruntime.Poller[RolesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[RolesClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[RolesClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - Deletes the role on the device. @@ -187,7 +180,7 @@ func (client *RolesClient) deleteCreateRequest(ctx context.Context, deviceName s return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -238,7 +231,7 @@ func (client *RolesClient) getCreateRequest(ctx context.Context, deviceName stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -246,7 +239,7 @@ func (client *RolesClient) getCreateRequest(ctx context.Context, deviceName stri // getHandleResponse handles the Get response. func (client *RolesClient) getHandleResponse(resp *http.Response) (RolesClientGetResponse, error) { - result := RolesClientGetResponse{RawResponse: resp} + result := RolesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return RolesClientGetResponse{}, err } @@ -259,16 +252,32 @@ func (client *RolesClient) getHandleResponse(resp *http.Response) (RolesClientGe // resourceGroupName - The resource group name. // options - RolesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the RolesClient.ListByDataBoxEdgeDevice // method. -func (client *RolesClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *RolesClientListByDataBoxEdgeDeviceOptions) *RolesClientListByDataBoxEdgeDevicePager { - return &RolesClientListByDataBoxEdgeDevicePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) +func (client *RolesClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *RolesClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[RolesClientListByDataBoxEdgeDeviceResponse] { + return runtime.NewPager(runtime.PageProcessor[RolesClientListByDataBoxEdgeDeviceResponse]{ + More: func(page RolesClientListByDataBoxEdgeDeviceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp RolesClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.RoleList.NextLink) + Fetcher: func(ctx context.Context, page *RolesClientListByDataBoxEdgeDeviceResponse) (RolesClientListByDataBoxEdgeDeviceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return RolesClientListByDataBoxEdgeDeviceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RolesClientListByDataBoxEdgeDeviceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RolesClientListByDataBoxEdgeDeviceResponse{}, runtime.NewResponseError(resp) + } + return client.listByDataBoxEdgeDeviceHandleResponse(resp) }, - } + }) } // listByDataBoxEdgeDeviceCreateRequest creates the ListByDataBoxEdgeDevice request. @@ -291,7 +300,7 @@ func (client *RolesClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -299,7 +308,7 @@ func (client *RolesClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.Cont // listByDataBoxEdgeDeviceHandleResponse handles the ListByDataBoxEdgeDevice response. func (client *RolesClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Response) (RolesClientListByDataBoxEdgeDeviceResponse, error) { - result := RolesClientListByDataBoxEdgeDeviceResponse{RawResponse: resp} + result := RolesClientListByDataBoxEdgeDeviceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.RoleList); err != nil { return RolesClientListByDataBoxEdgeDeviceResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_shares_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_shares_client.go index 3b9dcb4d3a17..8201aafeb211 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_shares_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_shares_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type SharesClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewSharesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SharesClient { +func NewSharesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &SharesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Creates a new share or updates an existing share on the device. @@ -57,22 +62,16 @@ func NewSharesClient(subscriptionID string, credential azcore.TokenCredential, o // share - The share properties. // options - SharesClientBeginCreateOrUpdateOptions contains the optional parameters for the SharesClient.BeginCreateOrUpdate // method. -func (client *SharesClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, share Share, options *SharesClientBeginCreateOrUpdateOptions) (SharesClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, share, options) - if err != nil { - return SharesClientCreateOrUpdatePollerResponse{}, err - } - result := SharesClientCreateOrUpdatePollerResponse{ - RawResponse: resp, +func (client *SharesClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, share Share, options *SharesClientBeginCreateOrUpdateOptions) (*armruntime.Poller[SharesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, share, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[SharesClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[SharesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("SharesClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return SharesClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &SharesClientCreateOrUpdatePoller{ - pt: pt, - } - return result, nil } // CreateOrUpdate - Creates a new share or updates an existing share on the device. @@ -116,7 +115,7 @@ func (client *SharesClient) createOrUpdateCreateRequest(ctx context.Context, dev return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, share) @@ -128,22 +127,16 @@ func (client *SharesClient) createOrUpdateCreateRequest(ctx context.Context, dev // name - The share name. // resourceGroupName - The resource group name. // options - SharesClientBeginDeleteOptions contains the optional parameters for the SharesClient.BeginDelete method. -func (client *SharesClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *SharesClientBeginDeleteOptions) (SharesClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) - if err != nil { - return SharesClientDeletePollerResponse{}, err - } - result := SharesClientDeletePollerResponse{ - RawResponse: resp, +func (client *SharesClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *SharesClientBeginDeleteOptions) (*armruntime.Poller[SharesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[SharesClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[SharesClientDeleteResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("SharesClient.Delete", "", resp, client.pl) - if err != nil { - return SharesClientDeletePollerResponse{}, err - } - result.Poller = &SharesClientDeletePoller{ - pt: pt, - } - return result, nil } // Delete - Deletes the share on the Data Box Edge/Data Box Gateway device. @@ -187,7 +180,7 @@ func (client *SharesClient) deleteCreateRequest(ctx context.Context, deviceName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -238,7 +231,7 @@ func (client *SharesClient) getCreateRequest(ctx context.Context, deviceName str return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -246,7 +239,7 @@ func (client *SharesClient) getCreateRequest(ctx context.Context, deviceName str // getHandleResponse handles the Get response. func (client *SharesClient) getHandleResponse(resp *http.Response) (SharesClientGetResponse, error) { - result := SharesClientGetResponse{RawResponse: resp} + result := SharesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Share); err != nil { return SharesClientGetResponse{}, err } @@ -259,16 +252,32 @@ func (client *SharesClient) getHandleResponse(resp *http.Response) (SharesClient // resourceGroupName - The resource group name. // options - SharesClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the SharesClient.ListByDataBoxEdgeDevice // method. -func (client *SharesClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *SharesClientListByDataBoxEdgeDeviceOptions) *SharesClientListByDataBoxEdgeDevicePager { - return &SharesClientListByDataBoxEdgeDevicePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) +func (client *SharesClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *SharesClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[SharesClientListByDataBoxEdgeDeviceResponse] { + return runtime.NewPager(runtime.PageProcessor[SharesClientListByDataBoxEdgeDeviceResponse]{ + More: func(page SharesClientListByDataBoxEdgeDeviceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp SharesClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ShareList.NextLink) + Fetcher: func(ctx context.Context, page *SharesClientListByDataBoxEdgeDeviceResponse) (SharesClientListByDataBoxEdgeDeviceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SharesClientListByDataBoxEdgeDeviceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SharesClientListByDataBoxEdgeDeviceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SharesClientListByDataBoxEdgeDeviceResponse{}, runtime.NewResponseError(resp) + } + return client.listByDataBoxEdgeDeviceHandleResponse(resp) }, - } + }) } // listByDataBoxEdgeDeviceCreateRequest creates the ListByDataBoxEdgeDevice request. @@ -291,7 +300,7 @@ func (client *SharesClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -299,7 +308,7 @@ func (client *SharesClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.Con // listByDataBoxEdgeDeviceHandleResponse handles the ListByDataBoxEdgeDevice response. func (client *SharesClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Response) (SharesClientListByDataBoxEdgeDeviceResponse, error) { - result := SharesClientListByDataBoxEdgeDeviceResponse{RawResponse: resp} + result := SharesClientListByDataBoxEdgeDeviceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ShareList); err != nil { return SharesClientListByDataBoxEdgeDeviceResponse{}, err } @@ -312,22 +321,16 @@ func (client *SharesClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Res // name - The share name. // resourceGroupName - The resource group name. // options - SharesClientBeginRefreshOptions contains the optional parameters for the SharesClient.BeginRefresh method. -func (client *SharesClient) BeginRefresh(ctx context.Context, deviceName string, name string, resourceGroupName string, options *SharesClientBeginRefreshOptions) (SharesClientRefreshPollerResponse, error) { - resp, err := client.refresh(ctx, deviceName, name, resourceGroupName, options) - if err != nil { - return SharesClientRefreshPollerResponse{}, err +func (client *SharesClient) BeginRefresh(ctx context.Context, deviceName string, name string, resourceGroupName string, options *SharesClientBeginRefreshOptions) (*armruntime.Poller[SharesClientRefreshResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.refresh(ctx, deviceName, name, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[SharesClientRefreshResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[SharesClientRefreshResponse](options.ResumeToken, client.pl, nil) } - result := SharesClientRefreshPollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("SharesClient.Refresh", "", resp, client.pl) - if err != nil { - return SharesClientRefreshPollerResponse{}, err - } - result.Poller = &SharesClientRefreshPoller{ - pt: pt, - } - return result, nil } // Refresh - Refreshes the share metadata with the data from the cloud. @@ -371,7 +374,7 @@ func (client *SharesClient) refreshCreateRequest(ctx context.Context, deviceName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccountcredentials_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccountcredentials_client.go index 12bb93c30a3b..906b45d464ae 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccountcredentials_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccountcredentials_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type StorageAccountCredentialsClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewStorageAccountCredentialsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *StorageAccountCredentialsClient { +func NewStorageAccountCredentialsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StorageAccountCredentialsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &StorageAccountCredentialsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Creates or updates the storage account credential. @@ -57,22 +62,16 @@ func NewStorageAccountCredentialsClient(subscriptionID string, credential azcore // storageAccountCredential - The storage account credential. // options - StorageAccountCredentialsClientBeginCreateOrUpdateOptions contains the optional parameters for the StorageAccountCredentialsClient.BeginCreateOrUpdate // method. -func (client *StorageAccountCredentialsClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, storageAccountCredential StorageAccountCredential, options *StorageAccountCredentialsClientBeginCreateOrUpdateOptions) (StorageAccountCredentialsClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, storageAccountCredential, options) - if err != nil { - return StorageAccountCredentialsClientCreateOrUpdatePollerResponse{}, err - } - result := StorageAccountCredentialsClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("StorageAccountCredentialsClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return StorageAccountCredentialsClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &StorageAccountCredentialsClientCreateOrUpdatePoller{ - pt: pt, +func (client *StorageAccountCredentialsClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, storageAccountCredential StorageAccountCredential, options *StorageAccountCredentialsClientBeginCreateOrUpdateOptions) (*armruntime.Poller[StorageAccountCredentialsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, storageAccountCredential, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[StorageAccountCredentialsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[StorageAccountCredentialsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // CreateOrUpdate - Creates or updates the storage account credential. @@ -116,7 +115,7 @@ func (client *StorageAccountCredentialsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, storageAccountCredential) @@ -129,22 +128,16 @@ func (client *StorageAccountCredentialsClient) createOrUpdateCreateRequest(ctx c // resourceGroupName - The resource group name. // options - StorageAccountCredentialsClientBeginDeleteOptions contains the optional parameters for the StorageAccountCredentialsClient.BeginDelete // method. -func (client *StorageAccountCredentialsClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *StorageAccountCredentialsClientBeginDeleteOptions) (StorageAccountCredentialsClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) - if err != nil { - return StorageAccountCredentialsClientDeletePollerResponse{}, err - } - result := StorageAccountCredentialsClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("StorageAccountCredentialsClient.Delete", "", resp, client.pl) - if err != nil { - return StorageAccountCredentialsClientDeletePollerResponse{}, err - } - result.Poller = &StorageAccountCredentialsClientDeletePoller{ - pt: pt, +func (client *StorageAccountCredentialsClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *StorageAccountCredentialsClientBeginDeleteOptions) (*armruntime.Poller[StorageAccountCredentialsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[StorageAccountCredentialsClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[StorageAccountCredentialsClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - Deletes the storage account credential. @@ -188,7 +181,7 @@ func (client *StorageAccountCredentialsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -240,7 +233,7 @@ func (client *StorageAccountCredentialsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -248,7 +241,7 @@ func (client *StorageAccountCredentialsClient) getCreateRequest(ctx context.Cont // getHandleResponse handles the Get response. func (client *StorageAccountCredentialsClient) getHandleResponse(resp *http.Response) (StorageAccountCredentialsClientGetResponse, error) { - result := StorageAccountCredentialsClientGetResponse{RawResponse: resp} + result := StorageAccountCredentialsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.StorageAccountCredential); err != nil { return StorageAccountCredentialsClientGetResponse{}, err } @@ -261,16 +254,32 @@ func (client *StorageAccountCredentialsClient) getHandleResponse(resp *http.Resp // resourceGroupName - The resource group name. // options - StorageAccountCredentialsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the StorageAccountCredentialsClient.ListByDataBoxEdgeDevice // method. -func (client *StorageAccountCredentialsClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *StorageAccountCredentialsClientListByDataBoxEdgeDeviceOptions) *StorageAccountCredentialsClientListByDataBoxEdgeDevicePager { - return &StorageAccountCredentialsClientListByDataBoxEdgeDevicePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) +func (client *StorageAccountCredentialsClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *StorageAccountCredentialsClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse] { + return runtime.NewPager(runtime.PageProcessor[StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse]{ + More: func(page StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.StorageAccountCredentialList.NextLink) + Fetcher: func(ctx context.Context, page *StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse) (StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse{}, runtime.NewResponseError(resp) + } + return client.listByDataBoxEdgeDeviceHandleResponse(resp) }, - } + }) } // listByDataBoxEdgeDeviceCreateRequest creates the ListByDataBoxEdgeDevice request. @@ -293,7 +302,7 @@ func (client *StorageAccountCredentialsClient) listByDataBoxEdgeDeviceCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -301,7 +310,7 @@ func (client *StorageAccountCredentialsClient) listByDataBoxEdgeDeviceCreateRequ // listByDataBoxEdgeDeviceHandleResponse handles the ListByDataBoxEdgeDevice response. func (client *StorageAccountCredentialsClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Response) (StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse, error) { - result := StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse{RawResponse: resp} + result := StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.StorageAccountCredentialList); err != nil { return StorageAccountCredentialsClientListByDataBoxEdgeDeviceResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccounts_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccounts_client.go index 29a82059b8b6..7acd1b49cdf3 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccounts_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_storageaccounts_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type StorageAccountsClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewStorageAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *StorageAccountsClient { +func NewStorageAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StorageAccountsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &StorageAccountsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Creates a new StorageAccount or updates an existing StorageAccount on the device. @@ -57,22 +62,16 @@ func NewStorageAccountsClient(subscriptionID string, credential azcore.TokenCred // storageAccount - The StorageAccount properties. // options - StorageAccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the StorageAccountsClient.BeginCreateOrUpdate // method. -func (client *StorageAccountsClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string, storageAccount StorageAccount, options *StorageAccountsClientBeginCreateOrUpdateOptions) (StorageAccountsClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, deviceName, storageAccountName, resourceGroupName, storageAccount, options) - if err != nil { - return StorageAccountsClientCreateOrUpdatePollerResponse{}, err - } - result := StorageAccountsClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("StorageAccountsClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return StorageAccountsClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &StorageAccountsClientCreateOrUpdatePoller{ - pt: pt, +func (client *StorageAccountsClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string, storageAccount StorageAccount, options *StorageAccountsClientBeginCreateOrUpdateOptions) (*armruntime.Poller[StorageAccountsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, deviceName, storageAccountName, resourceGroupName, storageAccount, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[StorageAccountsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[StorageAccountsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // CreateOrUpdate - Creates a new StorageAccount or updates an existing StorageAccount on the device. @@ -116,7 +115,7 @@ func (client *StorageAccountsClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, storageAccount) @@ -129,22 +128,16 @@ func (client *StorageAccountsClient) createOrUpdateCreateRequest(ctx context.Con // resourceGroupName - The resource group name. // options - StorageAccountsClientBeginDeleteOptions contains the optional parameters for the StorageAccountsClient.BeginDelete // method. -func (client *StorageAccountsClient) BeginDelete(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string, options *StorageAccountsClientBeginDeleteOptions) (StorageAccountsClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, deviceName, storageAccountName, resourceGroupName, options) - if err != nil { - return StorageAccountsClientDeletePollerResponse{}, err - } - result := StorageAccountsClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("StorageAccountsClient.Delete", "", resp, client.pl) - if err != nil { - return StorageAccountsClientDeletePollerResponse{}, err - } - result.Poller = &StorageAccountsClientDeletePoller{ - pt: pt, +func (client *StorageAccountsClient) BeginDelete(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string, options *StorageAccountsClientBeginDeleteOptions) (*armruntime.Poller[StorageAccountsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, deviceName, storageAccountName, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[StorageAccountsClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[StorageAccountsClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. @@ -188,7 +181,7 @@ func (client *StorageAccountsClient) deleteCreateRequest(ctx context.Context, de return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -239,7 +232,7 @@ func (client *StorageAccountsClient) getCreateRequest(ctx context.Context, devic return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -247,7 +240,7 @@ func (client *StorageAccountsClient) getCreateRequest(ctx context.Context, devic // getHandleResponse handles the Get response. func (client *StorageAccountsClient) getHandleResponse(resp *http.Response) (StorageAccountsClientGetResponse, error) { - result := StorageAccountsClientGetResponse{RawResponse: resp} + result := StorageAccountsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.StorageAccount); err != nil { return StorageAccountsClientGetResponse{}, err } @@ -260,16 +253,32 @@ func (client *StorageAccountsClient) getHandleResponse(resp *http.Response) (Sto // resourceGroupName - The resource group name. // options - StorageAccountsClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the StorageAccountsClient.ListByDataBoxEdgeDevice // method. -func (client *StorageAccountsClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *StorageAccountsClientListByDataBoxEdgeDeviceOptions) *StorageAccountsClientListByDataBoxEdgeDevicePager { - return &StorageAccountsClientListByDataBoxEdgeDevicePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) +func (client *StorageAccountsClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *StorageAccountsClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[StorageAccountsClientListByDataBoxEdgeDeviceResponse] { + return runtime.NewPager(runtime.PageProcessor[StorageAccountsClientListByDataBoxEdgeDeviceResponse]{ + More: func(page StorageAccountsClientListByDataBoxEdgeDeviceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp StorageAccountsClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.StorageAccountList.NextLink) + Fetcher: func(ctx context.Context, page *StorageAccountsClientListByDataBoxEdgeDeviceResponse) (StorageAccountsClientListByDataBoxEdgeDeviceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return StorageAccountsClientListByDataBoxEdgeDeviceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StorageAccountsClientListByDataBoxEdgeDeviceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StorageAccountsClientListByDataBoxEdgeDeviceResponse{}, runtime.NewResponseError(resp) + } + return client.listByDataBoxEdgeDeviceHandleResponse(resp) }, - } + }) } // listByDataBoxEdgeDeviceCreateRequest creates the ListByDataBoxEdgeDevice request. @@ -292,7 +301,7 @@ func (client *StorageAccountsClient) listByDataBoxEdgeDeviceCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -300,7 +309,7 @@ func (client *StorageAccountsClient) listByDataBoxEdgeDeviceCreateRequest(ctx co // listByDataBoxEdgeDeviceHandleResponse handles the ListByDataBoxEdgeDevice response. func (client *StorageAccountsClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Response) (StorageAccountsClientListByDataBoxEdgeDeviceResponse, error) { - result := StorageAccountsClientListByDataBoxEdgeDeviceResponse{RawResponse: resp} + result := StorageAccountsClientListByDataBoxEdgeDeviceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.StorageAccountList); err != nil { return StorageAccountsClientListByDataBoxEdgeDeviceResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_supportpackages_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_supportpackages_client.go index c94d1795f2f4..273c7e797a6e 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_supportpackages_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_supportpackages_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type SupportPackagesClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewSupportPackagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SupportPackagesClient { +func NewSupportPackagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SupportPackagesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &SupportPackagesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // BeginTriggerSupportPackage - Triggers support package on the device @@ -56,22 +61,16 @@ func NewSupportPackagesClient(subscriptionID string, credential azcore.TokenCred // triggerSupportPackageRequest - The trigger support package request object // options - SupportPackagesClientBeginTriggerSupportPackageOptions contains the optional parameters for the SupportPackagesClient.BeginTriggerSupportPackage // method. -func (client *SupportPackagesClient) BeginTriggerSupportPackage(ctx context.Context, deviceName string, resourceGroupName string, triggerSupportPackageRequest TriggerSupportPackageRequest, options *SupportPackagesClientBeginTriggerSupportPackageOptions) (SupportPackagesClientTriggerSupportPackagePollerResponse, error) { - resp, err := client.triggerSupportPackage(ctx, deviceName, resourceGroupName, triggerSupportPackageRequest, options) - if err != nil { - return SupportPackagesClientTriggerSupportPackagePollerResponse{}, err - } - result := SupportPackagesClientTriggerSupportPackagePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("SupportPackagesClient.TriggerSupportPackage", "", resp, client.pl) - if err != nil { - return SupportPackagesClientTriggerSupportPackagePollerResponse{}, err - } - result.Poller = &SupportPackagesClientTriggerSupportPackagePoller{ - pt: pt, +func (client *SupportPackagesClient) BeginTriggerSupportPackage(ctx context.Context, deviceName string, resourceGroupName string, triggerSupportPackageRequest TriggerSupportPackageRequest, options *SupportPackagesClientBeginTriggerSupportPackageOptions) (*armruntime.Poller[SupportPackagesClientTriggerSupportPackageResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.triggerSupportPackage(ctx, deviceName, resourceGroupName, triggerSupportPackageRequest, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[SupportPackagesClientTriggerSupportPackageResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[SupportPackagesClientTriggerSupportPackageResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // TriggerSupportPackage - Triggers support package on the device @@ -111,7 +110,7 @@ func (client *SupportPackagesClient) triggerSupportPackageCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, triggerSupportPackageRequest) diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_time_rfc3339.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_time_rfc3339.go index dd5339d9317f..45c181aad452 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_time_rfc3339.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_triggers_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_triggers_client.go index 52502239fd53..6c3887b7bfd0 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_triggers_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_triggers_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type TriggersClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewTriggersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *TriggersClient { +func NewTriggersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TriggersClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &TriggersClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Creates or updates a trigger. @@ -57,22 +62,16 @@ func NewTriggersClient(subscriptionID string, credential azcore.TokenCredential, // trigger - The trigger. // options - TriggersClientBeginCreateOrUpdateOptions contains the optional parameters for the TriggersClient.BeginCreateOrUpdate // method. -func (client *TriggersClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, trigger TriggerClassification, options *TriggersClientBeginCreateOrUpdateOptions) (TriggersClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, trigger, options) - if err != nil { - return TriggersClientCreateOrUpdatePollerResponse{}, err - } - result := TriggersClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("TriggersClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return TriggersClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &TriggersClientCreateOrUpdatePoller{ - pt: pt, +func (client *TriggersClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, trigger TriggerClassification, options *TriggersClientBeginCreateOrUpdateOptions) (*armruntime.Poller[TriggersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, trigger, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[TriggersClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[TriggersClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // CreateOrUpdate - Creates or updates a trigger. @@ -116,7 +115,7 @@ func (client *TriggersClient) createOrUpdateCreateRequest(ctx context.Context, d return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, trigger) @@ -128,22 +127,16 @@ func (client *TriggersClient) createOrUpdateCreateRequest(ctx context.Context, d // name - The trigger name. // resourceGroupName - The resource group name. // options - TriggersClientBeginDeleteOptions contains the optional parameters for the TriggersClient.BeginDelete method. -func (client *TriggersClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *TriggersClientBeginDeleteOptions) (TriggersClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) - if err != nil { - return TriggersClientDeletePollerResponse{}, err - } - result := TriggersClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("TriggersClient.Delete", "", resp, client.pl) - if err != nil { - return TriggersClientDeletePollerResponse{}, err - } - result.Poller = &TriggersClientDeletePoller{ - pt: pt, +func (client *TriggersClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *TriggersClientBeginDeleteOptions) (*armruntime.Poller[TriggersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[TriggersClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[TriggersClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - Deletes the trigger on the gateway device. @@ -187,7 +180,7 @@ func (client *TriggersClient) deleteCreateRequest(ctx context.Context, deviceNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -238,7 +231,7 @@ func (client *TriggersClient) getCreateRequest(ctx context.Context, deviceName s return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -246,7 +239,7 @@ func (client *TriggersClient) getCreateRequest(ctx context.Context, deviceName s // getHandleResponse handles the Get response. func (client *TriggersClient) getHandleResponse(resp *http.Response) (TriggersClientGetResponse, error) { - result := TriggersClientGetResponse{RawResponse: resp} + result := TriggersClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return TriggersClientGetResponse{}, err } @@ -259,16 +252,32 @@ func (client *TriggersClient) getHandleResponse(resp *http.Response) (TriggersCl // resourceGroupName - The resource group name. // options - TriggersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the TriggersClient.ListByDataBoxEdgeDevice // method. -func (client *TriggersClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *TriggersClientListByDataBoxEdgeDeviceOptions) *TriggersClientListByDataBoxEdgeDevicePager { - return &TriggersClientListByDataBoxEdgeDevicePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) +func (client *TriggersClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *TriggersClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[TriggersClientListByDataBoxEdgeDeviceResponse] { + return runtime.NewPager(runtime.PageProcessor[TriggersClientListByDataBoxEdgeDeviceResponse]{ + More: func(page TriggersClientListByDataBoxEdgeDeviceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp TriggersClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.TriggerList.NextLink) + Fetcher: func(ctx context.Context, page *TriggersClientListByDataBoxEdgeDeviceResponse) (TriggersClientListByDataBoxEdgeDeviceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return TriggersClientListByDataBoxEdgeDeviceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return TriggersClientListByDataBoxEdgeDeviceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TriggersClientListByDataBoxEdgeDeviceResponse{}, runtime.NewResponseError(resp) + } + return client.listByDataBoxEdgeDeviceHandleResponse(resp) }, - } + }) } // listByDataBoxEdgeDeviceCreateRequest creates the ListByDataBoxEdgeDevice request. @@ -291,7 +300,7 @@ func (client *TriggersClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -302,7 +311,7 @@ func (client *TriggersClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.C // listByDataBoxEdgeDeviceHandleResponse handles the ListByDataBoxEdgeDevice response. func (client *TriggersClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Response) (TriggersClientListByDataBoxEdgeDeviceResponse, error) { - result := TriggersClientListByDataBoxEdgeDeviceResponse{RawResponse: resp} + result := TriggersClientListByDataBoxEdgeDeviceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.TriggerList); err != nil { return TriggersClientListByDataBoxEdgeDeviceResponse{}, err } diff --git a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_users_client.go b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_users_client.go index 1687223beb6d..9f6db9c0b2a6 100644 --- a/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_users_client.go +++ b/sdk/resourcemanager/databoxedge/armdataboxedge/zz_generated_users_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type UsersClient struct { // subscriptionID - The subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewUsersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *UsersClient { +func NewUsersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsersClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &UsersClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway @@ -58,22 +63,16 @@ func NewUsersClient(subscriptionID string, credential azcore.TokenCredential, op // userParam - The user details. // options - UsersClientBeginCreateOrUpdateOptions contains the optional parameters for the UsersClient.BeginCreateOrUpdate // method. -func (client *UsersClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, userParam User, options *UsersClientBeginCreateOrUpdateOptions) (UsersClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, userParam, options) - if err != nil { - return UsersClientCreateOrUpdatePollerResponse{}, err - } - result := UsersClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("UsersClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return UsersClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &UsersClientCreateOrUpdatePoller{ - pt: pt, +func (client *UsersClient) BeginCreateOrUpdate(ctx context.Context, deviceName string, name string, resourceGroupName string, userParam User, options *UsersClientBeginCreateOrUpdateOptions) (*armruntime.Poller[UsersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, deviceName, name, resourceGroupName, userParam, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[UsersClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[UsersClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // CreateOrUpdate - Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. @@ -117,7 +116,7 @@ func (client *UsersClient) createOrUpdateCreateRequest(ctx context.Context, devi return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, userParam) @@ -129,22 +128,16 @@ func (client *UsersClient) createOrUpdateCreateRequest(ctx context.Context, devi // name - The user name. // resourceGroupName - The resource group name. // options - UsersClientBeginDeleteOptions contains the optional parameters for the UsersClient.BeginDelete method. -func (client *UsersClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *UsersClientBeginDeleteOptions) (UsersClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) - if err != nil { - return UsersClientDeletePollerResponse{}, err - } - result := UsersClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("UsersClient.Delete", "", resp, client.pl) - if err != nil { - return UsersClientDeletePollerResponse{}, err - } - result.Poller = &UsersClientDeletePoller{ - pt: pt, +func (client *UsersClient) BeginDelete(ctx context.Context, deviceName string, name string, resourceGroupName string, options *UsersClientBeginDeleteOptions) (*armruntime.Poller[UsersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, deviceName, name, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[UsersClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[UsersClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - Deletes the user on a databox edge/gateway device. @@ -188,7 +181,7 @@ func (client *UsersClient) deleteCreateRequest(ctx context.Context, deviceName s return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -239,7 +232,7 @@ func (client *UsersClient) getCreateRequest(ctx context.Context, deviceName stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -247,7 +240,7 @@ func (client *UsersClient) getCreateRequest(ctx context.Context, deviceName stri // getHandleResponse handles the Get response. func (client *UsersClient) getHandleResponse(resp *http.Response) (UsersClientGetResponse, error) { - result := UsersClientGetResponse{RawResponse: resp} + result := UsersClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.User); err != nil { return UsersClientGetResponse{}, err } @@ -260,16 +253,32 @@ func (client *UsersClient) getHandleResponse(resp *http.Response) (UsersClientGe // resourceGroupName - The resource group name. // options - UsersClientListByDataBoxEdgeDeviceOptions contains the optional parameters for the UsersClient.ListByDataBoxEdgeDevice // method. -func (client *UsersClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *UsersClientListByDataBoxEdgeDeviceOptions) *UsersClientListByDataBoxEdgeDevicePager { - return &UsersClientListByDataBoxEdgeDevicePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) +func (client *UsersClient) ListByDataBoxEdgeDevice(deviceName string, resourceGroupName string, options *UsersClientListByDataBoxEdgeDeviceOptions) *runtime.Pager[UsersClientListByDataBoxEdgeDeviceResponse] { + return runtime.NewPager(runtime.PageProcessor[UsersClientListByDataBoxEdgeDeviceResponse]{ + More: func(page UsersClientListByDataBoxEdgeDeviceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp UsersClientListByDataBoxEdgeDeviceResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.UserList.NextLink) + Fetcher: func(ctx context.Context, page *UsersClientListByDataBoxEdgeDeviceResponse) (UsersClientListByDataBoxEdgeDeviceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDataBoxEdgeDeviceCreateRequest(ctx, deviceName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return UsersClientListByDataBoxEdgeDeviceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return UsersClientListByDataBoxEdgeDeviceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UsersClientListByDataBoxEdgeDeviceResponse{}, runtime.NewResponseError(resp) + } + return client.listByDataBoxEdgeDeviceHandleResponse(resp) }, - } + }) } // listByDataBoxEdgeDeviceCreateRequest creates the ListByDataBoxEdgeDevice request. @@ -292,7 +301,7 @@ func (client *UsersClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-03-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -303,7 +312,7 @@ func (client *UsersClient) listByDataBoxEdgeDeviceCreateRequest(ctx context.Cont // listByDataBoxEdgeDeviceHandleResponse handles the ListByDataBoxEdgeDevice response. func (client *UsersClient) listByDataBoxEdgeDeviceHandleResponse(resp *http.Response) (UsersClientListByDataBoxEdgeDeviceResponse, error) { - result := UsersClientListByDataBoxEdgeDeviceResponse{RawResponse: resp} + result := UsersClientListByDataBoxEdgeDeviceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.UserList); err != nil { return UsersClientListByDataBoxEdgeDeviceResponse{}, err }