From 78ead24985b0e7955db689a57d084b285faec727 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 12 Aug 2024 03:03:15 +0000 Subject: [PATCH] CodeGen from PR 29954 in Azure/azure-rest-api-specs Merge d34a3210297a6e5855f4fb855ed87afd43014095 into 3cef1bf0125458cc60dfb9e644e6bc28b787beab --- .../armhybridcompute/CHANGELOG.md | 141 ++ .../armhybridcompute/autorest.md | 7 +- .../armhybridcompute/client_factory.go | 22 +- .../armhybridcompute/constants.go | 89 +- .../extensionmetadata_client.go | 8 +- .../extensionmetadata_client_example_test.go | 90 -- .../armhybridcompute/fake/gateways_server.go | 340 ----- .../fake/licenseprofiles_server.go | 316 +++++ .../armhybridcompute/fake/licenses_server.go | 48 + .../fake/machineruncommands_server.go | 284 ---- .../armhybridcompute/fake/machines_server.go | 2 +- ...ksecurityperimeterconfigurations_server.go | 6 +- .../armhybridcompute/fake/server_factory.go | 24 +- .../armhybridcompute/fake/settings_server.go | 222 ---- .../armhybridcompute/gateways_client.go | 446 ------- .../gateways_client_example_test.go | 242 ---- .../hybridcompute/armhybridcompute/go.mod | 12 +- .../hybridcompute/armhybridcompute/go.sum | 17 - .../licenseprofiles_client.go | 413 ++++++ .../armhybridcompute/licenses_client.go | 100 +- .../licenses_client_example_test.go | 282 ---- .../machineextensions_client.go | 26 +- .../machineextensions_client_example_test.go | 295 ----- .../machineruncommands_client.go | 349 ----- .../machineruncommands_client_example_test.go | 262 ---- .../armhybridcompute/machines_client.go | 38 +- .../machines_client_example_test.go | 1122 ---------------- .../armhybridcompute/management_client.go | 6 +- .../management_client_example_test.go | 49 - .../hybridcompute/armhybridcompute/models.go | 402 ++---- .../armhybridcompute/models_serde.go | 1170 +++++++---------- .../armhybridcompute/networkprofile_client.go | 4 +- .../networkprofile_client_example_test.go | 61 - ...ksecurityperimeterconfigurations_client.go | 16 +- ...meterconfigurations_client_example_test.go | 198 --- .../armhybridcompute/operations_client.go | 4 +- .../operations_client_example_test.go | 68 - .../hybridcompute/armhybridcompute/options.go | 80 +- .../privateendpointconnections_client.go | 20 +- ...endpointconnections_client_example_test.go | 191 --- .../privatelinkresources_client.go | 8 +- ...rivatelinkresources_client_example_test.go | 98 -- .../privatelinkscopes_client.go | 34 +- .../privatelinkscopes_client_example_test.go | 478 ------- .../armhybridcompute/responses.go | 89 +- .../armhybridcompute/settings_client.go | 289 ---- .../settings_client_example_test.go | 124 -- 47 files changed, 1778 insertions(+), 6814 deletions(-) delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/fake/gateways_server.go create mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/fake/licenseprofiles_server.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/fake/machineruncommands_server.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/fake/settings_server.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/gateways_client.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/gateways_client_example_test.go create mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/licenseprofiles_client.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/licenses_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/machineruncommands_client.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/machineruncommands_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/management_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/networksecurityperimeterconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client_example_test.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/settings_client.go delete mode 100644 sdk/resourcemanager/hybridcompute/armhybridcompute/settings_client_example_test.go diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md b/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md index 488544213f6f..6e99d6557cf3 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/CHANGELOG.md @@ -1,5 +1,146 @@ # Release History +## 2.0.0 (2024-08-12) +### Breaking Changes + +- Type of `MachineExtensionProperties.ProtectedSettings` has been changed from `any` to `map[string]any` +- Type of `MachineExtensionProperties.Settings` has been changed from `any` to `map[string]any` +- Type of `MachineExtensionUpdateProperties.ProtectedSettings` has been changed from `any` to `map[string]any` +- Type of `MachineExtensionUpdateProperties.Settings` has been changed from `any` to `map[string]any` +- Struct `ErrorResponse` has been removed +- Struct `PrivateLinkScopesResource` has been removed +- Struct `ProxyResource` has been removed +- Struct `Resource` has been removed +- Struct `ResourceUpdate` has been removed +- Struct `TrackedResource` has been removed + +### Features Added + +- New value `PublicNetworkAccessTypeSecuredByPerimeter` added to enum type `PublicNetworkAccessType` +- New enum type `AccessMode` with values `AccessModeAudit`, `AccessModeEnforced`, `AccessModeLearning` +- New enum type `AccessRuleDirection` with values `AccessRuleDirectionInbound`, `AccessRuleDirectionOutbound` +- New enum type `AgentConfigurationMode` with values `AgentConfigurationModeFull`, `AgentConfigurationModeMonitor` +- New enum type `ArcKindEnum` with values `ArcKindEnumAVS`, `ArcKindEnumAWS`, `ArcKindEnumEPS`, `ArcKindEnumGCP`, `ArcKindEnumHCI`, `ArcKindEnumSCVMM`, `ArcKindEnumVMware` +- New enum type `EsuEligibility` with values `EsuEligibilityEligible`, `EsuEligibilityIneligible`, `EsuEligibilityUnknown` +- New enum type `EsuKeyState` with values `EsuKeyStateActive`, `EsuKeyStateInactive` +- New enum type `EsuServerType` with values `EsuServerTypeDatacenter`, `EsuServerTypeStandard` +- New enum type `HotpatchEnablementStatus` with values `HotpatchEnablementStatusActionRequired`, `HotpatchEnablementStatusDisabled`, `HotpatchEnablementStatusEnabled`, `HotpatchEnablementStatusPendingEvaluation`, `HotpatchEnablementStatusUnknown` +- New enum type `LastAttemptStatusEnum` with values `LastAttemptStatusEnumFailed`, `LastAttemptStatusEnumSuccess` +- New enum type `LicenseAssignmentState` with values `LicenseAssignmentStateAssigned`, `LicenseAssignmentStateNotAssigned` +- New enum type `LicenseCoreType` with values `LicenseCoreTypePCore`, `LicenseCoreTypeVCore` +- New enum type `LicenseEdition` with values `LicenseEditionDatacenter`, `LicenseEditionStandard` +- New enum type `LicenseProfileProductType` with values `LicenseProfileProductTypeWindowsIoTEnterprise`, `LicenseProfileProductTypeWindowsServer` +- New enum type `LicenseProfileSubscriptionStatus` with values `LicenseProfileSubscriptionStatusDisabled`, `LicenseProfileSubscriptionStatusDisabling`, `LicenseProfileSubscriptionStatusEnabled`, `LicenseProfileSubscriptionStatusEnabling`, `LicenseProfileSubscriptionStatusFailed`, `LicenseProfileSubscriptionStatusUnknown` +- New enum type `LicenseProfileSubscriptionStatusUpdate` with values `LicenseProfileSubscriptionStatusUpdateDisable`, `LicenseProfileSubscriptionStatusUpdateEnable` +- New enum type `LicenseState` with values `LicenseStateActivated`, `LicenseStateDeactivated` +- New enum type `LicenseStatus` with values `LicenseStatusExtendedGrace`, `LicenseStatusLicensed`, `LicenseStatusNonGenuineGrace`, `LicenseStatusNotification`, `LicenseStatusOOBGrace`, `LicenseStatusOOTGrace`, `LicenseStatusUnlicensed` +- New enum type `LicenseTarget` with values `LicenseTargetWindowsServer2012`, `LicenseTargetWindowsServer2012R2` +- New enum type `LicenseType` with values `LicenseTypeESU` +- New enum type `OsType` with values `OsTypeLinux`, `OsTypeWindows` +- New enum type `PatchOperationStartedBy` with values `PatchOperationStartedByPlatform`, `PatchOperationStartedByUser` +- New enum type `PatchOperationStatus` with values `PatchOperationStatusCompletedWithWarnings`, `PatchOperationStatusFailed`, `PatchOperationStatusInProgress`, `PatchOperationStatusSucceeded`, `PatchOperationStatusUnknown` +- New enum type `PatchServiceUsed` with values `PatchServiceUsedAPT`, `PatchServiceUsedUnknown`, `PatchServiceUsedWU`, `PatchServiceUsedWUWSUS`, `PatchServiceUsedYUM`, `PatchServiceUsedZypper` +- New enum type `ProgramYear` with values `ProgramYearYear1`, `ProgramYearYear2`, `ProgramYearYear3` +- New enum type `ProvisioningIssueSeverity` with values `ProvisioningIssueSeverityError`, `ProvisioningIssueSeverityWarning` +- New enum type `ProvisioningIssueType` with values `ProvisioningIssueTypeConfigurationPropagationFailure`, `ProvisioningIssueTypeMissingIdentityConfiguration`, `ProvisioningIssueTypeMissingPerimeterConfiguration`, `ProvisioningIssueTypeOther` +- New enum type `ProvisioningState` with values `ProvisioningStateAccepted`, `ProvisioningStateCanceled`, `ProvisioningStateCreating`, `ProvisioningStateDeleted`, `ProvisioningStateDeleting`, `ProvisioningStateFailed`, `ProvisioningStateSucceeded`, `ProvisioningStateUpdating` +- New enum type `VMGuestPatchClassificationLinux` with values `VMGuestPatchClassificationLinuxCritical`, `VMGuestPatchClassificationLinuxOther`, `VMGuestPatchClassificationLinuxSecurity` +- New enum type `VMGuestPatchClassificationWindows` with values `VMGuestPatchClassificationWindowsCritical`, `VMGuestPatchClassificationWindowsDefinition`, `VMGuestPatchClassificationWindowsFeaturePack`, `VMGuestPatchClassificationWindowsSecurity`, `VMGuestPatchClassificationWindowsServicePack`, `VMGuestPatchClassificationWindowsTools`, `VMGuestPatchClassificationWindowsUpdateRollUp`, `VMGuestPatchClassificationWindowsUpdates` +- New enum type `VMGuestPatchRebootSetting` with values `VMGuestPatchRebootSettingAlways`, `VMGuestPatchRebootSettingIfRequired`, `VMGuestPatchRebootSettingNever` +- New enum type `VMGuestPatchRebootStatus` with values `VMGuestPatchRebootStatusCompleted`, `VMGuestPatchRebootStatusFailed`, `VMGuestPatchRebootStatusNotNeeded`, `VMGuestPatchRebootStatusRequired`, `VMGuestPatchRebootStatusStarted`, `VMGuestPatchRebootStatusUnknown` +- New function `*ClientFactory.NewExtensionMetadataClient() *ExtensionMetadataClient` +- New function `*ClientFactory.NewLicenseProfilesClient() *LicenseProfilesClient` +- New function `*ClientFactory.NewLicensesClient() *LicensesClient` +- New function `*ClientFactory.NewNetworkProfileClient() *NetworkProfileClient` +- New function `*ClientFactory.NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient` +- New function `NewExtensionMetadataClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ExtensionMetadataClient, error)` +- New function `*ExtensionMetadataClient.Get(context.Context, string, string, string, string, *ExtensionMetadataClientGetOptions) (ExtensionMetadataClientGetResponse, error)` +- New function `*ExtensionMetadataClient.NewListPager(string, string, string, *ExtensionMetadataClientListOptions) *runtime.Pager[ExtensionMetadataClientListResponse]` +- New function `NewLicenseProfilesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LicenseProfilesClient, error)` +- New function `*LicenseProfilesClient.BeginCreateOrUpdate(context.Context, string, string, LicenseProfile, *LicenseProfilesClientBeginCreateOrUpdateOptions) (*runtime.Poller[LicenseProfilesClientCreateOrUpdateResponse], error)` +- New function `*LicenseProfilesClient.BeginDelete(context.Context, string, string, *LicenseProfilesClientBeginDeleteOptions) (*runtime.Poller[LicenseProfilesClientDeleteResponse], error)` +- New function `*LicenseProfilesClient.Get(context.Context, string, string, *LicenseProfilesClientGetOptions) (LicenseProfilesClientGetResponse, error)` +- New function `*LicenseProfilesClient.NewListPager(string, string, *LicenseProfilesClientListOptions) *runtime.Pager[LicenseProfilesClientListResponse]` +- New function `*LicenseProfilesClient.BeginUpdate(context.Context, string, string, LicenseProfileUpdate, *LicenseProfilesClientBeginUpdateOptions) (*runtime.Poller[LicenseProfilesClientUpdateResponse], error)` +- New function `NewLicensesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LicensesClient, error)` +- New function `*LicensesClient.BeginCreateOrUpdate(context.Context, string, string, License, *LicensesClientBeginCreateOrUpdateOptions) (*runtime.Poller[LicensesClientCreateOrUpdateResponse], error)` +- New function `*LicensesClient.BeginDelete(context.Context, string, string, *LicensesClientBeginDeleteOptions) (*runtime.Poller[LicensesClientDeleteResponse], error)` +- New function `*LicensesClient.Get(context.Context, string, string, *LicensesClientGetOptions) (LicensesClientGetResponse, error)` +- New function `*LicensesClient.NewListByResourceGroupPager(string, *LicensesClientListByResourceGroupOptions) *runtime.Pager[LicensesClientListByResourceGroupResponse]` +- New function `*LicensesClient.NewListBySubscriptionPager(*LicensesClientListBySubscriptionOptions) *runtime.Pager[LicensesClientListBySubscriptionResponse]` +- New function `*LicensesClient.BeginUpdate(context.Context, string, string, LicenseUpdate, *LicensesClientBeginUpdateOptions) (*runtime.Poller[LicensesClientUpdateResponse], error)` +- New function `*LicensesClient.BeginValidateLicense(context.Context, License, *LicensesClientBeginValidateLicenseOptions) (*runtime.Poller[LicensesClientValidateLicenseResponse], error)` +- New function `*MachinesClient.BeginAssessPatches(context.Context, string, string, *MachinesClientBeginAssessPatchesOptions) (*runtime.Poller[MachinesClientAssessPatchesResponse], error)` +- New function `*MachinesClient.BeginInstallPatches(context.Context, string, string, MachineInstallPatchesParameters, *MachinesClientBeginInstallPatchesOptions) (*runtime.Poller[MachinesClientInstallPatchesResponse], error)` +- New function `PossibleLicenseProfileSubscriptionStatusValues() []LicenseProfileSubscriptionStatus` +- New function `NewNetworkProfileClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkProfileClient, error)` +- New function `*NetworkProfileClient.Get(context.Context, string, string, *NetworkProfileClientGetOptions) (NetworkProfileClientGetResponse, error)` +- New function `NewNetworkSecurityPerimeterConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.GetByPrivateLinkScope(context.Context, string, string, string, *NetworkSecurityPerimeterConfigurationsClientGetByPrivateLinkScopeOptions) (NetworkSecurityPerimeterConfigurationsClientGetByPrivateLinkScopeResponse, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.NewListByPrivateLinkScopePager(string, string, *NetworkSecurityPerimeterConfigurationsClientListByPrivateLinkScopeOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListByPrivateLinkScopeResponse]` +- New function `*NetworkSecurityPerimeterConfigurationsClient.BeginReconcileForPrivateLinkScope(context.Context, string, string, string, *NetworkSecurityPerimeterConfigurationsClientBeginReconcileForPrivateLinkScopeOptions) (*runtime.Poller[NetworkSecurityPerimeterConfigurationsClientReconcileForPrivateLinkScopeResponse], error)` +- New struct `AccessRule` +- New struct `AccessRuleProperties` +- New struct `AgentUpgrade` +- New struct `AvailablePatchCountByClassification` +- New struct `EsuKey` +- New struct `EsuProfileUpdateProperties` +- New struct `ExtensionValue` +- New struct `ExtensionValueListResult` +- New struct `ExtensionValueProperties` +- New struct `IPAddress` +- New struct `License` +- New struct `LicenseDetails` +- New struct `LicenseProfile` +- New struct `LicenseProfileArmEsuProperties` +- New struct `LicenseProfileArmProductProfileProperties` +- New struct `LicenseProfileMachineInstanceView` +- New struct `LicenseProfileMachineInstanceViewEsuProperties` +- New struct `LicenseProfileMachineInstanceViewSoftwareAssurance` +- New struct `LicenseProfileProperties` +- New struct `LicenseProfilePropertiesSoftwareAssurance` +- New struct `LicenseProfileUpdate` +- New struct `LicenseProfileUpdateProperties` +- New struct `LicenseProfileUpdatePropertiesSoftwareAssurance` +- New struct `LicenseProfilesListResult` +- New struct `LicenseProperties` +- New struct `LicenseUpdate` +- New struct `LicenseUpdateProperties` +- New struct `LicenseUpdatePropertiesLicenseDetails` +- New struct `LicensesListResult` +- New struct `LinuxParameters` +- New struct `MachineAssessPatchesResult` +- New struct `MachineInstallPatchesParameters` +- New struct `MachineInstallPatchesResult` +- New struct `NetworkInterface` +- New struct `NetworkProfile` +- New struct `NetworkSecurityPerimeter` +- New struct `NetworkSecurityPerimeterConfiguration` +- New struct `NetworkSecurityPerimeterConfigurationListResult` +- New struct `NetworkSecurityPerimeterConfigurationProperties` +- New struct `NetworkSecurityPerimeterConfigurationReconcileResult` +- New struct `NetworkSecurityPerimeterProfile` +- New struct `PatchSettingsStatus` +- New struct `ProductFeature` +- New struct `ProductFeatureUpdate` +- New struct `ProductProfileUpdateProperties` +- New struct `ProvisioningIssue` +- New struct `ProvisioningIssueProperties` +- New struct `ResourceAssociation` +- New struct `Subnet` +- New struct `VolumeLicenseDetails` +- New struct `WindowsParameters` +- New field `ConfigMode` in struct `AgentConfiguration` +- New field `Kind`, `Resources` in struct `Machine` +- New field `EnableAutomaticUpgrade` in struct `MachineExtensionUpdateProperties` +- New field `AgentUpgrade`, `LicenseProfile`, `NetworkProfile`, `OSEdition` in struct `MachineProperties` +- New field `Kind` in struct `MachineUpdate` +- New field `AgentUpgrade` in struct `MachineUpdateProperties` +- New field `Expand` in struct `MachinesClientCreateOrUpdateOptions` +- New field `Expand` in struct `MachinesClientListByResourceGroupOptions` +- New field `EnableHotpatching`, `Status` in struct `PatchSettings` + + ## 2.0.0-beta.4 (2024-07-23) ### Breaking Changes diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/autorest.md b/sdk/resourcemanager/hybridcompute/armhybridcompute/autorest.md index 79c768fc4964..7e8007f85d7f 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/autorest.md +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybridcompute/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybridcompute/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0-beta.4 -tag: package-preview-2024-05 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/client_factory.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/client_factory.go index 36ecd4e9720d..8794103489dc 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/client_factory.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/client_factory.go @@ -44,9 +44,9 @@ func (c *ClientFactory) NewExtensionMetadataClient() *ExtensionMetadataClient { } } -// NewGatewaysClient creates a new instance of GatewaysClient. -func (c *ClientFactory) NewGatewaysClient() *GatewaysClient { - return &GatewaysClient{ +// NewLicenseProfilesClient creates a new instance of LicenseProfilesClient. +func (c *ClientFactory) NewLicenseProfilesClient() *LicenseProfilesClient { + return &LicenseProfilesClient{ subscriptionID: c.subscriptionID, internal: c.internal, } @@ -68,14 +68,6 @@ func (c *ClientFactory) NewMachineExtensionsClient() *MachineExtensionsClient { } } -// NewMachineRunCommandsClient creates a new instance of MachineRunCommandsClient. -func (c *ClientFactory) NewMachineRunCommandsClient() *MachineRunCommandsClient { - return &MachineRunCommandsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewMachinesClient creates a new instance of MachinesClient. func (c *ClientFactory) NewMachinesClient() *MachinesClient { return &MachinesClient{ @@ -138,11 +130,3 @@ func (c *ClientFactory) NewPrivateLinkScopesClient() *PrivateLinkScopesClient { internal: c.internal, } } - -// NewSettingsClient creates a new instance of SettingsClient. -func (c *ClientFactory) NewSettingsClient() *SettingsClient { - return &SettingsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/constants.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/constants.go index 08a224f36b6a..afd5f90578f2 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/constants.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/constants.go @@ -10,7 +10,7 @@ package armhybridcompute const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute" - moduleVersion = "v2.0.0-beta.4" + moduleVersion = "v2.0.0" ) // AccessMode - Property that impacts a resource's logging behavior and its connectivity with other resources and public networks. @@ -181,64 +181,6 @@ func PossibleEsuServerTypeValues() []EsuServerType { } } -// ExecutionState - Script execution status. -type ExecutionState string - -const ( - ExecutionStateCanceled ExecutionState = "Canceled" - ExecutionStateFailed ExecutionState = "Failed" - ExecutionStatePending ExecutionState = "Pending" - ExecutionStateRunning ExecutionState = "Running" - ExecutionStateSucceeded ExecutionState = "Succeeded" - ExecutionStateTimedOut ExecutionState = "TimedOut" - ExecutionStateUnknown ExecutionState = "Unknown" -) - -// PossibleExecutionStateValues returns the possible values for the ExecutionState const type. -func PossibleExecutionStateValues() []ExecutionState { - return []ExecutionState{ - ExecutionStateCanceled, - ExecutionStateFailed, - ExecutionStatePending, - ExecutionStateRunning, - ExecutionStateSucceeded, - ExecutionStateTimedOut, - ExecutionStateUnknown, - } -} - -// ExtensionsStatusLevelTypes - The level code. -type ExtensionsStatusLevelTypes string - -const ( - ExtensionsStatusLevelTypesError ExtensionsStatusLevelTypes = "Error" - ExtensionsStatusLevelTypesInfo ExtensionsStatusLevelTypes = "Info" - ExtensionsStatusLevelTypesWarning ExtensionsStatusLevelTypes = "Warning" -) - -// PossibleExtensionsStatusLevelTypesValues returns the possible values for the ExtensionsStatusLevelTypes const type. -func PossibleExtensionsStatusLevelTypesValues() []ExtensionsStatusLevelTypes { - return []ExtensionsStatusLevelTypes{ - ExtensionsStatusLevelTypesError, - ExtensionsStatusLevelTypesInfo, - ExtensionsStatusLevelTypesWarning, - } -} - -// GatewayType - The type of the Gateway resource. -type GatewayType string - -const ( - GatewayTypePublic GatewayType = "Public" -) - -// PossibleGatewayTypeValues returns the possible values for the GatewayType const type. -func PossibleGatewayTypeValues() []GatewayType { - return []GatewayType{ - GatewayTypePublic, - } -} - // HotpatchEnablementStatus - Status of hotpatch enablement or disablement. type HotpatchEnablementStatus string @@ -261,6 +203,19 @@ func PossibleHotpatchEnablementStatusValues() []HotpatchEnablementStatus { } } +type InstanceViewTypes string + +const ( + InstanceViewTypesInstanceView InstanceViewTypes = "instanceView" +) + +// PossibleInstanceViewTypesValues returns the possible values for the InstanceViewTypes const type. +func PossibleInstanceViewTypesValues() []InstanceViewTypes { + return []InstanceViewTypes{ + InstanceViewTypesInstanceView, + } +} + // LastAttemptStatusEnum - Specifies the status of Agent Upgrade. type LastAttemptStatusEnum string @@ -365,6 +320,22 @@ func PossibleLicenseProfileSubscriptionStatusValues() []LicenseProfileSubscripti } } +// LicenseProfileSubscriptionStatusUpdate - Indicates the new subscription status of the OS or Product Features. +type LicenseProfileSubscriptionStatusUpdate string + +const ( + LicenseProfileSubscriptionStatusUpdateDisable LicenseProfileSubscriptionStatusUpdate = "Disable" + LicenseProfileSubscriptionStatusUpdateEnable LicenseProfileSubscriptionStatusUpdate = "Enable" +) + +// PossibleLicenseProfileSubscriptionStatusUpdateValues returns the possible values for the LicenseProfileSubscriptionStatusUpdate const type. +func PossibleLicenseProfileSubscriptionStatusUpdateValues() []LicenseProfileSubscriptionStatusUpdate { + return []LicenseProfileSubscriptionStatusUpdate{ + LicenseProfileSubscriptionStatusUpdateDisable, + LicenseProfileSubscriptionStatusUpdateEnable, + } +} + // LicenseState - Describes the state of the license. type LicenseState string diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client.go index 9a00492be47f..33a87a26e063 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client.go @@ -46,7 +46,7 @@ func NewExtensionMetadataClient(subscriptionID string, credential azcore.TokenCr // Get - Gets an Extension Metadata based on location, publisher, extensionType and version // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - location - The location of the Extension being received. // - publisher - The publisher of the Extension being received. // - extensionType - The extensionType of the Extension being received. @@ -102,7 +102,7 @@ func (client *ExtensionMetadataClient) getCreateRequest(ctx context.Context, loc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +119,7 @@ func (client *ExtensionMetadataClient) getHandleResponse(resp *http.Response) (E // NewListPager - Gets all Extension versions based on location, publisher, extensionType // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - location - The location of the Extension being received. // - publisher - The publisher of the Extension being received. // - extensionType - The extensionType of the Extension being received. @@ -173,7 +173,7 @@ func (client *ExtensionMetadataClient) listCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client_example_test.go deleted file mode 100644 index 94456c382bae..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/extensionmetadata_client_example_test.go +++ /dev/null @@ -1,90 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/ExtensionMetadata_Get.json -func ExampleExtensionMetadataClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtensionMetadataClient().Get(ctx, "EastUS", "microsoft.azure.monitor", "azuremonitorlinuxagent", "1.9.1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExtensionValue = armhybridcompute.ExtensionValue{ - // ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Providers/Microsoft.HybridCompute/locations/eastus/publishers/microsoft.azure.monitor/extensionTypes/azuremonitorlinuxagent/versions/1.9.1"), - // Properties: &armhybridcompute.ExtensionValueProperties{ - // ExtensionType: to.Ptr("azuremonitorlinuxagent"), - // Publisher: to.Ptr("microsoft.azure.monitor"), - // Version: to.Ptr("1.9.1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/ExtensionMetadata_List.json -func ExampleExtensionMetadataClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExtensionMetadataClient().NewListPager("EastUS", "microsoft.azure.monitor", "azuremonitorlinuxagent", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExtensionValueListResult = armhybridcompute.ExtensionValueListResult{ - // Value: []*armhybridcompute.ExtensionValue{ - // { - // ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Providers/Microsoft.HybridCompute/locations/eastus/publishers/microsoft.azure.monitor/extensionTypes/azuremonitorlinuxagent/versions/1.9.1"), - // Properties: &armhybridcompute.ExtensionValueProperties{ - // ExtensionType: to.Ptr("azuremonitorlinuxagent"), - // Publisher: to.Ptr("microsoft.azure.monitor"), - // Version: to.Ptr("1.9.1"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Providers/Microsoft.HybridCompute/locations/eastus/publishers/microsoft.azure.monitor/extensionTypes/azuremonitorlinuxagent/versions/1.9.2"), - // Properties: &armhybridcompute.ExtensionValueProperties{ - // ExtensionType: to.Ptr("azuremonitorlinuxagent"), - // Publisher: to.Ptr("microsoft.azure.monitor"), - // Version: to.Ptr("1.9.2"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/gateways_server.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/gateways_server.go deleted file mode 100644 index 423c819d8753..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/gateways_server.go +++ /dev/null @@ -1,340 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute/v2" - "net/http" - "net/url" - "regexp" -) - -// GatewaysServer is a fake server for instances of the armhybridcompute.GatewaysClient type. -type GatewaysServer struct { - // BeginCreateOrUpdate is the fake for method GatewaysClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, gatewayName string, parameters armhybridcompute.Gateway, options *armhybridcompute.GatewaysClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armhybridcompute.GatewaysClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method GatewaysClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, gatewayName string, options *armhybridcompute.GatewaysClientBeginDeleteOptions) (resp azfake.PollerResponder[armhybridcompute.GatewaysClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method GatewaysClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, gatewayName string, options *armhybridcompute.GatewaysClientGetOptions) (resp azfake.Responder[armhybridcompute.GatewaysClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByResourceGroupPager is the fake for method GatewaysClient.NewListByResourceGroupPager - // HTTP status codes to indicate success: http.StatusOK - NewListByResourceGroupPager func(resourceGroupName string, options *armhybridcompute.GatewaysClientListByResourceGroupOptions) (resp azfake.PagerResponder[armhybridcompute.GatewaysClientListByResourceGroupResponse]) - - // NewListBySubscriptionPager is the fake for method GatewaysClient.NewListBySubscriptionPager - // HTTP status codes to indicate success: http.StatusOK - NewListBySubscriptionPager func(options *armhybridcompute.GatewaysClientListBySubscriptionOptions) (resp azfake.PagerResponder[armhybridcompute.GatewaysClientListBySubscriptionResponse]) - - // Update is the fake for method GatewaysClient.Update - // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, resourceGroupName string, gatewayName string, parameters armhybridcompute.GatewayUpdate, options *armhybridcompute.GatewaysClientUpdateOptions) (resp azfake.Responder[armhybridcompute.GatewaysClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewGatewaysServerTransport creates a new instance of GatewaysServerTransport with the provided implementation. -// The returned GatewaysServerTransport instance is connected to an instance of armhybridcompute.GatewaysClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewGatewaysServerTransport(srv *GatewaysServer) *GatewaysServerTransport { - return &GatewaysServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armhybridcompute.GatewaysClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armhybridcompute.GatewaysClientDeleteResponse]](), - newListByResourceGroupPager: newTracker[azfake.PagerResponder[armhybridcompute.GatewaysClientListByResourceGroupResponse]](), - newListBySubscriptionPager: newTracker[azfake.PagerResponder[armhybridcompute.GatewaysClientListBySubscriptionResponse]](), - } -} - -// GatewaysServerTransport connects instances of armhybridcompute.GatewaysClient to instances of GatewaysServer. -// Don't use this type directly, use NewGatewaysServerTransport instead. -type GatewaysServerTransport struct { - srv *GatewaysServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armhybridcompute.GatewaysClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armhybridcompute.GatewaysClientDeleteResponse]] - newListByResourceGroupPager *tracker[azfake.PagerResponder[armhybridcompute.GatewaysClientListByResourceGroupResponse]] - newListBySubscriptionPager *tracker[azfake.PagerResponder[armhybridcompute.GatewaysClientListBySubscriptionResponse]] -} - -// Do implements the policy.Transporter interface for GatewaysServerTransport. -func (g *GatewaysServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "GatewaysClient.BeginCreateOrUpdate": - resp, err = g.dispatchBeginCreateOrUpdate(req) - case "GatewaysClient.BeginDelete": - resp, err = g.dispatchBeginDelete(req) - case "GatewaysClient.Get": - resp, err = g.dispatchGet(req) - case "GatewaysClient.NewListByResourceGroupPager": - resp, err = g.dispatchNewListByResourceGroupPager(req) - case "GatewaysClient.NewListBySubscriptionPager": - resp, err = g.dispatchNewListBySubscriptionPager(req) - case "GatewaysClient.Update": - resp, err = g.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (g *GatewaysServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if g.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := g.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/gateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhybridcompute.Gateway](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - gatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("gatewayName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, gatewayNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - g.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - g.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - g.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (g *GatewaysServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if g.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := g.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/gateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - gatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("gatewayName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.BeginDelete(req.Context(), resourceGroupNameParam, gatewayNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - g.beginDelete.add(req, beginDelete) - } - - resp, err := server.PollerResponderNext(beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - g.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDelete) { - g.beginDelete.remove(req) - } - - return resp, nil -} - -func (g *GatewaysServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if g.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/gateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - gatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("gatewayName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.Get(req.Context(), resourceGroupNameParam, gatewayNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Gateway, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (g *GatewaysServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { - if g.srv.NewListByResourceGroupPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} - } - newListByResourceGroupPager := g.newListByResourceGroupPager.get(req) - if newListByResourceGroupPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/gateways` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resp := g.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) - newListByResourceGroupPager = &resp - g.newListByResourceGroupPager.add(req, newListByResourceGroupPager) - server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armhybridcompute.GatewaysClientListByResourceGroupResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - g.newListByResourceGroupPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByResourceGroupPager) { - g.newListByResourceGroupPager.remove(req) - } - return resp, nil -} - -func (g *GatewaysServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { - if g.srv.NewListBySubscriptionPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} - } - newListBySubscriptionPager := g.newListBySubscriptionPager.get(req) - if newListBySubscriptionPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/gateways` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resp := g.srv.NewListBySubscriptionPager(nil) - newListBySubscriptionPager = &resp - g.newListBySubscriptionPager.add(req, newListBySubscriptionPager) - server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armhybridcompute.GatewaysClientListBySubscriptionResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - g.newListBySubscriptionPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListBySubscriptionPager) { - g.newListBySubscriptionPager.remove(req) - } - return resp, nil -} - -func (g *GatewaysServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { - if g.srv.Update == nil { - return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/gateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhybridcompute.GatewayUpdate](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - gatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("gatewayName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.Update(req.Context(), resourceGroupNameParam, gatewayNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Gateway, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/licenseprofiles_server.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/licenseprofiles_server.go new file mode 100644 index 000000000000..c59f75105d5b --- /dev/null +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/licenseprofiles_server.go @@ -0,0 +1,316 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute/v2" + "net/http" + "net/url" + "regexp" +) + +// LicenseProfilesServer is a fake server for instances of the armhybridcompute.LicenseProfilesClient type. +type LicenseProfilesServer struct { + // BeginCreateOrUpdate is the fake for method LicenseProfilesClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, machineName string, parameters armhybridcompute.LicenseProfile, options *armhybridcompute.LicenseProfilesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armhybridcompute.LicenseProfilesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method LicenseProfilesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, machineName string, options *armhybridcompute.LicenseProfilesClientBeginDeleteOptions) (resp azfake.PollerResponder[armhybridcompute.LicenseProfilesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method LicenseProfilesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, machineName string, options *armhybridcompute.LicenseProfilesClientGetOptions) (resp azfake.Responder[armhybridcompute.LicenseProfilesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method LicenseProfilesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, machineName string, options *armhybridcompute.LicenseProfilesClientListOptions) (resp azfake.PagerResponder[armhybridcompute.LicenseProfilesClientListResponse]) + + // BeginUpdate is the fake for method LicenseProfilesClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, machineName string, parameters armhybridcompute.LicenseProfileUpdate, options *armhybridcompute.LicenseProfilesClientBeginUpdateOptions) (resp azfake.PollerResponder[armhybridcompute.LicenseProfilesClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewLicenseProfilesServerTransport creates a new instance of LicenseProfilesServerTransport with the provided implementation. +// The returned LicenseProfilesServerTransport instance is connected to an instance of armhybridcompute.LicenseProfilesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewLicenseProfilesServerTransport(srv *LicenseProfilesServer) *LicenseProfilesServerTransport { + return &LicenseProfilesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armhybridcompute.LicenseProfilesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armhybridcompute.LicenseProfilesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armhybridcompute.LicenseProfilesClientListResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armhybridcompute.LicenseProfilesClientUpdateResponse]](), + } +} + +// LicenseProfilesServerTransport connects instances of armhybridcompute.LicenseProfilesClient to instances of LicenseProfilesServer. +// Don't use this type directly, use NewLicenseProfilesServerTransport instead. +type LicenseProfilesServerTransport struct { + srv *LicenseProfilesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armhybridcompute.LicenseProfilesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armhybridcompute.LicenseProfilesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armhybridcompute.LicenseProfilesClientListResponse]] + beginUpdate *tracker[azfake.PollerResponder[armhybridcompute.LicenseProfilesClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for LicenseProfilesServerTransport. +func (l *LicenseProfilesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "LicenseProfilesClient.BeginCreateOrUpdate": + resp, err = l.dispatchBeginCreateOrUpdate(req) + case "LicenseProfilesClient.BeginDelete": + resp, err = l.dispatchBeginDelete(req) + case "LicenseProfilesClient.Get": + resp, err = l.dispatchGet(req) + case "LicenseProfilesClient.NewListPager": + resp, err = l.dispatchNewListPager(req) + case "LicenseProfilesClient.BeginUpdate": + resp, err = l.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (l *LicenseProfilesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if l.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := l.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/machines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/licenseProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armhybridcompute.LicenseProfile](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + machineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("machineName")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, machineNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + l.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + l.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + l.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (l *LicenseProfilesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if l.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := l.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/machines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/licenseProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + machineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("machineName")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.BeginDelete(req.Context(), resourceGroupNameParam, machineNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + l.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + l.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + l.beginDelete.remove(req) + } + + return resp, nil +} + +func (l *LicenseProfilesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if l.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/machines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/licenseProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + machineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("machineName")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.Get(req.Context(), resourceGroupNameParam, machineNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LicenseProfile, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (l *LicenseProfilesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if l.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := l.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/machines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/licenseProfiles` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + machineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("machineName")]) + if err != nil { + return nil, err + } + resp := l.srv.NewListPager(resourceGroupNameParam, machineNameParam, nil) + newListPager = &resp + l.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armhybridcompute.LicenseProfilesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + l.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + l.newListPager.remove(req) + } + return resp, nil +} + +func (l *LicenseProfilesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if l.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := l.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/machines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/licenseProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armhybridcompute.LicenseProfileUpdate](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + machineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("machineName")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.BeginUpdate(req.Context(), resourceGroupNameParam, machineNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + l.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + l.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + l.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/licenses_server.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/licenses_server.go index 06b7adb65f1c..6a3b005657eb 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/licenses_server.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/licenses_server.go @@ -47,6 +47,10 @@ type LicensesServer struct { // BeginUpdate is the fake for method LicensesClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK BeginUpdate func(ctx context.Context, resourceGroupName string, licenseName string, parameters armhybridcompute.LicenseUpdate, options *armhybridcompute.LicensesClientBeginUpdateOptions) (resp azfake.PollerResponder[armhybridcompute.LicensesClientUpdateResponse], errResp azfake.ErrorResponder) + + // BeginValidateLicense is the fake for method LicensesClient.BeginValidateLicense + // HTTP status codes to indicate success: http.StatusOK + BeginValidateLicense func(ctx context.Context, parameters armhybridcompute.License, options *armhybridcompute.LicensesClientBeginValidateLicenseOptions) (resp azfake.PollerResponder[armhybridcompute.LicensesClientValidateLicenseResponse], errResp azfake.ErrorResponder) } // NewLicensesServerTransport creates a new instance of LicensesServerTransport with the provided implementation. @@ -60,6 +64,7 @@ func NewLicensesServerTransport(srv *LicensesServer) *LicensesServerTransport { newListByResourceGroupPager: newTracker[azfake.PagerResponder[armhybridcompute.LicensesClientListByResourceGroupResponse]](), newListBySubscriptionPager: newTracker[azfake.PagerResponder[armhybridcompute.LicensesClientListBySubscriptionResponse]](), beginUpdate: newTracker[azfake.PollerResponder[armhybridcompute.LicensesClientUpdateResponse]](), + beginValidateLicense: newTracker[azfake.PollerResponder[armhybridcompute.LicensesClientValidateLicenseResponse]](), } } @@ -72,6 +77,7 @@ type LicensesServerTransport struct { newListByResourceGroupPager *tracker[azfake.PagerResponder[armhybridcompute.LicensesClientListByResourceGroupResponse]] newListBySubscriptionPager *tracker[azfake.PagerResponder[armhybridcompute.LicensesClientListBySubscriptionResponse]] beginUpdate *tracker[azfake.PollerResponder[armhybridcompute.LicensesClientUpdateResponse]] + beginValidateLicense *tracker[azfake.PollerResponder[armhybridcompute.LicensesClientValidateLicenseResponse]] } // Do implements the policy.Transporter interface for LicensesServerTransport. @@ -98,6 +104,8 @@ func (l *LicensesServerTransport) Do(req *http.Request) (*http.Response, error) resp, err = l.dispatchNewListBySubscriptionPager(req) case "LicensesClient.BeginUpdate": resp, err = l.dispatchBeginUpdate(req) + case "LicensesClient.BeginValidateLicense": + resp, err = l.dispatchBeginValidateLicense(req) default: err = fmt.Errorf("unhandled API %s", method) } @@ -351,3 +359,43 @@ func (l *LicensesServerTransport) dispatchBeginUpdate(req *http.Request) (*http. return resp, nil } + +func (l *LicensesServerTransport) dispatchBeginValidateLicense(req *http.Request) (*http.Response, error) { + if l.srv.BeginValidateLicense == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginValidateLicense not implemented")} + } + beginValidateLicense := l.beginValidateLicense.get(req) + if beginValidateLicense == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/validateLicense` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armhybridcompute.License](req) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.BeginValidateLicense(req.Context(), body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginValidateLicense = &respr + l.beginValidateLicense.add(req, beginValidateLicense) + } + + resp, err := server.PollerResponderNext(beginValidateLicense, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK}, resp.StatusCode) { + l.beginValidateLicense.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PollerResponderMore(beginValidateLicense) { + l.beginValidateLicense.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/machineruncommands_server.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/machineruncommands_server.go deleted file mode 100644 index 6e21885d345b..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/machineruncommands_server.go +++ /dev/null @@ -1,284 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute/v2" - "net/http" - "net/url" - "regexp" -) - -// MachineRunCommandsServer is a fake server for instances of the armhybridcompute.MachineRunCommandsClient type. -type MachineRunCommandsServer struct { - // BeginCreateOrUpdate is the fake for method MachineRunCommandsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, machineName string, runCommandName string, runCommandProperties armhybridcompute.MachineRunCommand, options *armhybridcompute.MachineRunCommandsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armhybridcompute.MachineRunCommandsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method MachineRunCommandsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, machineName string, runCommandName string, options *armhybridcompute.MachineRunCommandsClientBeginDeleteOptions) (resp azfake.PollerResponder[armhybridcompute.MachineRunCommandsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method MachineRunCommandsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, machineName string, runCommandName string, options *armhybridcompute.MachineRunCommandsClientGetOptions) (resp azfake.Responder[armhybridcompute.MachineRunCommandsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method MachineRunCommandsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, machineName string, options *armhybridcompute.MachineRunCommandsClientListOptions) (resp azfake.PagerResponder[armhybridcompute.MachineRunCommandsClientListResponse]) -} - -// NewMachineRunCommandsServerTransport creates a new instance of MachineRunCommandsServerTransport with the provided implementation. -// The returned MachineRunCommandsServerTransport instance is connected to an instance of armhybridcompute.MachineRunCommandsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewMachineRunCommandsServerTransport(srv *MachineRunCommandsServer) *MachineRunCommandsServerTransport { - return &MachineRunCommandsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armhybridcompute.MachineRunCommandsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armhybridcompute.MachineRunCommandsClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armhybridcompute.MachineRunCommandsClientListResponse]](), - } -} - -// MachineRunCommandsServerTransport connects instances of armhybridcompute.MachineRunCommandsClient to instances of MachineRunCommandsServer. -// Don't use this type directly, use NewMachineRunCommandsServerTransport instead. -type MachineRunCommandsServerTransport struct { - srv *MachineRunCommandsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armhybridcompute.MachineRunCommandsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armhybridcompute.MachineRunCommandsClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armhybridcompute.MachineRunCommandsClientListResponse]] -} - -// Do implements the policy.Transporter interface for MachineRunCommandsServerTransport. -func (m *MachineRunCommandsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "MachineRunCommandsClient.BeginCreateOrUpdate": - resp, err = m.dispatchBeginCreateOrUpdate(req) - case "MachineRunCommandsClient.BeginDelete": - resp, err = m.dispatchBeginDelete(req) - case "MachineRunCommandsClient.Get": - resp, err = m.dispatchGet(req) - case "MachineRunCommandsClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (m *MachineRunCommandsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if m.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := m.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/machines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhybridcompute.MachineRunCommand](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - machineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("machineName")]) - if err != nil { - return nil, err - } - runCommandNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("runCommandName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, machineNameParam, runCommandNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - m.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - m.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - m.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (m *MachineRunCommandsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if m.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := m.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/machines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - machineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("machineName")]) - if err != nil { - return nil, err - } - runCommandNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("runCommandName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginDelete(req.Context(), resourceGroupNameParam, machineNameParam, runCommandNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - m.beginDelete.add(req, beginDelete) - } - - resp, err := server.PollerResponderNext(beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - m.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDelete) { - m.beginDelete.remove(req) - } - - return resp, nil -} - -func (m *MachineRunCommandsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if m.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/machines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - machineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("machineName")]) - if err != nil { - return nil, err - } - runCommandNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("runCommandName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameParam, machineNameParam, runCommandNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MachineRunCommand, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *MachineRunCommandsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if m.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := m.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/machines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - machineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("machineName")]) - if err != nil { - return nil, err - } - expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) - if err != nil { - return nil, err - } - expandParam := getOptional(expandUnescaped) - var options *armhybridcompute.MachineRunCommandsClientListOptions - if expandParam != nil { - options = &armhybridcompute.MachineRunCommandsClientListOptions{ - Expand: expandParam, - } - } - resp := m.srv.NewListPager(resourceGroupNameParam, machineNameParam, options) - newListPager = &resp - m.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armhybridcompute.MachineRunCommandsClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - m.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - m.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/machines_server.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/machines_server.go index 75de0d2804e0..9aefa6aa2689 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/machines_server.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/machines_server.go @@ -268,7 +268,7 @@ func (m *MachinesServerTransport) dispatchGet(req *http.Request) (*http.Response if err != nil { return nil, err } - expandParam := getOptional(expandUnescaped) + expandParam := getOptional(armhybridcompute.InstanceViewTypes(expandUnescaped)) var options *armhybridcompute.MachinesClientGetOptions if expandParam != nil { options = &armhybridcompute.MachinesClientGetOptions{ diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/networksecurityperimeterconfigurations_server.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/networksecurityperimeterconfigurations_server.go index a676c4d48161..9b8ea279bea2 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/networksecurityperimeterconfigurations_server.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/networksecurityperimeterconfigurations_server.go @@ -33,7 +33,7 @@ type NetworkSecurityPerimeterConfigurationsServer struct { NewListByPrivateLinkScopePager func(resourceGroupName string, scopeName string, options *armhybridcompute.NetworkSecurityPerimeterConfigurationsClientListByPrivateLinkScopeOptions) (resp azfake.PagerResponder[armhybridcompute.NetworkSecurityPerimeterConfigurationsClientListByPrivateLinkScopeResponse]) // BeginReconcileForPrivateLinkScope is the fake for method NetworkSecurityPerimeterConfigurationsClient.BeginReconcileForPrivateLinkScope - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginReconcileForPrivateLinkScope func(ctx context.Context, resourceGroupName string, scopeName string, perimeterName string, options *armhybridcompute.NetworkSecurityPerimeterConfigurationsClientBeginReconcileForPrivateLinkScopeOptions) (resp azfake.PollerResponder[armhybridcompute.NetworkSecurityPerimeterConfigurationsClientReconcileForPrivateLinkScopeResponse], errResp azfake.ErrorResponder) } @@ -200,9 +200,9 @@ func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchBeginRec return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { n.beginReconcileForPrivateLinkScope.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginReconcileForPrivateLinkScope) { n.beginReconcileForPrivateLinkScope.remove(req) diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/server_factory.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/server_factory.go index 49ade5ff43dc..4ca7e5635599 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/server_factory.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/server_factory.go @@ -20,10 +20,9 @@ import ( // ServerFactory is a fake server for instances of the armhybridcompute.ClientFactory type. type ServerFactory struct { ExtensionMetadataServer ExtensionMetadataServer - GatewaysServer GatewaysServer + LicenseProfilesServer LicenseProfilesServer LicensesServer LicensesServer MachineExtensionsServer MachineExtensionsServer - MachineRunCommandsServer MachineRunCommandsServer MachinesServer MachinesServer ManagementServer ManagementServer NetworkProfileServer NetworkProfileServer @@ -32,7 +31,6 @@ type ServerFactory struct { PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer PrivateLinkResourcesServer PrivateLinkResourcesServer PrivateLinkScopesServer PrivateLinkScopesServer - SettingsServer SettingsServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -50,10 +48,9 @@ type ServerFactoryTransport struct { srv *ServerFactory trMu sync.Mutex trExtensionMetadataServer *ExtensionMetadataServerTransport - trGatewaysServer *GatewaysServerTransport + trLicenseProfilesServer *LicenseProfilesServerTransport trLicensesServer *LicensesServerTransport trMachineExtensionsServer *MachineExtensionsServerTransport - trMachineRunCommandsServer *MachineRunCommandsServerTransport trMachinesServer *MachinesServerTransport trManagementServer *ManagementServerTransport trNetworkProfileServer *NetworkProfileServerTransport @@ -62,7 +59,6 @@ type ServerFactoryTransport struct { trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport trPrivateLinkScopesServer *PrivateLinkScopesServerTransport - trSettingsServer *SettingsServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -83,9 +79,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewExtensionMetadataServerTransport(&s.srv.ExtensionMetadataServer) }) resp, err = s.trExtensionMetadataServer.Do(req) - case "GatewaysClient": - initServer(s, &s.trGatewaysServer, func() *GatewaysServerTransport { return NewGatewaysServerTransport(&s.srv.GatewaysServer) }) - resp, err = s.trGatewaysServer.Do(req) + case "LicenseProfilesClient": + initServer(s, &s.trLicenseProfilesServer, func() *LicenseProfilesServerTransport { + return NewLicenseProfilesServerTransport(&s.srv.LicenseProfilesServer) + }) + resp, err = s.trLicenseProfilesServer.Do(req) case "LicensesClient": initServer(s, &s.trLicensesServer, func() *LicensesServerTransport { return NewLicensesServerTransport(&s.srv.LicensesServer) }) resp, err = s.trLicensesServer.Do(req) @@ -94,11 +92,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewMachineExtensionsServerTransport(&s.srv.MachineExtensionsServer) }) resp, err = s.trMachineExtensionsServer.Do(req) - case "MachineRunCommandsClient": - initServer(s, &s.trMachineRunCommandsServer, func() *MachineRunCommandsServerTransport { - return NewMachineRunCommandsServerTransport(&s.srv.MachineRunCommandsServer) - }) - resp, err = s.trMachineRunCommandsServer.Do(req) case "MachinesClient": initServer(s, &s.trMachinesServer, func() *MachinesServerTransport { return NewMachinesServerTransport(&s.srv.MachinesServer) }) resp, err = s.trMachinesServer.Do(req) @@ -133,9 +126,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewPrivateLinkScopesServerTransport(&s.srv.PrivateLinkScopesServer) }) resp, err = s.trPrivateLinkScopesServer.Do(req) - case "SettingsClient": - initServer(s, &s.trSettingsServer, func() *SettingsServerTransport { return NewSettingsServerTransport(&s.srv.SettingsServer) }) - resp, err = s.trSettingsServer.Do(req) default: err = fmt.Errorf("unhandled client %s", client) } diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/settings_server.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/settings_server.go deleted file mode 100644 index 56dcd15345bf..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/fake/settings_server.go +++ /dev/null @@ -1,222 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute/v2" - "net/http" - "net/url" - "regexp" -) - -// SettingsServer is a fake server for instances of the armhybridcompute.SettingsClient type. -type SettingsServer struct { - // Get is the fake for method SettingsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, baseProvider string, baseResourceType string, baseResourceName string, settingsResourceName string, options *armhybridcompute.SettingsClientGetOptions) (resp azfake.Responder[armhybridcompute.SettingsClientGetResponse], errResp azfake.ErrorResponder) - - // Patch is the fake for method SettingsClient.Patch - // HTTP status codes to indicate success: http.StatusOK - Patch func(ctx context.Context, resourceGroupName string, baseProvider string, baseResourceType string, baseResourceName string, settingsResourceName string, parameters armhybridcompute.Settings, options *armhybridcompute.SettingsClientPatchOptions) (resp azfake.Responder[armhybridcompute.SettingsClientPatchResponse], errResp azfake.ErrorResponder) - - // Update is the fake for method SettingsClient.Update - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - Update func(ctx context.Context, resourceGroupName string, baseProvider string, baseResourceType string, baseResourceName string, settingsResourceName string, parameters armhybridcompute.Settings, options *armhybridcompute.SettingsClientUpdateOptions) (resp azfake.Responder[armhybridcompute.SettingsClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewSettingsServerTransport creates a new instance of SettingsServerTransport with the provided implementation. -// The returned SettingsServerTransport instance is connected to an instance of armhybridcompute.SettingsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewSettingsServerTransport(srv *SettingsServer) *SettingsServerTransport { - return &SettingsServerTransport{srv: srv} -} - -// SettingsServerTransport connects instances of armhybridcompute.SettingsClient to instances of SettingsServer. -// Don't use this type directly, use NewSettingsServerTransport instead. -type SettingsServerTransport struct { - srv *SettingsServer -} - -// Do implements the policy.Transporter interface for SettingsServerTransport. -func (s *SettingsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "SettingsClient.Get": - resp, err = s.dispatchGet(req) - case "SettingsClient.Patch": - resp, err = s.dispatchPatch(req) - case "SettingsClient.Update": - resp, err = s.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (s *SettingsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if s.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/settings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 6 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - baseProviderParam, err := url.PathUnescape(matches[regex.SubexpIndex("baseProvider")]) - if err != nil { - return nil, err - } - baseResourceTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("baseResourceType")]) - if err != nil { - return nil, err - } - baseResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("baseResourceName")]) - if err != nil { - return nil, err - } - settingsResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("settingsResourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, baseProviderParam, baseResourceTypeParam, baseResourceNameParam, settingsResourceNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Settings, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (s *SettingsServerTransport) dispatchPatch(req *http.Request) (*http.Response, error) { - if s.srv.Patch == nil { - return nil, &nonRetriableError{errors.New("fake for method Patch not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/settings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 6 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhybridcompute.Settings](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - baseProviderParam, err := url.PathUnescape(matches[regex.SubexpIndex("baseProvider")]) - if err != nil { - return nil, err - } - baseResourceTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("baseResourceType")]) - if err != nil { - return nil, err - } - baseResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("baseResourceName")]) - if err != nil { - return nil, err - } - settingsResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("settingsResourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Patch(req.Context(), resourceGroupNameParam, baseProviderParam, baseResourceTypeParam, baseResourceNameParam, settingsResourceNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Settings, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (s *SettingsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { - if s.srv.Update == nil { - return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridCompute/settings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 6 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhybridcompute.Settings](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - baseProviderParam, err := url.PathUnescape(matches[regex.SubexpIndex("baseProvider")]) - if err != nil { - return nil, err - } - baseResourceTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("baseResourceType")]) - if err != nil { - return nil, err - } - baseResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("baseResourceName")]) - if err != nil { - return nil, err - } - settingsResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("settingsResourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Update(req.Context(), resourceGroupNameParam, baseProviderParam, baseResourceTypeParam, baseResourceNameParam, settingsResourceNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Settings, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/gateways_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/gateways_client.go deleted file mode 100644 index bc6c7d560533..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/gateways_client.go +++ /dev/null @@ -1,446 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybridcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "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" -) - -// GatewaysClient contains the methods for the Gateways group. -// Don't use this type directly, use NewGatewaysClient() instead. -type GatewaysClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGatewaysClient creates a new instance of GatewaysClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewaysClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GatewaysClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update a gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - gatewayName - The name of the Gateway. -// - parameters - Parameters supplied to the Create gateway operation. -// - options - GatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewaysClient.BeginCreateOrUpdate -// method. -func (client *GatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, parameters Gateway, options *GatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewaysClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, gatewayName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GatewaysClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GatewaysClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update a gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -func (client *GatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, parameters Gateway, options *GatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GatewaysClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, gatewayName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, parameters Gateway, options *GatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName}" - 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 gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete a gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - gatewayName - The name of the Gateway. -// - options - GatewaysClientBeginDeleteOptions contains the optional parameters for the GatewaysClient.BeginDelete method. -func (client *GatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*runtime.Poller[GatewaysClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GatewaysClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GatewaysClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete a gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -func (client *GatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GatewaysClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName}" - 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 gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about the view of a gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - gatewayName - The name of the Gateway. -// - options - GatewaysClientGetOptions contains the optional parameters for the GatewaysClient.Get method. -func (client *GatewaysClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, options *GatewaysClientGetOptions) (GatewaysClientGetResponse, error) { - var err error - const operationName = "GatewaysClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, gatewayName, options) - if err != nil { - return GatewaysClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GatewaysClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GatewaysClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *GatewaysClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName}" - 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 gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GatewaysClient) getHandleResponse(resp *http.Response) (GatewaysClientGetResponse, error) { - result := GatewaysClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Gateway); err != nil { - return GatewaysClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - The operation to get all gateways of a non-Azure machine -// -// Generated from API version 2024-05-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - options - GatewaysClientListByResourceGroupOptions contains the optional parameters for the GatewaysClient.NewListByResourceGroupPager -// method. -func (client *GatewaysClient) NewListByResourceGroupPager(resourceGroupName string, options *GatewaysClientListByResourceGroupOptions) *runtime.Pager[GatewaysClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[GatewaysClientListByResourceGroupResponse]{ - More: func(page GatewaysClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GatewaysClientListByResourceGroupResponse) (GatewaysClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GatewaysClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return GatewaysClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *GatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *GatewaysClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *GatewaysClient) listByResourceGroupHandleResponse(resp *http.Response) (GatewaysClientListByResourceGroupResponse, error) { - result := GatewaysClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GatewaysListResult); err != nil { - return GatewaysClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - The operation to get all gateways of a non-Azure machine -// -// Generated from API version 2024-05-20-preview -// - options - GatewaysClientListBySubscriptionOptions contains the optional parameters for the GatewaysClient.NewListBySubscriptionPager -// method. -func (client *GatewaysClient) NewListBySubscriptionPager(options *GatewaysClientListBySubscriptionOptions) *runtime.Pager[GatewaysClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[GatewaysClientListBySubscriptionResponse]{ - More: func(page GatewaysClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GatewaysClientListBySubscriptionResponse) (GatewaysClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GatewaysClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return GatewaysClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *GatewaysClient) listBySubscriptionCreateRequest(ctx context.Context, options *GatewaysClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *GatewaysClient) listBySubscriptionHandleResponse(resp *http.Response) (GatewaysClientListBySubscriptionResponse, error) { - result := GatewaysClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GatewaysListResult); err != nil { - return GatewaysClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - The operation to update a gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - gatewayName - The name of the Gateway. -// - parameters - Parameters supplied to the Update gateway operation. -// - options - GatewaysClientUpdateOptions contains the optional parameters for the GatewaysClient.Update method. -func (client *GatewaysClient) Update(ctx context.Context, resourceGroupName string, gatewayName string, parameters GatewayUpdate, options *GatewaysClientUpdateOptions) (GatewaysClientUpdateResponse, error) { - var err error - const operationName = "GatewaysClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, gatewayName, parameters, options) - if err != nil { - return GatewaysClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GatewaysClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GatewaysClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *GatewaysClient) updateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, parameters GatewayUpdate, options *GatewaysClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName}" - 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 gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *GatewaysClient) updateHandleResponse(resp *http.Response) (GatewaysClientUpdateResponse, error) { - result := GatewaysClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Gateway); err != nil { - return GatewaysClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/gateways_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/gateways_client_example_test.go deleted file mode 100644 index 280c5229c9f1..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/gateways_client_example_test.go +++ /dev/null @@ -1,242 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "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/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_CreateOrUpdate.json -func ExampleGatewaysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGatewaysClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{gatewayName}", armhybridcompute.Gateway{ - Location: to.Ptr("eastus2euap"), - Properties: &armhybridcompute.GatewayProperties{ - AllowedFeatures: []*string{ - to.Ptr("*")}, - GatewayType: to.Ptr(armhybridcompute.GatewayTypePublic), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gateway = armhybridcompute.Gateway{ - // Name: to.Ptr("{gatewayName}"), - // Type: to.Ptr("Microsoft.HybridCompute/gateways"), - // ID: to.Ptr("/subscriptions/ffd506c8-3415-42d3-9612-fdb423fb17df/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/gateways/{gatewayName}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.GatewayProperties{ - // AllowedFeatures: []*string{ - // to.Ptr("*")}, - // GatewayEndpoint: to.Ptr("https://uniqueValue.contoso.com"), - // GatewayID: to.Ptr(""), - // GatewayType: to.Ptr(armhybridcompute.GatewayTypePublic), - // ProvisioningState: to.Ptr(armhybridcompute.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_Update.json -func ExampleGatewaysClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGatewaysClient().Update(ctx, "myResourceGroup", "{gatewayName}", armhybridcompute.GatewayUpdate{ - Properties: &armhybridcompute.GatewayUpdateProperties{ - AllowedFeatures: []*string{ - to.Ptr("*")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gateway = armhybridcompute.Gateway{ - // Name: to.Ptr("{gatewayName}"), - // Type: to.Ptr("Microsoft.HybridCompute/gateways"), - // ID: to.Ptr("/subscriptions/ffd506c8-3415-42d3-9612-fdb423fb17df/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/gateways/{gatewayName}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.GatewayProperties{ - // AllowedFeatures: []*string{ - // to.Ptr("*")}, - // GatewayEndpoint: to.Ptr("https://uniqueValue.contoso.com"), - // GatewayID: to.Ptr(""), - // GatewayType: to.Ptr(armhybridcompute.GatewayTypePublic), - // ProvisioningState: to.Ptr(armhybridcompute.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_Get.json -func ExampleGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGatewaysClient().Get(ctx, "myResourceGroup", "{gatewayName}", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gateway = armhybridcompute.Gateway{ - // Name: to.Ptr("{gatewayName}"), - // Type: to.Ptr("Microsoft.HybridCompute/gateways"), - // ID: to.Ptr("/subscriptions/ffd506c8-3415-42d3-9612-fdb423fb17df/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/gateways/{gatewayName}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.GatewayProperties{ - // AllowedFeatures: []*string{ - // to.Ptr("*")}, - // GatewayEndpoint: to.Ptr("https://uniqueValue.contoso.com"), - // GatewayID: to.Ptr(""), - // GatewayType: to.Ptr(armhybridcompute.GatewayTypePublic), - // ProvisioningState: to.Ptr(armhybridcompute.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_Delete.json -func ExampleGatewaysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGatewaysClient().BeginDelete(ctx, "myResourceGroup", "{gatewayName}", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_ListByResourceGroup.json -func ExampleGatewaysClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGatewaysClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GatewaysListResult = armhybridcompute.GatewaysListResult{ - // Value: []*armhybridcompute.Gateway{ - // { - // Name: to.Ptr("{gatewayName}"), - // Type: to.Ptr("Microsoft.HybridCompute/gateways"), - // ID: to.Ptr("/subscriptions/ffd506c8-3415-42d3-9612-fdb423fb17df/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/gateways/{gatewayName}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.GatewayProperties{ - // AllowedFeatures: []*string{ - // to.Ptr("*")}, - // GatewayEndpoint: to.Ptr("https://uniqueValue.contoso.com"), - // GatewayID: to.Ptr(""), - // GatewayType: to.Ptr(armhybridcompute.GatewayTypePublic), - // ProvisioningState: to.Ptr(armhybridcompute.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_ListBySubscription.json -func ExampleGatewaysClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGatewaysClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GatewaysListResult = armhybridcompute.GatewaysListResult{ - // Value: []*armhybridcompute.Gateway{ - // { - // Name: to.Ptr("{gatewayName}"), - // Type: to.Ptr("Microsoft.HybridCompute/gateways"), - // ID: to.Ptr("/subscriptions/ffd506c8-3415-42d3-9612-fdb423fb17df/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/gateways/{gatewayName}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.GatewayProperties{ - // AllowedFeatures: []*string{ - // to.Ptr("*")}, - // GatewayEndpoint: to.Ptr("https://uniqueValue.contoso.com"), - // GatewayID: to.Ptr(""), - // GatewayType: to.Ptr(armhybridcompute.GatewayTypePublic), - // ProvisioningState: to.Ptr(armhybridcompute.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/go.mod b/sdk/resourcemanager/hybridcompute/armhybridcompute/go.mod index 1b14f993b9ae..600da10e9bee 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/go.mod +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhy go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/go.sum b/sdk/resourcemanager/hybridcompute/armhybridcompute/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/go.sum +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/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/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/licenseprofiles_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/licenseprofiles_client.go new file mode 100644 index 000000000000..57055bc0367b --- /dev/null +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/licenseprofiles_client.go @@ -0,0 +1,413 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armhybridcompute + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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" +) + +// LicenseProfilesClient contains the methods for the LicenseProfiles group. +// Don't use this type directly, use NewLicenseProfilesClient() instead. +type LicenseProfilesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLicenseProfilesClient creates a new instance of LicenseProfilesClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLicenseProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LicenseProfilesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LicenseProfilesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - The operation to create or update a license profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-10 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - machineName - The name of the hybrid machine. +// - parameters - Parameters supplied to the Create or Update license profile operation. +// - options - LicenseProfilesClientBeginCreateOrUpdateOptions contains the optional parameters for the LicenseProfilesClient.BeginCreateOrUpdate +// method. +func (client *LicenseProfilesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, machineName string, parameters LicenseProfile, options *LicenseProfilesClientBeginCreateOrUpdateOptions) (*runtime.Poller[LicenseProfilesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, machineName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LicenseProfilesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LicenseProfilesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - The operation to create or update a license profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-10 +func (client *LicenseProfilesClient) createOrUpdate(ctx context.Context, resourceGroupName string, machineName string, parameters LicenseProfile, options *LicenseProfilesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "LicenseProfilesClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, machineName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *LicenseProfilesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, machineName string, parameters LicenseProfile, options *LicenseProfilesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}" + 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 machineName == "" { + return nil, errors.New("parameter machineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) + urlPath = strings.ReplaceAll(urlPath, "{licenseProfileName}", url.PathEscape("default")) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-07-10") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - The operation to delete a license profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-10 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - machineName - The name of the hybrid machine. +// - options - LicenseProfilesClientBeginDeleteOptions contains the optional parameters for the LicenseProfilesClient.BeginDelete +// method. +func (client *LicenseProfilesClient) BeginDelete(ctx context.Context, resourceGroupName string, machineName string, options *LicenseProfilesClientBeginDeleteOptions) (*runtime.Poller[LicenseProfilesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, machineName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LicenseProfilesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LicenseProfilesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - The operation to delete a license profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-10 +func (client *LicenseProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, machineName string, options *LicenseProfilesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "LicenseProfilesClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, machineName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *LicenseProfilesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, machineName string, options *LicenseProfilesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}" + 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 machineName == "" { + return nil, errors.New("parameter machineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) + urlPath = strings.ReplaceAll(urlPath, "{licenseProfileName}", url.PathEscape("default")) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-07-10") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Retrieves information about the view of a license profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-10 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - machineName - The name of the hybrid machine. +// - options - LicenseProfilesClientGetOptions contains the optional parameters for the LicenseProfilesClient.Get method. +func (client *LicenseProfilesClient) Get(ctx context.Context, resourceGroupName string, machineName string, options *LicenseProfilesClientGetOptions) (LicenseProfilesClientGetResponse, error) { + var err error + const operationName = "LicenseProfilesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, machineName, options) + if err != nil { + return LicenseProfilesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LicenseProfilesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LicenseProfilesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *LicenseProfilesClient) getCreateRequest(ctx context.Context, resourceGroupName string, machineName string, options *LicenseProfilesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}" + 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 machineName == "" { + return nil, errors.New("parameter machineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) + urlPath = strings.ReplaceAll(urlPath, "{licenseProfileName}", url.PathEscape("default")) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-07-10") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LicenseProfilesClient) getHandleResponse(resp *http.Response) (LicenseProfilesClientGetResponse, error) { + result := LicenseProfilesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LicenseProfile); err != nil { + return LicenseProfilesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - The operation to get all license profiles of a non-Azure machine +// +// Generated from API version 2024-07-10 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - machineName - The name of the machine. +// - options - LicenseProfilesClientListOptions contains the optional parameters for the LicenseProfilesClient.NewListPager +// method. +func (client *LicenseProfilesClient) NewListPager(resourceGroupName string, machineName string, options *LicenseProfilesClientListOptions) *runtime.Pager[LicenseProfilesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[LicenseProfilesClientListResponse]{ + More: func(page LicenseProfilesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LicenseProfilesClientListResponse) (LicenseProfilesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LicenseProfilesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, machineName, options) + }, nil) + if err != nil { + return LicenseProfilesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *LicenseProfilesClient) listCreateRequest(ctx context.Context, resourceGroupName string, machineName string, options *LicenseProfilesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if machineName == "" { + return nil, errors.New("parameter machineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-07-10") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *LicenseProfilesClient) listHandleResponse(resp *http.Response) (LicenseProfilesClientListResponse, error) { + result := LicenseProfilesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LicenseProfilesListResult); err != nil { + return LicenseProfilesClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - The operation to update a license profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-10 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - machineName - The name of the hybrid machine. +// - parameters - Parameters supplied to the Update license profile operation. +// - options - LicenseProfilesClientBeginUpdateOptions contains the optional parameters for the LicenseProfilesClient.BeginUpdate +// method. +func (client *LicenseProfilesClient) BeginUpdate(ctx context.Context, resourceGroupName string, machineName string, parameters LicenseProfileUpdate, options *LicenseProfilesClientBeginUpdateOptions) (*runtime.Poller[LicenseProfilesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, machineName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LicenseProfilesClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LicenseProfilesClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - The operation to update a license profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-10 +func (client *LicenseProfilesClient) update(ctx context.Context, resourceGroupName string, machineName string, parameters LicenseProfileUpdate, options *LicenseProfilesClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "LicenseProfilesClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, machineName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *LicenseProfilesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, machineName string, parameters LicenseProfileUpdate, options *LicenseProfilesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}" + 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 machineName == "" { + return nil, errors.New("parameter machineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) + urlPath = strings.ReplaceAll(urlPath, "{licenseProfileName}", url.PathEscape("default")) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-07-10") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/licenses_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/licenses_client.go index 424d280c1bd6..c5d3dbf6a3c2 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/licenses_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/licenses_client.go @@ -46,7 +46,7 @@ func NewLicensesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - The operation to create or update a license. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - licenseName - The name of the license. // - parameters - Parameters supplied to the Create license operation. @@ -72,7 +72,7 @@ func (client *LicensesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - The operation to create or update a license. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *LicensesClient) createOrUpdate(ctx context.Context, resourceGroupName string, licenseName string, parameters License, options *LicensesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "LicensesClient.BeginCreateOrUpdate" @@ -114,7 +114,7 @@ func (client *LicensesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,7 +126,7 @@ func (client *LicensesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - The operation to delete a license. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - licenseName - The name of the license. // - options - LicensesClientBeginDeleteOptions contains the optional parameters for the LicensesClient.BeginDelete method. @@ -150,7 +150,7 @@ func (client *LicensesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - The operation to delete a license. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *LicensesClient) deleteOperation(ctx context.Context, resourceGroupName string, licenseName string, options *LicensesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "LicensesClient.BeginDelete" @@ -192,7 +192,7 @@ func (client *LicensesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *LicensesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Retrieves information about the view of a license. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - licenseName - The name of the license. // - options - LicensesClientGetOptions contains the optional parameters for the LicensesClient.Get method. @@ -247,7 +247,7 @@ func (client *LicensesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +264,7 @@ func (client *LicensesClient) getHandleResponse(resp *http.Response) (LicensesCl // NewListByResourceGroupPager - The operation to get all licenses of a non-Azure machine // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - LicensesClientListByResourceGroupOptions contains the optional parameters for the LicensesClient.NewListByResourceGroupPager // method. @@ -307,7 +307,7 @@ func (client *LicensesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *LicensesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - The operation to get all licenses of a non-Azure machine // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - options - LicensesClientListBySubscriptionOptions contains the optional parameters for the LicensesClient.NewListBySubscriptionPager // method. func (client *LicensesClient) NewListBySubscriptionPager(options *LicensesClientListBySubscriptionOptions) *runtime.Pager[LicensesClientListBySubscriptionResponse] { @@ -362,7 +362,7 @@ func (client *LicensesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -380,7 +380,7 @@ func (client *LicensesClient) listBySubscriptionHandleResponse(resp *http.Respon // BeginUpdate - The operation to update a license. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - licenseName - The name of the license. // - parameters - Parameters supplied to the Update license operation. @@ -405,7 +405,7 @@ func (client *LicensesClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - The operation to update a license. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *LicensesClient) update(ctx context.Context, resourceGroupName string, licenseName string, parameters LicenseUpdate, options *LicensesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "LicensesClient.BeginUpdate" @@ -447,7 +447,77 @@ func (client *LicensesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginValidateLicense - The operation to validate a license. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-10 +// - parameters - Parameters supplied to the license validation operation. +// - options - LicensesClientBeginValidateLicenseOptions contains the optional parameters for the LicensesClient.BeginValidateLicense +// method. +func (client *LicensesClient) BeginValidateLicense(ctx context.Context, parameters License, options *LicensesClientBeginValidateLicenseOptions) (*runtime.Poller[LicensesClientValidateLicenseResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.validateLicense(ctx, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LicensesClientValidateLicenseResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LicensesClientValidateLicenseResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// ValidateLicense - The operation to validate a license. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-10 +func (client *LicensesClient) validateLicense(ctx context.Context, parameters License, options *LicensesClientBeginValidateLicenseOptions) (*http.Response, error) { + var err error + const operationName = "LicensesClient.BeginValidateLicense" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.validateLicenseCreateRequest(ctx, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// validateLicenseCreateRequest creates the ValidateLicense request. +func (client *LicensesClient) validateLicenseCreateRequest(ctx context.Context, parameters License, options *LicensesClientBeginValidateLicenseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/validateLicense" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/licenses_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/licenses_client_example_test.go deleted file mode 100644 index 7f01cd15ab74..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/licenses_client_example_test.go +++ /dev/null @@ -1,282 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "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/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_CreateOrUpdate.json -func ExampleLicensesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLicensesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{licenseName}", armhybridcompute.License{ - Location: to.Ptr("eastus2euap"), - Properties: &armhybridcompute.LicenseProperties{ - LicenseDetails: &armhybridcompute.LicenseDetails{ - Type: to.Ptr(armhybridcompute.LicenseCoreTypePCore), - Edition: to.Ptr(armhybridcompute.LicenseEditionDatacenter), - Processors: to.Ptr[int32](6), - State: to.Ptr(armhybridcompute.LicenseStateActivated), - Target: to.Ptr(armhybridcompute.LicenseTargetWindowsServer2012), - }, - LicenseType: to.Ptr(armhybridcompute.LicenseTypeESU), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.License = armhybridcompute.License{ - // Name: to.Ptr("{licenseName}"), - // Type: to.Ptr("Microsoft.HybridCompute/licenses"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Licenses/{licenseName}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.LicenseProperties{ - // LicenseDetails: &armhybridcompute.LicenseDetails{ - // Type: to.Ptr(armhybridcompute.LicenseCoreTypePCore), - // AssignedLicenses: to.Ptr[int32](2), - // Edition: to.Ptr(armhybridcompute.LicenseEditionDatacenter), - // ImmutableID: to.Ptr(""), - // Processors: to.Ptr[int32](6), - // State: to.Ptr(armhybridcompute.LicenseStateActivated), - // Target: to.Ptr(armhybridcompute.LicenseTargetWindowsServer2012), - // }, - // LicenseType: to.Ptr(armhybridcompute.LicenseTypeESU), - // TenantID: to.Ptr("{tenandId}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_Update.json -func ExampleLicensesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLicensesClient().BeginUpdate(ctx, "myResourceGroup", "{licenseName}", armhybridcompute.LicenseUpdate{ - Properties: &armhybridcompute.LicenseUpdateProperties{ - LicenseDetails: &armhybridcompute.LicenseUpdatePropertiesLicenseDetails{ - Type: to.Ptr(armhybridcompute.LicenseCoreTypePCore), - Edition: to.Ptr(armhybridcompute.LicenseEditionDatacenter), - Processors: to.Ptr[int32](6), - State: to.Ptr(armhybridcompute.LicenseStateActivated), - Target: to.Ptr(armhybridcompute.LicenseTargetWindowsServer2012), - }, - LicenseType: to.Ptr(armhybridcompute.LicenseTypeESU), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.License = armhybridcompute.License{ - // Name: to.Ptr("{licenseName}"), - // Type: to.Ptr("Microsoft.HybridCompute/licenses"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/licenses/{licenseName}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.LicenseProperties{ - // LicenseDetails: &armhybridcompute.LicenseDetails{ - // Type: to.Ptr(armhybridcompute.LicenseCoreTypePCore), - // AssignedLicenses: to.Ptr[int32](8), - // Edition: to.Ptr(armhybridcompute.LicenseEditionDatacenter), - // ImmutableID: to.Ptr(""), - // Processors: to.Ptr[int32](6), - // State: to.Ptr(armhybridcompute.LicenseStateActivated), - // Target: to.Ptr(armhybridcompute.LicenseTargetWindowsServer2012), - // }, - // LicenseType: to.Ptr(armhybridcompute.LicenseTypeESU), - // TenantID: to.Ptr("{tenandId}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_Get.json -func ExampleLicensesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLicensesClient().Get(ctx, "myResourceGroup", "{licenseName}", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.License = armhybridcompute.License{ - // Name: to.Ptr("{licenseName}"), - // Type: to.Ptr("Microsoft.HybridCompute/licenses"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Licenses/{licenseName}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.LicenseProperties{ - // LicenseDetails: &armhybridcompute.LicenseDetails{ - // Type: to.Ptr(armhybridcompute.LicenseCoreTypePCore), - // AssignedLicenses: to.Ptr[int32](8), - // Edition: to.Ptr(armhybridcompute.LicenseEditionDatacenter), - // ImmutableID: to.Ptr(""), - // Processors: to.Ptr[int32](6), - // State: to.Ptr(armhybridcompute.LicenseStateActivated), - // Target: to.Ptr(armhybridcompute.LicenseTargetWindowsServer2012), - // }, - // LicenseType: to.Ptr(armhybridcompute.LicenseTypeESU), - // TenantID: to.Ptr("{tenandId}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_Delete.json -func ExampleLicensesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLicensesClient().BeginDelete(ctx, "myResourceGroup", "{licenseName}", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_ListByResourceGroup.json -func ExampleLicensesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLicensesClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LicensesListResult = armhybridcompute.LicensesListResult{ - // Value: []*armhybridcompute.License{ - // { - // Name: to.Ptr("{licenseName}"), - // Type: to.Ptr("Microsoft.HybridCompute/licenses"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Licenses/{licenseName}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.LicenseProperties{ - // LicenseDetails: &armhybridcompute.LicenseDetails{ - // Type: to.Ptr(armhybridcompute.LicenseCoreTypePCore), - // AssignedLicenses: to.Ptr[int32](8), - // Edition: to.Ptr(armhybridcompute.LicenseEditionDatacenter), - // ImmutableID: to.Ptr(""), - // Processors: to.Ptr[int32](6), - // State: to.Ptr(armhybridcompute.LicenseStateActivated), - // Target: to.Ptr(armhybridcompute.LicenseTargetWindowsServer2012), - // }, - // LicenseType: to.Ptr(armhybridcompute.LicenseTypeESU), - // TenantID: to.Ptr("{tenandId}"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_ListBySubscription.json -func ExampleLicensesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLicensesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LicensesListResult = armhybridcompute.LicensesListResult{ - // Value: []*armhybridcompute.License{ - // { - // Name: to.Ptr("{licenseName}"), - // Type: to.Ptr("Microsoft.HybridCompute/licenses"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Licenses/{licenseName}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.LicenseProperties{ - // LicenseDetails: &armhybridcompute.LicenseDetails{ - // Type: to.Ptr(armhybridcompute.LicenseCoreTypePCore), - // AssignedLicenses: to.Ptr[int32](8), - // Edition: to.Ptr(armhybridcompute.LicenseEditionDatacenter), - // ImmutableID: to.Ptr(""), - // Processors: to.Ptr[int32](6), - // State: to.Ptr(armhybridcompute.LicenseStateActivated), - // Target: to.Ptr(armhybridcompute.LicenseTargetWindowsServer2012), - // }, - // LicenseType: to.Ptr(armhybridcompute.LicenseTypeESU), - // TenantID: to.Ptr("{tenandId}"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client.go index 06f988633842..e50d323b1db5 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client.go @@ -46,7 +46,7 @@ func NewMachineExtensionsClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - The operation to create or update the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the machine where the extension should be created or updated. // - extensionName - The name of the machine extension. @@ -73,7 +73,7 @@ func (client *MachineExtensionsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - The operation to create or update the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *MachineExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, machineName string, extensionName string, extensionParameters MachineExtension, options *MachineExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "MachineExtensionsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *MachineExtensionsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { @@ -131,7 +131,7 @@ func (client *MachineExtensionsClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - The operation to delete the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the machine where the extension should be deleted. // - extensionName - The name of the machine extension. @@ -157,7 +157,7 @@ func (client *MachineExtensionsClient) BeginDelete(ctx context.Context, resource // Delete - The operation to delete the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *MachineExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, machineName string, extensionName string, options *MachineExtensionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "MachineExtensionsClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *MachineExtensionsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *MachineExtensionsClient) deleteCreateRequest(ctx context.Context, // Get - The operation to get the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the machine containing the extension. // - extensionName - The name of the machine extension. @@ -263,7 +263,7 @@ func (client *MachineExtensionsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *MachineExtensionsClient) getHandleResponse(resp *http.Response) (M // NewListPager - The operation to get all extensions of a non-Azure machine // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the machine containing the extension. // - options - MachineExtensionsClientListOptions contains the optional parameters for the MachineExtensionsClient.NewListPager @@ -331,7 +331,7 @@ func (client *MachineExtensionsClient) listCreateRequest(ctx context.Context, re if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +349,7 @@ func (client *MachineExtensionsClient) listHandleResponse(resp *http.Response) ( // BeginUpdate - The operation to update the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the machine where the extension should be created or updated. // - extensionName - The name of the machine extension. @@ -376,7 +376,7 @@ func (client *MachineExtensionsClient) BeginUpdate(ctx context.Context, resource // Update - The operation to update the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *MachineExtensionsClient) update(ctx context.Context, resourceGroupName string, machineName string, extensionName string, extensionParameters MachineExtensionUpdate, options *MachineExtensionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "MachineExtensionsClient.BeginUpdate" @@ -422,7 +422,7 @@ func (client *MachineExtensionsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client_example_test.go deleted file mode 100644 index c1ff6cf15b3e..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineextensions_client_example_test.go +++ /dev/null @@ -1,295 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "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/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_CreateOrUpdate.json -func ExampleMachineExtensionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMachineExtensionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myMachine", "CustomScriptExtension", armhybridcompute.MachineExtension{ - Location: to.Ptr("eastus2euap"), - Properties: &armhybridcompute.MachineExtensionProperties{ - Type: to.Ptr("CustomScriptExtension"), - Publisher: to.Ptr("Microsoft.Compute"), - Settings: map[string]any{ - "commandToExecute": "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"", - }, - TypeHandlerVersion: to.Ptr("1.10"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MachineExtension = armhybridcompute.MachineExtension{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/extensions"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/Extensions/CustomScriptExtension"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.MachineExtensionProperties{ - // Type: to.Ptr("string"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // InstanceView: &armhybridcompute.MachineExtensionInstanceView{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("CustomScriptExtension"), - // Status: &armhybridcompute.MachineExtensionInstanceViewStatus{ - // Code: to.Ptr("success"), - // Level: to.Ptr(armhybridcompute.StatusLevelTypes("Information")), - // Message: to.Ptr("Finished executing command, StdOut: , StdErr:"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-08T20:42:10.999Z"); return t}()), - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // ProtectedSettings: map[string]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // "commandToExecute": "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"", - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_Update.json -func ExampleMachineExtensionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMachineExtensionsClient().BeginUpdate(ctx, "myResourceGroup", "myMachine", "CustomScriptExtension", armhybridcompute.MachineExtensionUpdate{ - Properties: &armhybridcompute.MachineExtensionUpdateProperties{ - Type: to.Ptr("CustomScriptExtension"), - EnableAutomaticUpgrade: to.Ptr(true), - Publisher: to.Ptr("Microsoft.Compute"), - Settings: map[string]any{ - "commandToExecute": "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -lt 100 }\"", - }, - TypeHandlerVersion: to.Ptr("1.10"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MachineExtension = armhybridcompute.MachineExtension{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/extensions"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/Extensions/CustomScriptExtension"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.MachineExtensionProperties{ - // Type: to.Ptr("string"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // EnableAutomaticUpgrade: to.Ptr(true), - // InstanceView: &armhybridcompute.MachineExtensionInstanceView{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("CustomScriptExtension"), - // Status: &armhybridcompute.MachineExtensionInstanceViewStatus{ - // Code: to.Ptr("success"), - // Level: to.Ptr(armhybridcompute.StatusLevelTypes("Information")), - // Message: to.Ptr("Finished executing command, StdOut: , StdErr:"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-08T20:42:10.999Z"); return t}()), - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // ProtectedSettings: map[string]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // "commandToExecute": "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"", - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_Delete.json -func ExampleMachineExtensionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMachineExtensionsClient().BeginDelete(ctx, "myResourceGroup", "myMachine", "MMA", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_Get.json -func ExampleMachineExtensionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMachineExtensionsClient().Get(ctx, "myResourceGroup", "myMachine", "CustomScriptExtension", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MachineExtension = armhybridcompute.MachineExtension{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/extensions"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/Extensions/CustomScriptExtension"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.MachineExtensionProperties{ - // Type: to.Ptr("string"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // InstanceView: &armhybridcompute.MachineExtensionInstanceView{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("CustomScriptExtension"), - // Status: &armhybridcompute.MachineExtensionInstanceViewStatus{ - // Code: to.Ptr("success"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armhybridcompute.StatusLevelTypes("Information")), - // Message: to.Ptr("Finished executing command, StdOut: , StdErr:"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-08T20:42:10.999Z"); return t}()), - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // ProtectedSettings: map[string]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // "commandToExecute": "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"", - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_List.json -func ExampleMachineExtensionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMachineExtensionsClient().NewListPager("myResourceGroup", "myMachine", &armhybridcompute.MachineExtensionsClientListOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MachineExtensionsListResult = armhybridcompute.MachineExtensionsListResult{ - // Value: []*armhybridcompute.MachineExtension{ - // { - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/extensions"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/Extensions/CustomScriptExtension"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.MachineExtensionProperties{ - // Type: to.Ptr("CustomScriptExtension"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // InstanceView: &armhybridcompute.MachineExtensionInstanceView{ - // Name: to.Ptr("CustomScriptExtension"), - // Type: to.Ptr("CustomScriptExtension"), - // Status: &armhybridcompute.MachineExtensionInstanceViewStatus{ - // Code: to.Ptr("success"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armhybridcompute.StatusLevelTypes("Information")), - // Message: to.Ptr("formattedMessage: Finished executing command, StdOut: , StdErr: "), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-13T17:18:57.405Z"); return t}()), - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // "commandToExecute": "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"", - // }, - // TypeHandlerVersion: to.Ptr("1.10.3"), - // }, - // }, - // { - // Name: to.Ptr("winosupdateextension"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/extensions"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/Extensions/winosupdateextension"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.MachineExtensionProperties{ - // Type: to.Ptr("windowsosupdateextension"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // InstanceView: &armhybridcompute.MachineExtensionInstanceView{ - // Name: to.Ptr("winosupdateextension"), - // Type: to.Ptr("windowsosupdateextension"), - // Status: &armhybridcompute.MachineExtensionInstanceViewStatus{ - // }, - // TypeHandlerVersion: to.Ptr("1.0.0.0"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("microsoft.softwareupdatemanagement.test"), - // Settings: map[string]any{ - // }, - // TypeHandlerVersion: to.Ptr("1.0.0.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineruncommands_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/machineruncommands_client.go deleted file mode 100644 index 2acae76948ae..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineruncommands_client.go +++ /dev/null @@ -1,349 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybridcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "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" -) - -// MachineRunCommandsClient contains the methods for the MachineRunCommands group. -// Don't use this type directly, use NewMachineRunCommandsClient() instead. -type MachineRunCommandsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewMachineRunCommandsClient creates a new instance of MachineRunCommandsClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewMachineRunCommandsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MachineRunCommandsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &MachineRunCommandsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update a run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - machineName - The name of the hybrid machine. -// - runCommandName - The name of the run command. -// - runCommandProperties - Parameters supplied to the Create Run Command. -// - options - MachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the MachineRunCommandsClient.BeginCreateOrUpdate -// method. -func (client *MachineRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, machineName string, runCommandName string, runCommandProperties MachineRunCommand, options *MachineRunCommandsClientBeginCreateOrUpdateOptions) (*runtime.Poller[MachineRunCommandsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, machineName, runCommandName, runCommandProperties, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MachineRunCommandsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MachineRunCommandsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update a run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -func (client *MachineRunCommandsClient) createOrUpdate(ctx context.Context, resourceGroupName string, machineName string, runCommandName string, runCommandProperties MachineRunCommand, options *MachineRunCommandsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "MachineRunCommandsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, machineName, runCommandName, runCommandProperties, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *MachineRunCommandsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, machineName string, runCommandName string, runCommandProperties MachineRunCommand, options *MachineRunCommandsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if machineName == "" { - return nil, errors.New("parameter machineName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, runCommandProperties); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete a run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - machineName - The name of the hybrid machine. -// - runCommandName - The name of the run command. -// - options - MachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the MachineRunCommandsClient.BeginDelete -// method. -func (client *MachineRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, machineName string, runCommandName string, options *MachineRunCommandsClientBeginDeleteOptions) (*runtime.Poller[MachineRunCommandsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, machineName, runCommandName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MachineRunCommandsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MachineRunCommandsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete a run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -func (client *MachineRunCommandsClient) deleteOperation(ctx context.Context, resourceGroupName string, machineName string, runCommandName string, options *MachineRunCommandsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "MachineRunCommandsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, machineName, runCommandName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *MachineRunCommandsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, machineName string, runCommandName string, options *MachineRunCommandsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if machineName == "" { - return nil, errors.New("parameter machineName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get a run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - machineName - The name of the hybrid machine. -// - runCommandName - The name of the run command. -// - options - MachineRunCommandsClientGetOptions contains the optional parameters for the MachineRunCommandsClient.Get method. -func (client *MachineRunCommandsClient) Get(ctx context.Context, resourceGroupName string, machineName string, runCommandName string, options *MachineRunCommandsClientGetOptions) (MachineRunCommandsClientGetResponse, error) { - var err error - const operationName = "MachineRunCommandsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, machineName, runCommandName, options) - if err != nil { - return MachineRunCommandsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return MachineRunCommandsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return MachineRunCommandsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *MachineRunCommandsClient) getCreateRequest(ctx context.Context, resourceGroupName string, machineName string, runCommandName string, options *MachineRunCommandsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if machineName == "" { - return nil, errors.New("parameter machineName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *MachineRunCommandsClient) getHandleResponse(resp *http.Response) (MachineRunCommandsClientGetResponse, error) { - result := MachineRunCommandsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MachineRunCommand); err != nil { - return MachineRunCommandsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - The operation to get all the run commands of a non-Azure machine. -// -// Generated from API version 2024-05-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - machineName - The name of the hybrid machine. -// - options - MachineRunCommandsClientListOptions contains the optional parameters for the MachineRunCommandsClient.NewListPager -// method. -func (client *MachineRunCommandsClient) NewListPager(resourceGroupName string, machineName string, options *MachineRunCommandsClientListOptions) *runtime.Pager[MachineRunCommandsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[MachineRunCommandsClientListResponse]{ - More: func(page MachineRunCommandsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *MachineRunCommandsClientListResponse) (MachineRunCommandsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MachineRunCommandsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, machineName, options) - }, nil) - if err != nil { - return MachineRunCommandsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *MachineRunCommandsClient) listCreateRequest(ctx context.Context, resourceGroupName string, machineName string, options *MachineRunCommandsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if machineName == "" { - return nil, errors.New("parameter machineName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *MachineRunCommandsClient) listHandleResponse(resp *http.Response) (MachineRunCommandsClientListResponse, error) { - result := MachineRunCommandsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MachineRunCommandsListResult); err != nil { - return MachineRunCommandsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineruncommands_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/machineruncommands_client_example_test.go deleted file mode 100644 index 229f72a863f7..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/machineruncommands_client_example_test.go +++ /dev/null @@ -1,262 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "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/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/runCommand/RunCommands_CreateOrUpdate.json -func ExampleMachineRunCommandsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMachineRunCommandsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myMachine", "myRunCommand", armhybridcompute.MachineRunCommand{ - Location: to.Ptr("eastus2"), - Properties: &armhybridcompute.MachineRunCommandProperties{ - AsyncExecution: to.Ptr(false), - ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - Parameters: []*armhybridcompute.RunCommandInputParameter{ - { - Name: to.Ptr("param1"), - Value: to.Ptr("value1"), - }, - { - Name: to.Ptr("param2"), - Value: to.Ptr("value2"), - }}, - RunAsPassword: to.Ptr(""), - RunAsUser: to.Ptr("user1"), - Source: &armhybridcompute.MachineRunCommandScriptSource{ - Script: to.Ptr("Write-Host Hello World!"), - }, - TimeoutInSeconds: to.Ptr[int32](3600), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MachineRunCommand = armhybridcompute.MachineRunCommand{ - // Name: to.Ptr("myRunCommand"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/runcommands"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/runcommands/myRunCommand"), - // Location: to.Ptr("eastus2"), - // Properties: &armhybridcompute.MachineRunCommandProperties{ - // AsyncExecution: to.Ptr(false), - // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // Parameters: []*armhybridcompute.RunCommandInputParameter{ - // { - // Name: to.Ptr("param1"), - // Value: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("param2"), - // Value: to.Ptr("value2"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RunAsUser: to.Ptr("user1"), - // Source: &armhybridcompute.MachineRunCommandScriptSource{ - // Script: to.Ptr("Write-Host Hello World!"), - // }, - // TimeoutInSeconds: to.Ptr[int32](3600), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/runCommand/RunCommands_Delete.json -func ExampleMachineRunCommandsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMachineRunCommandsClient().BeginDelete(ctx, "myResourceGroup", "myMachine", "myRunCommand", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/runCommand/RunCommands_Get.json -func ExampleMachineRunCommandsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMachineRunCommandsClient().Get(ctx, "myResourceGroup", "myMachine", "myRunCommand", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MachineRunCommand = armhybridcompute.MachineRunCommand{ - // Name: to.Ptr("myRunCommand"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/runcommands"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/runcommands/myRunCommand"), - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armhybridcompute.MachineRunCommandProperties{ - // AsyncExecution: to.Ptr(false), - // InstanceView: &armhybridcompute.MachineRunCommandInstanceView{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-15T20:48:41.464Z"); return t}()), - // Error: to.Ptr(""), - // ExecutionMessage: to.Ptr(""), - // ExecutionState: to.Ptr(armhybridcompute.ExecutionStateSucceeded), - // ExitCode: to.Ptr[int32](0), - // Output: to.Ptr("Hello World"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-15T20:48:41.464Z"); return t}()), - // }, - // Parameters: []*armhybridcompute.RunCommandInputParameter{ - // { - // Name: to.Ptr("param1"), - // Value: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("param2"), - // Value: to.Ptr("value2"), - // }}, - // ProtectedParameters: []*armhybridcompute.RunCommandInputParameter{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // RunAsUser: to.Ptr("user1"), - // Source: &armhybridcompute.MachineRunCommandScriptSource{ - // Script: to.Ptr("Write-Host Hello World!"), - // }, - // TimeoutInSeconds: to.Ptr[int32](3600), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/runCommand/RunCommands_List.json -func ExampleMachineRunCommandsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMachineRunCommandsClient().NewListPager("myResourceGroup", "myMachine", &armhybridcompute.MachineRunCommandsClientListOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MachineRunCommandsListResult = armhybridcompute.MachineRunCommandsListResult{ - // Value: []*armhybridcompute.MachineRunCommand{ - // { - // Name: to.Ptr("myRunCommand_1"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/runcommands"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/runcommands/myRunCommand_1"), - // Location: to.Ptr("eastus2"), - // Properties: &armhybridcompute.MachineRunCommandProperties{ - // AsyncExecution: to.Ptr(false), - // InstanceView: &armhybridcompute.MachineRunCommandInstanceView{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-15T20:48:41.464Z"); return t}()), - // Error: to.Ptr(""), - // ExecutionMessage: to.Ptr(""), - // ExecutionState: to.Ptr(armhybridcompute.ExecutionStateSucceeded), - // ExitCode: to.Ptr[int32](0), - // Output: to.Ptr("Hello World"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-15T20:48:41.464Z"); return t}()), - // }, - // Parameters: []*armhybridcompute.RunCommandInputParameter{ - // { - // Name: to.Ptr("param1"), - // Value: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("param2"), - // Value: to.Ptr("value2"), - // }}, - // ProtectedParameters: []*armhybridcompute.RunCommandInputParameter{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // RunAsUser: to.Ptr("user1"), - // Source: &armhybridcompute.MachineRunCommandScriptSource{ - // Script: to.Ptr("Write-Host Hello World!"), - // }, - // TimeoutInSeconds: to.Ptr[int32](3600), - // }, - // }, - // { - // Name: to.Ptr("myRunCommand_2"), - // Type: to.Ptr("Microsoft.HybridCompute/machines/runcommands"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Machines/myMachine/runcommands/myRunCommand_2"), - // Location: to.Ptr("eastus2"), - // Properties: &armhybridcompute.MachineRunCommandProperties{ - // AsyncExecution: to.Ptr(false), - // InstanceView: &armhybridcompute.MachineRunCommandInstanceView{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-15T20:48:41.464Z"); return t}()), - // Error: to.Ptr(""), - // ExecutionMessage: to.Ptr(""), - // ExecutionState: to.Ptr(armhybridcompute.ExecutionStateSucceeded), - // ExitCode: to.Ptr[int32](0), - // Output: to.Ptr(""), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-15T20:48:41.464Z"); return t}()), - // }, - // Parameters: []*armhybridcompute.RunCommandInputParameter{ - // }, - // ProtectedParameters: []*armhybridcompute.RunCommandInputParameter{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // RunAsUser: to.Ptr("userA"), - // Source: &armhybridcompute.MachineRunCommandScriptSource{ - // Script: to.Ptr("Get-Process | Where-Object { $_.CPU -gt 10000 }"), - // }, - // TimeoutInSeconds: to.Ptr[int32](100), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client.go index 5c9ebe67b23b..9a14d6ab2e41 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client.go @@ -46,7 +46,7 @@ func NewMachinesClient(subscriptionID string, credential azcore.TokenCredential, // BeginAssessPatches - The operation to assess patches on a hybrid machine identity in Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. // - name - The name of the hybrid machine. // - options - MachinesClientBeginAssessPatchesOptions contains the optional parameters for the MachinesClient.BeginAssessPatches @@ -72,7 +72,7 @@ func (client *MachinesClient) BeginAssessPatches(ctx context.Context, resourceGr // AssessPatches - The operation to assess patches on a hybrid machine identity in Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *MachinesClient) assessPatches(ctx context.Context, resourceGroupName string, name string, options *MachinesClientBeginAssessPatchesOptions) (*http.Response, error) { var err error const operationName = "MachinesClient.BeginAssessPatches" @@ -114,7 +114,7 @@ func (client *MachinesClient) assessPatchesCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,7 +124,7 @@ func (client *MachinesClient) assessPatchesCreateRequest(ctx context.Context, re // machine creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the hybrid machine. // - parameters - Parameters supplied to the Create hybrid machine operation. @@ -174,7 +174,7 @@ func (client *MachinesClient) createOrUpdateCreateRequest(ctx context.Context, r if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -195,7 +195,7 @@ func (client *MachinesClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - The operation to delete a hybrid machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the hybrid machine. // - options - MachinesClientDeleteOptions contains the optional parameters for the MachinesClient.Delete method. @@ -240,7 +240,7 @@ func (client *MachinesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *MachinesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Retrieves information about the model view or the instance view of a hybrid machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the hybrid machine. // - options - MachinesClientGetOptions contains the optional parameters for the MachinesClient.Get method. @@ -296,9 +296,9 @@ func (client *MachinesClient) getCreateRequest(ctx context.Context, resourceGrou } reqQP := req.Raw().URL.Query() if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) + reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,7 +316,7 @@ func (client *MachinesClient) getHandleResponse(resp *http.Response) (MachinesCl // BeginInstallPatches - The operation to install patches on a hybrid machine identity in Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. // - name - The name of the hybrid machine. // - installPatchesInput - Input for InstallPatches as directly received by the API @@ -343,7 +343,7 @@ func (client *MachinesClient) BeginInstallPatches(ctx context.Context, resourceG // InstallPatches - The operation to install patches on a hybrid machine identity in Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *MachinesClient) installPatches(ctx context.Context, resourceGroupName string, name string, installPatchesInput MachineInstallPatchesParameters, options *MachinesClientBeginInstallPatchesOptions) (*http.Response, error) { var err error const operationName = "MachinesClient.BeginInstallPatches" @@ -385,7 +385,7 @@ func (client *MachinesClient) installPatchesCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, installPatchesInput); err != nil { @@ -397,7 +397,7 @@ func (client *MachinesClient) installPatchesCreateRequest(ctx context.Context, r // NewListByResourceGroupPager - Lists all the hybrid machines in the specified resource group. Use the nextLink property // in the response to get the next page of hybrid machines. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - MachinesClientListByResourceGroupOptions contains the optional parameters for the MachinesClient.NewListByResourceGroupPager // method. @@ -443,7 +443,7 @@ func (client *MachinesClient) listByResourceGroupCreateRequest(ctx context.Conte if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -461,7 +461,7 @@ func (client *MachinesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Lists all the hybrid machines in the specified subscription. Use the nextLink property in // the response to get the next page of hybrid machines. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - options - MachinesClientListBySubscriptionOptions contains the optional parameters for the MachinesClient.NewListBySubscriptionPager // method. func (client *MachinesClient) NewListBySubscriptionPager(options *MachinesClientListBySubscriptionOptions) *runtime.Pager[MachinesClientListBySubscriptionResponse] { @@ -499,7 +499,7 @@ func (client *MachinesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -517,7 +517,7 @@ func (client *MachinesClient) listBySubscriptionHandleResponse(resp *http.Respon // Update - The operation to update a hybrid machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the hybrid machine. // - parameters - Parameters supplied to the Update hybrid machine operation. @@ -564,7 +564,7 @@ func (client *MachinesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client_example_test.go deleted file mode 100644 index 9adcee2c4eb1..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/machines_client_example_test.go +++ /dev/null @@ -1,1122 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_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/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_CreateOrUpdate.json -func ExampleMachinesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMachinesClient().CreateOrUpdate(ctx, "myResourceGroup", "myMachine", armhybridcompute.Machine{ - Location: to.Ptr("eastus2euap"), - Identity: &armhybridcompute.Identity{ - Type: to.Ptr("SystemAssigned"), - }, - Properties: &armhybridcompute.MachineProperties{ - ClientPublicKey: to.Ptr("string"), - LocationData: &armhybridcompute.LocationData{ - Name: to.Ptr("Redmond"), - }, - OSProfile: &armhybridcompute.OSProfile{ - WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - PatchSettings: &armhybridcompute.PatchSettings{ - EnableHotpatching: to.Ptr(true), - }, - }, - }, - ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - }, - }, &armhybridcompute.MachinesClientCreateOrUpdateOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Machine = armhybridcompute.Machine{ - // Name: to.Ptr("myMachine"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine"), - // Location: to.Ptr("eastus2euap"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("string"), - // TenantID: to.Ptr("string"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Virtual Machine"), - // }, - // LicenseProfile: &armhybridcompute.LicenseProfileMachineInstanceView{ - // EsuProfile: &armhybridcompute.LicenseProfileMachineInstanceViewEsuProperties{ - // EsuKeys: []*armhybridcompute.EsuKey{ - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber1"), - // }, - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber2"), - // }}, - // EsuEligibility: to.Ptr(armhybridcompute.EsuEligibilityIneligible), - // EsuKeyState: to.Ptr(armhybridcompute.EsuKeyStateInactive), - // ServerType: to.Ptr(armhybridcompute.EsuServerTypeStandard), - // LicenseAssignmentState: to.Ptr(armhybridcompute.LicenseAssignmentStateAssigned), - // }, - // LicenseChannel: to.Ptr("PSG"), - // LicenseStatus: to.Ptr(armhybridcompute.LicenseStatusLicensed), - // ProductProfile: &armhybridcompute.LicenseProfileArmProductProfileProperties{ - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // ProductFeatures: []*armhybridcompute.ProductFeature{ - // { - // Name: to.Ptr("Hotpatch"), - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }}, - // ProductType: to.Ptr(armhybridcompute.LicenseProfileProductTypeWindowsServer), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }, - // SoftwareAssurance: &armhybridcompute.LicenseProfileMachineInstanceViewSoftwareAssurance{ - // SoftwareAssuranceCustomer: to.Ptr(true), - // }, - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // City: to.Ptr("redmond"), - // CountryOrRegion: to.Ptr("usa"), - // }, - // MssqlDiscovered: to.Ptr("false"), - // OSEdition: to.Ptr("Standard"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // EnableHotpatching: to.Ptr(true), - // Status: &armhybridcompute.PatchSettingsStatus{ - // HotpatchEnablementStatus: to.Ptr(armhybridcompute.HotpatchEnablementStatusPendingEvaluation), - // }, - // }, - // }, - // }, - // ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Update.json -func ExampleMachinesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMachinesClient().Update(ctx, "myResourceGroup", "myMachine", armhybridcompute.MachineUpdate{ - Identity: &armhybridcompute.Identity{ - Type: to.Ptr("SystemAssigned"), - }, - Properties: &armhybridcompute.MachineUpdateProperties{ - LocationData: &armhybridcompute.LocationData{ - Name: to.Ptr("Redmond"), - }, - OSProfile: &armhybridcompute.OSProfile{ - LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - PatchSettings: &armhybridcompute.PatchSettings{ - AssessmentMode: to.Ptr(armhybridcompute.AssessmentModeTypesImageDefault), - PatchMode: to.Ptr(armhybridcompute.PatchModeTypesManual), - }, - }, - WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - PatchSettings: &armhybridcompute.PatchSettings{ - AssessmentMode: to.Ptr(armhybridcompute.AssessmentModeTypesImageDefault), - EnableHotpatching: to.Ptr(true), - PatchMode: to.Ptr(armhybridcompute.PatchModeTypesAutomaticByPlatform), - }, - }, - }, - ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Machine = armhybridcompute.Machine{ - // Name: to.Ptr("myMachine"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine"), - // Location: to.Ptr("eastus2euap"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("string"), - // TenantID: to.Ptr("string"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // ClientPublicKey: to.Ptr("string"), - // LicenseProfile: &armhybridcompute.LicenseProfileMachineInstanceView{ - // EsuProfile: &armhybridcompute.LicenseProfileMachineInstanceViewEsuProperties{ - // EsuKeys: []*armhybridcompute.EsuKey{ - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber1"), - // }, - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber2"), - // }}, - // EsuEligibility: to.Ptr(armhybridcompute.EsuEligibilityIneligible), - // EsuKeyState: to.Ptr(armhybridcompute.EsuKeyStateInactive), - // ServerType: to.Ptr(armhybridcompute.EsuServerTypeStandard), - // LicenseAssignmentState: to.Ptr(armhybridcompute.LicenseAssignmentStateAssigned), - // }, - // LicenseChannel: to.Ptr("PSG"), - // LicenseStatus: to.Ptr(armhybridcompute.LicenseStatusLicensed), - // ProductProfile: &armhybridcompute.LicenseProfileArmProductProfileProperties{ - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // ProductFeatures: []*armhybridcompute.ProductFeature{ - // { - // Name: to.Ptr("Hotpatch"), - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }}, - // ProductType: to.Ptr(armhybridcompute.LicenseProfileProductTypeWindowsServer), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }, - // SoftwareAssurance: &armhybridcompute.LicenseProfileMachineInstanceViewSoftwareAssurance{ - // SoftwareAssuranceCustomer: to.Ptr(true), - // }, - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // }, - // OSEdition: to.Ptr("Standard"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // AssessmentMode: to.Ptr(armhybridcompute.AssessmentModeTypesImageDefault), - // PatchMode: to.Ptr(armhybridcompute.PatchModeTypesManual), - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // AssessmentMode: to.Ptr(armhybridcompute.AssessmentModeTypesImageDefault), - // EnableHotpatching: to.Ptr(true), - // PatchMode: to.Ptr(armhybridcompute.PatchModeTypesAutomaticByPlatform), - // Status: &armhybridcompute.PatchSettingsStatus{ - // HotpatchEnablementStatus: to.Ptr(armhybridcompute.HotpatchEnablementStatusPendingEvaluation), - // }, - // }, - // }, - // }, - // ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Delete.json -func ExampleMachinesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewMachinesClient().Delete(ctx, "myResourceGroup", "myMachine", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Get.json -func ExampleMachinesClient_Get_getMachine() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMachinesClient().Get(ctx, "myResourceGroup", "myMachine", &armhybridcompute.MachinesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Machine = armhybridcompute.Machine{ - // Name: to.Ptr("myMachine"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine"), - // Location: to.Ptr("eastus2euap"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("string"), - // TenantID: to.Ptr("string"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // AgentConfiguration: &armhybridcompute.AgentConfiguration{ - // ConfigMode: to.Ptr(armhybridcompute.AgentConfigurationModeFull), - // ExtensionsEnabled: to.Ptr("true"), - // GuestConfigurationEnabled: to.Ptr("true"), - // IncomingConnectionsPorts: []*string{ - // to.Ptr("22"), - // to.Ptr("23")}, - // ProxyBypass: []*string{ - // to.Ptr("proxy1"), - // to.Ptr("proxy2")}, - // ProxyURL: to.Ptr("https://test.test"), - // }, - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Virtual Machine"), - // }, - // LicenseProfile: &armhybridcompute.LicenseProfileMachineInstanceView{ - // EsuProfile: &armhybridcompute.LicenseProfileMachineInstanceViewEsuProperties{ - // EsuKeys: []*armhybridcompute.EsuKey{ - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber1"), - // }, - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber2"), - // }}, - // EsuEligibility: to.Ptr(armhybridcompute.EsuEligibilityIneligible), - // EsuKeyState: to.Ptr(armhybridcompute.EsuKeyStateInactive), - // ServerType: to.Ptr(armhybridcompute.EsuServerTypeStandard), - // LicenseAssignmentState: to.Ptr(armhybridcompute.LicenseAssignmentStateAssigned), - // }, - // LicenseChannel: to.Ptr("PSG"), - // LicenseStatus: to.Ptr(armhybridcompute.LicenseStatusLicensed), - // ProductProfile: &armhybridcompute.LicenseProfileArmProductProfileProperties{ - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // ProductFeatures: []*armhybridcompute.ProductFeature{ - // { - // Name: to.Ptr("Hotpatch"), - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }}, - // ProductType: to.Ptr(armhybridcompute.LicenseProfileProductTypeWindowsServer), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }, - // SoftwareAssurance: &armhybridcompute.LicenseProfileMachineInstanceViewSoftwareAssurance{ - // SoftwareAssuranceCustomer: to.Ptr(true), - // }, - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // City: to.Ptr("redmond"), - // CountryOrRegion: to.Ptr("usa"), - // }, - // MssqlDiscovered: to.Ptr("false"), - // NetworkProfile: &armhybridcompute.NetworkProfile{ - // NetworkInterfaces: []*armhybridcompute.NetworkInterface{ - // { - // IPAddresses: []*armhybridcompute.IPAddress{ - // { - // Address: to.Ptr("192.168.12.345"), - // IPAddressVersion: to.Ptr("IPv4"), - // Subnet: &armhybridcompute.Subnet{ - // AddressPrefix: to.Ptr("192.168.12.0/24"), - // }, - // }}, - // }, - // { - // IPAddresses: []*armhybridcompute.IPAddress{ - // { - // Address: to.Ptr("1001:0:34aa:5000:1234:aaaa:bbbb:cccc"), - // IPAddressVersion: to.Ptr("IPv6"), - // Subnet: &armhybridcompute.Subnet{ - // AddressPrefix: to.Ptr("1001:0:34aa:5000::/64"), - // }, - // }}, - // }}, - // }, - // OSEdition: to.Ptr("Standard"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // EnableHotpatching: to.Ptr(true), - // Status: &armhybridcompute.PatchSettingsStatus{ - // HotpatchEnablementStatus: to.Ptr(armhybridcompute.HotpatchEnablementStatusEnabled), - // }, - // }, - // }, - // }, - // ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceStatuses: &armhybridcompute.ServiceStatuses{ - // ExtensionService: &armhybridcompute.ServiceStatus{ - // StartupType: to.Ptr("Automatic"), - // Status: to.Ptr("Running"), - // }, - // GuestConfigurationService: &armhybridcompute.ServiceStatus{ - // StartupType: to.Ptr("Automatic"), - // Status: to.Ptr("Running"), - // }, - // }, - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // Resources: []*armhybridcompute.MachineExtension{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json -func ExampleMachinesClient_Get_getMachineWithLicenseProfileInstanceView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMachinesClient().Get(ctx, "myResourceGroup", "myMachine", &armhybridcompute.MachinesClientGetOptions{Expand: to.Ptr("instanceView")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Machine = armhybridcompute.Machine{ - // Name: to.Ptr("myMachine"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine"), - // Location: to.Ptr("eastus2euap"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("string"), - // TenantID: to.Ptr("string"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // AgentConfiguration: &armhybridcompute.AgentConfiguration{ - // ConfigMode: to.Ptr(armhybridcompute.AgentConfigurationModeFull), - // ExtensionsEnabled: to.Ptr("true"), - // GuestConfigurationEnabled: to.Ptr("true"), - // IncomingConnectionsPorts: []*string{ - // to.Ptr("22"), - // to.Ptr("23")}, - // ProxyBypass: []*string{ - // to.Ptr("proxy1"), - // to.Ptr("proxy2")}, - // ProxyURL: to.Ptr("https://test.test"), - // }, - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Virtual Machine"), - // }, - // LicenseProfile: &armhybridcompute.LicenseProfileMachineInstanceView{ - // EsuProfile: &armhybridcompute.LicenseProfileMachineInstanceViewEsuProperties{ - // EsuKeys: []*armhybridcompute.EsuKey{ - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber1"), - // }, - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber2"), - // }}, - // EsuEligibility: to.Ptr(armhybridcompute.EsuEligibilityIneligible), - // EsuKeyState: to.Ptr(armhybridcompute.EsuKeyStateInactive), - // ServerType: to.Ptr(armhybridcompute.EsuServerTypeStandard), - // AssignedLicense: &armhybridcompute.License{ - // Name: to.Ptr("{licenseName}"), - // Type: to.Ptr("Microsoft.HybridCompute/licenses"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/Licenses/{licenseName}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armhybridcompute.LicenseProperties{ - // LicenseDetails: &armhybridcompute.LicenseDetails{ - // Type: to.Ptr(armhybridcompute.LicenseCoreTypePCore), - // AssignedLicenses: to.Ptr[int32](8), - // Edition: to.Ptr(armhybridcompute.LicenseEditionDatacenter), - // ImmutableID: to.Ptr(""), - // Processors: to.Ptr[int32](6), - // State: to.Ptr(armhybridcompute.LicenseStateActivated), - // Target: to.Ptr(armhybridcompute.LicenseTargetWindowsServer2012), - // }, - // LicenseType: to.Ptr(armhybridcompute.LicenseTypeESU), - // TenantID: to.Ptr("{tenandId}"), - // }, - // }, - // LicenseAssignmentState: to.Ptr(armhybridcompute.LicenseAssignmentStateAssigned), - // }, - // LicenseChannel: to.Ptr("PSG"), - // LicenseStatus: to.Ptr(armhybridcompute.LicenseStatusLicensed), - // ProductProfile: &armhybridcompute.LicenseProfileArmProductProfileProperties{ - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // ProductFeatures: []*armhybridcompute.ProductFeature{ - // { - // Name: to.Ptr("Hotpatch"), - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }}, - // ProductType: to.Ptr(armhybridcompute.LicenseProfileProductTypeWindowsServer), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }, - // SoftwareAssurance: &armhybridcompute.LicenseProfileMachineInstanceViewSoftwareAssurance{ - // SoftwareAssuranceCustomer: to.Ptr(true), - // }, - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // City: to.Ptr("redmond"), - // CountryOrRegion: to.Ptr("usa"), - // }, - // MssqlDiscovered: to.Ptr("false"), - // NetworkProfile: &armhybridcompute.NetworkProfile{ - // NetworkInterfaces: []*armhybridcompute.NetworkInterface{ - // { - // IPAddresses: []*armhybridcompute.IPAddress{ - // { - // Address: to.Ptr("192.168.12.345"), - // IPAddressVersion: to.Ptr("IPv4"), - // Subnet: &armhybridcompute.Subnet{ - // AddressPrefix: to.Ptr("192.168.12.0/24"), - // }, - // }}, - // }, - // { - // IPAddresses: []*armhybridcompute.IPAddress{ - // { - // Address: to.Ptr("1001:0:34aa:5000:1234:aaaa:bbbb:cccc"), - // IPAddressVersion: to.Ptr("IPv6"), - // Subnet: &armhybridcompute.Subnet{ - // AddressPrefix: to.Ptr("1001:0:34aa:5000::/64"), - // }, - // }}, - // }}, - // }, - // OSEdition: to.Ptr("Standard"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // EnableHotpatching: to.Ptr(true), - // Status: &armhybridcompute.PatchSettingsStatus{ - // HotpatchEnablementStatus: to.Ptr(armhybridcompute.HotpatchEnablementStatusEnabled), - // }, - // }, - // }, - // }, - // ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceStatuses: &armhybridcompute.ServiceStatuses{ - // ExtensionService: &armhybridcompute.ServiceStatus{ - // StartupType: to.Ptr("Automatic"), - // Status: to.Ptr("Running"), - // }, - // GuestConfigurationService: &armhybridcompute.ServiceStatus{ - // StartupType: to.Ptr("Automatic"), - // Status: to.Ptr("Running"), - // }, - // }, - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // Resources: []*armhybridcompute.MachineExtension{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machine_AssessPatches.json -func ExampleMachinesClient_BeginAssessPatches() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMachinesClient().BeginAssessPatches(ctx, "myResourceGroupName", "myMachineName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MachineAssessPatchesResult = armhybridcompute.MachineAssessPatchesResult{ - // AssessmentActivityID: to.Ptr("68f8b292-dfc2-4646-9781-33cc88631968"), - // AvailablePatchCountByClassification: &armhybridcompute.AvailablePatchCountByClassification{ - // Critical: to.Ptr[int32](0), - // Definition: to.Ptr[int32](0), - // FeaturePack: to.Ptr[int32](0), - // Security: to.Ptr[int32](0), - // ServicePack: to.Ptr[int32](0), - // Tools: to.Ptr[int32](0), - // UpdateRollup: to.Ptr[int32](1), - // Updates: to.Ptr[int32](1), - // }, - // LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-22T02:16:06.974Z"); return t}()), - // OSType: to.Ptr(armhybridcompute.OsTypeWindows), - // RebootPending: to.Ptr(true), - // StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-22T02:15:20.934Z"); return t}()), - // StartedBy: to.Ptr(armhybridcompute.PatchOperationStartedByUser), - // Status: to.Ptr(armhybridcompute.PatchOperationStatusSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machine_InstallPatches.json -func ExampleMachinesClient_BeginInstallPatches() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMachinesClient().BeginInstallPatches(ctx, "myResourceGroupName", "myMachineName", armhybridcompute.MachineInstallPatchesParameters{ - MaximumDuration: to.Ptr("PT4H"), - RebootSetting: to.Ptr(armhybridcompute.VMGuestPatchRebootSettingIfRequired), - WindowsParameters: &armhybridcompute.WindowsParameters{ - ClassificationsToInclude: []*armhybridcompute.VMGuestPatchClassificationWindows{ - to.Ptr(armhybridcompute.VMGuestPatchClassificationWindowsCritical), - to.Ptr(armhybridcompute.VMGuestPatchClassificationWindowsSecurity)}, - MaxPatchPublishDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T02:36:43.053Z"); return t }()), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MachineInstallPatchesResult = armhybridcompute.MachineInstallPatchesResult{ - // ExcludedPatchCount: to.Ptr[int32](0), - // FailedPatchCount: to.Ptr[int32](0), - // InstallationActivityID: to.Ptr("68f8b292-dfc2-4646-9781-33cc88631968"), - // InstalledPatchCount: to.Ptr[int32](3), - // LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-22T02:16:06.974Z"); return t}()), - // MaintenanceWindowExceeded: to.Ptr(false), - // NotSelectedPatchCount: to.Ptr[int32](0), - // OSType: to.Ptr(armhybridcompute.OsTypeWindows), - // PendingPatchCount: to.Ptr[int32](2), - // RebootStatus: to.Ptr(armhybridcompute.VMGuestPatchRebootStatusCompleted), - // StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-22T02:15:06.974Z"); return t}()), - // StartedBy: to.Ptr(armhybridcompute.PatchOperationStartedByUser), - // Status: to.Ptr(armhybridcompute.PatchOperationStatusSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_ListByResourceGroup.json -func ExampleMachinesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMachinesClient().NewListByResourceGroupPager("myResourceGroup", &armhybridcompute.MachinesClientListByResourceGroupOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MachineListResult = armhybridcompute.MachineListResult{ - // Value: []*armhybridcompute.Machine{ - // { - // Name: to.Ptr("myMachine"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine"), - // Location: to.Ptr("eastus2euap"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("f7a068cc-b0b8-46e8-a203-22f301a62a8f"), - // TenantID: to.Ptr("c4098cc-91b8-46c2-a205-d82ab1a62a8f"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // AgentConfiguration: &armhybridcompute.AgentConfiguration{ - // ConfigMode: to.Ptr(armhybridcompute.AgentConfigurationModeFull), - // ExtensionsEnabled: to.Ptr("true"), - // GuestConfigurationEnabled: to.Ptr("true"), - // IncomingConnectionsPorts: []*string{ - // to.Ptr("22"), - // to.Ptr("23")}, - // ProxyBypass: []*string{ - // to.Ptr("proxy1"), - // to.Ptr("proxy2")}, - // ProxyURL: to.Ptr("https://test.test"), - // }, - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Virtual Machine"), - // }, - // LicenseProfile: &armhybridcompute.LicenseProfileMachineInstanceView{ - // EsuProfile: &armhybridcompute.LicenseProfileMachineInstanceViewEsuProperties{ - // EsuKeys: []*armhybridcompute.EsuKey{ - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber1"), - // }, - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber2"), - // }}, - // EsuEligibility: to.Ptr(armhybridcompute.EsuEligibilityIneligible), - // EsuKeyState: to.Ptr(armhybridcompute.EsuKeyStateInactive), - // ServerType: to.Ptr(armhybridcompute.EsuServerTypeStandard), - // LicenseAssignmentState: to.Ptr(armhybridcompute.LicenseAssignmentStateAssigned), - // }, - // LicenseChannel: to.Ptr("PSG"), - // LicenseStatus: to.Ptr(armhybridcompute.LicenseStatusLicensed), - // ProductProfile: &armhybridcompute.LicenseProfileArmProductProfileProperties{ - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // ProductFeatures: []*armhybridcompute.ProductFeature{ - // { - // Name: to.Ptr("Hotpatch"), - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }}, - // ProductType: to.Ptr(armhybridcompute.LicenseProfileProductTypeWindowsServer), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }, - // SoftwareAssurance: &armhybridcompute.LicenseProfileMachineInstanceViewSoftwareAssurance{ - // SoftwareAssuranceCustomer: to.Ptr(true), - // }, - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // }, - // MssqlDiscovered: to.Ptr("false"), - // OSEdition: to.Ptr("Standard"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // EnableHotpatching: to.Ptr(true), - // Status: &armhybridcompute.PatchSettingsStatus{ - // HotpatchEnablementStatus: to.Ptr(armhybridcompute.HotpatchEnablementStatusEnabled), - // }, - // }, - // }, - // }, - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // }, - // { - // Name: to.Ptr("myMachine2"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine2"), - // Location: to.Ptr("westus2"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("e7a068cc-b0b8-46e8-a203-22f301a62a8f"), - // TenantID: to.Ptr("c4098cc-91b8-46c2-a205-d82ab1a62a8f"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // AgentConfiguration: &armhybridcompute.AgentConfiguration{ - // ConfigMode: to.Ptr(armhybridcompute.AgentConfigurationModeFull), - // ExtensionsEnabled: to.Ptr("true"), - // GuestConfigurationEnabled: to.Ptr("true"), - // IncomingConnectionsPorts: []*string{ - // to.Ptr("22"), - // to.Ptr("23")}, - // ProxyBypass: []*string{ - // to.Ptr("proxy1"), - // to.Ptr("proxy2")}, - // ProxyURL: to.Ptr("https://test.test"), - // }, - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Surfacebook"), - // }, - // LicenseProfile: &armhybridcompute.LicenseProfileMachineInstanceView{ - // EsuProfile: &armhybridcompute.LicenseProfileMachineInstanceViewEsuProperties{ - // EsuKeys: []*armhybridcompute.EsuKey{ - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber1"), - // }, - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber2"), - // }}, - // EsuEligibility: to.Ptr(armhybridcompute.EsuEligibilityIneligible), - // EsuKeyState: to.Ptr(armhybridcompute.EsuKeyStateInactive), - // ServerType: to.Ptr(armhybridcompute.EsuServerTypeStandard), - // LicenseAssignmentState: to.Ptr(armhybridcompute.LicenseAssignmentStateAssigned), - // }, - // LicenseChannel: to.Ptr("PSG"), - // LicenseStatus: to.Ptr(armhybridcompute.LicenseStatusLicensed), - // ProductProfile: &armhybridcompute.LicenseProfileArmProductProfileProperties{ - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // ProductFeatures: []*armhybridcompute.ProductFeature{ - // { - // Name: to.Ptr("Hotpatch"), - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }}, - // ProductType: to.Ptr(armhybridcompute.LicenseProfileProductTypeWindowsServer), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }, - // SoftwareAssurance: &armhybridcompute.LicenseProfileMachineInstanceViewSoftwareAssurance{ - // SoftwareAssuranceCustomer: to.Ptr(true), - // }, - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // }, - // MssqlDiscovered: to.Ptr("true"), - // OSEdition: to.Ptr("Standard"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // EnableHotpatching: to.Ptr(true), - // Status: &armhybridcompute.PatchSettingsStatus{ - // HotpatchEnablementStatus: to.Ptr(armhybridcompute.HotpatchEnablementStatusEnabled), - // }, - // }, - // }, - // }, - // ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // VMID: to.Ptr("a4a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_ListBySubscription.json -func ExampleMachinesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMachinesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MachineListResult = armhybridcompute.MachineListResult{ - // Value: []*armhybridcompute.Machine{ - // { - // Name: to.Ptr("myMachine"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myMachine"), - // Location: to.Ptr("eastus2euap"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("string"), - // TenantID: to.Ptr("string"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // AgentConfiguration: &armhybridcompute.AgentConfiguration{ - // ConfigMode: to.Ptr(armhybridcompute.AgentConfigurationModeFull), - // ExtensionsEnabled: to.Ptr("true"), - // GuestConfigurationEnabled: to.Ptr("true"), - // IncomingConnectionsPorts: []*string{ - // to.Ptr("22"), - // to.Ptr("23")}, - // ProxyBypass: []*string{ - // to.Ptr("proxy1"), - // to.Ptr("proxy2")}, - // ProxyURL: to.Ptr("https://test.test"), - // }, - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Virtual Machine"), - // }, - // LicenseProfile: &armhybridcompute.LicenseProfileMachineInstanceView{ - // EsuProfile: &armhybridcompute.LicenseProfileMachineInstanceViewEsuProperties{ - // EsuKeys: []*armhybridcompute.EsuKey{ - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber1"), - // }, - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber2"), - // }}, - // EsuEligibility: to.Ptr(armhybridcompute.EsuEligibilityIneligible), - // EsuKeyState: to.Ptr(armhybridcompute.EsuKeyStateInactive), - // ServerType: to.Ptr(armhybridcompute.EsuServerTypeStandard), - // LicenseAssignmentState: to.Ptr(armhybridcompute.LicenseAssignmentStateAssigned), - // }, - // LicenseChannel: to.Ptr("PSG"), - // LicenseStatus: to.Ptr(armhybridcompute.LicenseStatusLicensed), - // ProductProfile: &armhybridcompute.LicenseProfileArmProductProfileProperties{ - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // ProductFeatures: []*armhybridcompute.ProductFeature{ - // { - // Name: to.Ptr("Hotpatch"), - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }}, - // ProductType: to.Ptr(armhybridcompute.LicenseProfileProductTypeWindowsServer), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }, - // SoftwareAssurance: &armhybridcompute.LicenseProfileMachineInstanceViewSoftwareAssurance{ - // SoftwareAssuranceCustomer: to.Ptr(true), - // }, - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // }, - // MssqlDiscovered: to.Ptr("false"), - // OSEdition: to.Ptr("Standard"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // EnableHotpatching: to.Ptr(true), - // Status: &armhybridcompute.PatchSettingsStatus{ - // HotpatchEnablementStatus: to.Ptr(armhybridcompute.HotpatchEnablementStatusEnabled), - // }, - // }, - // }, - // }, - // PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - // ProvisioningState: to.Ptr("Succeeded"), - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // }, - // { - // Name: to.Ptr("myMachine2"), - // Type: to.Ptr("Microsoft.HybridCompute/machines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup2/providers/Microsoft.HybridCompute/machines/myMachine2"), - // Location: to.Ptr("westus2"), - // Identity: &armhybridcompute.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("e7a068cc-b0b8-46e8-a203-22f301a62a8f"), - // TenantID: to.Ptr("c4098cc-91b8-46c2-a205-d82ab1a62a8f"), - // }, - // Properties: &armhybridcompute.MachineProperties{ - // AgentConfiguration: &armhybridcompute.AgentConfiguration{ - // ConfigMode: to.Ptr(armhybridcompute.AgentConfigurationModeFull), - // ExtensionsEnabled: to.Ptr("true"), - // GuestConfigurationEnabled: to.Ptr("true"), - // IncomingConnectionsPorts: []*string{ - // to.Ptr("22"), - // to.Ptr("23")}, - // ProxyBypass: []*string{ - // to.Ptr("proxy1"), - // to.Ptr("proxy2")}, - // ProxyURL: to.Ptr("https://test.test"), - // }, - // ClientPublicKey: to.Ptr("string"), - // DetectedProperties: map[string]*string{ - // "cloudprovider": to.Ptr("N/A"), - // "manufacturer": to.Ptr("Microsoft Corporation"), - // "model": to.Ptr("Surfacebook"), - // }, - // LicenseProfile: &armhybridcompute.LicenseProfileMachineInstanceView{ - // EsuProfile: &armhybridcompute.LicenseProfileMachineInstanceViewEsuProperties{ - // EsuKeys: []*armhybridcompute.EsuKey{ - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber1"), - // }, - // { - // LicenseStatus: to.Ptr[int32](1), - // SKU: to.Ptr("skuNumber2"), - // }}, - // EsuEligibility: to.Ptr(armhybridcompute.EsuEligibilityIneligible), - // EsuKeyState: to.Ptr(armhybridcompute.EsuKeyStateInactive), - // ServerType: to.Ptr(armhybridcompute.EsuServerTypeStandard), - // LicenseAssignmentState: to.Ptr(armhybridcompute.LicenseAssignmentStateAssigned), - // }, - // LicenseChannel: to.Ptr("PSG"), - // LicenseStatus: to.Ptr(armhybridcompute.LicenseStatusLicensed), - // ProductProfile: &armhybridcompute.LicenseProfileArmProductProfileProperties{ - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // ProductFeatures: []*armhybridcompute.ProductFeature{ - // { - // Name: to.Ptr("Hotpatch"), - // BillingEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // BillingStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // DisenrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-05T20:36:49.745Z"); return t}()), - // EnrollmentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-05T20:36:49.745Z"); return t}()), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }}, - // ProductType: to.Ptr(armhybridcompute.LicenseProfileProductTypeWindowsServer), - // SubscriptionStatus: to.Ptr(armhybridcompute.LicenseProfileSubscriptionStatusEnabled), - // }, - // SoftwareAssurance: &armhybridcompute.LicenseProfileMachineInstanceViewSoftwareAssurance{ - // SoftwareAssuranceCustomer: to.Ptr(true), - // }, - // }, - // LocationData: &armhybridcompute.LocationData{ - // Name: to.Ptr("Redmond"), - // }, - // MssqlDiscovered: to.Ptr("true"), - // OSEdition: to.Ptr("Standard"), - // OSProfile: &armhybridcompute.OSProfile{ - // LinuxConfiguration: &armhybridcompute.OSProfileLinuxConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // }, - // }, - // WindowsConfiguration: &armhybridcompute.OSProfileWindowsConfiguration{ - // PatchSettings: &armhybridcompute.PatchSettings{ - // EnableHotpatching: to.Ptr(true), - // Status: &armhybridcompute.PatchSettingsStatus{ - // HotpatchEnablementStatus: to.Ptr(armhybridcompute.HotpatchEnablementStatusEnabled), - // }, - // }, - // }, - // }, - // ParentClusterResourceID: to.Ptr("{AzureStackHCIResourceId}"), - // ProvisioningState: to.Ptr("Succeeded"), - // VMID: to.Ptr("a4a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client.go index e6a5675be3cd..02df22a6cfaf 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client.go @@ -46,7 +46,7 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // BeginUpgradeExtensions - The operation to Upgrade Machine Extensions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the hybrid machine. // - extensionUpgradeParameters - Parameters supplied to the Upgrade Extensions operation. @@ -72,7 +72,7 @@ func (client *ManagementClient) BeginUpgradeExtensions(ctx context.Context, reso // UpgradeExtensions - The operation to Upgrade Machine Extensions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *ManagementClient) upgradeExtensions(ctx context.Context, resourceGroupName string, machineName string, extensionUpgradeParameters MachineExtensionUpgrade, options *ManagementClientBeginUpgradeExtensionsOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginUpgradeExtensions" @@ -114,7 +114,7 @@ func (client *ManagementClient) upgradeExtensionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, extensionUpgradeParameters); err != nil { diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client_example_test.go deleted file mode 100644 index 366f7809d9e0..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/management_client_example_test.go +++ /dev/null @@ -1,49 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "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/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extensions_Upgrade.json -func ExampleManagementClient_BeginUpgradeExtensions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagementClient().BeginUpgradeExtensions(ctx, "myResourceGroup", "myMachine", armhybridcompute.MachineExtensionUpgrade{ - ExtensionTargets: map[string]*armhybridcompute.ExtensionTargetProperties{ - "Microsoft.Azure.Monitoring": { - TargetVersion: to.Ptr("2.0"), - }, - "Microsoft.Compute.CustomScriptExtension": { - TargetVersion: to.Ptr("1.10"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/models.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/models.go index b16a55bbc0c2..218e2348f05f 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/models.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/models.go @@ -180,6 +180,12 @@ type EsuKey struct { SKU *string } +// EsuProfileUpdateProperties - Describes the Update properties of a ESU License Profile. +type EsuProfileUpdateProperties struct { + // The resource id of the license. + AssignedLicense *string +} + // ExtensionTargetProperties - Describes the Machine Extension Target Version Properties type ExtensionTargetProperties struct { // Properties for the specified Extension to Upgrade. @@ -222,90 +228,6 @@ type ExtensionValueProperties struct { Version *string } -// ExtensionsResourceStatus - Instance view status. -type ExtensionsResourceStatus struct { - // The status code. - Code *string - - // The short localizable label for the status. - DisplayStatus *string - - // The level code. - Level *ExtensionsStatusLevelTypes - - // The detailed status message, including for alerts and error messages. - Message *string - - // The time of the status. - Time *time.Time -} - -// Gateway - Describes an Arc Gateway. -type Gateway struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Hybrid Compute Gateway properties - Properties *GatewayProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// GatewayProperties - Describes the properties of a Gateway Profile. -type GatewayProperties struct { - // Specifies the list of features that are enabled for this Gateway. - AllowedFeatures []*string - - // The type of the Gateway resource. - GatewayType *GatewayType - - // READ-ONLY; The endpoint fqdn for the Gateway. - GatewayEndpoint *string - - // READ-ONLY; A unique, immutable, identifier for the Gateway. - GatewayID *string - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *ProvisioningState -} - -// GatewayUpdate - Describes a License Update. -type GatewayUpdate struct { - // Gateway Update properties - Properties *GatewayUpdateProperties - - // Resource tags - Tags map[string]*string -} - -// GatewayUpdateProperties - Describes the Update properties of a Gateway Profile. -type GatewayUpdateProperties struct { - // Specifies the list of features that are enabled for this Gateway. - AllowedFeatures []*string -} - -// GatewaysListResult - The List license operation response. -type GatewaysListResult struct { - // REQUIRED; The list of Gateways. - Value []*Gateway - - // The URI to fetch the next page of Gateways. Call ListNext() with this URI to fetch the next page of Gateways. - NextLink *string -} - // IPAddress - Describes properties of the IP address. type IPAddress struct { // Represents the IP Address. @@ -381,6 +303,51 @@ type LicenseDetails struct { ImmutableID *string } +// LicenseProfile - Describes a license profile in a hybrid machine. +type LicenseProfile struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Describe the properties of a license profile. + Properties *LicenseProfileProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// LicenseProfileArmEsuProperties - Describes the properties of a License Profile ARM model. +type LicenseProfileArmEsuProperties struct { + // The resource id of the license. + AssignedLicense *string + + // READ-ONLY; The guid id of the license. + AssignedLicenseImmutableID *string + + // READ-ONLY; Indicates the eligibility state of Esu. + EsuEligibility *EsuEligibility + + // READ-ONLY; Indicates whether there is an ESU Key currently active for the machine. + EsuKeyState *EsuKeyState + + // READ-ONLY; The list of ESU keys. + EsuKeys []*EsuKey + + // READ-ONLY; The type of the Esu servers. + ServerType *EsuServerType +} + // LicenseProfileArmProductProfileProperties - Describes the properties of a Product License Profile ARM model. type LicenseProfileArmProductProfileProperties struct { // The list of product features. @@ -455,6 +422,57 @@ type LicenseProfileMachineInstanceViewSoftwareAssurance struct { SoftwareAssuranceCustomer *bool } +// LicenseProfileProperties - Describe the properties of a license profile. +type LicenseProfileProperties struct { + // Hybrid Compute ESU Profile properties + EsuProfile *LicenseProfileArmEsuProperties + + // Hybrid Compute Product Profile properties + ProductProfile *LicenseProfileArmProductProfileProperties + SoftwareAssurance *LicenseProfilePropertiesSoftwareAssurance + + // READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *ProvisioningState +} + +type LicenseProfilePropertiesSoftwareAssurance struct { + // Specifies if this machine is licensed as part of a Software Assurance agreement. + SoftwareAssuranceCustomer *bool +} + +// LicenseProfileUpdate - Describes a License Profile Update. +type LicenseProfileUpdate struct { + // Describe the Update properties of a license profile. + Properties *LicenseProfileUpdateProperties + + // Resource tags + Tags map[string]*string +} + +// LicenseProfileUpdateProperties - Describe the Update properties of a license profile. +type LicenseProfileUpdateProperties struct { + // Hybrid Compute ESU Profile Update properties + EsuProfile *EsuProfileUpdateProperties + + // Hybrid Compute Product Profile Update properties + ProductProfile *ProductProfileUpdateProperties + SoftwareAssurance *LicenseProfileUpdatePropertiesSoftwareAssurance +} + +type LicenseProfileUpdatePropertiesSoftwareAssurance struct { + // Specifies if this machine is licensed as part of a Software Assurance agreement. + SoftwareAssuranceCustomer *bool +} + +// LicenseProfilesListResult - The List hybrid machine license profile operation response. +type LicenseProfilesListResult struct { + // REQUIRED; The list of license profiles. + Value []*LicenseProfile + + // The URI to fetch the next page of Machines. Call ListNext() with this URI to fetch the next page of license profile. + NextLink *string +} + // LicenseProperties - Describes the properties of a License Profile. type LicenseProperties struct { // Describes the properties of a License. @@ -925,139 +943,6 @@ type MachineProperties struct { VMUUID *string } -// MachineRunCommand - Describes a Run Command -type MachineRunCommand struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Describes Run Command Properties - Properties *MachineRunCommandProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// MachineRunCommandInstanceView - The instance view of a machine run command. -type MachineRunCommandInstanceView struct { - // Script end time. - EndTime *time.Time - - // Script error stream. - Error *string - - // Communicate script configuration errors or execution messages. - ExecutionMessage *string - - // Script execution status. - ExecutionState *ExecutionState - - // Exit code returned from script execution. - ExitCode *int32 - - // Script output stream. - Output *string - - // Script start time. - StartTime *time.Time - - // The status information. - Statuses []*ExtensionsResourceStatus -} - -// MachineRunCommandProperties - Describes the properties of a run command. -type MachineRunCommandProperties struct { - // Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - AsyncExecution *bool - - // User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned - // identity. Make sure managed identity has been given access to blob's - // container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it - // under VM's identity. For more info on managed identity and Run Command, refer - // https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged - ErrorBlobManagedIdentity *RunCommandManagedIdentity - - // Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write - // access OR use managed identity to provide the VM access to the blob. Refer - // errorBlobManagedIdentity parameter. - ErrorBlobURI *string - - // User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned - // identity. Make sure managed identity has been given access to blob's - // container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it - // under VM's identity. For more info on managed identity and Run Command, refer - // https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged - OutputBlobManagedIdentity *RunCommandManagedIdentity - - // Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - // write access OR use managed identity to provide the VM access to the blob. Refer - // outputBlobManagedIdentity parameter. - OutputBlobURI *string - - // The parameters used by the script. - Parameters []*RunCommandInputParameter - - // The parameters used by the script. - ProtectedParameters []*RunCommandInputParameter - - // Specifies the user account password on the machine when executing the run command. - RunAsPassword *string - - // Specifies the user account on the machine when executing the run command. - RunAsUser *string - - // The source of the run command script. - Source *MachineRunCommandScriptSource - - // The timeout in seconds to execute the run command. - TimeoutInSeconds *int32 - - // READ-ONLY; The machine run command instance view. - InstanceView *MachineRunCommandInstanceView - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string -} - -// MachineRunCommandScriptSource - Describes the script sources for run command. Use only one of script, scriptUri, commandId. -type MachineRunCommandScriptSource struct { - // Specifies the commandId of predefined built-in script. - CommandID *string - - // Specifies the script content to be executed on the machine. - Script *string - - // Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - ScriptURI *string - - // User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case - // of system-assigned identity. Make sure the Azure storage blob exists, and managed - // identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned - // identity, make sure you add it under VM's identity. For more info on - // managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - ScriptURIManagedIdentity *RunCommandManagedIdentity -} - -// MachineRunCommandsListResult - Describes the Run Commands List Result. -type MachineRunCommandsListResult struct { - // The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. - NextLink *string - - // The list of run commands - Value []*MachineRunCommand -} - // MachineUpdate - Describes a hybrid machine Update. type MachineUpdate struct { // Identity for the resource. @@ -1162,6 +1047,12 @@ type NetworkSecurityPerimeterConfigurationProperties struct { ProvisioningState *string } +// NetworkSecurityPerimeterConfigurationReconcileResult - Result of network security perimeter configurations. +type NetworkSecurityPerimeterConfigurationReconcileResult struct { + // The URL of the resource used to check the status of the asynchronous operation. + Location *string +} + // NetworkSecurityPerimeterProfile - Network Security Perimeter profile type NetworkSecurityPerimeterProfile struct { // READ-ONLY; Collection of access rules for the profile @@ -1465,6 +1356,27 @@ type ProductFeature struct { Error *ErrorDetail } +// ProductFeatureUpdate - Product Feature +type ProductFeatureUpdate struct { + // Product feature name. + Name *string + + // Indicates the new status of the product feature. + SubscriptionStatus *LicenseProfileSubscriptionStatusUpdate +} + +// ProductProfileUpdateProperties - Describes the Update properties of a Product Profile. +type ProductProfileUpdateProperties struct { + // The list of product feature updates. + ProductFeatures []*ProductFeatureUpdate + + // Indicates the product type of the license. + ProductType *LicenseProfileProductType + + // Indicates the subscription status of the product. + SubscriptionStatus *LicenseProfileSubscriptionStatusUpdate +} + // ProvisioningIssue - Details on issues that occurred during provisioning. type ProvisioningIssue struct { // READ-ONLY; Name of the provisioning issue. @@ -1501,30 +1413,6 @@ type ResourceAssociation struct { Name *string } -// RunCommandInputParameter - Describes the properties of a run command parameter. -type RunCommandInputParameter struct { - // REQUIRED; The run command parameter name. - Name *string - - // REQUIRED; The run command parameter value. - Value *string -} - -// RunCommandManagedIdentity - Contains clientId or objectId (use only one, not both) of a user-assigned managed identity -// that has access to storage blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of -// system-assigned identity. Make sure the Azure storage blob exists in case of scriptUri, and managed identity has been given -// access to blob's container with 'Storage Blob Data Reader' role assignment -// with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, errorBlobUri). In case of user -// assigned identity, make sure you add it under VM's identity. For more info on -// managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. -type RunCommandManagedIdentity struct { - // Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - ClientID *string - - // Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - ObjectID *string -} - // ServiceStatus - Describes the status and behavior of a service. type ServiceStatus struct { // The behavior of the service when the Arc-enabled machine starts up. @@ -1543,38 +1431,6 @@ type ServiceStatuses struct { GuestConfigurationService *ServiceStatus } -type Settings struct { - // Settings properties - Properties *SettingsProperties - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// SettingsGatewayProperties - Settings Gateway properties -type SettingsGatewayProperties struct { - // Associated Gateway Resource Id - GatewayResourceID *string -} - -// SettingsProperties - Settings properties -type SettingsProperties struct { - // Settings Gateway properties - GatewayProperties *SettingsGatewayProperties - - // READ-ONLY; Azure resource tenant Id - TenantID *string -} - // Subnet - Describes the subnet. type Subnet struct { // Represents address prefix. diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/models_serde.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/models_serde.go index 66b9988de645..13ba377f3181 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/models_serde.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/models_serde.go @@ -448,6 +448,33 @@ func (e *EsuKey) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type EsuProfileUpdateProperties. +func (e EsuProfileUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assignedLicense", e.AssignedLicense) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EsuProfileUpdateProperties. +func (e *EsuProfileUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "assignedLicense": + err = unpopulate(val, "AssignedLicense", &e.AssignedLicense) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ExtensionTargetProperties. func (e ExtensionTargetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -580,317 +607,438 @@ func (e *ExtensionValueProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtensionsResourceStatus. -func (e ExtensionsResourceStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IPAddress. +func (i IPAddress) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", e.Code) - populate(objectMap, "displayStatus", e.DisplayStatus) - populate(objectMap, "level", e.Level) - populate(objectMap, "message", e.Message) - populateDateTimeRFC3339(objectMap, "time", e.Time) + populate(objectMap, "address", i.Address) + populate(objectMap, "ipAddressVersion", i.IPAddressVersion) + populate(objectMap, "subnet", i.Subnet) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionsResourceStatus. -func (e *ExtensionsResourceStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IPAddress. +func (i *IPAddress) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) + case "address": + err = unpopulate(val, "Address", &i.Address) delete(rawMsg, key) - case "displayStatus": - err = unpopulate(val, "DisplayStatus", &e.DisplayStatus) + case "ipAddressVersion": + err = unpopulate(val, "IPAddressVersion", &i.IPAddressVersion) delete(rawMsg, key) - case "level": - err = unpopulate(val, "Level", &e.Level) + case "subnet": + err = unpopulate(val, "Subnet", &i.Subnet) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + objectMap["type"] = "SystemAssigned" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. +func (i *Identity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) delete(rawMsg, key) - case "time": - err = unpopulateDateTimeRFC3339(val, "Time", &e.Time) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Gateway. -func (g Gateway) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type License. +func (l License) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "systemData", g.SystemData) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) + populate(objectMap, "id", l.ID) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Gateway. -func (g *Gateway) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type License. +func (l *License) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &g.ID) + err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) case "location": - err = unpopulate(val, "Location", &g.Location) + err = unpopulate(val, "Location", &l.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &g.Name) + err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &g.Properties) + err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &g.SystemData) + err = unpopulate(val, "SystemData", &l.SystemData) delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &g.Tags) + err = unpopulate(val, "Tags", &l.Tags) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &g.Type) + err = unpopulate(val, "Type", &l.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayProperties. -func (g GatewayProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseDetails. +func (l LicenseDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedFeatures", g.AllowedFeatures) - populate(objectMap, "gatewayEndpoint", g.GatewayEndpoint) - populate(objectMap, "gatewayId", g.GatewayID) - populate(objectMap, "gatewayType", g.GatewayType) - populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "assignedLicenses", l.AssignedLicenses) + populate(objectMap, "edition", l.Edition) + populate(objectMap, "immutableId", l.ImmutableID) + populate(objectMap, "processors", l.Processors) + populate(objectMap, "state", l.State) + populate(objectMap, "target", l.Target) + populate(objectMap, "type", l.Type) + populate(objectMap, "volumeLicenseDetails", l.VolumeLicenseDetails) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayProperties. -func (g *GatewayProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseDetails. +func (l *LicenseDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "allowedFeatures": - err = unpopulate(val, "AllowedFeatures", &g.AllowedFeatures) + case "assignedLicenses": + err = unpopulate(val, "AssignedLicenses", &l.AssignedLicenses) delete(rawMsg, key) - case "gatewayEndpoint": - err = unpopulate(val, "GatewayEndpoint", &g.GatewayEndpoint) + case "edition": + err = unpopulate(val, "Edition", &l.Edition) delete(rawMsg, key) - case "gatewayId": - err = unpopulate(val, "GatewayID", &g.GatewayID) + case "immutableId": + err = unpopulate(val, "ImmutableID", &l.ImmutableID) delete(rawMsg, key) - case "gatewayType": - err = unpopulate(val, "GatewayType", &g.GatewayType) + case "processors": + err = unpopulate(val, "Processors", &l.Processors) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) + case "state": + err = unpopulate(val, "State", &l.State) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &l.Target) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + case "volumeLicenseDetails": + err = unpopulate(val, "VolumeLicenseDetails", &l.VolumeLicenseDetails) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayUpdate. -func (g GatewayUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseProfile. +func (l LicenseProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) + populate(objectMap, "id", l.ID) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayUpdate. -func (g *GatewayUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfile. +func (l *LicenseProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &l.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &g.Properties) + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &g.Tags) + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayUpdateProperties. -func (g GatewayUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseProfileArmEsuProperties. +func (l LicenseProfileArmEsuProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedFeatures", g.AllowedFeatures) + populate(objectMap, "assignedLicense", l.AssignedLicense) + populate(objectMap, "assignedLicenseImmutableId", l.AssignedLicenseImmutableID) + populate(objectMap, "esuEligibility", l.EsuEligibility) + populate(objectMap, "esuKeyState", l.EsuKeyState) + populate(objectMap, "esuKeys", l.EsuKeys) + populate(objectMap, "serverType", l.ServerType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayUpdateProperties. -func (g *GatewayUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileArmEsuProperties. +func (l *LicenseProfileArmEsuProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "allowedFeatures": - err = unpopulate(val, "AllowedFeatures", &g.AllowedFeatures) + case "assignedLicense": + err = unpopulate(val, "AssignedLicense", &l.AssignedLicense) + delete(rawMsg, key) + case "assignedLicenseImmutableId": + err = unpopulate(val, "AssignedLicenseImmutableID", &l.AssignedLicenseImmutableID) + delete(rawMsg, key) + case "esuEligibility": + err = unpopulate(val, "EsuEligibility", &l.EsuEligibility) + delete(rawMsg, key) + case "esuKeyState": + err = unpopulate(val, "EsuKeyState", &l.EsuKeyState) + delete(rawMsg, key) + case "esuKeys": + err = unpopulate(val, "EsuKeys", &l.EsuKeys) + delete(rawMsg, key) + case "serverType": + err = unpopulate(val, "ServerType", &l.ServerType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewaysListResult. -func (g GatewaysListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseProfileArmProductProfileProperties. +func (l LicenseProfileArmProductProfileProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) + populateDateTimeRFC3339(objectMap, "billingEndDate", l.BillingEndDate) + populateDateTimeRFC3339(objectMap, "billingStartDate", l.BillingStartDate) + populateDateTimeRFC3339(objectMap, "disenrollmentDate", l.DisenrollmentDate) + populateDateTimeRFC3339(objectMap, "enrollmentDate", l.EnrollmentDate) + populate(objectMap, "error", l.Error) + populate(objectMap, "productFeatures", l.ProductFeatures) + populate(objectMap, "productType", l.ProductType) + populate(objectMap, "subscriptionStatus", l.SubscriptionStatus) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewaysListResult. -func (g *GatewaysListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileArmProductProfileProperties. +func (l *LicenseProfileArmProductProfileProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) + case "billingEndDate": + err = unpopulateDateTimeRFC3339(val, "BillingEndDate", &l.BillingEndDate) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) + case "billingStartDate": + err = unpopulateDateTimeRFC3339(val, "BillingStartDate", &l.BillingStartDate) + delete(rawMsg, key) + case "disenrollmentDate": + err = unpopulateDateTimeRFC3339(val, "DisenrollmentDate", &l.DisenrollmentDate) + delete(rawMsg, key) + case "enrollmentDate": + err = unpopulateDateTimeRFC3339(val, "EnrollmentDate", &l.EnrollmentDate) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &l.Error) + delete(rawMsg, key) + case "productFeatures": + err = unpopulate(val, "ProductFeatures", &l.ProductFeatures) + delete(rawMsg, key) + case "productType": + err = unpopulate(val, "ProductType", &l.ProductType) + delete(rawMsg, key) + case "subscriptionStatus": + err = unpopulate(val, "SubscriptionStatus", &l.SubscriptionStatus) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IPAddress. -func (i IPAddress) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseProfileMachineInstanceView. +func (l LicenseProfileMachineInstanceView) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "address", i.Address) - populate(objectMap, "ipAddressVersion", i.IPAddressVersion) - populate(objectMap, "subnet", i.Subnet) + populate(objectMap, "esuProfile", l.EsuProfile) + populate(objectMap, "licenseChannel", l.LicenseChannel) + populate(objectMap, "licenseStatus", l.LicenseStatus) + populate(objectMap, "productProfile", l.ProductProfile) + populate(objectMap, "softwareAssurance", l.SoftwareAssurance) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IPAddress. -func (i *IPAddress) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileMachineInstanceView. +func (l *LicenseProfileMachineInstanceView) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "address": - err = unpopulate(val, "Address", &i.Address) + case "esuProfile": + err = unpopulate(val, "EsuProfile", &l.EsuProfile) delete(rawMsg, key) - case "ipAddressVersion": - err = unpopulate(val, "IPAddressVersion", &i.IPAddressVersion) + case "licenseChannel": + err = unpopulate(val, "LicenseChannel", &l.LicenseChannel) delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &i.Subnet) + case "licenseStatus": + err = unpopulate(val, "LicenseStatus", &l.LicenseStatus) + delete(rawMsg, key) + case "productProfile": + err = unpopulate(val, "ProductProfile", &l.ProductProfile) + delete(rawMsg, key) + case "softwareAssurance": + err = unpopulate(val, "SoftwareAssurance", &l.SoftwareAssurance) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Identity. -func (i Identity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseProfileMachineInstanceViewEsuProperties. +func (l LicenseProfileMachineInstanceViewEsuProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "principalId", i.PrincipalID) - populate(objectMap, "tenantId", i.TenantID) - objectMap["type"] = "SystemAssigned" + populate(objectMap, "assignedLicense", l.AssignedLicense) + populate(objectMap, "assignedLicenseImmutableId", l.AssignedLicenseImmutableID) + populate(objectMap, "esuEligibility", l.EsuEligibility) + populate(objectMap, "esuKeyState", l.EsuKeyState) + populate(objectMap, "esuKeys", l.EsuKeys) + populate(objectMap, "licenseAssignmentState", l.LicenseAssignmentState) + populate(objectMap, "serverType", l.ServerType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. -func (i *Identity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileMachineInstanceViewEsuProperties. +func (l *LicenseProfileMachineInstanceViewEsuProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &i.PrincipalID) + case "assignedLicense": + err = unpopulate(val, "AssignedLicense", &l.AssignedLicense) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &i.TenantID) + case "assignedLicenseImmutableId": + err = unpopulate(val, "AssignedLicenseImmutableID", &l.AssignedLicenseImmutableID) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "esuEligibility": + err = unpopulate(val, "EsuEligibility", &l.EsuEligibility) + delete(rawMsg, key) + case "esuKeyState": + err = unpopulate(val, "EsuKeyState", &l.EsuKeyState) + delete(rawMsg, key) + case "esuKeys": + err = unpopulate(val, "EsuKeys", &l.EsuKeys) + delete(rawMsg, key) + case "licenseAssignmentState": + err = unpopulate(val, "LicenseAssignmentState", &l.LicenseAssignmentState) + delete(rawMsg, key) + case "serverType": + err = unpopulate(val, "ServerType", &l.ServerType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type License. -func (l License) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseProfileMachineInstanceViewSoftwareAssurance. +func (l LicenseProfileMachineInstanceViewSoftwareAssurance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "location", l.Location) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "systemData", l.SystemData) - populate(objectMap, "tags", l.Tags) - populate(objectMap, "type", l.Type) + populate(objectMap, "softwareAssuranceCustomer", l.SoftwareAssuranceCustomer) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type License. -func (l *License) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileMachineInstanceViewSoftwareAssurance. +func (l *LicenseProfileMachineInstanceViewSoftwareAssurance) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -898,26 +1046,8 @@ func (l *License) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &l.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &l.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &l.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) + case "softwareAssuranceCustomer": + err = unpopulate(val, "SoftwareAssuranceCustomer", &l.SoftwareAssuranceCustomer) delete(rawMsg, key) } if err != nil { @@ -927,22 +1057,18 @@ func (l *License) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type LicenseDetails. -func (l LicenseDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseProfileProperties. +func (l LicenseProfileProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "assignedLicenses", l.AssignedLicenses) - populate(objectMap, "edition", l.Edition) - populate(objectMap, "immutableId", l.ImmutableID) - populate(objectMap, "processors", l.Processors) - populate(objectMap, "state", l.State) - populate(objectMap, "target", l.Target) - populate(objectMap, "type", l.Type) - populate(objectMap, "volumeLicenseDetails", l.VolumeLicenseDetails) + populate(objectMap, "esuProfile", l.EsuProfile) + populate(objectMap, "productProfile", l.ProductProfile) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "softwareAssurance", l.SoftwareAssurance) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseDetails. -func (l *LicenseDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileProperties. +func (l *LicenseProfileProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -950,29 +1076,44 @@ func (l *LicenseDetails) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "assignedLicenses": - err = unpopulate(val, "AssignedLicenses", &l.AssignedLicenses) - delete(rawMsg, key) - case "edition": - err = unpopulate(val, "Edition", &l.Edition) - delete(rawMsg, key) - case "immutableId": - err = unpopulate(val, "ImmutableID", &l.ImmutableID) - delete(rawMsg, key) - case "processors": - err = unpopulate(val, "Processors", &l.Processors) + case "esuProfile": + err = unpopulate(val, "EsuProfile", &l.EsuProfile) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &l.State) + case "productProfile": + err = unpopulate(val, "ProductProfile", &l.ProductProfile) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &l.Target) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) + case "softwareAssurance": + err = unpopulate(val, "SoftwareAssurance", &l.SoftwareAssurance) delete(rawMsg, key) - case "volumeLicenseDetails": - err = unpopulate(val, "VolumeLicenseDetails", &l.VolumeLicenseDetails) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LicenseProfilePropertiesSoftwareAssurance. +func (l LicenseProfilePropertiesSoftwareAssurance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "softwareAssuranceCustomer", l.SoftwareAssuranceCustomer) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfilePropertiesSoftwareAssurance. +func (l *LicenseProfilePropertiesSoftwareAssurance) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "softwareAssuranceCustomer": + err = unpopulate(val, "SoftwareAssuranceCustomer", &l.SoftwareAssuranceCustomer) delete(rawMsg, key) } if err != nil { @@ -982,22 +1123,16 @@ func (l *LicenseDetails) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type LicenseProfileArmProductProfileProperties. -func (l LicenseProfileArmProductProfileProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseProfileUpdate. +func (l LicenseProfileUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "billingEndDate", l.BillingEndDate) - populateDateTimeRFC3339(objectMap, "billingStartDate", l.BillingStartDate) - populateDateTimeRFC3339(objectMap, "disenrollmentDate", l.DisenrollmentDate) - populateDateTimeRFC3339(objectMap, "enrollmentDate", l.EnrollmentDate) - populate(objectMap, "error", l.Error) - populate(objectMap, "productFeatures", l.ProductFeatures) - populate(objectMap, "productType", l.ProductType) - populate(objectMap, "subscriptionStatus", l.SubscriptionStatus) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "tags", l.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileArmProductProfileProperties. -func (l *LicenseProfileArmProductProfileProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileUpdate. +func (l *LicenseProfileUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -1005,29 +1140,11 @@ func (l *LicenseProfileArmProductProfileProperties) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "billingEndDate": - err = unpopulateDateTimeRFC3339(val, "BillingEndDate", &l.BillingEndDate) - delete(rawMsg, key) - case "billingStartDate": - err = unpopulateDateTimeRFC3339(val, "BillingStartDate", &l.BillingStartDate) - delete(rawMsg, key) - case "disenrollmentDate": - err = unpopulateDateTimeRFC3339(val, "DisenrollmentDate", &l.DisenrollmentDate) - delete(rawMsg, key) - case "enrollmentDate": - err = unpopulateDateTimeRFC3339(val, "EnrollmentDate", &l.EnrollmentDate) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &l.Error) - delete(rawMsg, key) - case "productFeatures": - err = unpopulate(val, "ProductFeatures", &l.ProductFeatures) - delete(rawMsg, key) - case "productType": - err = unpopulate(val, "ProductType", &l.ProductType) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) - case "subscriptionStatus": - err = unpopulate(val, "SubscriptionStatus", &l.SubscriptionStatus) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) delete(rawMsg, key) } if err != nil { @@ -1037,19 +1154,17 @@ func (l *LicenseProfileArmProductProfileProperties) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type LicenseProfileMachineInstanceView. -func (l LicenseProfileMachineInstanceView) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseProfileUpdateProperties. +func (l LicenseProfileUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "esuProfile", l.EsuProfile) - populate(objectMap, "licenseChannel", l.LicenseChannel) - populate(objectMap, "licenseStatus", l.LicenseStatus) populate(objectMap, "productProfile", l.ProductProfile) populate(objectMap, "softwareAssurance", l.SoftwareAssurance) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileMachineInstanceView. -func (l *LicenseProfileMachineInstanceView) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileUpdateProperties. +func (l *LicenseProfileUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -1060,12 +1175,6 @@ func (l *LicenseProfileMachineInstanceView) UnmarshalJSON(data []byte) error { case "esuProfile": err = unpopulate(val, "EsuProfile", &l.EsuProfile) delete(rawMsg, key) - case "licenseChannel": - err = unpopulate(val, "LicenseChannel", &l.LicenseChannel) - delete(rawMsg, key) - case "licenseStatus": - err = unpopulate(val, "LicenseStatus", &l.LicenseStatus) - delete(rawMsg, key) case "productProfile": err = unpopulate(val, "ProductProfile", &l.ProductProfile) delete(rawMsg, key) @@ -1080,21 +1189,15 @@ func (l *LicenseProfileMachineInstanceView) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type LicenseProfileMachineInstanceViewEsuProperties. -func (l LicenseProfileMachineInstanceViewEsuProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseProfileUpdatePropertiesSoftwareAssurance. +func (l LicenseProfileUpdatePropertiesSoftwareAssurance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "assignedLicense", l.AssignedLicense) - populate(objectMap, "assignedLicenseImmutableId", l.AssignedLicenseImmutableID) - populate(objectMap, "esuEligibility", l.EsuEligibility) - populate(objectMap, "esuKeyState", l.EsuKeyState) - populate(objectMap, "esuKeys", l.EsuKeys) - populate(objectMap, "licenseAssignmentState", l.LicenseAssignmentState) - populate(objectMap, "serverType", l.ServerType) + populate(objectMap, "softwareAssuranceCustomer", l.SoftwareAssuranceCustomer) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileMachineInstanceViewEsuProperties. -func (l *LicenseProfileMachineInstanceViewEsuProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileUpdatePropertiesSoftwareAssurance. +func (l *LicenseProfileUpdatePropertiesSoftwareAssurance) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -1102,26 +1205,8 @@ func (l *LicenseProfileMachineInstanceViewEsuProperties) UnmarshalJSON(data []by for key, val := range rawMsg { var err error switch key { - case "assignedLicense": - err = unpopulate(val, "AssignedLicense", &l.AssignedLicense) - delete(rawMsg, key) - case "assignedLicenseImmutableId": - err = unpopulate(val, "AssignedLicenseImmutableID", &l.AssignedLicenseImmutableID) - delete(rawMsg, key) - case "esuEligibility": - err = unpopulate(val, "EsuEligibility", &l.EsuEligibility) - delete(rawMsg, key) - case "esuKeyState": - err = unpopulate(val, "EsuKeyState", &l.EsuKeyState) - delete(rawMsg, key) - case "esuKeys": - err = unpopulate(val, "EsuKeys", &l.EsuKeys) - delete(rawMsg, key) - case "licenseAssignmentState": - err = unpopulate(val, "LicenseAssignmentState", &l.LicenseAssignmentState) - delete(rawMsg, key) - case "serverType": - err = unpopulate(val, "ServerType", &l.ServerType) + case "softwareAssuranceCustomer": + err = unpopulate(val, "SoftwareAssuranceCustomer", &l.SoftwareAssuranceCustomer) delete(rawMsg, key) } if err != nil { @@ -1131,15 +1216,16 @@ func (l *LicenseProfileMachineInstanceViewEsuProperties) UnmarshalJSON(data []by return nil } -// MarshalJSON implements the json.Marshaller interface for type LicenseProfileMachineInstanceViewSoftwareAssurance. -func (l LicenseProfileMachineInstanceViewSoftwareAssurance) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LicenseProfilesListResult. +func (l LicenseProfilesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "softwareAssuranceCustomer", l.SoftwareAssuranceCustomer) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfileMachineInstanceViewSoftwareAssurance. -func (l *LicenseProfileMachineInstanceViewSoftwareAssurance) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseProfilesListResult. +func (l *LicenseProfilesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -1147,8 +1233,11 @@ func (l *LicenseProfileMachineInstanceViewSoftwareAssurance) UnmarshalJSON(data for key, val := range rawMsg { var err error switch key { - case "softwareAssuranceCustomer": - err = unpopulate(val, "SoftwareAssuranceCustomer", &l.SoftwareAssuranceCustomer) + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { @@ -2138,283 +2227,32 @@ func (m *MachineProperties) UnmarshalJSON(data []byte) error { case "osSku": err = unpopulate(val, "OSSKU", &m.OSSKU) delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &m.OSType) - delete(rawMsg, key) - case "osVersion": - err = unpopulate(val, "OSVersion", &m.OSVersion) - delete(rawMsg, key) - case "parentClusterResourceId": - err = unpopulate(val, "ParentClusterResourceID", &m.ParentClusterResourceID) - delete(rawMsg, key) - case "privateLinkScopeResourceId": - err = unpopulate(val, "PrivateLinkScopeResourceID", &m.PrivateLinkScopeResourceID) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) - delete(rawMsg, key) - case "serviceStatuses": - err = unpopulate(val, "ServiceStatuses", &m.ServiceStatuses) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - case "vmId": - err = unpopulate(val, "VMID", &m.VMID) - delete(rawMsg, key) - case "vmUuid": - err = unpopulate(val, "VMUUID", &m.VMUUID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MachineRunCommand. -func (m MachineRunCommand) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MachineRunCommand. -func (m *MachineRunCommand) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &m.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MachineRunCommandInstanceView. -func (m MachineRunCommandInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endTime", m.EndTime) - populate(objectMap, "error", m.Error) - populate(objectMap, "executionMessage", m.ExecutionMessage) - populate(objectMap, "executionState", m.ExecutionState) - populate(objectMap, "exitCode", m.ExitCode) - populate(objectMap, "output", m.Output) - populateDateTimeRFC3339(objectMap, "startTime", m.StartTime) - populate(objectMap, "statuses", m.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MachineRunCommandInstanceView. -func (m *MachineRunCommandInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &m.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &m.Error) - delete(rawMsg, key) - case "executionMessage": - err = unpopulate(val, "ExecutionMessage", &m.ExecutionMessage) - delete(rawMsg, key) - case "executionState": - err = unpopulate(val, "ExecutionState", &m.ExecutionState) - delete(rawMsg, key) - case "exitCode": - err = unpopulate(val, "ExitCode", &m.ExitCode) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &m.Output) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &m.StartTime) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &m.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MachineRunCommandProperties. -func (m MachineRunCommandProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "asyncExecution", m.AsyncExecution) - populate(objectMap, "errorBlobManagedIdentity", m.ErrorBlobManagedIdentity) - populate(objectMap, "errorBlobUri", m.ErrorBlobURI) - populate(objectMap, "instanceView", m.InstanceView) - populate(objectMap, "outputBlobManagedIdentity", m.OutputBlobManagedIdentity) - populate(objectMap, "outputBlobUri", m.OutputBlobURI) - populate(objectMap, "parameters", m.Parameters) - populate(objectMap, "protectedParameters", m.ProtectedParameters) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "runAsPassword", m.RunAsPassword) - populate(objectMap, "runAsUser", m.RunAsUser) - populate(objectMap, "source", m.Source) - populate(objectMap, "timeoutInSeconds", m.TimeoutInSeconds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MachineRunCommandProperties. -func (m *MachineRunCommandProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "asyncExecution": - err = unpopulate(val, "AsyncExecution", &m.AsyncExecution) - delete(rawMsg, key) - case "errorBlobManagedIdentity": - err = unpopulate(val, "ErrorBlobManagedIdentity", &m.ErrorBlobManagedIdentity) - delete(rawMsg, key) - case "errorBlobUri": - err = unpopulate(val, "ErrorBlobURI", &m.ErrorBlobURI) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &m.InstanceView) - delete(rawMsg, key) - case "outputBlobManagedIdentity": - err = unpopulate(val, "OutputBlobManagedIdentity", &m.OutputBlobManagedIdentity) - delete(rawMsg, key) - case "outputBlobUri": - err = unpopulate(val, "OutputBlobURI", &m.OutputBlobURI) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &m.Parameters) - delete(rawMsg, key) - case "protectedParameters": - err = unpopulate(val, "ProtectedParameters", &m.ProtectedParameters) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) - delete(rawMsg, key) - case "runAsPassword": - err = unpopulate(val, "RunAsPassword", &m.RunAsPassword) - delete(rawMsg, key) - case "runAsUser": - err = unpopulate(val, "RunAsUser", &m.RunAsUser) + case "osType": + err = unpopulate(val, "OSType", &m.OSType) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &m.Source) + case "osVersion": + err = unpopulate(val, "OSVersion", &m.OSVersion) delete(rawMsg, key) - case "timeoutInSeconds": - err = unpopulate(val, "TimeoutInSeconds", &m.TimeoutInSeconds) + case "parentClusterResourceId": + err = unpopulate(val, "ParentClusterResourceID", &m.ParentClusterResourceID) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MachineRunCommandScriptSource. -func (m MachineRunCommandScriptSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "commandId", m.CommandID) - populate(objectMap, "script", m.Script) - populate(objectMap, "scriptUri", m.ScriptURI) - populate(objectMap, "scriptUriManagedIdentity", m.ScriptURIManagedIdentity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MachineRunCommandScriptSource. -func (m *MachineRunCommandScriptSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "commandId": - err = unpopulate(val, "CommandID", &m.CommandID) + case "privateLinkScopeResourceId": + err = unpopulate(val, "PrivateLinkScopeResourceID", &m.PrivateLinkScopeResourceID) delete(rawMsg, key) - case "script": - err = unpopulate(val, "Script", &m.Script) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) delete(rawMsg, key) - case "scriptUri": - err = unpopulate(val, "ScriptURI", &m.ScriptURI) + case "serviceStatuses": + err = unpopulate(val, "ServiceStatuses", &m.ServiceStatuses) delete(rawMsg, key) - case "scriptUriManagedIdentity": - err = unpopulate(val, "ScriptURIManagedIdentity", &m.ScriptURIManagedIdentity) + case "status": + err = unpopulate(val, "Status", &m.Status) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MachineRunCommandsListResult. -func (m MachineRunCommandsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MachineRunCommandsListResult. -func (m *MachineRunCommandsListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) + case "vmId": + err = unpopulate(val, "VMID", &m.VMID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "vmUuid": + err = unpopulate(val, "VMUUID", &m.VMUUID) delete(rawMsg, key) } if err != nil { @@ -2712,6 +2550,33 @@ func (n *NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON(data []b return nil } +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationReconcileResult. +func (n NetworkSecurityPerimeterConfigurationReconcileResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", n.Location) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationReconcileResult. +func (n *NetworkSecurityPerimeterConfigurationReconcileResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterProfile. func (n NetworkSecurityPerimeterProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3549,16 +3414,16 @@ func (p *ProductFeature) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssue. -func (p ProvisioningIssue) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProductFeatureUpdate. +func (p ProductFeatureUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) + populate(objectMap, "subscriptionStatus", p.SubscriptionStatus) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssue. -func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductFeatureUpdate. +func (p *ProductFeatureUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -3569,8 +3434,8 @@ func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "subscriptionStatus": + err = unpopulate(val, "SubscriptionStatus", &p.SubscriptionStatus) delete(rawMsg, key) } if err != nil { @@ -3580,19 +3445,17 @@ func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssueProperties. -func (p ProvisioningIssueProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProductProfileUpdateProperties. +func (p ProductProfileUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", p.Description) - populate(objectMap, "issueType", p.IssueType) - populate(objectMap, "severity", p.Severity) - populate(objectMap, "suggestedAccessRules", p.SuggestedAccessRules) - populate(objectMap, "suggestedResourceIds", p.SuggestedResourceIDs) + populate(objectMap, "productFeatures", p.ProductFeatures) + populate(objectMap, "productType", p.ProductType) + populate(objectMap, "subscriptionStatus", p.SubscriptionStatus) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssueProperties. -func (p *ProvisioningIssueProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductProfileUpdateProperties. +func (p *ProductProfileUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -3600,20 +3463,14 @@ func (p *ProvisioningIssueProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "issueType": - err = unpopulate(val, "IssueType", &p.IssueType) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &p.Severity) + case "productFeatures": + err = unpopulate(val, "ProductFeatures", &p.ProductFeatures) delete(rawMsg, key) - case "suggestedAccessRules": - err = unpopulate(val, "SuggestedAccessRules", &p.SuggestedAccessRules) + case "productType": + err = unpopulate(val, "ProductType", &p.ProductType) delete(rawMsg, key) - case "suggestedResourceIds": - err = unpopulate(val, "SuggestedResourceIDs", &p.SuggestedResourceIDs) + case "subscriptionStatus": + err = unpopulate(val, "SubscriptionStatus", &p.SubscriptionStatus) delete(rawMsg, key) } if err != nil { @@ -3623,78 +3480,90 @@ func (p *ProvisioningIssueProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceAssociation. -func (r ResourceAssociation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssue. +func (p ProvisioningIssue) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "accessMode", r.AccessMode) - populate(objectMap, "name", r.Name) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAssociation. -func (r *ResourceAssociation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssue. +func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "accessMode": - err = unpopulate(val, "AccessMode", &r.AccessMode) - delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &r.Name) + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RunCommandInputParameter. -func (r RunCommandInputParameter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssueProperties. +func (p ProvisioningIssueProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", r.Name) - populate(objectMap, "value", r.Value) + populate(objectMap, "description", p.Description) + populate(objectMap, "issueType", p.IssueType) + populate(objectMap, "severity", p.Severity) + populate(objectMap, "suggestedAccessRules", p.SuggestedAccessRules) + populate(objectMap, "suggestedResourceIds", p.SuggestedResourceIDs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandInputParameter. -func (r *RunCommandInputParameter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssueProperties. +func (p *ProvisioningIssueProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &r.Name) + case "description": + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "issueType": + err = unpopulate(val, "IssueType", &p.IssueType) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &p.Severity) + delete(rawMsg, key) + case "suggestedAccessRules": + err = unpopulate(val, "SuggestedAccessRules", &p.SuggestedAccessRules) + delete(rawMsg, key) + case "suggestedResourceIds": + err = unpopulate(val, "SuggestedResourceIDs", &p.SuggestedResourceIDs) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RunCommandManagedIdentity. -func (r RunCommandManagedIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceAssociation. +func (r ResourceAssociation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientId", r.ClientID) - populate(objectMap, "objectId", r.ObjectID) + populate(objectMap, "accessMode", r.AccessMode) + populate(objectMap, "name", r.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandManagedIdentity. -func (r *RunCommandManagedIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAssociation. +func (r *ResourceAssociation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -3702,11 +3571,11 @@ func (r *RunCommandManagedIdentity) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "clientId": - err = unpopulate(val, "ClientID", &r.ClientID) + case "accessMode": + err = unpopulate(val, "AccessMode", &r.AccessMode) delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &r.ObjectID) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) } if err != nil { @@ -3778,107 +3647,6 @@ func (s *ServiceStatuses) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Settings. -func (s Settings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Settings. -func (s *Settings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SettingsGatewayProperties. -func (s SettingsGatewayProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "gatewayResourceId", s.GatewayResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SettingsGatewayProperties. -func (s *SettingsGatewayProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "gatewayResourceId": - err = unpopulate(val, "GatewayResourceID", &s.GatewayResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SettingsProperties. -func (s SettingsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "gatewayProperties", s.GatewayProperties) - populate(objectMap, "tenantId", s.TenantID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SettingsProperties. -func (s *SettingsProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "gatewayProperties": - err = unpopulate(val, "GatewayProperties", &s.GatewayProperties) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &s.TenantID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Subnet. func (s Subnet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client.go index c47f4d77a9dd..7e85e1ad789b 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client.go @@ -46,7 +46,7 @@ func NewNetworkProfileClient(subscriptionID string, credential azcore.TokenCrede // Get - The operation to get network information of hybrid machine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the hybrid machine. // - options - NetworkProfileClientGetOptions contains the optional parameters for the NetworkProfileClient.Get method. @@ -92,7 +92,7 @@ func (client *NetworkProfileClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client_example_test.go deleted file mode 100644 index b33d2a086406..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/networkprofile_client_example_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/NetworkProfile_Get.json -func ExampleNetworkProfileClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkProfileClient().Get(ctx, "myResourceGroup", "myMachine", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NetworkProfile = armhybridcompute.NetworkProfile{ - // NetworkInterfaces: []*armhybridcompute.NetworkInterface{ - // { - // IPAddresses: []*armhybridcompute.IPAddress{ - // { - // Address: to.Ptr("192.168.12.345"), - // IPAddressVersion: to.Ptr("IPv4"), - // Subnet: &armhybridcompute.Subnet{ - // AddressPrefix: to.Ptr("192.168.12.0/24"), - // }, - // }}, - // }, - // { - // IPAddresses: []*armhybridcompute.IPAddress{ - // { - // Address: to.Ptr("1001:0:34aa:5000:1234:aaaa:bbbb:cccc"), - // IPAddressVersion: to.Ptr("IPv6"), - // Subnet: &armhybridcompute.Subnet{ - // AddressPrefix: to.Ptr("1001:0:34aa:5000::/64"), - // }, - // }}, - // }}, - // } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/networksecurityperimeterconfigurations_client.go index b205daba176b..3d9e4b8cfe88 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/networksecurityperimeterconfigurations_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/networksecurityperimeterconfigurations_client.go @@ -46,7 +46,7 @@ func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, cred // GetByPrivateLinkScope - Gets the network security perimeter configuration for a private link scope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - perimeterName - The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. @@ -98,7 +98,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) getByPrivateLinkScop return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) getByPrivateLinkScop // NewListByPrivateLinkScopePager - Lists the network security perimeter configurations for a private link scope. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - options - NetworkSecurityPerimeterConfigurationsClientListByPrivateLinkScopeOptions contains the optional parameters for @@ -163,7 +163,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) listByPrivateLinkSco return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) listByPrivateLinkSco // BeginReconcileForPrivateLinkScope - Forces the network security perimeter configuration to refresh for a private link scope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - perimeterName - The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. @@ -207,7 +207,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) BeginReconcileForPri // ReconcileForPrivateLinkScope - Forces the network security perimeter configuration to refresh for a private link scope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileForPrivateLinkScope(ctx context.Context, resourceGroupName string, scopeName string, perimeterName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileForPrivateLinkScopeOptions) (*http.Response, error) { var err error const operationName = "NetworkSecurityPerimeterConfigurationsClient.BeginReconcileForPrivateLinkScope" @@ -222,7 +222,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileForPrivateL if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -253,7 +253,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileForPrivateL return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/networksecurityperimeterconfigurations_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/networksecurityperimeterconfigurations_client_example_test.go deleted file mode 100644 index d4c94b91b15d..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/networksecurityperimeterconfigurations_client_example_test.go +++ /dev/null @@ -1,198 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json -func ExampleNetworkSecurityPerimeterConfigurationsClient_GetByPrivateLinkScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().GetByPrivateLinkScope(ctx, "my-resource-group", "my-privatelinkscope", "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee.myAssociation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NetworkSecurityPerimeterConfiguration = armhybridcompute.NetworkSecurityPerimeterConfiguration{ - // Name: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee.myAssociation"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/networkSecurityPerimeterConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/my-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/my-privatelinkscope/networkSecurityPerimeterConfigurations/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee.myAssociation"), - // Properties: &armhybridcompute.NetworkSecurityPerimeterConfigurationProperties{ - // NetworkSecurityPerimeter: &armhybridcompute.NetworkSecurityPerimeter{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/networkSecurityPerimeters/myPerimeter"), - // Location: to.Ptr("westus"), - // PerimeterGUID: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // }, - // Profile: &armhybridcompute.NetworkSecurityPerimeterProfile{ - // Name: to.Ptr("myProfile"), - // AccessRules: []*armhybridcompute.AccessRule{ - // { - // Name: to.Ptr("myAccessRule"), - // Properties: &armhybridcompute.AccessRuleProperties{ - // AddressPrefixes: []*string{ - // to.Ptr("148.0.0.0/8"), - // to.Ptr("152.4.6.0/24"), - // to.Ptr("...")}, - // Direction: to.Ptr(armhybridcompute.AccessRuleDirectionInbound), - // }, - // }}, - // AccessRulesVersion: to.Ptr[int32](1), - // DiagnosticSettingsVersion: to.Ptr[int32](1), - // EnabledLogCategories: []*string{ - // }, - // }, - // ProvisioningIssues: []*armhybridcompute.ProvisioningIssue{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ResourceAssociation: &armhybridcompute.ResourceAssociation{ - // Name: to.Ptr("myAssociation"), - // AccessMode: to.Ptr(armhybridcompute.AccessModeEnforced), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationList.json -func ExampleNetworkSecurityPerimeterConfigurationsClient_NewListByPrivateLinkScopePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().NewListByPrivateLinkScopePager("my-resource-group", "my-privatelinkscope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkSecurityPerimeterConfigurationListResult = armhybridcompute.NetworkSecurityPerimeterConfigurationListResult{ - // Value: []*armhybridcompute.NetworkSecurityPerimeterConfiguration{ - // { - // Name: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee.myAssociation"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/networkSecurityPerimeterConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/my-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/my-privatelinkscope/networkSecurityPerimeterConfigurations/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee.myAssociation"), - // Properties: &armhybridcompute.NetworkSecurityPerimeterConfigurationProperties{ - // NetworkSecurityPerimeter: &armhybridcompute.NetworkSecurityPerimeter{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/networkSecurityPerimeters/myPerimeter"), - // Location: to.Ptr("westus"), - // PerimeterGUID: to.Ptr("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // }, - // Profile: &armhybridcompute.NetworkSecurityPerimeterProfile{ - // Name: to.Ptr("myProfile"), - // AccessRules: []*armhybridcompute.AccessRule{ - // { - // Name: to.Ptr("myAccessRule"), - // Properties: &armhybridcompute.AccessRuleProperties{ - // AddressPrefixes: []*string{ - // to.Ptr("148.0.0.0/8"), - // to.Ptr("152.4.6.0/24"), - // to.Ptr("...")}, - // Direction: to.Ptr(armhybridcompute.AccessRuleDirectionInbound), - // }, - // }}, - // AccessRulesVersion: to.Ptr[int32](1), - // DiagnosticSettingsVersion: to.Ptr[int32](1), - // EnabledLogCategories: []*string{ - // }, - // }, - // ProvisioningIssues: []*armhybridcompute.ProvisioningIssue{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ResourceAssociation: &armhybridcompute.ResourceAssociation{ - // Name: to.Ptr("myAssociation"), - // AccessMode: to.Ptr(armhybridcompute.AccessModeEnforced), - // }, - // }, - // }, - // { - // Name: to.Ptr("aaaaaaaa-0000-cccc-1111-eeeeeeeeeeee.myAssociation2"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/networkSecurityPerimeterConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/my-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/my-privatelinkscope/networkSecurityPerimeterConfigurations/37364608-77ea-4c2a-bdc3-4b0b1cdfab15.myAssociation2"), - // Properties: &armhybridcompute.NetworkSecurityPerimeterConfigurationProperties{ - // NetworkSecurityPerimeter: &armhybridcompute.NetworkSecurityPerimeter{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/networkSecurityPerimeters/myOtherPerimeter"), - // Location: to.Ptr("westus"), - // PerimeterGUID: to.Ptr("aaaaaaaa-0000-cccc-1111-eeeeeeeeeeee"), - // }, - // Profile: &armhybridcompute.NetworkSecurityPerimeterProfile{ - // Name: to.Ptr("myProfile"), - // AccessRules: []*armhybridcompute.AccessRule{ - // { - // Name: to.Ptr("myAccessRule"), - // Properties: &armhybridcompute.AccessRuleProperties{ - // AddressPrefixes: []*string{ - // to.Ptr("122.0.0.0/8"), - // to.Ptr("144.4.6.0/24"), - // to.Ptr("...")}, - // Direction: to.Ptr(armhybridcompute.AccessRuleDirectionInbound), - // }, - // }}, - // AccessRulesVersion: to.Ptr[int32](1), - // DiagnosticSettingsVersion: to.Ptr[int32](1), - // EnabledLogCategories: []*string{ - // }, - // }, - // ProvisioningIssues: []*armhybridcompute.ProvisioningIssue{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ResourceAssociation: &armhybridcompute.ResourceAssociation{ - // Name: to.Ptr("myAssociation"), - // AccessMode: to.Ptr(armhybridcompute.AccessModeLearning), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationReconcile.json -func ExampleNetworkSecurityPerimeterConfigurationsClient_BeginReconcileForPrivateLinkScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().BeginReconcileForPrivateLinkScope(ctx, "my-resource-group", "my-privatelinkscope", "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee.myAssociation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client.go index 97a2c25d655d..9aae792ff5dc 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Gets a list of hybrid compute operations. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -73,7 +73,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client_example_test.go deleted file mode 100644 index 4b38bc175646..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/operations_client_example_test.go +++ /dev/null @@ -1,68 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armhybridcompute.OperationListResult{ - // Value: []*armhybridcompute.OperationValue{ - // { - // Name: to.Ptr("Microsoft.HybridCompute/operations/read"), - // Display: &armhybridcompute.OperationValueDisplay{ - // Description: to.Ptr("Read all Operations for Azure Arc for Servers"), - // Operation: to.Ptr("Read all Operations"), - // Provider: to.Ptr("Microsoft HybridCompute"), - // Resource: to.Ptr("Microsoft.HybridCompute Resource Provider"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HybridCompute/register/action"), - // Display: &armhybridcompute.OperationValueDisplay{ - // Description: to.Ptr("Registers the subscription for the Microsoft.HybridCompute Resource Provider"), - // Operation: to.Ptr("Register Subscription for Azure Arc for Servers"), - // Provider: to.Ptr("Microsoft HybridCompute"), - // Resource: to.Ptr("Microsoft.HybridCompute Resource Provider"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr("user,system"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/options.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/options.go index 546028498b52..d881192fec8a 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/options.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/options.go @@ -18,37 +18,32 @@ type ExtensionMetadataClientListOptions struct { // placeholder for future optional parameters } -// GatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewaysClient.BeginCreateOrUpdate method. -type GatewaysClientBeginCreateOrUpdateOptions struct { +// LicenseProfilesClientBeginCreateOrUpdateOptions contains the optional parameters for the LicenseProfilesClient.BeginCreateOrUpdate +// method. +type LicenseProfilesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// GatewaysClientBeginDeleteOptions contains the optional parameters for the GatewaysClient.BeginDelete method. -type GatewaysClientBeginDeleteOptions struct { +// LicenseProfilesClientBeginDeleteOptions contains the optional parameters for the LicenseProfilesClient.BeginDelete method. +type LicenseProfilesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// GatewaysClientGetOptions contains the optional parameters for the GatewaysClient.Get method. -type GatewaysClientGetOptions struct { - // placeholder for future optional parameters -} - -// GatewaysClientListByResourceGroupOptions contains the optional parameters for the GatewaysClient.NewListByResourceGroupPager -// method. -type GatewaysClientListByResourceGroupOptions struct { - // placeholder for future optional parameters +// LicenseProfilesClientBeginUpdateOptions contains the optional parameters for the LicenseProfilesClient.BeginUpdate method. +type LicenseProfilesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// GatewaysClientListBySubscriptionOptions contains the optional parameters for the GatewaysClient.NewListBySubscriptionPager -// method. -type GatewaysClientListBySubscriptionOptions struct { +// LicenseProfilesClientGetOptions contains the optional parameters for the LicenseProfilesClient.Get method. +type LicenseProfilesClientGetOptions struct { // placeholder for future optional parameters } -// GatewaysClientUpdateOptions contains the optional parameters for the GatewaysClient.Update method. -type GatewaysClientUpdateOptions struct { +// LicenseProfilesClientListOptions contains the optional parameters for the LicenseProfilesClient.NewListPager method. +type LicenseProfilesClientListOptions struct { // placeholder for future optional parameters } @@ -70,6 +65,13 @@ type LicensesClientBeginUpdateOptions struct { ResumeToken string } +// LicensesClientBeginValidateLicenseOptions contains the optional parameters for the LicensesClient.BeginValidateLicense +// method. +type LicensesClientBeginValidateLicenseOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // LicensesClientGetOptions contains the optional parameters for the LicensesClient.Get method. type LicensesClientGetOptions struct { // placeholder for future optional parameters @@ -119,31 +121,6 @@ type MachineExtensionsClientListOptions struct { Expand *string } -// MachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the MachineRunCommandsClient.BeginCreateOrUpdate -// method. -type MachineRunCommandsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the MachineRunCommandsClient.BeginDelete -// method. -type MachineRunCommandsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MachineRunCommandsClientGetOptions contains the optional parameters for the MachineRunCommandsClient.Get method. -type MachineRunCommandsClientGetOptions struct { - // placeholder for future optional parameters -} - -// MachineRunCommandsClientListOptions contains the optional parameters for the MachineRunCommandsClient.NewListPager method. -type MachineRunCommandsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - // MachinesClientBeginAssessPatchesOptions contains the optional parameters for the MachinesClient.BeginAssessPatches method. type MachinesClientBeginAssessPatchesOptions struct { // Resumes the LRO from the provided token. @@ -170,7 +147,7 @@ type MachinesClientDeleteOptions struct { // MachinesClientGetOptions contains the optional parameters for the MachinesClient.Get method. type MachinesClientGetOptions struct { // The expand expression to apply on the operation. - Expand *string + Expand *InstanceViewTypes } // MachinesClientListByResourceGroupOptions contains the optional parameters for the MachinesClient.NewListByResourceGroupPager @@ -309,18 +286,3 @@ type PrivateLinkScopesClientListOptions struct { type PrivateLinkScopesClientUpdateTagsOptions struct { // placeholder for future optional parameters } - -// SettingsClientGetOptions contains the optional parameters for the SettingsClient.Get method. -type SettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SettingsClientPatchOptions contains the optional parameters for the SettingsClient.Patch method. -type SettingsClientPatchOptions struct { - // placeholder for future optional parameters -} - -// SettingsClientUpdateOptions contains the optional parameters for the SettingsClient.Update method. -type SettingsClientUpdateOptions struct { - // placeholder for future optional parameters -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client.go index 61d1a1d40032..a5da9fe8eca5 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client.go @@ -46,7 +46,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -72,7 +72,7 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginCreateOrUpdate" @@ -118,7 +118,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -130,7 +130,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -156,7 +156,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginDelete" @@ -202,7 +202,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -263,7 +263,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByPrivateLinkScopePager - Gets all private endpoint connections on a private link scope. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - options - PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByPrivateLinkScopePager @@ -328,7 +328,7 @@ func (client *PrivateEndpointConnectionsClient) listByPrivateLinkScopeCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client_example_test.go deleted file mode 100644 index cd793fffac54..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,191 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "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/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armhybridcompute.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("hybridcompute")}, - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateEndpoint/PrivateEndpointConnection_Update.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", armhybridcompute.PrivateEndpointConnection{ - Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armhybridcompute.PrivateEndpointConnection{ - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("hybridcompute")}, - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Approved by johndoe@contoso.com"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateEndpoint/PrivateEndpointConnection_Delete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "myResourceGroup", "myPrivateLinkScope", "private-endpoint-connection-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateEndpoint/PrivateEndpointConnection_List.json -func ExamplePrivateEndpointConnectionsClient_NewListByPrivateLinkScopePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByPrivateLinkScopePager("myResourceGroup", "myPrivateLinkScope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armhybridcompute.PrivateEndpointConnectionListResult{ - // Value: []*armhybridcompute.PrivateEndpointConnection{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("hybridcompute")}, - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }, - // { - // Name: to.Ptr("private-endpoint-connection-name-2"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name-2"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("hybridcompute")}, - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Please approve my connection."), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Pending"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client.go index 32a2f4fead15..b53e1986fd0b 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client.go @@ -46,7 +46,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - groupName - The name of the private link resource. @@ -98,7 +98,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByPrivateLinkScopePager - Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - options - PrivateLinkResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByPrivateLinkScopePager @@ -163,7 +163,7 @@ func (client *PrivateLinkResourcesClient) listByPrivateLinkScopeCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client_example_test.go deleted file mode 100644 index 431923ac42c7..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,98 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_ListGet.json -func ExamplePrivateLinkResourcesClient_NewListByPrivateLinkScopePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListByPrivateLinkScopePager("myResourceGroup", "myPrivateLinkScope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourceListResult = armhybridcompute.PrivateLinkResourceListResult{ - // Value: []*armhybridcompute.PrivateLinkResource{ - // { - // Name: to.Ptr("hybridcompute"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateLinkResources/hybridcompute"), - // Properties: &armhybridcompute.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("hybridcompute"), - // RequiredMembers: []*string{ - // to.Ptr("HybridCompute.ServerDP"), - // to.Ptr("HybridCompute.K8sConfigurationDP"), - // to.Ptr("HybridCompute.GuestConfigDP")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.his.arc.azure.com"), - // to.Ptr("privatelink.kubernetesconfiguration.azure.com"), - // to.Ptr("privatelink.Guestconfiguration.azure.com")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "myResourceGroup", "myPrivateLinkScope", "hybridcompute", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResource = armhybridcompute.PrivateLinkResource{ - // Name: to.Ptr("hybridcompute"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateLinkResources/hybridcompute"), - // Properties: &armhybridcompute.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("hybridcompute"), - // RequiredMembers: []*string{ - // to.Ptr("HybridCompute.Server"), - // to.Ptr("HybridCompute.K8sConfiguration"), - // to.Ptr("GuestConfig.DP")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.his.arc.azure.com"), - // to.Ptr("privatelink.kubernetesconfiguration.azure.com"), - // to.Ptr("privatelink.Guestconfiguration.azure.com")}, - // }, - // } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client.go index 00ec114fd06f..1711b4b11026 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client.go @@ -47,7 +47,7 @@ func NewPrivateLinkScopesClient(subscriptionID string, credential azcore.TokenCr // nor AppId in the Put operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - parameters - Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. @@ -95,7 +95,7 @@ func (client *PrivateLinkScopesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -116,7 +116,7 @@ func (client *PrivateLinkScopesClient) createOrUpdateHandleResponse(resp *http.R // BeginDelete - Deletes a Azure Arc PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - options - PrivateLinkScopesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopesClient.BeginDelete @@ -141,7 +141,7 @@ func (client *PrivateLinkScopesClient) BeginDelete(ctx context.Context, resource // Delete - Deletes a Azure Arc PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 func (client *PrivateLinkScopesClient) deleteOperation(ctx context.Context, resourceGroupName string, scopeName string, options *PrivateLinkScopesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkScopesClient.BeginDelete" @@ -183,7 +183,7 @@ func (client *PrivateLinkScopesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +192,7 @@ func (client *PrivateLinkScopesClient) deleteCreateRequest(ctx context.Context, // Get - Returns a Azure Arc PrivateLinkScope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - options - PrivateLinkScopesClientGetOptions contains the optional parameters for the PrivateLinkScopesClient.Get method. @@ -238,7 +238,7 @@ func (client *PrivateLinkScopesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,7 +256,7 @@ func (client *PrivateLinkScopesClient) getHandleResponse(resp *http.Response) (P // GetValidationDetails - Returns a Azure Arc PrivateLinkScope's validation details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - location - The location of the target resource. // - privateLinkScopeID - The id (Guid) of the Azure Arc PrivateLinkScope resource. // - options - PrivateLinkScopesClientGetValidationDetailsOptions contains the optional parameters for the PrivateLinkScopesClient.GetValidationDetails @@ -303,7 +303,7 @@ func (client *PrivateLinkScopesClient) getValidationDetailsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +321,7 @@ func (client *PrivateLinkScopesClient) getValidationDetailsHandleResponse(resp * // GetValidationDetailsForMachine - Returns a Azure Arc PrivateLinkScope's validation details for a given machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - machineName - The name of the target machine to get the private link scope validation details for. // - options - PrivateLinkScopesClientGetValidationDetailsForMachineOptions contains the optional parameters for the PrivateLinkScopesClient.GetValidationDetailsForMachine @@ -368,7 +368,7 @@ func (client *PrivateLinkScopesClient) getValidationDetailsForMachineCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,7 @@ func (client *PrivateLinkScopesClient) getValidationDetailsForMachineHandleRespo // NewListPager - Gets a list of all Azure Arc PrivateLinkScopes within a subscription. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - options - PrivateLinkScopesClientListOptions contains the optional parameters for the PrivateLinkScopesClient.NewListPager // method. func (client *PrivateLinkScopesClient) NewListPager(options *PrivateLinkScopesClientListOptions) *runtime.Pager[PrivateLinkScopesClientListResponse] { @@ -423,7 +423,7 @@ func (client *PrivateLinkScopesClient) listCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -440,7 +440,7 @@ func (client *PrivateLinkScopesClient) listHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - Gets a list of Azure Arc PrivateLinkScopes within a resource group. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - PrivateLinkScopesClientListByResourceGroupOptions contains the optional parameters for the PrivateLinkScopesClient.NewListByResourceGroupPager // method. @@ -483,7 +483,7 @@ func (client *PrivateLinkScopesClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -501,7 +501,7 @@ func (client *PrivateLinkScopesClient) listByResourceGroupHandleResponse(resp *h // UpdateTags - Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-20-preview +// Generated from API version 2024-07-10 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - scopeName - The name of the Azure Arc PrivateLinkScope resource. // - privateLinkScopeTags - Updated tag information to set into the PrivateLinkScope instance. @@ -549,7 +549,7 @@ func (client *PrivateLinkScopesClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") + reqQP.Set("api-version", "2024-07-10") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, privateLinkScopeTags); err != nil { diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client_example_test.go deleted file mode 100644 index 83cee16ce973..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/privatelinkscopes_client_example_test.go +++ /dev/null @@ -1,478 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "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/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_List.json -func ExamplePrivateLinkScopesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkScopesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkScopeListResult = armhybridcompute.PrivateLinkScopeListResult{ - // Value: []*armhybridcompute.PrivateLinkScope{ - // { - // Name: to.Ptr("my-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateLinkScopeID: to.Ptr("e5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // }, - // { - // Name: to.Ptr("my-other-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-other-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("f5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_ListByResourceGroup.json -func ExamplePrivateLinkScopesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkScopesClient().NewListByResourceGroupPager("my-resource-group", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkScopeListResult = armhybridcompute.PrivateLinkScopeListResult{ - // Value: []*armhybridcompute.PrivateLinkScope{ - // { - // Name: to.Ptr("my-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("f5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // }, - // { - // Name: to.Ptr("my-other-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-other-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("a5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_Delete.json -func ExamplePrivateLinkScopesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateLinkScopesClient().BeginDelete(ctx, "my-resource-group", "my-privatelinkscope", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json -func ExamplePrivateLinkScopesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkScopesClient().Get(ctx, "my-resource-group", "my-privatelinkscope", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkScope = armhybridcompute.PrivateLinkScope{ - // Name: to.Ptr("my-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("f5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_Create.json -func ExamplePrivateLinkScopesClient_CreateOrUpdate_privateLinkScopeCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkScopesClient().CreateOrUpdate(ctx, "my-resource-group", "my-privatelinkscope", armhybridcompute.PrivateLinkScope{ - Location: to.Ptr("westus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkScope = armhybridcompute.PrivateLinkScope{ - // Name: to.Ptr("my-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("e5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_Update.json -func ExamplePrivateLinkScopesClient_CreateOrUpdate_privateLinkScopeUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkScopesClient().CreateOrUpdate(ctx, "my-resource-group", "my-privatelinkscope", armhybridcompute.PrivateLinkScope{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "Tag1": to.Ptr("Value1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkScope = armhybridcompute.PrivateLinkScope{ - // Name: to.Ptr("my-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridCompute/privateLinkScopes/my-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "Tag1": to.Ptr("Value1"), - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("e5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_UpdateTagsOnly.json -func ExamplePrivateLinkScopesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkScopesClient().UpdateTags(ctx, "my-resource-group", "my-privatelinkscope", armhybridcompute.TagsResource{ - Tags: map[string]*string{ - "Tag1": to.Ptr("Value1"), - "Tag2": to.Ptr("Value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkScope = armhybridcompute.PrivateLinkScope{ - // Name: to.Ptr("my-privatelinkscope"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "Tag1": to.Ptr("Value1"), - // "Tag2": to.Ptr("Value2"), - // }, - // Properties: &armhybridcompute.PrivateLinkScopeProperties{ - // PrivateEndpointConnections: []*armhybridcompute.PrivateEndpointConnectionDataModel{ - // { - // Name: to.Ptr("private-endpoint-connection-name"), - // Type: to.Ptr("Microsoft.HybridCompute/privateLinkScopes/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/myPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), - // Properties: &armhybridcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhybridcompute.PrivateEndpointProperty{ - // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), - // }, - // PrivateLinkServiceConnectionState: &armhybridcompute.PrivateLinkServiceConnectionStateProperty{ - // Description: to.Ptr("Auto-approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr("Approved"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // PrivateLinkScopeID: to.Ptr("e5dc51d3-92ed-4d7e-947a-775ea79b4919"), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidation.json -func ExamplePrivateLinkScopesClient_GetValidationDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkScopesClient().GetValidationDetails(ctx, "wus2", "f5dc51d3-92ed-4d7e-947a-775ea79b4919", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkScopeValidationDetails = armhybridcompute.PrivateLinkScopeValidationDetails{ - // ConnectionDetails: []*armhybridcompute.ConnectionDetail{ - // { - // GroupID: to.Ptr("groupId"), - // ID: to.Ptr("id"), - // LinkIdentifier: to.Ptr("linkId"), - // MemberName: to.Ptr("memberName"), - // PrivateIPAddress: to.Ptr("ip"), - // }}, - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidationForMachine.json -func ExamplePrivateLinkScopesClient_GetValidationDetailsForMachine() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkScopesClient().GetValidationDetailsForMachine(ctx, "my-resource-group", "machineName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkScopeValidationDetails = armhybridcompute.PrivateLinkScopeValidationDetails{ - // ConnectionDetails: []*armhybridcompute.ConnectionDetail{ - // { - // GroupID: to.Ptr("groupId"), - // ID: to.Ptr("id"), - // LinkIdentifier: to.Ptr("linkId"), - // MemberName: to.Ptr("memberName"), - // PrivateIPAddress: to.Ptr("ip"), - // }}, - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.hybridcompute/privateLinkScopes/my-privatelinkscope"), - // PublicNetworkAccess: to.Ptr(armhybridcompute.PublicNetworkAccessTypeDisabled), - // } -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/responses.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/responses.go index 512205b5e999..358d36cc943d 100644 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/responses.go +++ b/sdk/resourcemanager/hybridcompute/armhybridcompute/responses.go @@ -20,39 +20,33 @@ type ExtensionMetadataClientListResponse struct { ExtensionValueListResult } -// GatewaysClientCreateOrUpdateResponse contains the response from method GatewaysClient.BeginCreateOrUpdate. -type GatewaysClientCreateOrUpdateResponse struct { - // Describes an Arc Gateway. - Gateway +// LicenseProfilesClientCreateOrUpdateResponse contains the response from method LicenseProfilesClient.BeginCreateOrUpdate. +type LicenseProfilesClientCreateOrUpdateResponse struct { + // Describes a license profile in a hybrid machine. + LicenseProfile } -// GatewaysClientDeleteResponse contains the response from method GatewaysClient.BeginDelete. -type GatewaysClientDeleteResponse struct { +// LicenseProfilesClientDeleteResponse contains the response from method LicenseProfilesClient.BeginDelete. +type LicenseProfilesClientDeleteResponse struct { // placeholder for future response values } -// GatewaysClientGetResponse contains the response from method GatewaysClient.Get. -type GatewaysClientGetResponse struct { - // Describes an Arc Gateway. - Gateway +// LicenseProfilesClientGetResponse contains the response from method LicenseProfilesClient.Get. +type LicenseProfilesClientGetResponse struct { + // Describes a license profile in a hybrid machine. + LicenseProfile } -// GatewaysClientListByResourceGroupResponse contains the response from method GatewaysClient.NewListByResourceGroupPager. -type GatewaysClientListByResourceGroupResponse struct { - // The List license operation response. - GatewaysListResult -} - -// GatewaysClientListBySubscriptionResponse contains the response from method GatewaysClient.NewListBySubscriptionPager. -type GatewaysClientListBySubscriptionResponse struct { - // The List license operation response. - GatewaysListResult +// LicenseProfilesClientListResponse contains the response from method LicenseProfilesClient.NewListPager. +type LicenseProfilesClientListResponse struct { + // The List hybrid machine license profile operation response. + LicenseProfilesListResult } -// GatewaysClientUpdateResponse contains the response from method GatewaysClient.Update. -type GatewaysClientUpdateResponse struct { - // Describes an Arc Gateway. - Gateway +// LicenseProfilesClientUpdateResponse contains the response from method LicenseProfilesClient.BeginUpdate. +type LicenseProfilesClientUpdateResponse struct { + // Describes a license profile in a hybrid machine. + LicenseProfile } // LicensesClientCreateOrUpdateResponse contains the response from method LicensesClient.BeginCreateOrUpdate. @@ -90,6 +84,12 @@ type LicensesClientUpdateResponse struct { License } +// LicensesClientValidateLicenseResponse contains the response from method LicensesClient.BeginValidateLicense. +type LicensesClientValidateLicenseResponse struct { + // Describes a license in a hybrid machine. + License +} + // MachineExtensionsClientCreateOrUpdateResponse contains the response from method MachineExtensionsClient.BeginCreateOrUpdate. type MachineExtensionsClientCreateOrUpdateResponse struct { // Describes a Machine Extension. @@ -119,29 +119,6 @@ type MachineExtensionsClientUpdateResponse struct { MachineExtension } -// MachineRunCommandsClientCreateOrUpdateResponse contains the response from method MachineRunCommandsClient.BeginCreateOrUpdate. -type MachineRunCommandsClientCreateOrUpdateResponse struct { - // Describes a Run Command - MachineRunCommand -} - -// MachineRunCommandsClientDeleteResponse contains the response from method MachineRunCommandsClient.BeginDelete. -type MachineRunCommandsClientDeleteResponse struct { - // placeholder for future response values -} - -// MachineRunCommandsClientGetResponse contains the response from method MachineRunCommandsClient.Get. -type MachineRunCommandsClientGetResponse struct { - // Describes a Run Command - MachineRunCommand -} - -// MachineRunCommandsClientListResponse contains the response from method MachineRunCommandsClient.NewListPager. -type MachineRunCommandsClientListResponse struct { - // Describes the Run Commands List Result. - MachineRunCommandsListResult -} - // MachinesClientAssessPatchesResponse contains the response from method MachinesClient.BeginAssessPatches. type MachinesClientAssessPatchesResponse struct { // Describes the properties of an AssessPatches result. @@ -214,7 +191,8 @@ type NetworkSecurityPerimeterConfigurationsClientListByPrivateLinkScopeResponse // NetworkSecurityPerimeterConfigurationsClientReconcileForPrivateLinkScopeResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.BeginReconcileForPrivateLinkScope. type NetworkSecurityPerimeterConfigurationsClientReconcileForPrivateLinkScopeResponse struct { - // placeholder for future response values + // Result of network security perimeter configurations. + NetworkSecurityPerimeterConfigurationReconcileResult } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. @@ -302,18 +280,3 @@ type PrivateLinkScopesClientUpdateTagsResponse struct { // An Azure Arc PrivateLinkScope definition. PrivateLinkScope } - -// SettingsClientGetResponse contains the response from method SettingsClient.Get. -type SettingsClientGetResponse struct { - Settings -} - -// SettingsClientPatchResponse contains the response from method SettingsClient.Patch. -type SettingsClientPatchResponse struct { - Settings -} - -// SettingsClientUpdateResponse contains the response from method SettingsClient.Update. -type SettingsClientUpdateResponse struct { - Settings -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/settings_client.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/settings_client.go deleted file mode 100644 index ab563827f306..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/settings_client.go +++ /dev/null @@ -1,289 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armhybridcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "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" -) - -// SettingsClient contains the methods for the Settings group. -// Don't use this type directly, use NewSettingsClient() instead. -type SettingsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSettingsClient creates a new instance of SettingsClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SettingsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SettingsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Returns the base Settings for the target resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - baseProvider - The name of the base Resource Provider. -// - baseResourceType - The name of the base Resource Type. -// - baseResourceName - The name of the base resource. -// - settingsResourceName - The name of the settings resource. -// - options - SettingsClientGetOptions contains the optional parameters for the SettingsClient.Get method. -func (client *SettingsClient) Get(ctx context.Context, resourceGroupName string, baseProvider string, baseResourceType string, baseResourceName string, settingsResourceName string, options *SettingsClientGetOptions) (SettingsClientGetResponse, error) { - var err error - const operationName = "SettingsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, options) - if err != nil { - return SettingsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SettingsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SettingsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *SettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, baseProvider string, baseResourceType string, baseResourceName string, settingsResourceName string, options *SettingsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName}" - 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 baseProvider == "" { - return nil, errors.New("parameter baseProvider cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{baseProvider}", url.PathEscape(baseProvider)) - if baseResourceType == "" { - return nil, errors.New("parameter baseResourceType cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{baseResourceType}", url.PathEscape(baseResourceType)) - if baseResourceName == "" { - return nil, errors.New("parameter baseResourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{baseResourceName}", url.PathEscape(baseResourceName)) - if settingsResourceName == "" { - return nil, errors.New("parameter settingsResourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{settingsResourceName}", url.PathEscape(settingsResourceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SettingsClient) getHandleResponse(resp *http.Response) (SettingsClientGetResponse, error) { - result := SettingsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Settings); err != nil { - return SettingsClientGetResponse{}, err - } - return result, nil -} - -// Patch - Update the base Settings of the target resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - baseProvider - The name of the base Resource Provider. -// - baseResourceType - The name of the base Resource Type. -// - baseResourceName - The name of the base resource. -// - settingsResourceName - The name of the settings resource. -// - parameters - Settings details -// - options - SettingsClientPatchOptions contains the optional parameters for the SettingsClient.Patch method. -func (client *SettingsClient) Patch(ctx context.Context, resourceGroupName string, baseProvider string, baseResourceType string, baseResourceName string, settingsResourceName string, parameters Settings, options *SettingsClientPatchOptions) (SettingsClientPatchResponse, error) { - var err error - const operationName = "SettingsClient.Patch" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.patchCreateRequest(ctx, resourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, parameters, options) - if err != nil { - return SettingsClientPatchResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SettingsClientPatchResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SettingsClientPatchResponse{}, err - } - resp, err := client.patchHandleResponse(httpResp) - return resp, err -} - -// patchCreateRequest creates the Patch request. -func (client *SettingsClient) patchCreateRequest(ctx context.Context, resourceGroupName string, baseProvider string, baseResourceType string, baseResourceName string, settingsResourceName string, parameters Settings, options *SettingsClientPatchOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName}" - 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 baseProvider == "" { - return nil, errors.New("parameter baseProvider cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{baseProvider}", url.PathEscape(baseProvider)) - if baseResourceType == "" { - return nil, errors.New("parameter baseResourceType cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{baseResourceType}", url.PathEscape(baseResourceType)) - if baseResourceName == "" { - return nil, errors.New("parameter baseResourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{baseResourceName}", url.PathEscape(baseResourceName)) - if settingsResourceName == "" { - return nil, errors.New("parameter settingsResourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{settingsResourceName}", url.PathEscape(settingsResourceName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// patchHandleResponse handles the Patch response. -func (client *SettingsClient) patchHandleResponse(resp *http.Response) (SettingsClientPatchResponse, error) { - result := SettingsClientPatchResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Settings); err != nil { - return SettingsClientPatchResponse{}, err - } - return result, nil -} - -// Update - Updates the base Settings of the target resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - baseProvider - The name of the base Resource Provider. -// - baseResourceType - The name of the base Resource Type. -// - baseResourceName - The name of the base resource. -// - settingsResourceName - The name of the settings resource. -// - parameters - Settings details -// - options - SettingsClientUpdateOptions contains the optional parameters for the SettingsClient.Update method. -func (client *SettingsClient) Update(ctx context.Context, resourceGroupName string, baseProvider string, baseResourceType string, baseResourceName string, settingsResourceName string, parameters Settings, options *SettingsClientUpdateOptions) (SettingsClientUpdateResponse, error) { - var err error - const operationName = "SettingsClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, parameters, options) - if err != nil { - return SettingsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SettingsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return SettingsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *SettingsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, baseProvider string, baseResourceType string, baseResourceName string, settingsResourceName string, parameters Settings, options *SettingsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName}" - 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 baseProvider == "" { - return nil, errors.New("parameter baseProvider cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{baseProvider}", url.PathEscape(baseProvider)) - if baseResourceType == "" { - return nil, errors.New("parameter baseResourceType cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{baseResourceType}", url.PathEscape(baseResourceType)) - if baseResourceName == "" { - return nil, errors.New("parameter baseResourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{baseResourceName}", url.PathEscape(baseResourceName)) - if settingsResourceName == "" { - return nil, errors.New("parameter settingsResourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{settingsResourceName}", url.PathEscape(settingsResourceName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *SettingsClient) updateHandleResponse(resp *http.Response) (SettingsClientUpdateResponse, error) { - result := SettingsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Settings); err != nil { - return SettingsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hybridcompute/armhybridcompute/settings_client_example_test.go b/sdk/resourcemanager/hybridcompute/armhybridcompute/settings_client_example_test.go deleted file mode 100644 index 2dd3020b1e3a..000000000000 --- a/sdk/resourcemanager/hybridcompute/armhybridcompute/settings_client_example_test.go +++ /dev/null @@ -1,124 +0,0 @@ -//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. -// DO NOT EDIT. - -package armhybridcompute_test - -import ( - "context" - "log" - - "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/hybridcompute/armhybridcompute/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/settings/SettingsGet.json -func ExampleSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSettingsClient().Get(ctx, "hybridRG", "Microsoft.HybridCompute", "machines", "testMachine", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Settings = armhybridcompute.Settings{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.HybridCompute/settings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridCompute/settings/default"), - // Properties: &armhybridcompute.SettingsProperties{ - // GatewayProperties: &armhybridcompute.SettingsGatewayProperties{ - // GatewayResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/gateways/newGateway"), - // }, - // TenantID: to.Ptr("00000000-1111-2222-5555-444444444444"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/settings/SettingsUpdate.json -func ExampleSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSettingsClient().Update(ctx, "hybridRG", "Microsoft.HybridCompute", "machines", "testMachine", "default", armhybridcompute.Settings{ - Properties: &armhybridcompute.SettingsProperties{ - GatewayProperties: &armhybridcompute.SettingsGatewayProperties{ - GatewayResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/gateways/newGateway"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Settings = armhybridcompute.Settings{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.HybridCompute/settings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridCompute/settings/default"), - // Properties: &armhybridcompute.SettingsProperties{ - // GatewayProperties: &armhybridcompute.SettingsGatewayProperties{ - // GatewayResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/gateways/newGateway"), - // }, - // TenantID: to.Ptr("00000000-1111-2222-5555-444444444444"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/settings/SettingsPatch.json -func ExampleSettingsClient_Patch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhybridcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSettingsClient().Patch(ctx, "hybridRG", "Microsoft.HybridCompute", "machines", "testMachine", "default", armhybridcompute.Settings{ - Properties: &armhybridcompute.SettingsProperties{ - GatewayProperties: &armhybridcompute.SettingsGatewayProperties{ - GatewayResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/gateways/newGateway"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Settings = armhybridcompute.Settings{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.HybridCompute/settings"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridCompute/settings/default"), - // Properties: &armhybridcompute.SettingsProperties{ - // GatewayProperties: &armhybridcompute.SettingsGatewayProperties{ - // GatewayResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/gateways/newGateway"), - // }, - // TenantID: to.Ptr("00000000-1111-2222-5555-444444444444"), - // }, - // } -}