diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md b/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md index b61979e0d279..2c47c13f183d 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md +++ b/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 0.2.0 (2024-10-16) +### Breaking Changes + +- `NetworkAPIVersion20201101` from enum `NetworkAPIVersion` has been removed + +### Features Added + +- New value `NetworkAPIVersionV20201101` added to enum type `NetworkAPIVersion` + + ## 0.1.0 (2024-07-26) ### Other Changes diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/constants.go b/sdk/resourcemanager/computefleet/armcomputefleet/constants.go index c49940367a6f..63cd369b5222 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/constants.go +++ b/sdk/resourcemanager/computefleet/armcomputefleet/constants.go @@ -6,7 +6,7 @@ package armcomputefleet const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet" - moduleVersion = "v0.1.0" + moduleVersion = "v0.2.0" ) // ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -395,14 +395,14 @@ func PossibleModeValues() []Mode { type NetworkAPIVersion string const ( - // NetworkAPIVersion20201101 - Initial version supported. Later versions are supported as well. - NetworkAPIVersion20201101 NetworkAPIVersion = "2020-11-01" + // NetworkAPIVersionV20201101 - Initial version supported. Later versions are supported as well. + NetworkAPIVersionV20201101 NetworkAPIVersion = "2020-11-01" ) // PossibleNetworkAPIVersionValues returns the possible values for the NetworkAPIVersion const type. func PossibleNetworkAPIVersionValues() []NetworkAPIVersion { return []NetworkAPIVersion{ - NetworkAPIVersion20201101, + NetworkAPIVersionV20201101, } } diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go b/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go new file mode 100644 index 000000000000..2a760c30181b --- /dev/null +++ b/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go @@ -0,0 +1,3114 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armcomputefleet_test + +import ( + "context" + "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/computefleet/armcomputefleet" + "log" +) + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_CreateOrUpdate.json +func ExampleFleetsClient_BeginCreateOrUpdate_fleetsCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewFleetsClient().BeginCreateOrUpdate(ctx, "rgazurefleet", "testFleet", armcomputefleet.Fleet{ + Properties: &armcomputefleet.FleetProperties{ + SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + Capacity: to.Ptr[int32](20), + MinCapacity: to.Ptr[int32](10), + MaxPricePerVM: to.Ptr[float32](0.00865), + EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + Maintain: to.Ptr(true), + }, + RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + Capacity: to.Ptr[int32](20), + MinCapacity: to.Ptr[int32](10), + AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + }, + VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + { + Name: to.Ptr("Standard_d1_v2"), + Rank: to.Ptr[int32](19225), + }, + }, + ComputeProfile: &armcomputefleet.ComputeProfile{ + BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + ComputerNamePrefix: to.Ptr("o"), + AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + AdminPassword: to.Ptr("adfbrdxpv"), + CustomData: to.Ptr("xjjib"), + WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + ProvisionVMAgent: to.Ptr(true), + EnableAutomaticUpdates: to.Ptr(true), + TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + { + PassName: to.Ptr("OobeSystem"), + ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + Content: to.Ptr("bubmqbxjkj"), + }, + }, + PatchSettings: &armcomputefleet.PatchSettings{ + PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + EnableHotpatching: to.Ptr(true), + AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + }, + }, + WinRM: &armcomputefleet.WinRMConfiguration{ + Listeners: []*armcomputefleet.WinRMListener{ + { + Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTPS), + CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + }, + }, + }, + EnableVMAgentPlatformUpdates: to.Ptr(true), + }, + LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + DisablePasswordAuthentication: to.Ptr(true), + SSH: &armcomputefleet.SSHConfiguration{ + PublicKeys: []*armcomputefleet.SSHPublicKey{ + { + Path: to.Ptr("kmqz"), + KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + }, + }, + }, + ProvisionVMAgent: to.Ptr(true), + PatchSettings: &armcomputefleet.LinuxPatchSettings{ + PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + }, + }, + EnableVMAgentPlatformUpdates: to.Ptr(true), + }, + Secrets: []*armcomputefleet.VaultSecretGroup{ + { + SourceVault: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + }, + VaultCertificates: []*armcomputefleet.VaultCertificate{ + { + CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + }, + }, + }, + }, + AllowExtensionOperations: to.Ptr(true), + RequireGuestProvisionSignal: to.Ptr(true), + }, + StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + ImageReference: &armcomputefleet.ImageReference{ + Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + Offer: to.Ptr("isxgumkarlkomp"), + SKU: to.Ptr("eojmppqcrnpmxirtp"), + Version: to.Ptr("wvpcqefgtmqdgltiuz"), + SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + CommunityGalleryImageID: to.Ptr("vlqe"), + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + }, + OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + Name: to.Ptr("wfttw"), + Caching: to.Ptr(armcomputefleet.CachingTypesNone), + WriteAcceleratorEnabled: to.Ptr(true), + CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + }, + DiskSizeGB: to.Ptr[int32](14), + OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + Image: &armcomputefleet.VirtualHardDisk{ + URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), + }, + VhdContainers: []*string{ + to.Ptr("tkzcwddtinkfpnfklatw"), + }, + ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + }, + }, + DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + }, + DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + { + Name: to.Ptr("eogiykmdmeikswxmigjws"), + Lun: to.Ptr[int32](14), + Caching: to.Ptr(armcomputefleet.CachingTypesNone), + WriteAcceleratorEnabled: to.Ptr(true), + CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + DiskSizeGB: to.Ptr[int32](6), + ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + }, + }, + DiskIOPSReadWrite: to.Ptr[int64](27), + DiskMBpsReadWrite: to.Ptr[int64](2), + DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + }, + }, + }, + NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + HealthProbe: &armcomputefleet.APIEntityReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + }, + NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + { + Name: to.Ptr("i"), + Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + Primary: to.Ptr(true), + EnableAcceleratedNetworking: to.Ptr(true), + DisableTCPStateTracking: to.Ptr(true), + EnableFpga: to.Ptr(true), + NetworkSecurityGroup: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + }, + DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + DNSServers: []*string{ + to.Ptr("nxmmfolhclsesu"), + }, + }, + IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + { + Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + Subnet: &armcomputefleet.APIEntityReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + }, + Primary: to.Ptr(true), + PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + Name: to.Ptr("fvpqf"), + Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + IdleTimeoutInMinutes: to.Ptr[int32](9), + DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + }, + IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + { + IPTagType: to.Ptr("sddgsoemnzgqizale"), + Tag: to.Ptr("wufmhrjsakbiaetyara"), + }, + }, + PublicIPPrefix: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + }, + PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + }, + SKU: &armcomputefleet.PublicIPAddressSKU{ + Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + }, + }, + PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + }, + }, + ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + }, + }, + LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + }, + }, + LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + }, + }, + }, + }, + }, + EnableIPForwarding: to.Ptr(true), + DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + }, + }, + }, + NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), + }, + SecurityProfile: &armcomputefleet.SecurityProfile{ + UefiSettings: &armcomputefleet.UefiSettings{ + SecureBootEnabled: to.Ptr(true), + VTpmEnabled: to.Ptr(true), + }, + EncryptionAtHost: to.Ptr(true), + SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + }, + ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + Enabled: to.Ptr(true), + Mode: to.Ptr(armcomputefleet.ModeAudit), + KeyIncarnationID: to.Ptr[int32](20), + }, + }, + DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + BootDiagnostics: &armcomputefleet.BootDiagnostics{ + Enabled: to.Ptr(true), + StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), + }, + }, + ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + { + Name: to.Ptr("bndxuxx"), + Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + ForceUpdateTag: to.Ptr("yhgxw"), + Publisher: to.Ptr("kpxtirxjfprhs"), + Type: to.Ptr("pgjilctjjwaa"), + TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + AutoUpgradeMinorVersion: to.Ptr(true), + EnableAutomaticUpgrade: to.Ptr(true), + Settings: map[string]any{}, + ProtectedSettings: map[string]any{}, + ProvisionAfterExtensions: []*string{ + to.Ptr("nftzosroolbcwmpupujzqwqe"), + }, + SuppressFailures: to.Ptr(true), + ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + SecretURL: to.Ptr("https://myvaultName.vault.azure.net/secrets/secret/mySecretName"), + SourceVault: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + }, + }, + }, + }, + }, + ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + }, + LicenseType: to.Ptr("v"), + ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + NotBeforeTimeout: to.Ptr("iljppmmw"), + Enable: to.Ptr(true), + }, + OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + Enable: to.Ptr(true), + }, + }, + UserData: to.Ptr("s"), + CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + CapacityReservationGroup: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + }, + }, + ApplicationProfile: &armcomputefleet.ApplicationProfile{ + GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + { + Tags: to.Ptr("eyrqjbib"), + Order: to.Ptr[int32](5), + PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + ConfigurationReference: to.Ptr("ulztmiavpojpbpbddgnuuiimxcpau"), + TreatFailureAsDeploymentFailure: to.Ptr(true), + EnableAutomaticUpgrade: to.Ptr(true), + }, + }, + }, + HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + VMSizeProperties: &armcomputefleet.VMSizeProperties{ + VCPUsAvailable: to.Ptr[int32](16), + VCPUsPerCore: to.Ptr[int32](23), + }, + }, + ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + }, + SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), + ExcludeExtensions: []*string{ + to.Ptr("{securityPostureVMExtensionName}"), + }, + IsOverridable: to.Ptr(true), + }, + }, + ComputeAPIVersion: to.Ptr("2023-07-01"), + PlatformFaultDomainCount: to.Ptr[int32](1), + }, + }, + Zones: []*string{ + to.Ptr("zone1"), + to.Ptr("zone2"), + }, + Identity: &armcomputefleet.ManagedServiceIdentity{ + Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ + "key9851": {}, + }, + }, + Tags: map[string]*string{ + "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), + }, + Location: to.Ptr("westus"), + Plan: &armcomputefleet.Plan{ + Name: to.Ptr("jwgrcrnrtfoxn"), + Publisher: to.Ptr("iozjbiqqckqm"), + Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), + PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), + Version: to.Ptr("wa"), + }, + }, 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 = armcomputefleet.FleetsClientCreateOrUpdateResponse{ + // Fleet: &armcomputefleet.Fleet{ + // Properties: &armcomputefleet.FleetProperties{ + // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + // Capacity: to.Ptr[int32](10), + // MinCapacity: to.Ptr[int32](20), + // MaxPricePerVM: to.Ptr[float32](0.00865), + // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + // Maintain: to.Ptr(true), + // }, + // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + // Capacity: to.Ptr[int32](10), + // MinCapacity: to.Ptr[int32](10), + // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + // }, + // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + // { + // Name: to.Ptr("Standard_d1_v2"), + // Rank: to.Ptr[int32](19225), + // }, + // }, + // ComputeProfile: &armcomputefleet.ComputeProfile{ + // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + // ComputerNamePrefix: to.Ptr("o"), + // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + // ProvisionVMAgent: to.Ptr(true), + // EnableAutomaticUpdates: to.Ptr(true), + // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + // { + // PassName: to.Ptr("OobeSystem"), + // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + // }, + // }, + // PatchSettings: &armcomputefleet.PatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + // EnableHotpatching: to.Ptr(true), + // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // WinRM: &armcomputefleet.WinRMConfiguration{ + // Listeners: []*armcomputefleet.WinRMListener{ + // { + // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTPS), + // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + // }, + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + // DisablePasswordAuthentication: to.Ptr(true), + // SSH: &armcomputefleet.SSHConfiguration{ + // PublicKeys: []*armcomputefleet.SSHPublicKey{ + // { + // Path: to.Ptr("kmqz"), + // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + // }, + // }, + // }, + // ProvisionVMAgent: to.Ptr(true), + // PatchSettings: &armcomputefleet.LinuxPatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // Secrets: []*armcomputefleet.VaultSecretGroup{ + // { + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // VaultCertificates: []*armcomputefleet.VaultCertificate{ + // { + // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + // }, + // }, + // }, + // }, + // AllowExtensionOperations: to.Ptr(true), + // RequireGuestProvisionSignal: to.Ptr(true), + // }, + // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + // ImageReference: &armcomputefleet.ImageReference{ + // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + // Offer: to.Ptr("isxgumkarlkomp"), + // SKU: to.Ptr("eojmppqcrnpmxirtp"), + // Version: to.Ptr("wvpcqefgtmqdgltiuz"), + // ExactVersion: to.Ptr("zjbntmiskjexlr"), + // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + // CommunityGalleryImageID: to.Ptr("vlqe"), + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + // }, + // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + // Name: to.Ptr("wfttw"), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + // }, + // DiskSizeGB: to.Ptr[int32](14), + // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + // Image: &armcomputefleet.VirtualHardDisk{ + // URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), + // }, + // VhdContainers: []*string{ + // to.Ptr("tkzcwddtinkfpnfklatw"), + // }, + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + // { + // Name: to.Ptr("eogiykmdmeikswxmigjws"), + // Lun: to.Ptr[int32](14), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiskSizeGB: to.Ptr[int32](6), + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DiskIOPSReadWrite: to.Ptr[int64](27), + // DiskMBpsReadWrite: to.Ptr[int64](2), + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // }, + // }, + // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + // HealthProbe: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + // }, + // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + // { + // Name: to.Ptr("i"), + // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + // Primary: to.Ptr(true), + // EnableAcceleratedNetworking: to.Ptr(true), + // DisableTCPStateTracking: to.Ptr(true), + // EnableFpga: to.Ptr(true), + // NetworkSecurityGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + // }, + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + // DNSServers: []*string{ + // to.Ptr("nxmmfolhclsesu"), + // }, + // }, + // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + // { + // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + // Subnet: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + // }, + // Primary: to.Ptr(true), + // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + // Name: to.Ptr("fvpqf"), + // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + // IdleTimeoutInMinutes: to.Ptr[int32](9), + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + // }, + // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + // { + // IPTagType: to.Ptr("sddgsoemnzgqizale"), + // Tag: to.Ptr("wufmhrjsakbiaetyara"), + // }, + // }, + // PublicIPPrefix: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + // }, + // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // }, + // SKU: &armcomputefleet.PublicIPAddressSKU{ + // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + // }, + // }, + // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + // }, + // }, + // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + // }, + // }, + // }, + // }, + // }, + // EnableIPForwarding: to.Ptr(true), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + // }, + // }, + // }, + // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), + // }, + // SecurityProfile: &armcomputefleet.SecurityProfile{ + // UefiSettings: &armcomputefleet.UefiSettings{ + // SecureBootEnabled: to.Ptr(true), + // VTpmEnabled: to.Ptr(true), + // }, + // EncryptionAtHost: to.Ptr(true), + // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + // }, + // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + // Enabled: to.Ptr(true), + // Mode: to.Ptr(armcomputefleet.ModeAudit), + // KeyIncarnationID: to.Ptr[int32](20), + // }, + // }, + // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + // BootDiagnostics: &armcomputefleet.BootDiagnostics{ + // Enabled: to.Ptr(true), + // StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), + // }, + // }, + // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + // { + // Name: to.Ptr("bndxuxx"), + // Type: to.Ptr("cmeam"), + // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + // ForceUpdateTag: to.Ptr("yhgxw"), + // Publisher: to.Ptr("kpxtirxjfprhs"), + // Type: to.Ptr("pgjilctjjwaa"), + // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // Settings: map[string]any{ + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // ProvisionAfterExtensions: []*string{ + // to.Ptr("nftzosroolbcwmpupujzqwqe"), + // }, + // SuppressFailures: to.Ptr(true), + // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + // SecretURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/secret/mySecretName"), + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // }, + // }, + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), + // }, + // }, + // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + // }, + // LicenseType: to.Ptr("v"), + // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + // NotBeforeTimeout: to.Ptr("iljppmmw"), + // Enable: to.Ptr(true), + // }, + // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + // Enable: to.Ptr(true), + // }, + // }, + // UserData: to.Ptr("s"), + // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + // CapacityReservationGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + // }, + // }, + // ApplicationProfile: &armcomputefleet.ApplicationProfile{ + // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + // { + // Tags: to.Ptr("eyrqjbib"), + // Order: to.Ptr[int32](5), + // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + // TreatFailureAsDeploymentFailure: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // }, + // }, + // }, + // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + // VMSizeProperties: &armcomputefleet.VMSizeProperties{ + // VCPUsAvailable: to.Ptr[int32](16), + // VCPUsPerCore: to.Ptr[int32](23), + // }, + // }, + // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + // }, + // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + // ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), + // ExcludeExtensions: []*string{ + // to.Ptr("{securityPostureVMExtensionName}"), + // }, + // IsOverridable: to.Ptr(true), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // ComputeAPIVersion: to.Ptr("2023-07-01"), + // PlatformFaultDomainCount: to.Ptr[int32](1), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), + // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), + // }, + // Zones: []*string{ + // to.Ptr("zone1"), + // to.Ptr("zone2"), + // }, + // Identity: &armcomputefleet.ManagedServiceIdentity{ + // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ + // "key9851": &armcomputefleet.UserAssignedIdentity{ + // PrincipalID: to.Ptr("6d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // ClientID: to.Ptr("7d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // }, + // }, + // }, + // Plan: &armcomputefleet.Plan{ + // Name: to.Ptr("jwgrcrnrtfoxn"), + // Publisher: to.Ptr("iozjbiqqckqm"), + // Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), + // PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), + // Version: to.Ptr("wa"), + // }, + // Tags: map[string]*string{ + // "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), + // }, + // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), + // Name: to.Ptr("testFleet"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets"), + // SystemData: &armcomputefleet.SystemData{ + // CreatedBy: to.Ptr("rowegentrpoajsv"), + // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), + // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // }, + // } +} + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_CreateOrUpdate_MinimumSet.json +func ExampleFleetsClient_BeginCreateOrUpdate_fleetsCreateOrUpdateMinimumSet() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewFleetsClient().BeginCreateOrUpdate(ctx, "rgazurefleet", "testFleet", armcomputefleet.Fleet{ + Properties: &armcomputefleet.FleetProperties{ + SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + Capacity: to.Ptr[int32](2), + MinCapacity: to.Ptr[int32](1), + EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + Maintain: to.Ptr(true), + }, + RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + Capacity: to.Ptr[int32](2), + MinCapacity: to.Ptr[int32](1), + AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + }, + VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + { + Name: to.Ptr("Standard_D2s_v3"), + }, + { + Name: to.Ptr("Standard_D4s_v3"), + }, + { + Name: to.Ptr("Standard_E2s_v3"), + }, + }, + ComputeProfile: &armcomputefleet.ComputeProfile{ + BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + ImageReference: &armcomputefleet.ImageReference{ + Publisher: to.Ptr("canonical"), + Offer: to.Ptr("0001-com-ubuntu-server-focal"), + SKU: to.Ptr("20_04-lts-gen2"), + Version: to.Ptr("latest"), + }, + OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + Caching: to.Ptr(armcomputefleet.CachingTypesReadWrite), + CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + OSType: to.Ptr(armcomputefleet.OperatingSystemTypesLinux), + ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + }, + }, + }, + OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + ComputerNamePrefix: to.Ptr("prefix"), + AdminUsername: to.Ptr("azureuser"), + AdminPassword: to.Ptr("TestPassword$0"), + LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + DisablePasswordAuthentication: to.Ptr(false), + }, + }, + NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + { + Name: to.Ptr("vmNameTest"), + Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + Primary: to.Ptr(true), + EnableAcceleratedNetworking: to.Ptr(false), + IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + { + Name: to.Ptr("vmNameTest"), + Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + Subnet: &armcomputefleet.APIEntityReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + }, + Primary: to.Ptr(true), + LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + }, + }, + }, + }, + }, + EnableIPForwarding: to.Ptr(true), + }, + }, + }, + }, + }, + ComputeAPIVersion: to.Ptr("2023-09-01"), + PlatformFaultDomainCount: to.Ptr[int32](1), + }, + }, + Tags: map[string]*string{ + "key": to.Ptr("fleets-test"), + }, + Location: to.Ptr("eastus2euap"), + }, 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 = armcomputefleet.FleetsClientCreateOrUpdateResponse{ + // Fleet: &armcomputefleet.Fleet{ + // Properties: &armcomputefleet.FleetProperties{ + // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + // Capacity: to.Ptr[int32](2), + // MinCapacity: to.Ptr[int32](1), + // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + // Maintain: to.Ptr(true), + // }, + // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + // Capacity: to.Ptr[int32](2), + // MinCapacity: to.Ptr[int32](1), + // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + // }, + // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + // { + // Name: to.Ptr("Standard_D2s_v3"), + // }, + // { + // Name: to.Ptr("Standard_D4s_v3"), + // }, + // { + // Name: to.Ptr("Standard_E2s_v3"), + // }, + // }, + // ComputeProfile: &armcomputefleet.ComputeProfile{ + // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + // ImageReference: &armcomputefleet.ImageReference{ + // Publisher: to.Ptr("canonical"), + // Offer: to.Ptr("0001-com-ubuntu-server-focal"), + // SKU: to.Ptr("20_04-lts-gen2"), + // Version: to.Ptr("latest"), + // }, + // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + // Caching: to.Ptr(armcomputefleet.CachingTypesReadWrite), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesLinux), + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // }, + // }, + // }, + // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + // ComputerNamePrefix: to.Ptr("prefix"), + // AdminUsername: to.Ptr("azureuser"), + // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + // DisablePasswordAuthentication: to.Ptr(false), + // }, + // }, + // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + // { + // Name: to.Ptr("vmNameTest"), + // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + // Primary: to.Ptr(true), + // EnableAcceleratedNetworking: to.Ptr(false), + // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + // { + // Name: to.Ptr("vmNameTest"), + // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + // Subnet: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + // }, + // Primary: to.Ptr(true), + // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // }, + // }, + // }, + // EnableIPForwarding: to.Ptr(true), + // }, + // }, + // }, + // }, + // }, + // ComputeAPIVersion: to.Ptr("2023-09-01"), + // PlatformFaultDomainCount: to.Ptr[int32](1), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), + // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), + // }, + // Tags: map[string]*string{ + // "key": to.Ptr("fleets-test"), + // }, + // Location: to.Ptr("eastus2euap"), + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), + // Name: to.Ptr("testFleet"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets"), + // }, + // } +} + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_Delete.json +func ExampleFleetsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewFleetsClient().BeginDelete(ctx, "rgazurefleet", "testFleet", 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: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_Get.json +func ExampleFleetsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewFleetsClient().Get(ctx, "rgazurefleet", "testFleet", 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 = armcomputefleet.FleetsClientGetResponse{ + // Fleet: &armcomputefleet.Fleet{ + // Properties: &armcomputefleet.FleetProperties{ + // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // MaxPricePerVM: to.Ptr[float32](0.00865), + // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + // Maintain: to.Ptr(true), + // }, + // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + // }, + // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + // { + // Name: to.Ptr("Standard_d1_v2"), + // Rank: to.Ptr[int32](19225), + // }, + // }, + // ComputeProfile: &armcomputefleet.ComputeProfile{ + // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + // ComputerNamePrefix: to.Ptr("o"), + // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + // ProvisionVMAgent: to.Ptr(true), + // EnableAutomaticUpdates: to.Ptr(true), + // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + // { + // PassName: to.Ptr("OobeSystem"), + // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + // }, + // }, + // PatchSettings: &armcomputefleet.PatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + // EnableHotpatching: to.Ptr(true), + // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // WinRM: &armcomputefleet.WinRMConfiguration{ + // Listeners: []*armcomputefleet.WinRMListener{ + // { + // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), + // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + // }, + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + // DisablePasswordAuthentication: to.Ptr(true), + // SSH: &armcomputefleet.SSHConfiguration{ + // PublicKeys: []*armcomputefleet.SSHPublicKey{ + // { + // Path: to.Ptr("kmqz"), + // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + // }, + // }, + // }, + // ProvisionVMAgent: to.Ptr(true), + // PatchSettings: &armcomputefleet.LinuxPatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // Secrets: []*armcomputefleet.VaultSecretGroup{ + // { + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // VaultCertificates: []*armcomputefleet.VaultCertificate{ + // { + // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + // }, + // }, + // }, + // }, + // AllowExtensionOperations: to.Ptr(true), + // RequireGuestProvisionSignal: to.Ptr(true), + // }, + // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + // ImageReference: &armcomputefleet.ImageReference{ + // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + // Offer: to.Ptr("isxgumkarlkomp"), + // SKU: to.Ptr("eojmppqcrnpmxirtp"), + // Version: to.Ptr("wvpcqefgtmqdgltiuz"), + // ExactVersion: to.Ptr("zjbntmiskjexlr"), + // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + // CommunityGalleryImageID: to.Ptr("vlqe"), + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + // }, + // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + // Name: to.Ptr("wfttw"), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + // }, + // DiskSizeGB: to.Ptr[int32](14), + // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + // Image: &armcomputefleet.VirtualHardDisk{ + // URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), + // }, + // VhdContainers: []*string{ + // to.Ptr("tkzcwddtinkfpnfklatw"), + // }, + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + // { + // Name: to.Ptr("eogiykmdmeikswxmigjws"), + // Lun: to.Ptr[int32](14), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiskSizeGB: to.Ptr[int32](6), + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DiskIOPSReadWrite: to.Ptr[int64](27), + // DiskMBpsReadWrite: to.Ptr[int64](2), + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // }, + // }, + // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + // HealthProbe: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + // }, + // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + // { + // Name: to.Ptr("i"), + // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + // Primary: to.Ptr(true), + // EnableAcceleratedNetworking: to.Ptr(true), + // DisableTCPStateTracking: to.Ptr(true), + // EnableFpga: to.Ptr(true), + // NetworkSecurityGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + // }, + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + // DNSServers: []*string{ + // to.Ptr("nxmmfolhclsesu"), + // }, + // }, + // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + // { + // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + // Subnet: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + // }, + // Primary: to.Ptr(true), + // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + // Name: to.Ptr("fvpqf"), + // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + // IdleTimeoutInMinutes: to.Ptr[int32](9), + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + // }, + // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + // { + // IPTagType: to.Ptr("sddgsoemnzgqizale"), + // Tag: to.Ptr("wufmhrjsakbiaetyara"), + // }, + // }, + // PublicIPPrefix: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + // }, + // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // }, + // SKU: &armcomputefleet.PublicIPAddressSKU{ + // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + // }, + // }, + // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + // }, + // }, + // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + // }, + // }, + // }, + // }, + // }, + // EnableIPForwarding: to.Ptr(true), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + // }, + // }, + // }, + // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), + // }, + // SecurityProfile: &armcomputefleet.SecurityProfile{ + // UefiSettings: &armcomputefleet.UefiSettings{ + // SecureBootEnabled: to.Ptr(true), + // VTpmEnabled: to.Ptr(true), + // }, + // EncryptionAtHost: to.Ptr(true), + // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + // }, + // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + // Enabled: to.Ptr(true), + // Mode: to.Ptr(armcomputefleet.ModeAudit), + // KeyIncarnationID: to.Ptr[int32](20), + // }, + // }, + // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + // BootDiagnostics: &armcomputefleet.BootDiagnostics{ + // Enabled: to.Ptr(true), + // StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), + // }, + // }, + // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + // { + // Name: to.Ptr("bndxuxx"), + // Type: to.Ptr("cmeam"), + // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + // ForceUpdateTag: to.Ptr("yhgxw"), + // Publisher: to.Ptr("kpxtirxjfprhs"), + // Type: to.Ptr("pgjilctjjwaa"), + // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // Settings: map[string]any{ + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // ProvisionAfterExtensions: []*string{ + // to.Ptr("nftzosroolbcwmpupujzqwqe"), + // }, + // SuppressFailures: to.Ptr(true), + // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + // SecretURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/secret/mySecretName"), + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // }, + // }, + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), + // }, + // }, + // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + // }, + // LicenseType: to.Ptr("v"), + // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + // NotBeforeTimeout: to.Ptr("iljppmmw"), + // Enable: to.Ptr(true), + // }, + // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + // Enable: to.Ptr(true), + // }, + // }, + // UserData: to.Ptr("s"), + // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + // CapacityReservationGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + // }, + // }, + // ApplicationProfile: &armcomputefleet.ApplicationProfile{ + // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + // { + // Tags: to.Ptr("eyrqjbib"), + // Order: to.Ptr[int32](5), + // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + // TreatFailureAsDeploymentFailure: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // }, + // }, + // }, + // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + // VMSizeProperties: &armcomputefleet.VMSizeProperties{ + // VCPUsAvailable: to.Ptr[int32](16), + // VCPUsPerCore: to.Ptr[int32](23), + // }, + // }, + // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + // }, + // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + // ID: to.Ptr("mubredelfbshboaxrsxiajihahaa"), + // ExcludeExtensions: []*string{ + // to.Ptr("{securityPostureVMExtensionName}"), + // }, + // IsOverridable: to.Ptr(true), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // ComputeAPIVersion: to.Ptr("2023-07-01"), + // PlatformFaultDomainCount: to.Ptr[int32](1), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), + // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), + // }, + // Zones: []*string{ + // to.Ptr("zone1"), + // to.Ptr("zone2"), + // }, + // Identity: &armcomputefleet.ManagedServiceIdentity{ + // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ + // "key9851": &armcomputefleet.UserAssignedIdentity{ + // PrincipalID: to.Ptr("6d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // ClientID: to.Ptr("7d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), + // }, + // Plan: &armcomputefleet.Plan{ + // Name: to.Ptr("jwgrcrnrtfoxn"), + // Publisher: to.Ptr("iozjbiqqckqm"), + // Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), + // PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), + // Version: to.Ptr("wa"), + // }, + // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), + // Name: to.Ptr("testFleet"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets"), + // SystemData: &armcomputefleet.SystemData{ + // CreatedBy: to.Ptr("rowegentrpoajsv"), + // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), + // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // }, + // } +} + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_ListByResourceGroup.json +func ExampleFleetsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewFleetsClient().NewListByResourceGroupPager("rgazurefleet", 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 = armcomputefleet.FleetsClientListByResourceGroupResponse{ + // FleetListResult: armcomputefleet.FleetListResult{ + // Value: []*armcomputefleet.Fleet{ + // { + // Properties: &armcomputefleet.FleetProperties{ + // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // MaxPricePerVM: to.Ptr[float32](0.00865), + // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + // Maintain: to.Ptr(true), + // }, + // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + // }, + // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + // { + // Name: to.Ptr("Standard_d1_v2"), + // Rank: to.Ptr[int32](19225), + // }, + // }, + // ComputeProfile: &armcomputefleet.ComputeProfile{ + // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + // ComputerNamePrefix: to.Ptr("o"), + // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + // ProvisionVMAgent: to.Ptr(true), + // EnableAutomaticUpdates: to.Ptr(true), + // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + // { + // PassName: to.Ptr("OobeSystem"), + // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + // }, + // }, + // PatchSettings: &armcomputefleet.PatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + // EnableHotpatching: to.Ptr(true), + // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // WinRM: &armcomputefleet.WinRMConfiguration{ + // Listeners: []*armcomputefleet.WinRMListener{ + // { + // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), + // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + // }, + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + // DisablePasswordAuthentication: to.Ptr(true), + // SSH: &armcomputefleet.SSHConfiguration{ + // PublicKeys: []*armcomputefleet.SSHPublicKey{ + // { + // Path: to.Ptr("kmqz"), + // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + // }, + // }, + // }, + // ProvisionVMAgent: to.Ptr(true), + // PatchSettings: &armcomputefleet.LinuxPatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // Secrets: []*armcomputefleet.VaultSecretGroup{ + // { + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // VaultCertificates: []*armcomputefleet.VaultCertificate{ + // { + // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + // }, + // }, + // }, + // }, + // AllowExtensionOperations: to.Ptr(true), + // RequireGuestProvisionSignal: to.Ptr(true), + // }, + // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + // ImageReference: &armcomputefleet.ImageReference{ + // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + // Offer: to.Ptr("isxgumkarlkomp"), + // SKU: to.Ptr("eojmppqcrnpmxirtp"), + // Version: to.Ptr("wvpcqefgtmqdgltiuz"), + // ExactVersion: to.Ptr("zjbntmiskjexlr"), + // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + // CommunityGalleryImageID: to.Ptr("vlqe"), + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + // }, + // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + // Name: to.Ptr("wfttw"), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + // }, + // DiskSizeGB: to.Ptr[int32](14), + // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + // Image: &armcomputefleet.VirtualHardDisk{ + // URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), + // }, + // VhdContainers: []*string{ + // to.Ptr("tkzcwddtinkfpnfklatw"), + // }, + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + // { + // Name: to.Ptr("eogiykmdmeikswxmigjws"), + // Lun: to.Ptr[int32](14), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiskSizeGB: to.Ptr[int32](6), + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DiskIOPSReadWrite: to.Ptr[int64](27), + // DiskMBpsReadWrite: to.Ptr[int64](2), + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // }, + // }, + // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + // HealthProbe: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + // }, + // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + // { + // Name: to.Ptr("i"), + // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + // Primary: to.Ptr(true), + // EnableAcceleratedNetworking: to.Ptr(true), + // DisableTCPStateTracking: to.Ptr(true), + // EnableFpga: to.Ptr(true), + // NetworkSecurityGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + // }, + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + // DNSServers: []*string{ + // to.Ptr("nxmmfolhclsesu"), + // }, + // }, + // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + // { + // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + // Subnet: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + // }, + // Primary: to.Ptr(true), + // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + // Name: to.Ptr("fvpqf"), + // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + // IdleTimeoutInMinutes: to.Ptr[int32](9), + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + // }, + // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + // { + // IPTagType: to.Ptr("sddgsoemnzgqizale"), + // Tag: to.Ptr("wufmhrjsakbiaetyara"), + // }, + // }, + // PublicIPPrefix: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + // }, + // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // }, + // SKU: &armcomputefleet.PublicIPAddressSKU{ + // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + // }, + // }, + // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + // }, + // }, + // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + // }, + // }, + // }, + // }, + // }, + // EnableIPForwarding: to.Ptr(true), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + // }, + // }, + // }, + // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), + // }, + // SecurityProfile: &armcomputefleet.SecurityProfile{ + // UefiSettings: &armcomputefleet.UefiSettings{ + // SecureBootEnabled: to.Ptr(true), + // VTpmEnabled: to.Ptr(true), + // }, + // EncryptionAtHost: to.Ptr(true), + // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + // }, + // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + // Enabled: to.Ptr(true), + // Mode: to.Ptr(armcomputefleet.ModeAudit), + // KeyIncarnationID: to.Ptr[int32](20), + // }, + // }, + // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + // BootDiagnostics: &armcomputefleet.BootDiagnostics{ + // Enabled: to.Ptr(true), + // StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), + // }, + // }, + // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + // { + // Name: to.Ptr("bndxuxx"), + // Type: to.Ptr("cmeam"), + // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + // ForceUpdateTag: to.Ptr("yhgxw"), + // Publisher: to.Ptr("kpxtirxjfprhs"), + // Type: to.Ptr("pgjilctjjwaa"), + // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // Settings: map[string]any{ + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // ProvisionAfterExtensions: []*string{ + // to.Ptr("nftzosroolbcwmpupujzqwqe"), + // }, + // SuppressFailures: to.Ptr(true), + // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + // SecretURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/secret/mySecretName"), + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // }, + // }, + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), + // }, + // }, + // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + // }, + // LicenseType: to.Ptr("v"), + // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + // NotBeforeTimeout: to.Ptr("iljppmmw"), + // Enable: to.Ptr(true), + // }, + // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + // Enable: to.Ptr(true), + // }, + // }, + // UserData: to.Ptr("s"), + // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + // CapacityReservationGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + // }, + // }, + // ApplicationProfile: &armcomputefleet.ApplicationProfile{ + // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + // { + // Tags: to.Ptr("eyrqjbib"), + // Order: to.Ptr[int32](5), + // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + // TreatFailureAsDeploymentFailure: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // }, + // }, + // }, + // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + // VMSizeProperties: &armcomputefleet.VMSizeProperties{ + // VCPUsAvailable: to.Ptr[int32](16), + // VCPUsPerCore: to.Ptr[int32](23), + // }, + // }, + // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + // }, + // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + // ID: to.Ptr("mubredelfbshboaxrsxiajihahaa"), + // ExcludeExtensions: []*string{ + // to.Ptr("{securityPostureVMExtensionName}"), + // }, + // IsOverridable: to.Ptr(true), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // ComputeAPIVersion: to.Ptr("2023-07-01"), + // PlatformFaultDomainCount: to.Ptr[int32](1), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), + // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), + // }, + // Zones: []*string{ + // to.Ptr("zone1"), + // to.Ptr("zone2"), + // }, + // Identity: &armcomputefleet.ManagedServiceIdentity{ + // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ + // "key9851": &armcomputefleet.UserAssignedIdentity{ + // PrincipalID: to.Ptr("6d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // ClientID: to.Ptr("7d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // }, + // }, + // }, + // Plan: &armcomputefleet.Plan{ + // Name: to.Ptr("jwgrcrnrtfoxn"), + // Publisher: to.Ptr("iozjbiqqckqm"), + // Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), + // PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), + // Version: to.Ptr("wa"), + // }, + // Tags: map[string]*string{ + // "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), + // }, + // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), + // Name: to.Ptr("testFleet"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets"), + // SystemData: &armcomputefleet.SystemData{ + // CreatedBy: to.Ptr("rowegentrpoajsv"), + // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), + // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // }, + // }, + // NextLink: to.Ptr("https://microsoft.com/a"), + // }, + // } + } +} + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_ListBySubscription.json +func ExampleFleetsClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewFleetsClient().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 = armcomputefleet.FleetsClientListBySubscriptionResponse{ + // FleetListResult: armcomputefleet.FleetListResult{ + // Value: []*armcomputefleet.Fleet{ + // { + // Properties: &armcomputefleet.FleetProperties{ + // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // MaxPricePerVM: to.Ptr[float32](0.00865), + // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + // Maintain: to.Ptr(true), + // }, + // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + // }, + // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + // { + // Name: to.Ptr("Standard_d1_v2"), + // Rank: to.Ptr[int32](19225), + // }, + // }, + // ComputeProfile: &armcomputefleet.ComputeProfile{ + // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + // ComputerNamePrefix: to.Ptr("o"), + // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + // ProvisionVMAgent: to.Ptr(true), + // EnableAutomaticUpdates: to.Ptr(true), + // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + // { + // PassName: to.Ptr("OobeSystem"), + // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + // }, + // }, + // PatchSettings: &armcomputefleet.PatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + // EnableHotpatching: to.Ptr(true), + // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // WinRM: &armcomputefleet.WinRMConfiguration{ + // Listeners: []*armcomputefleet.WinRMListener{ + // { + // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), + // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + // }, + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + // DisablePasswordAuthentication: to.Ptr(true), + // SSH: &armcomputefleet.SSHConfiguration{ + // PublicKeys: []*armcomputefleet.SSHPublicKey{ + // { + // Path: to.Ptr("kmqz"), + // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + // }, + // }, + // }, + // ProvisionVMAgent: to.Ptr(true), + // PatchSettings: &armcomputefleet.LinuxPatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // Secrets: []*armcomputefleet.VaultSecretGroup{ + // { + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // VaultCertificates: []*armcomputefleet.VaultCertificate{ + // { + // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + // }, + // }, + // }, + // }, + // AllowExtensionOperations: to.Ptr(true), + // RequireGuestProvisionSignal: to.Ptr(true), + // }, + // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + // ImageReference: &armcomputefleet.ImageReference{ + // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + // Offer: to.Ptr("isxgumkarlkomp"), + // SKU: to.Ptr("eojmppqcrnpmxirtp"), + // Version: to.Ptr("wvpcqefgtmqdgltiuz"), + // ExactVersion: to.Ptr("zjbntmiskjexlr"), + // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + // CommunityGalleryImageID: to.Ptr("vlqe"), + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + // }, + // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + // Name: to.Ptr("wfttw"), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + // }, + // DiskSizeGB: to.Ptr[int32](14), + // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + // Image: &armcomputefleet.VirtualHardDisk{ + // URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), + // }, + // VhdContainers: []*string{ + // to.Ptr("tkzcwddtinkfpnfklatw"), + // }, + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + // { + // Name: to.Ptr("eogiykmdmeikswxmigjws"), + // Lun: to.Ptr[int32](14), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiskSizeGB: to.Ptr[int32](6), + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DiskIOPSReadWrite: to.Ptr[int64](27), + // DiskMBpsReadWrite: to.Ptr[int64](2), + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // }, + // }, + // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + // HealthProbe: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + // }, + // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + // { + // Name: to.Ptr("i"), + // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + // Primary: to.Ptr(true), + // EnableAcceleratedNetworking: to.Ptr(true), + // DisableTCPStateTracking: to.Ptr(true), + // EnableFpga: to.Ptr(true), + // NetworkSecurityGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + // }, + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + // DNSServers: []*string{ + // to.Ptr("nxmmfolhclsesu"), + // }, + // }, + // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + // { + // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + // Subnet: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + // }, + // Primary: to.Ptr(true), + // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + // Name: to.Ptr("fvpqf"), + // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + // IdleTimeoutInMinutes: to.Ptr[int32](9), + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + // }, + // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + // { + // IPTagType: to.Ptr("sddgsoemnzgqizale"), + // Tag: to.Ptr("wufmhrjsakbiaetyara"), + // }, + // }, + // PublicIPPrefix: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + // }, + // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // }, + // SKU: &armcomputefleet.PublicIPAddressSKU{ + // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + // }, + // }, + // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + // }, + // }, + // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + // }, + // }, + // }, + // }, + // }, + // EnableIPForwarding: to.Ptr(true), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + // }, + // }, + // }, + // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), + // }, + // SecurityProfile: &armcomputefleet.SecurityProfile{ + // UefiSettings: &armcomputefleet.UefiSettings{ + // SecureBootEnabled: to.Ptr(true), + // VTpmEnabled: to.Ptr(true), + // }, + // EncryptionAtHost: to.Ptr(true), + // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + // }, + // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + // Enabled: to.Ptr(true), + // Mode: to.Ptr(armcomputefleet.ModeAudit), + // KeyIncarnationID: to.Ptr[int32](20), + // }, + // }, + // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + // BootDiagnostics: &armcomputefleet.BootDiagnostics{ + // Enabled: to.Ptr(true), + // StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), + // }, + // }, + // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + // { + // Name: to.Ptr("bndxuxx"), + // Type: to.Ptr("cmeam"), + // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + // ForceUpdateTag: to.Ptr("yhgxw"), + // Publisher: to.Ptr("kpxtirxjfprhs"), + // Type: to.Ptr("pgjilctjjwaa"), + // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // Settings: map[string]any{ + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // ProvisionAfterExtensions: []*string{ + // to.Ptr("nftzosroolbcwmpupujzqwqe"), + // }, + // SuppressFailures: to.Ptr(true), + // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + // SecretURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/secret/mySecretName"), + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // }, + // }, + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), + // }, + // }, + // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + // }, + // LicenseType: to.Ptr("v"), + // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + // NotBeforeTimeout: to.Ptr("iljppmmw"), + // Enable: to.Ptr(true), + // }, + // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + // Enable: to.Ptr(true), + // }, + // }, + // UserData: to.Ptr("s"), + // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + // CapacityReservationGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + // }, + // }, + // ApplicationProfile: &armcomputefleet.ApplicationProfile{ + // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + // { + // Tags: to.Ptr("eyrqjbib"), + // Order: to.Ptr[int32](5), + // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + // TreatFailureAsDeploymentFailure: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // }, + // }, + // }, + // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + // VMSizeProperties: &armcomputefleet.VMSizeProperties{ + // VCPUsAvailable: to.Ptr[int32](16), + // VCPUsPerCore: to.Ptr[int32](23), + // }, + // }, + // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + // }, + // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + // ID: to.Ptr("mubredelfbshboaxrsxiajihahaa"), + // ExcludeExtensions: []*string{ + // to.Ptr("{securityPostureVMExtensionName}"), + // }, + // IsOverridable: to.Ptr(true), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // ComputeAPIVersion: to.Ptr("2023-07-01"), + // PlatformFaultDomainCount: to.Ptr[int32](1), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), + // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), + // }, + // Zones: []*string{ + // to.Ptr("zone1"), + // to.Ptr("zone2"), + // }, + // Identity: &armcomputefleet.ManagedServiceIdentity{ + // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ + // "key9851": &armcomputefleet.UserAssignedIdentity{ + // PrincipalID: to.Ptr("6d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // ClientID: to.Ptr("7d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // }, + // }, + // }, + // Plan: &armcomputefleet.Plan{ + // Name: to.Ptr("jwgrcrnrtfoxn"), + // Publisher: to.Ptr("iozjbiqqckqm"), + // Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), + // PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), + // Version: to.Ptr("wa"), + // }, + // Tags: map[string]*string{ + // "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), + // }, + // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), + // Name: to.Ptr("testFleet"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets"), + // SystemData: &armcomputefleet.SystemData{ + // CreatedBy: to.Ptr("rowegentrpoajsv"), + // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), + // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // }, + // }, + // NextLink: to.Ptr("https://microsoft.com/a"), + // }, + // } + } +} + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_ListVirtualMachineScaleSets.json +func ExampleFleetsClient_NewListVirtualMachineScaleSetsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewFleetsClient().NewListVirtualMachineScaleSetsPager("rgazurefleet", "myFleet", 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 = armcomputefleet.FleetsClientListVirtualMachineScaleSetsResponse{ + // VirtualMachineScaleSetListResult: armcomputefleet.VirtualMachineScaleSetListResult{ + // Value: []*armcomputefleet.VirtualMachineScaleSet{ + // { + // Name: to.Ptr("myVmss"), + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/myFleet/virtualMachineScaleSets/myVmss"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets/virtualMachineScaleSets"), + // OperationStatus: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // Error: &armcomputefleet.APIError{ + // Details: []*armcomputefleet.APIErrorBase{ + // { + // Code: to.Ptr("gzhtOverconstrainedAllocationRequestyosk"), + // Target: to.Ptr("qfthabhrmndhfizfnrwpgxvnokpy"), + // Message: to.Ptr("Allocation Failed"), + // }, + // }, + // Innererror: &armcomputefleet.InnerError{ + // ExceptionType: to.Ptr("sfaomfpoaptnbxchrfskm"), + // ErrorDetail: to.Ptr("ihjwbwykq"), + // }, + // Code: to.Ptr("OverconstrainedAllocationRequest"), + // Target: to.Ptr("nhaj"), + // Message: to.Ptr("Allocation Failed"), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_Update.json +func ExampleFleetsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewFleetsClient().BeginUpdate(ctx, "rgazurefleet", "testFleet", armcomputefleet.FleetUpdate{ + Identity: &armcomputefleet.ManagedServiceIdentityUpdate{ + Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{}, + }, + Tags: map[string]*string{}, + Properties: &armcomputefleet.FleetProperties{ + SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + Capacity: to.Ptr[int32](20), + MinCapacity: to.Ptr[int32](10), + MaxPricePerVM: to.Ptr[float32](0.00865), + EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + Maintain: to.Ptr(true), + }, + RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + Capacity: to.Ptr[int32](20), + MinCapacity: to.Ptr[int32](10), + AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + }, + VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + { + Name: to.Ptr("Standard_d1_v2"), + Rank: to.Ptr[int32](19225), + }, + }, + ComputeProfile: &armcomputefleet.ComputeProfile{ + BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + ComputerNamePrefix: to.Ptr("o"), + AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + AdminPassword: to.Ptr("adfbrdxpv"), + CustomData: to.Ptr("xjjib"), + WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + ProvisionVMAgent: to.Ptr(true), + EnableAutomaticUpdates: to.Ptr(true), + TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + { + PassName: to.Ptr("OobeSystem"), + ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + Content: to.Ptr("bubmqbxjkj"), + }, + }, + PatchSettings: &armcomputefleet.PatchSettings{ + PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + EnableHotpatching: to.Ptr(true), + AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + }, + }, + WinRM: &armcomputefleet.WinRMConfiguration{ + Listeners: []*armcomputefleet.WinRMListener{ + { + Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), + CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + }, + }, + }, + EnableVMAgentPlatformUpdates: to.Ptr(true), + }, + LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + DisablePasswordAuthentication: to.Ptr(true), + SSH: &armcomputefleet.SSHConfiguration{ + PublicKeys: []*armcomputefleet.SSHPublicKey{ + { + Path: to.Ptr("kmqz"), + KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + }, + }, + }, + ProvisionVMAgent: to.Ptr(true), + PatchSettings: &armcomputefleet.LinuxPatchSettings{ + PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + }, + }, + EnableVMAgentPlatformUpdates: to.Ptr(true), + }, + Secrets: []*armcomputefleet.VaultSecretGroup{ + { + SourceVault: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + }, + VaultCertificates: []*armcomputefleet.VaultCertificate{ + { + CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + }, + }, + }, + }, + AllowExtensionOperations: to.Ptr(true), + RequireGuestProvisionSignal: to.Ptr(true), + }, + StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + ImageReference: &armcomputefleet.ImageReference{ + Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + Offer: to.Ptr("isxgumkarlkomp"), + SKU: to.Ptr("eojmppqcrnpmxirtp"), + Version: to.Ptr("wvpcqefgtmqdgltiuz"), + SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + CommunityGalleryImageID: to.Ptr("vlqe"), + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + }, + OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + Name: to.Ptr("wfttw"), + Caching: to.Ptr(armcomputefleet.CachingTypesNone), + WriteAcceleratorEnabled: to.Ptr(true), + CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + }, + DiskSizeGB: to.Ptr[int32](14), + OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + Image: &armcomputefleet.VirtualHardDisk{ + URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), + }, + VhdContainers: []*string{ + to.Ptr("tkzcwddtinkfpnfklatw"), + }, + ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + }, + }, + DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + }, + DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + { + Name: to.Ptr("eogiykmdmeikswxmigjws"), + Lun: to.Ptr[int32](14), + Caching: to.Ptr(armcomputefleet.CachingTypesNone), + WriteAcceleratorEnabled: to.Ptr(true), + CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + DiskSizeGB: to.Ptr[int32](6), + ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + }, + }, + DiskIOPSReadWrite: to.Ptr[int64](27), + DiskMBpsReadWrite: to.Ptr[int64](2), + DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + }, + }, + }, + NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + HealthProbe: &armcomputefleet.APIEntityReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + }, + NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + { + Name: to.Ptr("i"), + Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + Primary: to.Ptr(true), + EnableAcceleratedNetworking: to.Ptr(true), + DisableTCPStateTracking: to.Ptr(true), + EnableFpga: to.Ptr(true), + NetworkSecurityGroup: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + }, + DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + DNSServers: []*string{ + to.Ptr("nxmmfolhclsesu"), + }, + }, + IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + { + Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + Subnet: &armcomputefleet.APIEntityReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + }, + Primary: to.Ptr(true), + PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + Name: to.Ptr("fvpqf"), + Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + IdleTimeoutInMinutes: to.Ptr[int32](9), + DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + }, + IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + { + IPTagType: to.Ptr("sddgsoemnzgqizale"), + Tag: to.Ptr("wufmhrjsakbiaetyara"), + }, + }, + PublicIPPrefix: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + }, + PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + }, + SKU: &armcomputefleet.PublicIPAddressSKU{ + Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + }, + }, + PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + }, + }, + ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + }, + }, + LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + }, + }, + LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + }, + }, + }, + }, + }, + EnableIPForwarding: to.Ptr(true), + DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + }, + }, + }, + NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), + }, + SecurityProfile: &armcomputefleet.SecurityProfile{ + UefiSettings: &armcomputefleet.UefiSettings{ + SecureBootEnabled: to.Ptr(true), + VTpmEnabled: to.Ptr(true), + }, + EncryptionAtHost: to.Ptr(true), + SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + }, + ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + Enabled: to.Ptr(true), + Mode: to.Ptr(armcomputefleet.ModeAudit), + KeyIncarnationID: to.Ptr[int32](20), + }, + }, + DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + BootDiagnostics: &armcomputefleet.BootDiagnostics{ + Enabled: to.Ptr(true), + StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), + }, + }, + ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + { + Name: to.Ptr("bndxuxx"), + Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + ForceUpdateTag: to.Ptr("yhgxw"), + Publisher: to.Ptr("kpxtirxjfprhs"), + Type: to.Ptr("pgjilctjjwaa"), + TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + AutoUpgradeMinorVersion: to.Ptr(true), + EnableAutomaticUpgrade: to.Ptr(true), + Settings: map[string]any{}, + ProtectedSettings: map[string]any{}, + ProvisionAfterExtensions: []*string{ + to.Ptr("nftzosroolbcwmpupujzqwqe"), + }, + SuppressFailures: to.Ptr(true), + ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + SecretURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/secret/mySecretName"), + SourceVault: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + }, + }, + }, + }, + }, + ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + }, + LicenseType: to.Ptr("v"), + ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + NotBeforeTimeout: to.Ptr("iljppmmw"), + Enable: to.Ptr(true), + }, + OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + Enable: to.Ptr(true), + }, + }, + UserData: to.Ptr("s"), + CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + CapacityReservationGroup: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + }, + }, + ApplicationProfile: &armcomputefleet.ApplicationProfile{ + GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + { + Tags: to.Ptr("eyrqjbib"), + Order: to.Ptr[int32](5), + PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + ConfigurationReference: to.Ptr("ulztmiavpojpbpbddgnuuiimxcpau"), + TreatFailureAsDeploymentFailure: to.Ptr(true), + EnableAutomaticUpgrade: to.Ptr(true), + }, + }, + }, + HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + VMSizeProperties: &armcomputefleet.VMSizeProperties{ + VCPUsAvailable: to.Ptr[int32](16), + VCPUsPerCore: to.Ptr[int32](23), + }, + }, + ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + }, + SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), + ExcludeExtensions: []*string{ + to.Ptr("{securityPostureVMExtensionName}"), + }, + IsOverridable: to.Ptr(true), + }, + }, + ComputeAPIVersion: to.Ptr("2023-07-01"), + PlatformFaultDomainCount: to.Ptr[int32](1), + }, + }, + Plan: &armcomputefleet.ResourcePlanUpdate{ + Name: to.Ptr("jwgrcrnrtfoxn"), + Publisher: to.Ptr("iozjbiqqckqm"), + Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), + PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), + Version: to.Ptr("wa"), + }, + }, 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 = armcomputefleet.FleetsClientUpdateResponse{ + // Fleet: &armcomputefleet.Fleet{ + // Properties: &armcomputefleet.FleetProperties{ + // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // MaxPricePerVM: to.Ptr[float32](0.00865), + // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + // Maintain: to.Ptr(true), + // }, + // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + // }, + // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + // { + // Name: to.Ptr("Standard_d1_v2"), + // Rank: to.Ptr[int32](19225), + // }, + // }, + // ComputeProfile: &armcomputefleet.ComputeProfile{ + // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + // ComputerNamePrefix: to.Ptr("o"), + // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + // ProvisionVMAgent: to.Ptr(true), + // EnableAutomaticUpdates: to.Ptr(true), + // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + // { + // PassName: to.Ptr("OobeSystem"), + // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + // }, + // }, + // PatchSettings: &armcomputefleet.PatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + // EnableHotpatching: to.Ptr(true), + // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // WinRM: &armcomputefleet.WinRMConfiguration{ + // Listeners: []*armcomputefleet.WinRMListener{ + // { + // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), + // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + // }, + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + // DisablePasswordAuthentication: to.Ptr(true), + // SSH: &armcomputefleet.SSHConfiguration{ + // PublicKeys: []*armcomputefleet.SSHPublicKey{ + // { + // Path: to.Ptr("kmqz"), + // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + // }, + // }, + // }, + // ProvisionVMAgent: to.Ptr(true), + // PatchSettings: &armcomputefleet.LinuxPatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // Secrets: []*armcomputefleet.VaultSecretGroup{ + // { + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // VaultCertificates: []*armcomputefleet.VaultCertificate{ + // { + // CertificateURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/myCertName"), + // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + // }, + // }, + // }, + // }, + // AllowExtensionOperations: to.Ptr(true), + // RequireGuestProvisionSignal: to.Ptr(true), + // }, + // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + // ImageReference: &armcomputefleet.ImageReference{ + // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + // Offer: to.Ptr("isxgumkarlkomp"), + // SKU: to.Ptr("eojmppqcrnpmxirtp"), + // Version: to.Ptr("wvpcqefgtmqdgltiuz"), + // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + // CommunityGalleryImageID: to.Ptr("vlqe"), + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + // ExactVersion: to.Ptr("zjbntmiskjexlr"), + // }, + // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + // Name: to.Ptr("wfttw"), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + // }, + // DiskSizeGB: to.Ptr[int32](14), + // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + // Image: &armcomputefleet.VirtualHardDisk{ + // URI: to.Ptr("https://myStorageAccountName.blob.core.windows.net/myContainerName/myVhdName.vhd"), + // }, + // VhdContainers: []*string{ + // to.Ptr("tkzcwddtinkfpnfklatw"), + // }, + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + // { + // Name: to.Ptr("eogiykmdmeikswxmigjws"), + // Lun: to.Ptr[int32](14), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiskSizeGB: to.Ptr[int32](6), + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DiskIOPSReadWrite: to.Ptr[int64](27), + // DiskMBpsReadWrite: to.Ptr[int64](2), + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // }, + // }, + // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + // HealthProbe: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + // }, + // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + // { + // Name: to.Ptr("i"), + // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + // Primary: to.Ptr(true), + // EnableAcceleratedNetworking: to.Ptr(true), + // DisableTCPStateTracking: to.Ptr(true), + // EnableFpga: to.Ptr(true), + // NetworkSecurityGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + // }, + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + // DNSServers: []*string{ + // to.Ptr("nxmmfolhclsesu"), + // }, + // }, + // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + // { + // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + // Subnet: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + // }, + // Primary: to.Ptr(true), + // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + // Name: to.Ptr("fvpqf"), + // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + // IdleTimeoutInMinutes: to.Ptr[int32](9), + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + // }, + // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + // { + // IPTagType: to.Ptr("sddgsoemnzgqizale"), + // Tag: to.Ptr("wufmhrjsakbiaetyara"), + // }, + // }, + // PublicIPPrefix: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + // }, + // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // }, + // SKU: &armcomputefleet.PublicIPAddressSKU{ + // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + // }, + // }, + // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + // }, + // }, + // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + // }, + // }, + // }, + // }, + // }, + // EnableIPForwarding: to.Ptr(true), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + // }, + // }, + // }, + // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersionV20201101), + // }, + // SecurityProfile: &armcomputefleet.SecurityProfile{ + // UefiSettings: &armcomputefleet.UefiSettings{ + // SecureBootEnabled: to.Ptr(true), + // VTpmEnabled: to.Ptr(true), + // }, + // EncryptionAtHost: to.Ptr(true), + // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + // }, + // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + // Enabled: to.Ptr(true), + // Mode: to.Ptr(armcomputefleet.ModeAudit), + // KeyIncarnationID: to.Ptr[int32](20), + // }, + // }, + // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + // BootDiagnostics: &armcomputefleet.BootDiagnostics{ + // Enabled: to.Ptr(true), + // StorageURI: to.Ptr("http://myStorageAccountName.blob.core.windows.net"), + // }, + // }, + // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + // { + // Name: to.Ptr("bndxuxx"), + // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + // ForceUpdateTag: to.Ptr("yhgxw"), + // Publisher: to.Ptr("kpxtirxjfprhs"), + // Type: to.Ptr("pgjilctjjwaa"), + // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // ProvisionAfterExtensions: []*string{ + // to.Ptr("nftzosroolbcwmpupujzqwqe"), + // }, + // SuppressFailures: to.Ptr(true), + // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + // SecretURL: to.Ptr("https://myVaultName.vault.azure.net/secrets/secret/mySecretName"), + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // }, + // Settings: map[string]any{ + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // Type: to.Ptr("cmeam"), + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), + // }, + // }, + // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + // }, + // LicenseType: to.Ptr("v"), + // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + // NotBeforeTimeout: to.Ptr("iljppmmw"), + // Enable: to.Ptr(true), + // }, + // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + // Enable: to.Ptr(true), + // }, + // }, + // UserData: to.Ptr("s"), + // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + // CapacityReservationGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + // }, + // }, + // ApplicationProfile: &armcomputefleet.ApplicationProfile{ + // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + // { + // Tags: to.Ptr("eyrqjbib"), + // Order: to.Ptr[int32](5), + // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + // TreatFailureAsDeploymentFailure: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // }, + // }, + // }, + // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + // VMSizeProperties: &armcomputefleet.VMSizeProperties{ + // VCPUsAvailable: to.Ptr[int32](16), + // VCPUsPerCore: to.Ptr[int32](23), + // }, + // }, + // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + // }, + // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + // ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), + // ExcludeExtensions: []*string{ + // to.Ptr("{securityPostureVMExtensionName}"), + // }, + // IsOverridable: to.Ptr(true), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // ComputeAPIVersion: to.Ptr("2023-07-01"), + // PlatformFaultDomainCount: to.Ptr[int32](1), + // }, + // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), + // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), + // }, + // Zones: []*string{ + // to.Ptr("zone1"), + // to.Ptr("zone2"), + // }, + // Identity: &armcomputefleet.ManagedServiceIdentity{ + // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ + // }, + // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // }, + // Tags: map[string]*string{ + // }, + // Location: to.Ptr("westus"), + // Plan: &armcomputefleet.Plan{ + // Name: to.Ptr("uapfngmdekvpgjhomthtpxjfdmmll"), + // Publisher: to.Ptr("aqhles"), + // Product: to.Ptr("bfzbkdnbexmedxdc"), + // PromotionCode: to.Ptr("gspehogwfjxirz"), + // Version: to.Ptr("yza"), + // }, + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), + // Name: to.Ptr("testFleet"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets"), + // SystemData: &armcomputefleet.SystemData{ + // CreatedBy: to.Ptr("rowegentrpoajsv"), + // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), + // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/go.mod b/sdk/resourcemanager/computefleet/armcomputefleet/go.mod index 25682f2d2194..43724ff7ef95 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/go.mod +++ b/sdk/resourcemanager/computefleet/armcomputefleet/go.mod @@ -2,10 +2,20 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcom go 1.18 -require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 +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/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/computefleet/armcomputefleet/go.sum b/sdk/resourcemanager/computefleet/armcomputefleet/go.sum index 917448a001b7..09d275cb9a37 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/go.sum +++ b/sdk/resourcemanager/computefleet/armcomputefleet/go.sum @@ -1,12 +1,29 @@ 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/computefleet/armcomputefleet/operations_client_example_test.go b/sdk/resourcemanager/computefleet/armcomputefleet/operations_client_example_test.go new file mode 100644 index 000000000000..419439f85dd3 --- /dev/null +++ b/sdk/resourcemanager/computefleet/armcomputefleet/operations_client_example_test.go @@ -0,0 +1,98 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armcomputefleet_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet" + "log" +) + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/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 := armcomputefleet.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 = armcomputefleet.OperationsClientListResponse{ + // OperationListResult: armcomputefleet.OperationListResult{ + // Value: []*armcomputefleet.Operation{ + // { + // Origin: to.Ptr(armcomputefleet.OriginUserSystem), + // Name: to.Ptr("Microsoft.AzureFleet/fleets/read"), + // IsDataAction: to.Ptr(false), + // Display: &armcomputefleet.OperationDisplay{ + // Provider: to.Ptr("Microsoft Azure Fleet"), + // Resource: to.Ptr("Fleets"), + // Operation: to.Ptr("Get Azure Fleet"), + // Description: to.Ptr("Get properties of Azure Fleet resource"), + // }, + // }, + // { + // Origin: to.Ptr(armcomputefleet.OriginUserSystem), + // Name: to.Ptr("Microsoft.AzureFleet/fleets/write"), + // IsDataAction: to.Ptr(false), + // Display: &armcomputefleet.OperationDisplay{ + // Provider: to.Ptr("Microsoft Azure Fleet"), + // Resource: to.Ptr("Fleets"), + // Operation: to.Ptr("Create or Update Azure Fleet"), + // Description: to.Ptr("Creates a new Azure Fleet resource or updates an existing one"), + // }, + // }, + // { + // Origin: to.Ptr(armcomputefleet.OriginUserSystem), + // Name: to.Ptr("Microsoft.AzureFleet/fleets/delete"), + // IsDataAction: to.Ptr(false), + // Display: &armcomputefleet.OperationDisplay{ + // Provider: to.Ptr("Microsoft Azure Fleet"), + // Resource: to.Ptr("Fleets"), + // Operation: to.Ptr("Delete Virtual Machine and Virtual Machine scale sets in a Azure Fleet resource"), + // Description: to.Ptr("Deletes all compute resources of Azure Fleet resource"), + // }, + // }, + // { + // Origin: to.Ptr(armcomputefleet.OriginUserSystem), + // Name: to.Ptr("Microsoft.AzureFleet/register/action"), + // IsDataAction: to.Ptr(false), + // Display: &armcomputefleet.OperationDisplay{ + // Provider: to.Ptr("Microsoft Azure Fleet"), + // Resource: to.Ptr("Subscription"), + // Operation: to.Ptr("Register subscription for Microsoft.AzureFleet"), + // Description: to.Ptr("Registers Subscription with Microsoft.AzureFleet resource provider"), + // }, + // }, + // { + // Origin: to.Ptr(armcomputefleet.OriginUserSystem), + // Name: to.Ptr("Microsoft.AzureFleet/unregister/action"), + // IsDataAction: to.Ptr(false), + // Display: &armcomputefleet.OperationDisplay{ + // Provider: to.Ptr("Microsoft Azure Fleet"), + // Resource: to.Ptr("Subscription"), + // Operation: to.Ptr("Unregister Subscription for Microsoft.AzureFleet"), + // Description: to.Ptr("Unregisters Subscription with Microsoft.AzureFleet resource provider"), + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml b/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml index f26478624109..2a1cd750dc76 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml +++ b/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/azurefleet/AzureFleet.Management -commit: aa23ddc02b2b1c5a34c56a49d83b77c0a1aaa614 -repo: Azure/azure-rest-api-specs -additionalDirectories: +commit: 9e35bd472e0aca04a5ec037f3cfe60c875b6fde7 +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: \ No newline at end of file diff --git a/sdk/resourcemanager/standbypool/armstandbypool/CHANGELOG.md b/sdk/resourcemanager/standbypool/armstandbypool/CHANGELOG.md index 6eae06204d16..249b21376cca 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/CHANGELOG.md +++ b/sdk/resourcemanager/standbypool/armstandbypool/CHANGELOG.md @@ -1,5 +1,70 @@ # Release History +## 2.0.0-beta.1 (2024-10-16) +### Breaking Changes + +- Enum `CreatedByType` has been removed +- Enum `ProvisioningState` has been removed +- Enum `RefillPolicy` has been removed +- Enum `VirtualMachineState` has been removed +- Function `*ClientFactory.NewStandbyContainerGroupPoolRuntimeViewsClient` has been removed +- Function `*ClientFactory.NewStandbyContainerGroupPoolsClient` has been removed +- Function `*ClientFactory.NewStandbyVirtualMachinePoolRuntimeViewsClient` has been removed +- Function `*ClientFactory.NewStandbyVirtualMachinePoolsClient` has been removed +- Function `*ClientFactory.NewStandbyVirtualMachinesClient` has been removed +- Function `NewStandbyContainerGroupPoolRuntimeViewsClient` has been removed +- Function `*StandbyContainerGroupPoolRuntimeViewsClient.Get` has been removed +- Function `*StandbyContainerGroupPoolRuntimeViewsClient.NewListByStandbyPoolPager` has been removed +- Function `NewStandbyContainerGroupPoolsClient` has been removed +- Function `*StandbyContainerGroupPoolsClient.BeginCreateOrUpdate` has been removed +- Function `*StandbyContainerGroupPoolsClient.BeginDelete` has been removed +- Function `*StandbyContainerGroupPoolsClient.Get` has been removed +- Function `*StandbyContainerGroupPoolsClient.NewListByResourceGroupPager` has been removed +- Function `*StandbyContainerGroupPoolsClient.NewListBySubscriptionPager` has been removed +- Function `*StandbyContainerGroupPoolsClient.Update` has been removed +- Function `NewStandbyVirtualMachinePoolRuntimeViewsClient` has been removed +- Function `*StandbyVirtualMachinePoolRuntimeViewsClient.Get` has been removed +- Function `*StandbyVirtualMachinePoolRuntimeViewsClient.NewListByStandbyPoolPager` has been removed +- Function `NewStandbyVirtualMachinePoolsClient` has been removed +- Function `*StandbyVirtualMachinePoolsClient.BeginCreateOrUpdate` has been removed +- Function `*StandbyVirtualMachinePoolsClient.BeginDelete` has been removed +- Function `*StandbyVirtualMachinePoolsClient.Get` has been removed +- Function `*StandbyVirtualMachinePoolsClient.NewListByResourceGroupPager` has been removed +- Function `*StandbyVirtualMachinePoolsClient.NewListBySubscriptionPager` has been removed +- Function `*StandbyVirtualMachinePoolsClient.Update` has been removed +- Function `NewStandbyVirtualMachinesClient` has been removed +- Function `*StandbyVirtualMachinesClient.Get` has been removed +- Function `*StandbyVirtualMachinesClient.NewListByStandbyVirtualMachinePoolResourcePager` has been removed +- Struct `ContainerGroupInstanceCountSummary` has been removed +- Struct `ContainerGroupProfile` has been removed +- Struct `ContainerGroupProperties` has been removed +- Struct `PoolResourceStateCount` has been removed +- Struct `StandbyContainerGroupPoolElasticityProfile` has been removed +- Struct `StandbyContainerGroupPoolResource` has been removed +- Struct `StandbyContainerGroupPoolResourceListResult` has been removed +- Struct `StandbyContainerGroupPoolResourceProperties` has been removed +- Struct `StandbyContainerGroupPoolResourceUpdate` has been removed +- Struct `StandbyContainerGroupPoolResourceUpdateProperties` has been removed +- Struct `StandbyContainerGroupPoolRuntimeViewResource` has been removed +- Struct `StandbyContainerGroupPoolRuntimeViewResourceListResult` has been removed +- Struct `StandbyContainerGroupPoolRuntimeViewResourceProperties` has been removed +- Struct `StandbyVirtualMachinePoolElasticityProfile` has been removed +- Struct `StandbyVirtualMachinePoolResource` has been removed +- Struct `StandbyVirtualMachinePoolResourceListResult` has been removed +- Struct `StandbyVirtualMachinePoolResourceProperties` has been removed +- Struct `StandbyVirtualMachinePoolResourceUpdate` has been removed +- Struct `StandbyVirtualMachinePoolResourceUpdateProperties` has been removed +- Struct `StandbyVirtualMachinePoolRuntimeViewResource` has been removed +- Struct `StandbyVirtualMachinePoolRuntimeViewResourceListResult` has been removed +- Struct `StandbyVirtualMachinePoolRuntimeViewResourceProperties` has been removed +- Struct `StandbyVirtualMachineResource` has been removed +- Struct `StandbyVirtualMachineResourceListResult` has been removed +- Struct `StandbyVirtualMachineResourceProperties` has been removed +- Struct `Subnet` has been removed +- Struct `SystemData` has been removed +- Struct `VirtualMachineInstanceCountSummary` has been removed + + ## 0.1.0 (2024-04-26) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). diff --git a/sdk/resourcemanager/standbypool/armstandbypool/README.md b/sdk/resourcemanager/standbypool/armstandbypool/README.md index a37fe9df92f7..a3177e71a5eb 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/README.md +++ b/sdk/resourcemanager/standbypool/armstandbypool/README.md @@ -1,6 +1,6 @@ # Azure Standbypool Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool/v2)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool/v2) The `armstandbypool` module provides operations for working with Azure Standbypool. @@ -20,7 +20,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Standbypool module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool/v2 ``` ## Authorization diff --git a/sdk/resourcemanager/standbypool/armstandbypool/autorest.md b/sdk/resourcemanager/standbypool/armstandbypool/autorest.md index c64752b8fde1..ec8f4625084f 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/autorest.md +++ b/sdk/resourcemanager/standbypool/armstandbypool/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/standbypool/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/standbypool/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.0 -tag: package-preview-2023-12 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/standbypool/armstandbypool/client_factory.go b/sdk/resourcemanager/standbypool/armstandbypool/client_factory.go index c0042b9f6503..a87e202c959e 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/client_factory.go +++ b/sdk/resourcemanager/standbypool/armstandbypool/client_factory.go @@ -16,23 +16,20 @@ import ( // ClientFactory is a client factory used to create any client in this module. // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { - subscriptionID string - internal *arm.Client + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. -func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { +func NewClientFactory(credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, - internal: internal, + internal: internal, }, nil } @@ -42,27 +39,3 @@ func (c *ClientFactory) NewOperationsClient() *OperationsClient { internal: c.internal, } } - -// NewStandbyContainerGroupPoolsClient creates a new instance of StandbyContainerGroupPoolsClient. -func (c *ClientFactory) NewStandbyContainerGroupPoolsClient() *StandbyContainerGroupPoolsClient { - return &StandbyContainerGroupPoolsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewStandbyVirtualMachinePoolsClient creates a new instance of StandbyVirtualMachinePoolsClient. -func (c *ClientFactory) NewStandbyVirtualMachinePoolsClient() *StandbyVirtualMachinePoolsClient { - return &StandbyVirtualMachinePoolsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewStandbyVirtualMachinesClient creates a new instance of StandbyVirtualMachinesClient. -func (c *ClientFactory) NewStandbyVirtualMachinesClient() *StandbyVirtualMachinesClient { - return &StandbyVirtualMachinesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/constants.go b/sdk/resourcemanager/standbypool/armstandbypool/constants.go index 9728ccc985e3..a4fc8a6ac7ea 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/constants.go +++ b/sdk/resourcemanager/standbypool/armstandbypool/constants.go @@ -10,7 +10,7 @@ package armstandbypool const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool" - moduleVersion = "v0.1.0" + moduleVersion = "v2.0.0-beta.1" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -27,26 +27,6 @@ func PossibleActionTypeValues() []ActionType { } } -// CreatedByType - The type of identity that created the resource. -type CreatedByType string - -const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" - CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" -) - -// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. -func PossibleCreatedByTypeValues() []CreatedByType { - return []CreatedByType{ - CreatedByTypeApplication, - CreatedByTypeKey, - CreatedByTypeManagedIdentity, - CreatedByTypeUser, - } -} - // Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" type Origin string @@ -65,60 +45,3 @@ func PossibleOriginValues() []Origin { OriginUserSystem, } } - -// ProvisioningState - Provisioning state -type ProvisioningState string - -const ( - // ProvisioningStateCanceled - Resource creation was canceled. - ProvisioningStateCanceled ProvisioningState = "Canceled" - // ProvisioningStateDeleting - Resource is being deleted. - ProvisioningStateDeleting ProvisioningState = "Deleting" - // ProvisioningStateFailed - Resource creation failed. - ProvisioningStateFailed ProvisioningState = "Failed" - // ProvisioningStateSucceeded - Resource has been created. - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ - ProvisioningStateCanceled, - ProvisioningStateDeleting, - ProvisioningStateFailed, - ProvisioningStateSucceeded, - } -} - -// RefillPolicy - Refill policy of standby pool -type RefillPolicy string - -const ( - // RefillPolicyAlways - A refill policy that standby pool is automatically refilled to maintain maxReadyCapacity. - RefillPolicyAlways RefillPolicy = "always" -) - -// PossibleRefillPolicyValues returns the possible values for the RefillPolicy const type. -func PossibleRefillPolicyValues() []RefillPolicy { - return []RefillPolicy{ - RefillPolicyAlways, - } -} - -// VirtualMachineState - State of standby virtual machines -type VirtualMachineState string - -const ( - // VirtualMachineStateDeallocated - The virtual machine has released the lease on the underlying hardware and is powered off. - VirtualMachineStateDeallocated VirtualMachineState = "Deallocated" - // VirtualMachineStateRunning - The virtual machine is up and running. - VirtualMachineStateRunning VirtualMachineState = "Running" -) - -// PossibleVirtualMachineStateValues returns the possible values for the VirtualMachineState const type. -func PossibleVirtualMachineStateValues() []VirtualMachineState { - return []VirtualMachineState{ - VirtualMachineStateDeallocated, - VirtualMachineStateRunning, - } -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/fake/operations_server.go b/sdk/resourcemanager/standbypool/armstandbypool/fake/operations_server.go index ffec2bd32982..21a8708e37d9 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/fake/operations_server.go +++ b/sdk/resourcemanager/standbypool/armstandbypool/fake/operations_server.go @@ -15,7 +15,7 @@ import ( "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/standbypool/armstandbypool" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool/v2" "net/http" ) diff --git a/sdk/resourcemanager/standbypool/armstandbypool/fake/server_factory.go b/sdk/resourcemanager/standbypool/armstandbypool/fake/server_factory.go index 79ac195cdfd2..803e746ccd5b 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/fake/server_factory.go +++ b/sdk/resourcemanager/standbypool/armstandbypool/fake/server_factory.go @@ -19,10 +19,7 @@ import ( // ServerFactory is a fake server for instances of the armstandbypool.ClientFactory type. type ServerFactory struct { - OperationsServer OperationsServer - StandbyContainerGroupPoolsServer StandbyContainerGroupPoolsServer - StandbyVirtualMachinePoolsServer StandbyVirtualMachinePoolsServer - StandbyVirtualMachinesServer StandbyVirtualMachinesServer + OperationsServer OperationsServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -37,12 +34,9 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armstandbypool.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trOperationsServer *OperationsServerTransport - trStandbyContainerGroupPoolsServer *StandbyContainerGroupPoolsServerTransport - trStandbyVirtualMachinePoolsServer *StandbyVirtualMachinePoolsServerTransport - trStandbyVirtualMachinesServer *StandbyVirtualMachinesServerTransport + srv *ServerFactory + trMu sync.Mutex + trOperationsServer *OperationsServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -61,21 +55,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) - case "StandbyContainerGroupPoolsClient": - initServer(s, &s.trStandbyContainerGroupPoolsServer, func() *StandbyContainerGroupPoolsServerTransport { - return NewStandbyContainerGroupPoolsServerTransport(&s.srv.StandbyContainerGroupPoolsServer) - }) - resp, err = s.trStandbyContainerGroupPoolsServer.Do(req) - case "StandbyVirtualMachinePoolsClient": - initServer(s, &s.trStandbyVirtualMachinePoolsServer, func() *StandbyVirtualMachinePoolsServerTransport { - return NewStandbyVirtualMachinePoolsServerTransport(&s.srv.StandbyVirtualMachinePoolsServer) - }) - resp, err = s.trStandbyVirtualMachinePoolsServer.Do(req) - case "StandbyVirtualMachinesClient": - initServer(s, &s.trStandbyVirtualMachinesServer, func() *StandbyVirtualMachinesServerTransport { - return NewStandbyVirtualMachinesServerTransport(&s.srv.StandbyVirtualMachinesServer) - }) - resp, err = s.trStandbyVirtualMachinesServer.Do(req) default: err = fmt.Errorf("unhandled client %s", client) } diff --git a/sdk/resourcemanager/standbypool/armstandbypool/fake/standbycontainergrouppools_server.go b/sdk/resourcemanager/standbypool/armstandbypool/fake/standbycontainergrouppools_server.go deleted file mode 100644 index 0f5e80c66d75..000000000000 --- a/sdk/resourcemanager/standbypool/armstandbypool/fake/standbycontainergrouppools_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/standbypool/armstandbypool" - "net/http" - "net/url" - "regexp" -) - -// StandbyContainerGroupPoolsServer is a fake server for instances of the armstandbypool.StandbyContainerGroupPoolsClient type. -type StandbyContainerGroupPoolsServer struct { - // BeginCreateOrUpdate is the fake for method StandbyContainerGroupPoolsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, resource armstandbypool.StandbyContainerGroupPoolResource, options *armstandbypool.StandbyContainerGroupPoolsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armstandbypool.StandbyContainerGroupPoolsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method StandbyContainerGroupPoolsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, options *armstandbypool.StandbyContainerGroupPoolsClientBeginDeleteOptions) (resp azfake.PollerResponder[armstandbypool.StandbyContainerGroupPoolsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method StandbyContainerGroupPoolsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, options *armstandbypool.StandbyContainerGroupPoolsClientGetOptions) (resp azfake.Responder[armstandbypool.StandbyContainerGroupPoolsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByResourceGroupPager is the fake for method StandbyContainerGroupPoolsClient.NewListByResourceGroupPager - // HTTP status codes to indicate success: http.StatusOK - NewListByResourceGroupPager func(resourceGroupName string, options *armstandbypool.StandbyContainerGroupPoolsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armstandbypool.StandbyContainerGroupPoolsClientListByResourceGroupResponse]) - - // NewListBySubscriptionPager is the fake for method StandbyContainerGroupPoolsClient.NewListBySubscriptionPager - // HTTP status codes to indicate success: http.StatusOK - NewListBySubscriptionPager func(options *armstandbypool.StandbyContainerGroupPoolsClientListBySubscriptionOptions) (resp azfake.PagerResponder[armstandbypool.StandbyContainerGroupPoolsClientListBySubscriptionResponse]) - - // Update is the fake for method StandbyContainerGroupPoolsClient.Update - // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, properties armstandbypool.StandbyContainerGroupPoolResourceUpdate, options *armstandbypool.StandbyContainerGroupPoolsClientUpdateOptions) (resp azfake.Responder[armstandbypool.StandbyContainerGroupPoolsClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewStandbyContainerGroupPoolsServerTransport creates a new instance of StandbyContainerGroupPoolsServerTransport with the provided implementation. -// The returned StandbyContainerGroupPoolsServerTransport instance is connected to an instance of armstandbypool.StandbyContainerGroupPoolsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewStandbyContainerGroupPoolsServerTransport(srv *StandbyContainerGroupPoolsServer) *StandbyContainerGroupPoolsServerTransport { - return &StandbyContainerGroupPoolsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armstandbypool.StandbyContainerGroupPoolsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armstandbypool.StandbyContainerGroupPoolsClientDeleteResponse]](), - newListByResourceGroupPager: newTracker[azfake.PagerResponder[armstandbypool.StandbyContainerGroupPoolsClientListByResourceGroupResponse]](), - newListBySubscriptionPager: newTracker[azfake.PagerResponder[armstandbypool.StandbyContainerGroupPoolsClientListBySubscriptionResponse]](), - } -} - -// StandbyContainerGroupPoolsServerTransport connects instances of armstandbypool.StandbyContainerGroupPoolsClient to instances of StandbyContainerGroupPoolsServer. -// Don't use this type directly, use NewStandbyContainerGroupPoolsServerTransport instead. -type StandbyContainerGroupPoolsServerTransport struct { - srv *StandbyContainerGroupPoolsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armstandbypool.StandbyContainerGroupPoolsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armstandbypool.StandbyContainerGroupPoolsClientDeleteResponse]] - newListByResourceGroupPager *tracker[azfake.PagerResponder[armstandbypool.StandbyContainerGroupPoolsClientListByResourceGroupResponse]] - newListBySubscriptionPager *tracker[azfake.PagerResponder[armstandbypool.StandbyContainerGroupPoolsClientListBySubscriptionResponse]] -} - -// Do implements the policy.Transporter interface for StandbyContainerGroupPoolsServerTransport. -func (s *StandbyContainerGroupPoolsServerTransport) 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 "StandbyContainerGroupPoolsClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "StandbyContainerGroupPoolsClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "StandbyContainerGroupPoolsClient.Get": - resp, err = s.dispatchGet(req) - case "StandbyContainerGroupPoolsClient.NewListByResourceGroupPager": - resp, err = s.dispatchNewListByResourceGroupPager(req) - case "StandbyContainerGroupPoolsClient.NewListBySubscriptionPager": - resp, err = s.dispatchNewListBySubscriptionPager(req) - case "StandbyContainerGroupPoolsClient.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 *StandbyContainerGroupPoolsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if s.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := s.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StandbyPool/standbyContainerGroupPools/(?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[armstandbypool.StandbyContainerGroupPoolResource](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - standbyContainerGroupPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standbyContainerGroupPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, standbyContainerGroupPoolNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - s.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) { - s.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) { - s.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (s *StandbyContainerGroupPoolsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if s.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := s.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StandbyPool/standbyContainerGroupPools/(?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 - } - standbyContainerGroupPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standbyContainerGroupPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, standbyContainerGroupPoolNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - s.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) { - s.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) { - s.beginDelete.remove(req) - } - - return resp, nil -} - -func (s *StandbyContainerGroupPoolsServerTransport) 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/Microsoft\.StandbyPool/standbyContainerGroupPools/(?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 - } - standbyContainerGroupPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standbyContainerGroupPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, standbyContainerGroupPoolNameParam, 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).StandbyContainerGroupPoolResource, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (s *StandbyContainerGroupPoolsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { - if s.srv.NewListByResourceGroupPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} - } - newListByResourceGroupPager := s.newListByResourceGroupPager.get(req) - if newListByResourceGroupPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StandbyPool/standbyContainerGroupPools` - 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 := s.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) - newListByResourceGroupPager = &resp - s.newListByResourceGroupPager.add(req, newListByResourceGroupPager) - server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armstandbypool.StandbyContainerGroupPoolsClientListByResourceGroupResponse, 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) { - s.newListByResourceGroupPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByResourceGroupPager) { - s.newListByResourceGroupPager.remove(req) - } - return resp, nil -} - -func (s *StandbyContainerGroupPoolsServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { - if s.srv.NewListBySubscriptionPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} - } - newListBySubscriptionPager := s.newListBySubscriptionPager.get(req) - if newListBySubscriptionPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StandbyPool/standbyContainerGroupPools` - 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 := s.srv.NewListBySubscriptionPager(nil) - newListBySubscriptionPager = &resp - s.newListBySubscriptionPager.add(req, newListBySubscriptionPager) - server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armstandbypool.StandbyContainerGroupPoolsClientListBySubscriptionResponse, 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) { - s.newListBySubscriptionPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListBySubscriptionPager) { - s.newListBySubscriptionPager.remove(req) - } - return resp, nil -} - -func (s *StandbyContainerGroupPoolsServerTransport) 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/Microsoft\.StandbyPool/standbyContainerGroupPools/(?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[armstandbypool.StandbyContainerGroupPoolResourceUpdate](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - standbyContainerGroupPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standbyContainerGroupPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Update(req.Context(), resourceGroupNameParam, standbyContainerGroupPoolNameParam, 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).StandbyContainerGroupPoolResource, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/fake/standbyvirtualmachinepools_server.go b/sdk/resourcemanager/standbypool/armstandbypool/fake/standbyvirtualmachinepools_server.go deleted file mode 100644 index b41175afbbfe..000000000000 --- a/sdk/resourcemanager/standbypool/armstandbypool/fake/standbyvirtualmachinepools_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/standbypool/armstandbypool" - "net/http" - "net/url" - "regexp" -) - -// StandbyVirtualMachinePoolsServer is a fake server for instances of the armstandbypool.StandbyVirtualMachinePoolsClient type. -type StandbyVirtualMachinePoolsServer struct { - // BeginCreateOrUpdate is the fake for method StandbyVirtualMachinePoolsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, resource armstandbypool.StandbyVirtualMachinePoolResource, options *armstandbypool.StandbyVirtualMachinePoolsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armstandbypool.StandbyVirtualMachinePoolsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method StandbyVirtualMachinePoolsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, options *armstandbypool.StandbyVirtualMachinePoolsClientBeginDeleteOptions) (resp azfake.PollerResponder[armstandbypool.StandbyVirtualMachinePoolsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method StandbyVirtualMachinePoolsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, options *armstandbypool.StandbyVirtualMachinePoolsClientGetOptions) (resp azfake.Responder[armstandbypool.StandbyVirtualMachinePoolsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByResourceGroupPager is the fake for method StandbyVirtualMachinePoolsClient.NewListByResourceGroupPager - // HTTP status codes to indicate success: http.StatusOK - NewListByResourceGroupPager func(resourceGroupName string, options *armstandbypool.StandbyVirtualMachinePoolsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armstandbypool.StandbyVirtualMachinePoolsClientListByResourceGroupResponse]) - - // NewListBySubscriptionPager is the fake for method StandbyVirtualMachinePoolsClient.NewListBySubscriptionPager - // HTTP status codes to indicate success: http.StatusOK - NewListBySubscriptionPager func(options *armstandbypool.StandbyVirtualMachinePoolsClientListBySubscriptionOptions) (resp azfake.PagerResponder[armstandbypool.StandbyVirtualMachinePoolsClientListBySubscriptionResponse]) - - // Update is the fake for method StandbyVirtualMachinePoolsClient.Update - // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, properties armstandbypool.StandbyVirtualMachinePoolResourceUpdate, options *armstandbypool.StandbyVirtualMachinePoolsClientUpdateOptions) (resp azfake.Responder[armstandbypool.StandbyVirtualMachinePoolsClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewStandbyVirtualMachinePoolsServerTransport creates a new instance of StandbyVirtualMachinePoolsServerTransport with the provided implementation. -// The returned StandbyVirtualMachinePoolsServerTransport instance is connected to an instance of armstandbypool.StandbyVirtualMachinePoolsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewStandbyVirtualMachinePoolsServerTransport(srv *StandbyVirtualMachinePoolsServer) *StandbyVirtualMachinePoolsServerTransport { - return &StandbyVirtualMachinePoolsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armstandbypool.StandbyVirtualMachinePoolsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armstandbypool.StandbyVirtualMachinePoolsClientDeleteResponse]](), - newListByResourceGroupPager: newTracker[azfake.PagerResponder[armstandbypool.StandbyVirtualMachinePoolsClientListByResourceGroupResponse]](), - newListBySubscriptionPager: newTracker[azfake.PagerResponder[armstandbypool.StandbyVirtualMachinePoolsClientListBySubscriptionResponse]](), - } -} - -// StandbyVirtualMachinePoolsServerTransport connects instances of armstandbypool.StandbyVirtualMachinePoolsClient to instances of StandbyVirtualMachinePoolsServer. -// Don't use this type directly, use NewStandbyVirtualMachinePoolsServerTransport instead. -type StandbyVirtualMachinePoolsServerTransport struct { - srv *StandbyVirtualMachinePoolsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armstandbypool.StandbyVirtualMachinePoolsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armstandbypool.StandbyVirtualMachinePoolsClientDeleteResponse]] - newListByResourceGroupPager *tracker[azfake.PagerResponder[armstandbypool.StandbyVirtualMachinePoolsClientListByResourceGroupResponse]] - newListBySubscriptionPager *tracker[azfake.PagerResponder[armstandbypool.StandbyVirtualMachinePoolsClientListBySubscriptionResponse]] -} - -// Do implements the policy.Transporter interface for StandbyVirtualMachinePoolsServerTransport. -func (s *StandbyVirtualMachinePoolsServerTransport) 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 "StandbyVirtualMachinePoolsClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "StandbyVirtualMachinePoolsClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "StandbyVirtualMachinePoolsClient.Get": - resp, err = s.dispatchGet(req) - case "StandbyVirtualMachinePoolsClient.NewListByResourceGroupPager": - resp, err = s.dispatchNewListByResourceGroupPager(req) - case "StandbyVirtualMachinePoolsClient.NewListBySubscriptionPager": - resp, err = s.dispatchNewListBySubscriptionPager(req) - case "StandbyVirtualMachinePoolsClient.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 *StandbyVirtualMachinePoolsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if s.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := s.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StandbyPool/standbyVirtualMachinePools/(?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[armstandbypool.StandbyVirtualMachinePoolResource](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - standbyVirtualMachinePoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standbyVirtualMachinePoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, standbyVirtualMachinePoolNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - s.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) { - s.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) { - s.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (s *StandbyVirtualMachinePoolsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if s.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := s.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StandbyPool/standbyVirtualMachinePools/(?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 - } - standbyVirtualMachinePoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standbyVirtualMachinePoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, standbyVirtualMachinePoolNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - s.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) { - s.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) { - s.beginDelete.remove(req) - } - - return resp, nil -} - -func (s *StandbyVirtualMachinePoolsServerTransport) 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/Microsoft\.StandbyPool/standbyVirtualMachinePools/(?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 - } - standbyVirtualMachinePoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standbyVirtualMachinePoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, standbyVirtualMachinePoolNameParam, 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).StandbyVirtualMachinePoolResource, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (s *StandbyVirtualMachinePoolsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { - if s.srv.NewListByResourceGroupPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} - } - newListByResourceGroupPager := s.newListByResourceGroupPager.get(req) - if newListByResourceGroupPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StandbyPool/standbyVirtualMachinePools` - 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 := s.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) - newListByResourceGroupPager = &resp - s.newListByResourceGroupPager.add(req, newListByResourceGroupPager) - server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armstandbypool.StandbyVirtualMachinePoolsClientListByResourceGroupResponse, 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) { - s.newListByResourceGroupPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByResourceGroupPager) { - s.newListByResourceGroupPager.remove(req) - } - return resp, nil -} - -func (s *StandbyVirtualMachinePoolsServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { - if s.srv.NewListBySubscriptionPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} - } - newListBySubscriptionPager := s.newListBySubscriptionPager.get(req) - if newListBySubscriptionPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StandbyPool/standbyVirtualMachinePools` - 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 := s.srv.NewListBySubscriptionPager(nil) - newListBySubscriptionPager = &resp - s.newListBySubscriptionPager.add(req, newListBySubscriptionPager) - server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armstandbypool.StandbyVirtualMachinePoolsClientListBySubscriptionResponse, 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) { - s.newListBySubscriptionPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListBySubscriptionPager) { - s.newListBySubscriptionPager.remove(req) - } - return resp, nil -} - -func (s *StandbyVirtualMachinePoolsServerTransport) 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/Microsoft\.StandbyPool/standbyVirtualMachinePools/(?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[armstandbypool.StandbyVirtualMachinePoolResourceUpdate](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - standbyVirtualMachinePoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standbyVirtualMachinePoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Update(req.Context(), resourceGroupNameParam, standbyVirtualMachinePoolNameParam, 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).StandbyVirtualMachinePoolResource, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/fake/standbyvirtualmachines_server.go b/sdk/resourcemanager/standbypool/armstandbypool/fake/standbyvirtualmachines_server.go deleted file mode 100644 index 54c472156135..000000000000 --- a/sdk/resourcemanager/standbypool/armstandbypool/fake/standbyvirtualmachines_server.go +++ /dev/null @@ -1,156 +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/standbypool/armstandbypool" - "net/http" - "net/url" - "regexp" -) - -// StandbyVirtualMachinesServer is a fake server for instances of the armstandbypool.StandbyVirtualMachinesClient type. -type StandbyVirtualMachinesServer struct { - // Get is the fake for method StandbyVirtualMachinesClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, standbyVirtualMachineName string, options *armstandbypool.StandbyVirtualMachinesClientGetOptions) (resp azfake.Responder[armstandbypool.StandbyVirtualMachinesClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByStandbyVirtualMachinePoolResourcePager is the fake for method StandbyVirtualMachinesClient.NewListByStandbyVirtualMachinePoolResourcePager - // HTTP status codes to indicate success: http.StatusOK - NewListByStandbyVirtualMachinePoolResourcePager func(resourceGroupName string, standbyVirtualMachinePoolName string, options *armstandbypool.StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceOptions) (resp azfake.PagerResponder[armstandbypool.StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse]) -} - -// NewStandbyVirtualMachinesServerTransport creates a new instance of StandbyVirtualMachinesServerTransport with the provided implementation. -// The returned StandbyVirtualMachinesServerTransport instance is connected to an instance of armstandbypool.StandbyVirtualMachinesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewStandbyVirtualMachinesServerTransport(srv *StandbyVirtualMachinesServer) *StandbyVirtualMachinesServerTransport { - return &StandbyVirtualMachinesServerTransport{ - srv: srv, - newListByStandbyVirtualMachinePoolResourcePager: newTracker[azfake.PagerResponder[armstandbypool.StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse]](), - } -} - -// StandbyVirtualMachinesServerTransport connects instances of armstandbypool.StandbyVirtualMachinesClient to instances of StandbyVirtualMachinesServer. -// Don't use this type directly, use NewStandbyVirtualMachinesServerTransport instead. -type StandbyVirtualMachinesServerTransport struct { - srv *StandbyVirtualMachinesServer - newListByStandbyVirtualMachinePoolResourcePager *tracker[azfake.PagerResponder[armstandbypool.StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse]] -} - -// Do implements the policy.Transporter interface for StandbyVirtualMachinesServerTransport. -func (s *StandbyVirtualMachinesServerTransport) 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 "StandbyVirtualMachinesClient.Get": - resp, err = s.dispatchGet(req) - case "StandbyVirtualMachinesClient.NewListByStandbyVirtualMachinePoolResourcePager": - resp, err = s.dispatchNewListByStandbyVirtualMachinePoolResourcePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (s *StandbyVirtualMachinesServerTransport) 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/Microsoft\.StandbyPool/standbyVirtualMachinePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/standbyVirtualMachines/(?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 - } - standbyVirtualMachinePoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standbyVirtualMachinePoolName")]) - if err != nil { - return nil, err - } - standbyVirtualMachineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standbyVirtualMachineName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, standbyVirtualMachinePoolNameParam, standbyVirtualMachineNameParam, 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).StandbyVirtualMachineResource, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (s *StandbyVirtualMachinesServerTransport) dispatchNewListByStandbyVirtualMachinePoolResourcePager(req *http.Request) (*http.Response, error) { - if s.srv.NewListByStandbyVirtualMachinePoolResourcePager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByStandbyVirtualMachinePoolResourcePager not implemented")} - } - newListByStandbyVirtualMachinePoolResourcePager := s.newListByStandbyVirtualMachinePoolResourcePager.get(req) - if newListByStandbyVirtualMachinePoolResourcePager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.StandbyPool/standbyVirtualMachinePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/standbyVirtualMachines` - 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 - } - standbyVirtualMachinePoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standbyVirtualMachinePoolName")]) - if err != nil { - return nil, err - } - resp := s.srv.NewListByStandbyVirtualMachinePoolResourcePager(resourceGroupNameParam, standbyVirtualMachinePoolNameParam, nil) - newListByStandbyVirtualMachinePoolResourcePager = &resp - s.newListByStandbyVirtualMachinePoolResourcePager.add(req, newListByStandbyVirtualMachinePoolResourcePager) - server.PagerResponderInjectNextLinks(newListByStandbyVirtualMachinePoolResourcePager, req, func(page *armstandbypool.StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByStandbyVirtualMachinePoolResourcePager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - s.newListByStandbyVirtualMachinePoolResourcePager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByStandbyVirtualMachinePoolResourcePager) { - s.newListByStandbyVirtualMachinePoolResourcePager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/fake/time_rfc3339.go b/sdk/resourcemanager/standbypool/armstandbypool/fake/time_rfc3339.go deleted file mode 100644 index 81f308b0d343..000000000000 --- a/sdk/resourcemanager/standbypool/armstandbypool/fake/time_rfc3339.go +++ /dev/null @@ -1,110 +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 ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/go.mod b/sdk/resourcemanager/standbypool/armstandbypool/go.mod index 240851bac176..a44dc3f742fa 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/go.mod +++ b/sdk/resourcemanager/standbypool/armstandbypool/go.mod @@ -1,21 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool/v2 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/standbypool/armstandbypool/go.sum b/sdk/resourcemanager/standbypool/armstandbypool/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/go.sum +++ b/sdk/resourcemanager/standbypool/armstandbypool/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/standbypool/armstandbypool/models.go b/sdk/resourcemanager/standbypool/armstandbypool/models.go index 7e0504e9dc02..d10e2823b2a4 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/models.go +++ b/sdk/resourcemanager/standbypool/armstandbypool/models.go @@ -8,44 +8,6 @@ package armstandbypool -import "time" - -// ContainerGroupProfile - Details of the ContainerGroupProfile. -type ContainerGroupProfile struct { - // REQUIRED; Specifies container group profile id of standby container groups. - ID *string - - // Specifies revision of container group profile. - Revision *int64 -} - -// ContainerGroupProfileUpdate - Details of the ContainerGroupProfile. -type ContainerGroupProfileUpdate struct { - // Specifies container group profile id of standby container groups. - ID *string - - // Specifies revision of container group profile. - Revision *int64 -} - -// ContainerGroupProperties - Details of the ContainerGroupProperties. -type ContainerGroupProperties struct { - // REQUIRED; Specifies container group profile of standby container groups. - ContainerGroupProfile *ContainerGroupProfile - - // Specifies subnet Ids for container group. - SubnetIDs []*Subnet -} - -// ContainerGroupPropertiesUpdate - Details of the ContainerGroupProperties. -type ContainerGroupPropertiesUpdate struct { - // Specifies container group profile of standby container groups. - ContainerGroupProfile *ContainerGroupProfileUpdate - - // Specifies subnet Ids for container group. - SubnetIDs []*Subnet -} - // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. @@ -94,229 +56,3 @@ type OperationListResult struct { // READ-ONLY; List of operations supported by the resource provider Value []*Operation } - -// StandbyContainerGroupPoolElasticityProfile - Specifies the elasticity profile of the standby container group pools. -type StandbyContainerGroupPoolElasticityProfile struct { - // REQUIRED; Specifies maximum number of standby container groups in the standby pool. - MaxReadyCapacity *int64 - - // Specifies refill policy of the pool. - RefillPolicy *RefillPolicy -} - -// StandbyContainerGroupPoolElasticityProfileUpdate - Specifies the elasticity profile of the standby container group pools. -type StandbyContainerGroupPoolElasticityProfileUpdate struct { - // Specifies maximum number of standby container groups in the standby pool. - MaxReadyCapacity *int64 - - // Specifies refill policy of the pool. - RefillPolicy *RefillPolicy -} - -// StandbyContainerGroupPoolResource - A StandbyContainerGroupPoolResource. -type StandbyContainerGroupPoolResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // The resource-specific properties for this resource. - Properties *StandbyContainerGroupPoolResourceProperties - - // 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 -} - -// StandbyContainerGroupPoolResourceListResult - The response of a StandbyContainerGroupPoolResource list operation. -type StandbyContainerGroupPoolResourceListResult struct { - // REQUIRED; The StandbyContainerGroupPoolResource items on this page - Value []*StandbyContainerGroupPoolResource - - // READ-ONLY; The link to the next page of items - NextLink *string -} - -// StandbyContainerGroupPoolResourceProperties - Details of the StandbyContainerGroupPool. -type StandbyContainerGroupPoolResourceProperties struct { - // REQUIRED; Specifies container group properties of standby container group pools. - ContainerGroupProperties *ContainerGroupProperties - - // REQUIRED; Specifies elasticity profile of standby container group pools. - ElasticityProfile *StandbyContainerGroupPoolElasticityProfile - - // READ-ONLY; The status of the last operation. - ProvisioningState *ProvisioningState -} - -// StandbyContainerGroupPoolResourceUpdate - The type used for update operations of the StandbyContainerGroupPoolResource. -type StandbyContainerGroupPoolResourceUpdate struct { - // The updatable properties of the StandbyContainerGroupPoolResource. - Properties *StandbyContainerGroupPoolResourceUpdateProperties - - // Resource tags. - Tags map[string]*string -} - -// StandbyContainerGroupPoolResourceUpdateProperties - The updatable properties of the StandbyContainerGroupPoolResource. -type StandbyContainerGroupPoolResourceUpdateProperties struct { - // Specifies container group properties of standby container group pools. - ContainerGroupProperties *ContainerGroupPropertiesUpdate - - // Specifies elasticity profile of standby container group pools. - ElasticityProfile *StandbyContainerGroupPoolElasticityProfileUpdate -} - -// StandbyVirtualMachinePoolElasticityProfile - Details of the elasticity profile. -type StandbyVirtualMachinePoolElasticityProfile struct { - // REQUIRED; Specifies the maximum number of virtual machines in the standby virtual machine pool. - MaxReadyCapacity *int64 -} - -// StandbyVirtualMachinePoolElasticityProfileUpdate - Details of the elasticity profile. -type StandbyVirtualMachinePoolElasticityProfileUpdate struct { - // Specifies the maximum number of virtual machines in the standby virtual machine pool. - MaxReadyCapacity *int64 -} - -// StandbyVirtualMachinePoolResource - A StandbyVirtualMachinePoolResource. -type StandbyVirtualMachinePoolResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // The resource-specific properties for this resource. - Properties *StandbyVirtualMachinePoolResourceProperties - - // 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 -} - -// StandbyVirtualMachinePoolResourceListResult - The response of a StandbyVirtualMachinePoolResource list operation. -type StandbyVirtualMachinePoolResourceListResult struct { - // REQUIRED; The StandbyVirtualMachinePoolResource items on this page - Value []*StandbyVirtualMachinePoolResource - - // READ-ONLY; The link to the next page of items - NextLink *string -} - -// StandbyVirtualMachinePoolResourceProperties - Details of the StandbyVirtualMachinePool. -type StandbyVirtualMachinePoolResourceProperties struct { - // REQUIRED; Specifies the desired state of virtual machines in the pool. - VirtualMachineState *VirtualMachineState - - // Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to. - AttachedVirtualMachineScaleSetID *string - - // Specifies the elasticity profile of the standby virtual machine pools. - ElasticityProfile *StandbyVirtualMachinePoolElasticityProfile - - // READ-ONLY; The status of the last operation. - ProvisioningState *ProvisioningState -} - -// StandbyVirtualMachinePoolResourceUpdate - The type used for update operations of the StandbyVirtualMachinePoolResource. -type StandbyVirtualMachinePoolResourceUpdate struct { - // The updatable properties of the StandbyVirtualMachinePoolResource. - Properties *StandbyVirtualMachinePoolResourceUpdateProperties - - // Resource tags. - Tags map[string]*string -} - -// StandbyVirtualMachinePoolResourceUpdateProperties - The updatable properties of the StandbyVirtualMachinePoolResource. -type StandbyVirtualMachinePoolResourceUpdateProperties struct { - // Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to. - AttachedVirtualMachineScaleSetID *string - - // Specifies the elasticity profile of the standby virtual machine pools. - ElasticityProfile *StandbyVirtualMachinePoolElasticityProfileUpdate - - // Specifies the desired state of virtual machines in the pool. - VirtualMachineState *VirtualMachineState -} - -// StandbyVirtualMachineResource - Concrete proxy resource types can be created by aliasing this type using a specific property -// type. -type StandbyVirtualMachineResource struct { - // The resource-specific properties for this resource. - Properties *StandbyVirtualMachineResourceProperties - - // 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 -} - -// StandbyVirtualMachineResourceListResult - The response of a StandbyVirtualMachineResource list operation. -type StandbyVirtualMachineResourceListResult struct { - // REQUIRED; The StandbyVirtualMachineResource items on this page - Value []*StandbyVirtualMachineResource - - // READ-ONLY; The link to the next page of items - NextLink *string -} - -// StandbyVirtualMachineResourceProperties - Details of the StandbyVirtualMachine. -type StandbyVirtualMachineResourceProperties struct { - // REQUIRED; Resource id of the virtual machine. - VirtualMachineResourceID *string - - // READ-ONLY; The status of the last operation. - ProvisioningState *ProvisioningState -} - -// Subnet of container group -type Subnet struct { - // REQUIRED; Specifies ARM resource id of the subnet. - ID *string -} - -// SystemData - Metadata pertaining to creation and last modification of the resource. -type SystemData struct { - // The timestamp of resource creation (UTC). - CreatedAt *time.Time - - // The identity that created the resource. - CreatedBy *string - - // The type of identity that created the resource. - CreatedByType *CreatedByType - - // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time - - // The identity that last modified the resource. - LastModifiedBy *string - - // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/models_serde.go b/sdk/resourcemanager/standbypool/armstandbypool/models_serde.go index 6ada58efb903..f075e45b1963 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/models_serde.go +++ b/sdk/resourcemanager/standbypool/armstandbypool/models_serde.go @@ -15,130 +15,6 @@ import ( "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type ContainerGroupProfile. -func (c ContainerGroupProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "revision", c.Revision) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerGroupProfile. -func (c *ContainerGroupProfile) 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", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "revision": - err = unpopulate(val, "Revision", &c.Revision) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerGroupProfileUpdate. -func (c ContainerGroupProfileUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "revision", c.Revision) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerGroupProfileUpdate. -func (c *ContainerGroupProfileUpdate) 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", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "revision": - err = unpopulate(val, "Revision", &c.Revision) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerGroupProperties. -func (c ContainerGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "containerGroupProfile", c.ContainerGroupProfile) - populate(objectMap, "subnetIds", c.SubnetIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerGroupProperties. -func (c *ContainerGroupProperties) 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", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "containerGroupProfile": - err = unpopulate(val, "ContainerGroupProfile", &c.ContainerGroupProfile) - delete(rawMsg, key) - case "subnetIds": - err = unpopulate(val, "SubnetIDs", &c.SubnetIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerGroupPropertiesUpdate. -func (c ContainerGroupPropertiesUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "containerGroupProfile", c.ContainerGroupProfile) - populate(objectMap, "subnetIds", c.SubnetIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerGroupPropertiesUpdate. -func (c *ContainerGroupPropertiesUpdate) 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", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "containerGroupProfile": - err = unpopulate(val, "ContainerGroupProfile", &c.ContainerGroupProfile) - delete(rawMsg, key) - case "subnetIds": - err = unpopulate(val, "SubnetIDs", &c.SubnetIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -252,667 +128,6 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StandbyContainerGroupPoolElasticityProfile. -func (s StandbyContainerGroupPoolElasticityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxReadyCapacity", s.MaxReadyCapacity) - populate(objectMap, "refillPolicy", s.RefillPolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyContainerGroupPoolElasticityProfile. -func (s *StandbyContainerGroupPoolElasticityProfile) 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 "maxReadyCapacity": - err = unpopulate(val, "MaxReadyCapacity", &s.MaxReadyCapacity) - delete(rawMsg, key) - case "refillPolicy": - err = unpopulate(val, "RefillPolicy", &s.RefillPolicy) - 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 StandbyContainerGroupPoolElasticityProfileUpdate. -func (s StandbyContainerGroupPoolElasticityProfileUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxReadyCapacity", s.MaxReadyCapacity) - populate(objectMap, "refillPolicy", s.RefillPolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyContainerGroupPoolElasticityProfileUpdate. -func (s *StandbyContainerGroupPoolElasticityProfileUpdate) 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 "maxReadyCapacity": - err = unpopulate(val, "MaxReadyCapacity", &s.MaxReadyCapacity) - delete(rawMsg, key) - case "refillPolicy": - err = unpopulate(val, "RefillPolicy", &s.RefillPolicy) - 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 StandbyContainerGroupPoolResource. -func (s StandbyContainerGroupPoolResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyContainerGroupPoolResource. -func (s *StandbyContainerGroupPoolResource) 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 "location": - err = unpopulate(val, "Location", &s.Location) - 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 "tags": - err = unpopulate(val, "Tags", &s.Tags) - 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 StandbyContainerGroupPoolResourceListResult. -func (s StandbyContainerGroupPoolResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyContainerGroupPoolResourceListResult. -func (s *StandbyContainerGroupPoolResourceListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - 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 StandbyContainerGroupPoolResourceProperties. -func (s StandbyContainerGroupPoolResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "containerGroupProperties", s.ContainerGroupProperties) - populate(objectMap, "elasticityProfile", s.ElasticityProfile) - populate(objectMap, "provisioningState", s.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyContainerGroupPoolResourceProperties. -func (s *StandbyContainerGroupPoolResourceProperties) 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 "containerGroupProperties": - err = unpopulate(val, "ContainerGroupProperties", &s.ContainerGroupProperties) - delete(rawMsg, key) - case "elasticityProfile": - err = unpopulate(val, "ElasticityProfile", &s.ElasticityProfile) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - 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 StandbyContainerGroupPoolResourceUpdate. -func (s StandbyContainerGroupPoolResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyContainerGroupPoolResourceUpdate. -func (s *StandbyContainerGroupPoolResourceUpdate) 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 "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - 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 StandbyContainerGroupPoolResourceUpdateProperties. -func (s StandbyContainerGroupPoolResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "containerGroupProperties", s.ContainerGroupProperties) - populate(objectMap, "elasticityProfile", s.ElasticityProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyContainerGroupPoolResourceUpdateProperties. -func (s *StandbyContainerGroupPoolResourceUpdateProperties) 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 "containerGroupProperties": - err = unpopulate(val, "ContainerGroupProperties", &s.ContainerGroupProperties) - delete(rawMsg, key) - case "elasticityProfile": - err = unpopulate(val, "ElasticityProfile", &s.ElasticityProfile) - 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 StandbyVirtualMachinePoolElasticityProfile. -func (s StandbyVirtualMachinePoolElasticityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxReadyCapacity", s.MaxReadyCapacity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyVirtualMachinePoolElasticityProfile. -func (s *StandbyVirtualMachinePoolElasticityProfile) 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 "maxReadyCapacity": - err = unpopulate(val, "MaxReadyCapacity", &s.MaxReadyCapacity) - 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 StandbyVirtualMachinePoolElasticityProfileUpdate. -func (s StandbyVirtualMachinePoolElasticityProfileUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxReadyCapacity", s.MaxReadyCapacity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyVirtualMachinePoolElasticityProfileUpdate. -func (s *StandbyVirtualMachinePoolElasticityProfileUpdate) 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 "maxReadyCapacity": - err = unpopulate(val, "MaxReadyCapacity", &s.MaxReadyCapacity) - 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 StandbyVirtualMachinePoolResource. -func (s StandbyVirtualMachinePoolResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyVirtualMachinePoolResource. -func (s *StandbyVirtualMachinePoolResource) 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 "location": - err = unpopulate(val, "Location", &s.Location) - 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 "tags": - err = unpopulate(val, "Tags", &s.Tags) - 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 StandbyVirtualMachinePoolResourceListResult. -func (s StandbyVirtualMachinePoolResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyVirtualMachinePoolResourceListResult. -func (s *StandbyVirtualMachinePoolResourceListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - 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 StandbyVirtualMachinePoolResourceProperties. -func (s StandbyVirtualMachinePoolResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "attachedVirtualMachineScaleSetId", s.AttachedVirtualMachineScaleSetID) - populate(objectMap, "elasticityProfile", s.ElasticityProfile) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "virtualMachineState", s.VirtualMachineState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyVirtualMachinePoolResourceProperties. -func (s *StandbyVirtualMachinePoolResourceProperties) 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 "attachedVirtualMachineScaleSetId": - err = unpopulate(val, "AttachedVirtualMachineScaleSetID", &s.AttachedVirtualMachineScaleSetID) - delete(rawMsg, key) - case "elasticityProfile": - err = unpopulate(val, "ElasticityProfile", &s.ElasticityProfile) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "virtualMachineState": - err = unpopulate(val, "VirtualMachineState", &s.VirtualMachineState) - 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 StandbyVirtualMachinePoolResourceUpdate. -func (s StandbyVirtualMachinePoolResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyVirtualMachinePoolResourceUpdate. -func (s *StandbyVirtualMachinePoolResourceUpdate) 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 "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - 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 StandbyVirtualMachinePoolResourceUpdateProperties. -func (s StandbyVirtualMachinePoolResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "attachedVirtualMachineScaleSetId", s.AttachedVirtualMachineScaleSetID) - populate(objectMap, "elasticityProfile", s.ElasticityProfile) - populate(objectMap, "virtualMachineState", s.VirtualMachineState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyVirtualMachinePoolResourceUpdateProperties. -func (s *StandbyVirtualMachinePoolResourceUpdateProperties) 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 "attachedVirtualMachineScaleSetId": - err = unpopulate(val, "AttachedVirtualMachineScaleSetID", &s.AttachedVirtualMachineScaleSetID) - delete(rawMsg, key) - case "elasticityProfile": - err = unpopulate(val, "ElasticityProfile", &s.ElasticityProfile) - delete(rawMsg, key) - case "virtualMachineState": - err = unpopulate(val, "VirtualMachineState", &s.VirtualMachineState) - 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 StandbyVirtualMachineResource. -func (s StandbyVirtualMachineResource) 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 StandbyVirtualMachineResource. -func (s *StandbyVirtualMachineResource) 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 StandbyVirtualMachineResourceListResult. -func (s StandbyVirtualMachineResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyVirtualMachineResourceListResult. -func (s *StandbyVirtualMachineResourceListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - 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 StandbyVirtualMachineResourceProperties. -func (s StandbyVirtualMachineResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "virtualMachineResourceId", s.VirtualMachineResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StandbyVirtualMachineResourceProperties. -func (s *StandbyVirtualMachineResourceProperties) 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 "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "virtualMachineResourceId": - err = unpopulate(val, "VirtualMachineResourceID", &s.VirtualMachineResourceID) - 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) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Subnet. -func (s *Subnet) 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) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - func populate(m map[string]any, k string, v any) { if v == nil { return diff --git a/sdk/resourcemanager/standbypool/armstandbypool/operations_client.go b/sdk/resourcemanager/standbypool/armstandbypool/operations_client.go index d42322d11641..d9c767b15026 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/operations_client.go +++ b/sdk/resourcemanager/standbypool/armstandbypool/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2023-12-01-preview +// Generated from API version 2024-03-01-preview // - 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]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-12-01-preview") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/standbypool/armstandbypool/operations_client_example_test.go b/sdk/resourcemanager/standbypool/armstandbypool/operations_client_example_test.go deleted file mode 100644 index 1293c0bb9277..000000000000 --- a/sdk/resourcemanager/standbypool/armstandbypool/operations_client_example_test.go +++ /dev/null @@ -1,58 +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 armstandbypool_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-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 := armstandbypool.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 = armstandbypool.OperationListResult{ - // Value: []*armstandbypool.Operation{ - // { - // Name: to.Ptr("Microsoft.StandbyPool/standbyContainerGroupPools/write"), - // ActionType: to.Ptr(armstandbypool.ActionTypeInternal), - // Display: &armstandbypool.OperationDisplay{ - // Description: to.Ptr("Create a StandbyContainerGroupPools Resource"), - // Operation: to.Ptr("StandbyContainerGroupPools_Create"), - // Provider: to.Ptr("Microsoft.StandbyPool"), - // Resource: to.Ptr("standbyContainerGroupPools"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armstandbypool.OriginUser), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/options.go b/sdk/resourcemanager/standbypool/armstandbypool/options.go index 9c96fe7d61da..c9e5948a93e0 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/options.go +++ b/sdk/resourcemanager/standbypool/armstandbypool/options.go @@ -12,90 +12,3 @@ package armstandbypool type OperationsClientListOptions struct { // placeholder for future optional parameters } - -// StandbyContainerGroupPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the StandbyContainerGroupPoolsClient.BeginCreateOrUpdate -// method. -type StandbyContainerGroupPoolsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// StandbyContainerGroupPoolsClientBeginDeleteOptions contains the optional parameters for the StandbyContainerGroupPoolsClient.BeginDelete -// method. -type StandbyContainerGroupPoolsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// StandbyContainerGroupPoolsClientGetOptions contains the optional parameters for the StandbyContainerGroupPoolsClient.Get -// method. -type StandbyContainerGroupPoolsClientGetOptions struct { - // placeholder for future optional parameters -} - -// StandbyContainerGroupPoolsClientListByResourceGroupOptions contains the optional parameters for the StandbyContainerGroupPoolsClient.NewListByResourceGroupPager -// method. -type StandbyContainerGroupPoolsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// StandbyContainerGroupPoolsClientListBySubscriptionOptions contains the optional parameters for the StandbyContainerGroupPoolsClient.NewListBySubscriptionPager -// method. -type StandbyContainerGroupPoolsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// StandbyContainerGroupPoolsClientUpdateOptions contains the optional parameters for the StandbyContainerGroupPoolsClient.Update -// method. -type StandbyContainerGroupPoolsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// StandbyVirtualMachinePoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the StandbyVirtualMachinePoolsClient.BeginCreateOrUpdate -// method. -type StandbyVirtualMachinePoolsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// StandbyVirtualMachinePoolsClientBeginDeleteOptions contains the optional parameters for the StandbyVirtualMachinePoolsClient.BeginDelete -// method. -type StandbyVirtualMachinePoolsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// StandbyVirtualMachinePoolsClientGetOptions contains the optional parameters for the StandbyVirtualMachinePoolsClient.Get -// method. -type StandbyVirtualMachinePoolsClientGetOptions struct { - // placeholder for future optional parameters -} - -// StandbyVirtualMachinePoolsClientListByResourceGroupOptions contains the optional parameters for the StandbyVirtualMachinePoolsClient.NewListByResourceGroupPager -// method. -type StandbyVirtualMachinePoolsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// StandbyVirtualMachinePoolsClientListBySubscriptionOptions contains the optional parameters for the StandbyVirtualMachinePoolsClient.NewListBySubscriptionPager -// method. -type StandbyVirtualMachinePoolsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// StandbyVirtualMachinePoolsClientUpdateOptions contains the optional parameters for the StandbyVirtualMachinePoolsClient.Update -// method. -type StandbyVirtualMachinePoolsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// StandbyVirtualMachinesClientGetOptions contains the optional parameters for the StandbyVirtualMachinesClient.Get method. -type StandbyVirtualMachinesClientGetOptions struct { - // placeholder for future optional parameters -} - -// StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceOptions contains the optional parameters for the StandbyVirtualMachinesClient.NewListByStandbyVirtualMachinePoolResourcePager -// method. -type StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceOptions struct { - // placeholder for future optional parameters -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/responses.go b/sdk/resourcemanager/standbypool/armstandbypool/responses.go index dfefa3073208..2af5254851a6 100644 --- a/sdk/resourcemanager/standbypool/armstandbypool/responses.go +++ b/sdk/resourcemanager/standbypool/armstandbypool/responses.go @@ -13,85 +13,3 @@ type OperationsClientListResponse struct { // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult } - -// StandbyContainerGroupPoolsClientCreateOrUpdateResponse contains the response from method StandbyContainerGroupPoolsClient.BeginCreateOrUpdate. -type StandbyContainerGroupPoolsClientCreateOrUpdateResponse struct { - // A StandbyContainerGroupPoolResource. - StandbyContainerGroupPoolResource -} - -// StandbyContainerGroupPoolsClientDeleteResponse contains the response from method StandbyContainerGroupPoolsClient.BeginDelete. -type StandbyContainerGroupPoolsClientDeleteResponse struct { - // placeholder for future response values -} - -// StandbyContainerGroupPoolsClientGetResponse contains the response from method StandbyContainerGroupPoolsClient.Get. -type StandbyContainerGroupPoolsClientGetResponse struct { - // A StandbyContainerGroupPoolResource. - StandbyContainerGroupPoolResource -} - -// StandbyContainerGroupPoolsClientListByResourceGroupResponse contains the response from method StandbyContainerGroupPoolsClient.NewListByResourceGroupPager. -type StandbyContainerGroupPoolsClientListByResourceGroupResponse struct { - // The response of a StandbyContainerGroupPoolResource list operation. - StandbyContainerGroupPoolResourceListResult -} - -// StandbyContainerGroupPoolsClientListBySubscriptionResponse contains the response from method StandbyContainerGroupPoolsClient.NewListBySubscriptionPager. -type StandbyContainerGroupPoolsClientListBySubscriptionResponse struct { - // The response of a StandbyContainerGroupPoolResource list operation. - StandbyContainerGroupPoolResourceListResult -} - -// StandbyContainerGroupPoolsClientUpdateResponse contains the response from method StandbyContainerGroupPoolsClient.Update. -type StandbyContainerGroupPoolsClientUpdateResponse struct { - // A StandbyContainerGroupPoolResource. - StandbyContainerGroupPoolResource -} - -// StandbyVirtualMachinePoolsClientCreateOrUpdateResponse contains the response from method StandbyVirtualMachinePoolsClient.BeginCreateOrUpdate. -type StandbyVirtualMachinePoolsClientCreateOrUpdateResponse struct { - // A StandbyVirtualMachinePoolResource. - StandbyVirtualMachinePoolResource -} - -// StandbyVirtualMachinePoolsClientDeleteResponse contains the response from method StandbyVirtualMachinePoolsClient.BeginDelete. -type StandbyVirtualMachinePoolsClientDeleteResponse struct { - // placeholder for future response values -} - -// StandbyVirtualMachinePoolsClientGetResponse contains the response from method StandbyVirtualMachinePoolsClient.Get. -type StandbyVirtualMachinePoolsClientGetResponse struct { - // A StandbyVirtualMachinePoolResource. - StandbyVirtualMachinePoolResource -} - -// StandbyVirtualMachinePoolsClientListByResourceGroupResponse contains the response from method StandbyVirtualMachinePoolsClient.NewListByResourceGroupPager. -type StandbyVirtualMachinePoolsClientListByResourceGroupResponse struct { - // The response of a StandbyVirtualMachinePoolResource list operation. - StandbyVirtualMachinePoolResourceListResult -} - -// StandbyVirtualMachinePoolsClientListBySubscriptionResponse contains the response from method StandbyVirtualMachinePoolsClient.NewListBySubscriptionPager. -type StandbyVirtualMachinePoolsClientListBySubscriptionResponse struct { - // The response of a StandbyVirtualMachinePoolResource list operation. - StandbyVirtualMachinePoolResourceListResult -} - -// StandbyVirtualMachinePoolsClientUpdateResponse contains the response from method StandbyVirtualMachinePoolsClient.Update. -type StandbyVirtualMachinePoolsClientUpdateResponse struct { - // A StandbyVirtualMachinePoolResource. - StandbyVirtualMachinePoolResource -} - -// StandbyVirtualMachinesClientGetResponse contains the response from method StandbyVirtualMachinesClient.Get. -type StandbyVirtualMachinesClientGetResponse struct { - // Concrete proxy resource types can be created by aliasing this type using a specific property type. - StandbyVirtualMachineResource -} - -// StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse contains the response from method StandbyVirtualMachinesClient.NewListByStandbyVirtualMachinePoolResourcePager. -type StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse struct { - // The response of a StandbyVirtualMachineResource list operation. - StandbyVirtualMachineResourceListResult -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/standbycontainergrouppools_client.go b/sdk/resourcemanager/standbypool/armstandbypool/standbycontainergrouppools_client.go deleted file mode 100644 index 909d02439519..000000000000 --- a/sdk/resourcemanager/standbypool/armstandbypool/standbycontainergrouppools_client.go +++ /dev/null @@ -1,451 +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 armstandbypool - -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" -) - -// StandbyContainerGroupPoolsClient contains the methods for the StandbyContainerGroupPools group. -// Don't use this type directly, use NewStandbyContainerGroupPoolsClient() instead. -type StandbyContainerGroupPoolsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewStandbyContainerGroupPoolsClient creates a new instance of StandbyContainerGroupPoolsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewStandbyContainerGroupPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StandbyContainerGroupPoolsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &StandbyContainerGroupPoolsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create a StandbyContainerGroupPoolResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - standbyContainerGroupPoolName - Name of the standby container group pool -// - resource - Resource create parameters. -// - options - StandbyContainerGroupPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the StandbyContainerGroupPoolsClient.BeginCreateOrUpdate -// method. -func (client *StandbyContainerGroupPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, resource StandbyContainerGroupPoolResource, options *StandbyContainerGroupPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[StandbyContainerGroupPoolsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, standbyContainerGroupPoolName, resource, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[StandbyContainerGroupPoolsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[StandbyContainerGroupPoolsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create a StandbyContainerGroupPoolResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -func (client *StandbyContainerGroupPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, resource StandbyContainerGroupPoolResource, options *StandbyContainerGroupPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "StandbyContainerGroupPoolsClient.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, standbyContainerGroupPoolName, resource, 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 *StandbyContainerGroupPoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, resource StandbyContainerGroupPoolResource, options *StandbyContainerGroupPoolsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" - 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 standbyContainerGroupPoolName == "" { - return nil, errors.New("parameter standbyContainerGroupPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{standbyContainerGroupPoolName}", url.PathEscape(standbyContainerGroupPoolName)) - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a StandbyContainerGroupPoolResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - standbyContainerGroupPoolName - Name of the standby container group pool -// - options - StandbyContainerGroupPoolsClientBeginDeleteOptions contains the optional parameters for the StandbyContainerGroupPoolsClient.BeginDelete -// method. -func (client *StandbyContainerGroupPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, options *StandbyContainerGroupPoolsClientBeginDeleteOptions) (*runtime.Poller[StandbyContainerGroupPoolsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, standbyContainerGroupPoolName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[StandbyContainerGroupPoolsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[StandbyContainerGroupPoolsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a StandbyContainerGroupPoolResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -func (client *StandbyContainerGroupPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, options *StandbyContainerGroupPoolsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "StandbyContainerGroupPoolsClient.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, standbyContainerGroupPoolName, 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 *StandbyContainerGroupPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, options *StandbyContainerGroupPoolsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" - 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 standbyContainerGroupPoolName == "" { - return nil, errors.New("parameter standbyContainerGroupPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{standbyContainerGroupPoolName}", url.PathEscape(standbyContainerGroupPoolName)) - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a StandbyContainerGroupPoolResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - standbyContainerGroupPoolName - Name of the standby container group pool -// - options - StandbyContainerGroupPoolsClientGetOptions contains the optional parameters for the StandbyContainerGroupPoolsClient.Get -// method. -func (client *StandbyContainerGroupPoolsClient) Get(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, options *StandbyContainerGroupPoolsClientGetOptions) (StandbyContainerGroupPoolsClientGetResponse, error) { - var err error - const operationName = "StandbyContainerGroupPoolsClient.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, standbyContainerGroupPoolName, options) - if err != nil { - return StandbyContainerGroupPoolsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return StandbyContainerGroupPoolsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return StandbyContainerGroupPoolsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *StandbyContainerGroupPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, options *StandbyContainerGroupPoolsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" - 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 standbyContainerGroupPoolName == "" { - return nil, errors.New("parameter standbyContainerGroupPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{standbyContainerGroupPoolName}", url.PathEscape(standbyContainerGroupPoolName)) - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *StandbyContainerGroupPoolsClient) getHandleResponse(resp *http.Response) (StandbyContainerGroupPoolsClientGetResponse, error) { - result := StandbyContainerGroupPoolsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StandbyContainerGroupPoolResource); err != nil { - return StandbyContainerGroupPoolsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - List StandbyContainerGroupPoolResource resources by resource group -// -// Generated from API version 2023-12-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - options - StandbyContainerGroupPoolsClientListByResourceGroupOptions contains the optional parameters for the StandbyContainerGroupPoolsClient.NewListByResourceGroupPager -// method. -func (client *StandbyContainerGroupPoolsClient) NewListByResourceGroupPager(resourceGroupName string, options *StandbyContainerGroupPoolsClientListByResourceGroupOptions) *runtime.Pager[StandbyContainerGroupPoolsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[StandbyContainerGroupPoolsClientListByResourceGroupResponse]{ - More: func(page StandbyContainerGroupPoolsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *StandbyContainerGroupPoolsClientListByResourceGroupResponse) (StandbyContainerGroupPoolsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "StandbyContainerGroupPoolsClient.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 StandbyContainerGroupPoolsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *StandbyContainerGroupPoolsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *StandbyContainerGroupPoolsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools" - 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)) - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *StandbyContainerGroupPoolsClient) listByResourceGroupHandleResponse(resp *http.Response) (StandbyContainerGroupPoolsClientListByResourceGroupResponse, error) { - result := StandbyContainerGroupPoolsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StandbyContainerGroupPoolResourceListResult); err != nil { - return StandbyContainerGroupPoolsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - List StandbyContainerGroupPoolResource resources by subscription ID -// -// Generated from API version 2023-12-01-preview -// - options - StandbyContainerGroupPoolsClientListBySubscriptionOptions contains the optional parameters for the StandbyContainerGroupPoolsClient.NewListBySubscriptionPager -// method. -func (client *StandbyContainerGroupPoolsClient) NewListBySubscriptionPager(options *StandbyContainerGroupPoolsClientListBySubscriptionOptions) *runtime.Pager[StandbyContainerGroupPoolsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[StandbyContainerGroupPoolsClientListBySubscriptionResponse]{ - More: func(page StandbyContainerGroupPoolsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *StandbyContainerGroupPoolsClientListBySubscriptionResponse) (StandbyContainerGroupPoolsClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "StandbyContainerGroupPoolsClient.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 StandbyContainerGroupPoolsClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *StandbyContainerGroupPoolsClient) listBySubscriptionCreateRequest(ctx context.Context, options *StandbyContainerGroupPoolsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyContainerGroupPools" - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *StandbyContainerGroupPoolsClient) listBySubscriptionHandleResponse(resp *http.Response) (StandbyContainerGroupPoolsClientListBySubscriptionResponse, error) { - result := StandbyContainerGroupPoolsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StandbyContainerGroupPoolResourceListResult); err != nil { - return StandbyContainerGroupPoolsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update a StandbyContainerGroupPoolResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - standbyContainerGroupPoolName - Name of the standby container group pool -// - properties - The resource properties to be updated. -// - options - StandbyContainerGroupPoolsClientUpdateOptions contains the optional parameters for the StandbyContainerGroupPoolsClient.Update -// method. -func (client *StandbyContainerGroupPoolsClient) Update(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, properties StandbyContainerGroupPoolResourceUpdate, options *StandbyContainerGroupPoolsClientUpdateOptions) (StandbyContainerGroupPoolsClientUpdateResponse, error) { - var err error - const operationName = "StandbyContainerGroupPoolsClient.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, standbyContainerGroupPoolName, properties, options) - if err != nil { - return StandbyContainerGroupPoolsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return StandbyContainerGroupPoolsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return StandbyContainerGroupPoolsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *StandbyContainerGroupPoolsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, standbyContainerGroupPoolName string, properties StandbyContainerGroupPoolResourceUpdate, options *StandbyContainerGroupPoolsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}" - 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 standbyContainerGroupPoolName == "" { - return nil, errors.New("parameter standbyContainerGroupPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{standbyContainerGroupPoolName}", url.PathEscape(standbyContainerGroupPoolName)) - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, properties); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *StandbyContainerGroupPoolsClient) updateHandleResponse(resp *http.Response) (StandbyContainerGroupPoolsClientUpdateResponse, error) { - result := StandbyContainerGroupPoolsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StandbyContainerGroupPoolResource); err != nil { - return StandbyContainerGroupPoolsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/standbycontainergrouppools_client_example_test.go b/sdk/resourcemanager/standbypool/armstandbypool/standbycontainergrouppools_client_example_test.go deleted file mode 100644 index 7094a15278c7..000000000000 --- a/sdk/resourcemanager/standbypool/armstandbypool/standbycontainergrouppools_client_example_test.go +++ /dev/null @@ -1,362 +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 armstandbypool_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/standbypool/armstandbypool" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyContainerGroupPools_ListBySubscription.json -func ExampleStandbyContainerGroupPoolsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStandbyContainerGroupPoolsClient().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.StandbyContainerGroupPoolResourceListResult = armstandbypool.StandbyContainerGroupPoolResourceListResult{ - // Value: []*armstandbypool.StandbyContainerGroupPoolResource{ - // { - // Name: to.Ptr("pool"), - // Type: to.Ptr("Microsoft.StandbyPool/standbyContainerGroupPools"), - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool"), - // SystemData: &armstandbypool.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // CreatedBy: to.Ptr("pooluser@microsoft.com"), - // CreatedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // LastModifiedBy: to.Ptr("pooluser@microsoft.com"), - // LastModifiedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armstandbypool.StandbyContainerGroupPoolResourceProperties{ - // ContainerGroupProperties: &armstandbypool.ContainerGroupProperties{ - // ContainerGroupProfile: &armstandbypool.ContainerGroupProfile{ - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile"), - // Revision: to.Ptr[int64](1), - // }, - // SubnetIDs: []*armstandbypool.Subnet{ - // { - // ID: to.Ptr("/subscriptions/8cf6c1b6-c80f-437c-87ad-45fbaff54f73/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet"), - // }}, - // }, - // ElasticityProfile: &armstandbypool.StandbyContainerGroupPoolElasticityProfile{ - // MaxReadyCapacity: to.Ptr[int64](688), - // RefillPolicy: to.Ptr(armstandbypool.RefillPolicyAlways), - // }, - // ProvisioningState: to.Ptr(armstandbypool.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyContainerGroupPools_ListByResourceGroup.json -func ExampleStandbyContainerGroupPoolsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStandbyContainerGroupPoolsClient().NewListByResourceGroupPager("rgstandbypool", 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.StandbyContainerGroupPoolResourceListResult = armstandbypool.StandbyContainerGroupPoolResourceListResult{ - // Value: []*armstandbypool.StandbyContainerGroupPoolResource{ - // { - // Name: to.Ptr("pool"), - // Type: to.Ptr("Microsoft.StandbyPool/standbyContainerGroupPools"), - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool"), - // SystemData: &armstandbypool.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // CreatedBy: to.Ptr("pooluser@microsoft.com"), - // CreatedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // LastModifiedBy: to.Ptr("pooluser@microsoft.com"), - // LastModifiedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armstandbypool.StandbyContainerGroupPoolResourceProperties{ - // ContainerGroupProperties: &armstandbypool.ContainerGroupProperties{ - // ContainerGroupProfile: &armstandbypool.ContainerGroupProfile{ - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile"), - // Revision: to.Ptr[int64](1), - // }, - // SubnetIDs: []*armstandbypool.Subnet{ - // { - // ID: to.Ptr("/subscriptions/8cf6c1b6-c80f-437c-87ad-45fbaff54f73/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet"), - // }}, - // }, - // ElasticityProfile: &armstandbypool.StandbyContainerGroupPoolElasticityProfile{ - // MaxReadyCapacity: to.Ptr[int64](688), - // RefillPolicy: to.Ptr(armstandbypool.RefillPolicyAlways), - // }, - // ProvisioningState: to.Ptr(armstandbypool.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyContainerGroupPools_Get.json -func ExampleStandbyContainerGroupPoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStandbyContainerGroupPoolsClient().Get(ctx, "rgstandbypool", "pool", 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.StandbyContainerGroupPoolResource = armstandbypool.StandbyContainerGroupPoolResource{ - // Name: to.Ptr("pool"), - // Type: to.Ptr("Microsoft.StandbyPool/standbyContainerGroupPools"), - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool"), - // SystemData: &armstandbypool.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // CreatedBy: to.Ptr("pooluser@microsoft.com"), - // CreatedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // LastModifiedBy: to.Ptr("pooluser@microsoft.com"), - // LastModifiedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armstandbypool.StandbyContainerGroupPoolResourceProperties{ - // ContainerGroupProperties: &armstandbypool.ContainerGroupProperties{ - // ContainerGroupProfile: &armstandbypool.ContainerGroupProfile{ - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile"), - // Revision: to.Ptr[int64](1), - // }, - // SubnetIDs: []*armstandbypool.Subnet{ - // { - // ID: to.Ptr("/subscriptions/8cf6c1b6-c80f-437c-87ad-45fbaff54f73/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet"), - // }}, - // }, - // ElasticityProfile: &armstandbypool.StandbyContainerGroupPoolElasticityProfile{ - // MaxReadyCapacity: to.Ptr[int64](688), - // RefillPolicy: to.Ptr(armstandbypool.RefillPolicyAlways), - // }, - // ProvisioningState: to.Ptr(armstandbypool.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyContainerGroupPools_CreateOrUpdate.json -func ExampleStandbyContainerGroupPoolsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStandbyContainerGroupPoolsClient().BeginCreateOrUpdate(ctx, "rgstandbypool", "pool", armstandbypool.StandbyContainerGroupPoolResource{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armstandbypool.StandbyContainerGroupPoolResourceProperties{ - ContainerGroupProperties: &armstandbypool.ContainerGroupProperties{ - ContainerGroupProfile: &armstandbypool.ContainerGroupProfile{ - ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile"), - Revision: to.Ptr[int64](1), - }, - SubnetIDs: []*armstandbypool.Subnet{ - { - ID: to.Ptr("/subscriptions/8cf6c1b6-c80f-437c-87ad-45fbaff54f73/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet"), - }}, - }, - ElasticityProfile: &armstandbypool.StandbyContainerGroupPoolElasticityProfile{ - MaxReadyCapacity: to.Ptr[int64](688), - RefillPolicy: to.Ptr(armstandbypool.RefillPolicyAlways), - }, - }, - }, 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.StandbyContainerGroupPoolResource = armstandbypool.StandbyContainerGroupPoolResource{ - // Name: to.Ptr("pool"), - // Type: to.Ptr("Microsoft.StandbyPool/standbyContainerGroupPools"), - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool"), - // SystemData: &armstandbypool.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // CreatedBy: to.Ptr("pooluser@microsoft.com"), - // CreatedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // LastModifiedBy: to.Ptr("pooluser@microsoft.com"), - // LastModifiedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armstandbypool.StandbyContainerGroupPoolResourceProperties{ - // ContainerGroupProperties: &armstandbypool.ContainerGroupProperties{ - // ContainerGroupProfile: &armstandbypool.ContainerGroupProfile{ - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile"), - // Revision: to.Ptr[int64](1), - // }, - // SubnetIDs: []*armstandbypool.Subnet{ - // { - // ID: to.Ptr("/subscriptions/8cf6c1b6-c80f-437c-87ad-45fbaff54f73/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet"), - // }}, - // }, - // ElasticityProfile: &armstandbypool.StandbyContainerGroupPoolElasticityProfile{ - // MaxReadyCapacity: to.Ptr[int64](688), - // RefillPolicy: to.Ptr(armstandbypool.RefillPolicyAlways), - // }, - // ProvisioningState: to.Ptr(armstandbypool.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyContainerGroupPools_Update.json -func ExampleStandbyContainerGroupPoolsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStandbyContainerGroupPoolsClient().Update(ctx, "rgstandbypool", "pool", armstandbypool.StandbyContainerGroupPoolResourceUpdate{ - Properties: &armstandbypool.StandbyContainerGroupPoolResourceUpdateProperties{ - ContainerGroupProperties: &armstandbypool.ContainerGroupPropertiesUpdate{ - ContainerGroupProfile: &armstandbypool.ContainerGroupProfileUpdate{ - ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile"), - Revision: to.Ptr[int64](2), - }, - SubnetIDs: []*armstandbypool.Subnet{ - { - ID: to.Ptr("/subscriptions/8cf6c1b6-c80f-437c-87ad-45fbaff54f73/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet"), - }}, - }, - ElasticityProfile: &armstandbypool.StandbyContainerGroupPoolElasticityProfileUpdate{ - MaxReadyCapacity: to.Ptr[int64](1743), - RefillPolicy: to.Ptr(armstandbypool.RefillPolicyAlways), - }, - }, - Tags: map[string]*string{}, - }, 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.StandbyContainerGroupPoolResource = armstandbypool.StandbyContainerGroupPoolResource{ - // Name: to.Ptr("pool"), - // Type: to.Ptr("Microsoft.StandbyPool/standbyContainerGroupPools"), - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool"), - // SystemData: &armstandbypool.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // CreatedBy: to.Ptr("pooluser@microsoft.com"), - // CreatedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // LastModifiedBy: to.Ptr("pooluser@microsoft.com"), - // LastModifiedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armstandbypool.StandbyContainerGroupPoolResourceProperties{ - // ContainerGroupProperties: &armstandbypool.ContainerGroupProperties{ - // ContainerGroupProfile: &armstandbypool.ContainerGroupProfile{ - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile"), - // Revision: to.Ptr[int64](2), - // }, - // SubnetIDs: []*armstandbypool.Subnet{ - // { - // ID: to.Ptr("/subscriptions/8cf6c1b6-c80f-437c-87ad-45fbaff54f73/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet"), - // }}, - // }, - // ElasticityProfile: &armstandbypool.StandbyContainerGroupPoolElasticityProfile{ - // MaxReadyCapacity: to.Ptr[int64](1743), - // RefillPolicy: to.Ptr(armstandbypool.RefillPolicyAlways), - // }, - // ProvisioningState: to.Ptr(armstandbypool.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyContainerGroupPools_Delete.json -func ExampleStandbyContainerGroupPoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStandbyContainerGroupPoolsClient().BeginDelete(ctx, "rgstandbypool", "pool", 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/standbypool/armstandbypool/standbyvirtualmachinepools_client.go b/sdk/resourcemanager/standbypool/armstandbypool/standbyvirtualmachinepools_client.go deleted file mode 100644 index 845ed9315a91..000000000000 --- a/sdk/resourcemanager/standbypool/armstandbypool/standbyvirtualmachinepools_client.go +++ /dev/null @@ -1,451 +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 armstandbypool - -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" -) - -// StandbyVirtualMachinePoolsClient contains the methods for the StandbyVirtualMachinePools group. -// Don't use this type directly, use NewStandbyVirtualMachinePoolsClient() instead. -type StandbyVirtualMachinePoolsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewStandbyVirtualMachinePoolsClient creates a new instance of StandbyVirtualMachinePoolsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewStandbyVirtualMachinePoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StandbyVirtualMachinePoolsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &StandbyVirtualMachinePoolsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create a StandbyVirtualMachinePoolResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - standbyVirtualMachinePoolName - Name of the standby virtual machine pool -// - resource - Resource create parameters. -// - options - StandbyVirtualMachinePoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the StandbyVirtualMachinePoolsClient.BeginCreateOrUpdate -// method. -func (client *StandbyVirtualMachinePoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, resource StandbyVirtualMachinePoolResource, options *StandbyVirtualMachinePoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[StandbyVirtualMachinePoolsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, standbyVirtualMachinePoolName, resource, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[StandbyVirtualMachinePoolsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[StandbyVirtualMachinePoolsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create a StandbyVirtualMachinePoolResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -func (client *StandbyVirtualMachinePoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, resource StandbyVirtualMachinePoolResource, options *StandbyVirtualMachinePoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "StandbyVirtualMachinePoolsClient.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, standbyVirtualMachinePoolName, resource, 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 *StandbyVirtualMachinePoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, resource StandbyVirtualMachinePoolResource, options *StandbyVirtualMachinePoolsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" - 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 standbyVirtualMachinePoolName == "" { - return nil, errors.New("parameter standbyVirtualMachinePoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{standbyVirtualMachinePoolName}", url.PathEscape(standbyVirtualMachinePoolName)) - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a StandbyVirtualMachinePoolResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - standbyVirtualMachinePoolName - Name of the standby virtual machine pool -// - options - StandbyVirtualMachinePoolsClientBeginDeleteOptions contains the optional parameters for the StandbyVirtualMachinePoolsClient.BeginDelete -// method. -func (client *StandbyVirtualMachinePoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, options *StandbyVirtualMachinePoolsClientBeginDeleteOptions) (*runtime.Poller[StandbyVirtualMachinePoolsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, standbyVirtualMachinePoolName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[StandbyVirtualMachinePoolsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[StandbyVirtualMachinePoolsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a StandbyVirtualMachinePoolResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -func (client *StandbyVirtualMachinePoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, options *StandbyVirtualMachinePoolsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "StandbyVirtualMachinePoolsClient.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, standbyVirtualMachinePoolName, 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 *StandbyVirtualMachinePoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, options *StandbyVirtualMachinePoolsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" - 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 standbyVirtualMachinePoolName == "" { - return nil, errors.New("parameter standbyVirtualMachinePoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{standbyVirtualMachinePoolName}", url.PathEscape(standbyVirtualMachinePoolName)) - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a StandbyVirtualMachinePoolResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - standbyVirtualMachinePoolName - Name of the standby virtual machine pool -// - options - StandbyVirtualMachinePoolsClientGetOptions contains the optional parameters for the StandbyVirtualMachinePoolsClient.Get -// method. -func (client *StandbyVirtualMachinePoolsClient) Get(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, options *StandbyVirtualMachinePoolsClientGetOptions) (StandbyVirtualMachinePoolsClientGetResponse, error) { - var err error - const operationName = "StandbyVirtualMachinePoolsClient.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, standbyVirtualMachinePoolName, options) - if err != nil { - return StandbyVirtualMachinePoolsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return StandbyVirtualMachinePoolsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return StandbyVirtualMachinePoolsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *StandbyVirtualMachinePoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, options *StandbyVirtualMachinePoolsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" - 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 standbyVirtualMachinePoolName == "" { - return nil, errors.New("parameter standbyVirtualMachinePoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{standbyVirtualMachinePoolName}", url.PathEscape(standbyVirtualMachinePoolName)) - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *StandbyVirtualMachinePoolsClient) getHandleResponse(resp *http.Response) (StandbyVirtualMachinePoolsClientGetResponse, error) { - result := StandbyVirtualMachinePoolsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StandbyVirtualMachinePoolResource); err != nil { - return StandbyVirtualMachinePoolsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - List StandbyVirtualMachinePoolResource resources by resource group -// -// Generated from API version 2023-12-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - options - StandbyVirtualMachinePoolsClientListByResourceGroupOptions contains the optional parameters for the StandbyVirtualMachinePoolsClient.NewListByResourceGroupPager -// method. -func (client *StandbyVirtualMachinePoolsClient) NewListByResourceGroupPager(resourceGroupName string, options *StandbyVirtualMachinePoolsClientListByResourceGroupOptions) *runtime.Pager[StandbyVirtualMachinePoolsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[StandbyVirtualMachinePoolsClientListByResourceGroupResponse]{ - More: func(page StandbyVirtualMachinePoolsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *StandbyVirtualMachinePoolsClientListByResourceGroupResponse) (StandbyVirtualMachinePoolsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "StandbyVirtualMachinePoolsClient.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 StandbyVirtualMachinePoolsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *StandbyVirtualMachinePoolsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *StandbyVirtualMachinePoolsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools" - 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)) - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *StandbyVirtualMachinePoolsClient) listByResourceGroupHandleResponse(resp *http.Response) (StandbyVirtualMachinePoolsClientListByResourceGroupResponse, error) { - result := StandbyVirtualMachinePoolsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StandbyVirtualMachinePoolResourceListResult); err != nil { - return StandbyVirtualMachinePoolsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - List StandbyVirtualMachinePoolResource resources by subscription ID -// -// Generated from API version 2023-12-01-preview -// - options - StandbyVirtualMachinePoolsClientListBySubscriptionOptions contains the optional parameters for the StandbyVirtualMachinePoolsClient.NewListBySubscriptionPager -// method. -func (client *StandbyVirtualMachinePoolsClient) NewListBySubscriptionPager(options *StandbyVirtualMachinePoolsClientListBySubscriptionOptions) *runtime.Pager[StandbyVirtualMachinePoolsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[StandbyVirtualMachinePoolsClientListBySubscriptionResponse]{ - More: func(page StandbyVirtualMachinePoolsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *StandbyVirtualMachinePoolsClientListBySubscriptionResponse) (StandbyVirtualMachinePoolsClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "StandbyVirtualMachinePoolsClient.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 StandbyVirtualMachinePoolsClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *StandbyVirtualMachinePoolsClient) listBySubscriptionCreateRequest(ctx context.Context, options *StandbyVirtualMachinePoolsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools" - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *StandbyVirtualMachinePoolsClient) listBySubscriptionHandleResponse(resp *http.Response) (StandbyVirtualMachinePoolsClientListBySubscriptionResponse, error) { - result := StandbyVirtualMachinePoolsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StandbyVirtualMachinePoolResourceListResult); err != nil { - return StandbyVirtualMachinePoolsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update a StandbyVirtualMachinePoolResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - standbyVirtualMachinePoolName - Name of the standby virtual machine pool -// - properties - The resource properties to be updated. -// - options - StandbyVirtualMachinePoolsClientUpdateOptions contains the optional parameters for the StandbyVirtualMachinePoolsClient.Update -// method. -func (client *StandbyVirtualMachinePoolsClient) Update(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, properties StandbyVirtualMachinePoolResourceUpdate, options *StandbyVirtualMachinePoolsClientUpdateOptions) (StandbyVirtualMachinePoolsClientUpdateResponse, error) { - var err error - const operationName = "StandbyVirtualMachinePoolsClient.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, standbyVirtualMachinePoolName, properties, options) - if err != nil { - return StandbyVirtualMachinePoolsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return StandbyVirtualMachinePoolsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return StandbyVirtualMachinePoolsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *StandbyVirtualMachinePoolsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, properties StandbyVirtualMachinePoolResourceUpdate, options *StandbyVirtualMachinePoolsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}" - 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 standbyVirtualMachinePoolName == "" { - return nil, errors.New("parameter standbyVirtualMachinePoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{standbyVirtualMachinePoolName}", url.PathEscape(standbyVirtualMachinePoolName)) - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, properties); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *StandbyVirtualMachinePoolsClient) updateHandleResponse(resp *http.Response) (StandbyVirtualMachinePoolsClientUpdateResponse, error) { - result := StandbyVirtualMachinePoolsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StandbyVirtualMachinePoolResource); err != nil { - return StandbyVirtualMachinePoolsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/standbyvirtualmachinepools_client_example_test.go b/sdk/resourcemanager/standbypool/armstandbypool/standbyvirtualmachinepools_client_example_test.go deleted file mode 100644 index 094fb75d93c2..000000000000 --- a/sdk/resourcemanager/standbypool/armstandbypool/standbyvirtualmachinepools_client_example_test.go +++ /dev/null @@ -1,299 +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 armstandbypool_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/standbypool/armstandbypool" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyVirtualMachinePools_ListBySubscription.json -func ExampleStandbyVirtualMachinePoolsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStandbyVirtualMachinePoolsClient().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.StandbyVirtualMachinePoolResourceListResult = armstandbypool.StandbyVirtualMachinePoolResourceListResult{ - // Value: []*armstandbypool.StandbyVirtualMachinePoolResource{ - // { - // Name: to.Ptr("pool"), - // Type: to.Ptr("Microsoft.StandbyPool/standbyVirtualMachinePools"), - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool"), - // SystemData: &armstandbypool.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // CreatedBy: to.Ptr("pooluser@microsoft.com"), - // CreatedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // LastModifiedBy: to.Ptr("pooluser@microsoft.com"), - // LastModifiedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armstandbypool.StandbyVirtualMachinePoolResourceProperties{ - // AttachedVirtualMachineScaleSetID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss"), - // ElasticityProfile: &armstandbypool.StandbyVirtualMachinePoolElasticityProfile{ - // MaxReadyCapacity: to.Ptr[int64](304), - // }, - // ProvisioningState: to.Ptr(armstandbypool.ProvisioningStateSucceeded), - // VirtualMachineState: to.Ptr(armstandbypool.VirtualMachineStateRunning), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyVirtualMachinePools_ListByResourceGroup.json -func ExampleStandbyVirtualMachinePoolsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStandbyVirtualMachinePoolsClient().NewListByResourceGroupPager("rgstandbypool", 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.StandbyVirtualMachinePoolResourceListResult = armstandbypool.StandbyVirtualMachinePoolResourceListResult{ - // Value: []*armstandbypool.StandbyVirtualMachinePoolResource{ - // { - // Name: to.Ptr("pool"), - // Type: to.Ptr("Microsoft.StandbyPool/standbyVirtualMachinePools"), - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool"), - // SystemData: &armstandbypool.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // CreatedBy: to.Ptr("pooluser@microsoft.com"), - // CreatedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // LastModifiedBy: to.Ptr("pooluser@microsoft.com"), - // LastModifiedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armstandbypool.StandbyVirtualMachinePoolResourceProperties{ - // AttachedVirtualMachineScaleSetID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss"), - // ElasticityProfile: &armstandbypool.StandbyVirtualMachinePoolElasticityProfile{ - // MaxReadyCapacity: to.Ptr[int64](304), - // }, - // ProvisioningState: to.Ptr(armstandbypool.ProvisioningStateSucceeded), - // VirtualMachineState: to.Ptr(armstandbypool.VirtualMachineStateRunning), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyVirtualMachinePools_Get.json -func ExampleStandbyVirtualMachinePoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStandbyVirtualMachinePoolsClient().Get(ctx, "rgstandbypool", "pool", 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.StandbyVirtualMachinePoolResource = armstandbypool.StandbyVirtualMachinePoolResource{ - // Name: to.Ptr("pool"), - // Type: to.Ptr("Microsoft.StandbyPool/standbyVirtualMachinePools"), - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool"), - // SystemData: &armstandbypool.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // CreatedBy: to.Ptr("pooluser@microsoft.com"), - // CreatedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // LastModifiedBy: to.Ptr("pooluser@microsoft.com"), - // LastModifiedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armstandbypool.StandbyVirtualMachinePoolResourceProperties{ - // AttachedVirtualMachineScaleSetID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss"), - // ElasticityProfile: &armstandbypool.StandbyVirtualMachinePoolElasticityProfile{ - // MaxReadyCapacity: to.Ptr[int64](304), - // }, - // ProvisioningState: to.Ptr(armstandbypool.ProvisioningStateSucceeded), - // VirtualMachineState: to.Ptr(armstandbypool.VirtualMachineStateRunning), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyVirtualMachinePools_CreateOrUpdate.json -func ExampleStandbyVirtualMachinePoolsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStandbyVirtualMachinePoolsClient().BeginCreateOrUpdate(ctx, "rgstandbypool", "pool", armstandbypool.StandbyVirtualMachinePoolResource{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armstandbypool.StandbyVirtualMachinePoolResourceProperties{ - AttachedVirtualMachineScaleSetID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss"), - ElasticityProfile: &armstandbypool.StandbyVirtualMachinePoolElasticityProfile{ - MaxReadyCapacity: to.Ptr[int64](304), - }, - VirtualMachineState: to.Ptr(armstandbypool.VirtualMachineStateRunning), - }, - }, 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.StandbyVirtualMachinePoolResource = armstandbypool.StandbyVirtualMachinePoolResource{ - // Name: to.Ptr("pool"), - // Type: to.Ptr("Microsoft.StandbyPool/standbyVirtualMachinePools"), - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool"), - // SystemData: &armstandbypool.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // CreatedBy: to.Ptr("pooluser@microsoft.com"), - // CreatedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // LastModifiedBy: to.Ptr("pooluser@microsoft.com"), - // LastModifiedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armstandbypool.StandbyVirtualMachinePoolResourceProperties{ - // AttachedVirtualMachineScaleSetID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss"), - // ElasticityProfile: &armstandbypool.StandbyVirtualMachinePoolElasticityProfile{ - // MaxReadyCapacity: to.Ptr[int64](304), - // }, - // ProvisioningState: to.Ptr(armstandbypool.ProvisioningStateSucceeded), - // VirtualMachineState: to.Ptr(armstandbypool.VirtualMachineStateRunning), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyVirtualMachinePools_Update.json -func ExampleStandbyVirtualMachinePoolsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStandbyVirtualMachinePoolsClient().Update(ctx, "rgstandbypool", "pool", armstandbypool.StandbyVirtualMachinePoolResourceUpdate{ - Properties: &armstandbypool.StandbyVirtualMachinePoolResourceUpdateProperties{ - AttachedVirtualMachineScaleSetID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss"), - ElasticityProfile: &armstandbypool.StandbyVirtualMachinePoolElasticityProfileUpdate{ - MaxReadyCapacity: to.Ptr[int64](304), - }, - VirtualMachineState: to.Ptr(armstandbypool.VirtualMachineStateRunning), - }, - Tags: map[string]*string{}, - }, 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.StandbyVirtualMachinePoolResource = armstandbypool.StandbyVirtualMachinePoolResource{ - // Name: to.Ptr("pool"), - // Type: to.Ptr("Microsoft.StandbyPool/standbyVirtualMachinePools"), - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool"), - // SystemData: &armstandbypool.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // CreatedBy: to.Ptr("pooluser@microsoft.com"), - // CreatedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // LastModifiedBy: to.Ptr("pooluser@microsoft.com"), - // LastModifiedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armstandbypool.StandbyVirtualMachinePoolResourceProperties{ - // AttachedVirtualMachineScaleSetID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss"), - // ElasticityProfile: &armstandbypool.StandbyVirtualMachinePoolElasticityProfile{ - // MaxReadyCapacity: to.Ptr[int64](304), - // }, - // ProvisioningState: to.Ptr(armstandbypool.ProvisioningStateSucceeded), - // VirtualMachineState: to.Ptr(armstandbypool.VirtualMachineStateRunning), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyVirtualMachinePools_Delete.json -func ExampleStandbyVirtualMachinePoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStandbyVirtualMachinePoolsClient().BeginDelete(ctx, "rgstandbypool", "pool", 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/standbypool/armstandbypool/standbyvirtualmachines_client.go b/sdk/resourcemanager/standbypool/armstandbypool/standbyvirtualmachines_client.go deleted file mode 100644 index fbdc18c6f5de..000000000000 --- a/sdk/resourcemanager/standbypool/armstandbypool/standbyvirtualmachines_client.go +++ /dev/null @@ -1,179 +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 armstandbypool - -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" -) - -// StandbyVirtualMachinesClient contains the methods for the StandbyVirtualMachines group. -// Don't use this type directly, use NewStandbyVirtualMachinesClient() instead. -type StandbyVirtualMachinesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewStandbyVirtualMachinesClient creates a new instance of StandbyVirtualMachinesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewStandbyVirtualMachinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StandbyVirtualMachinesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &StandbyVirtualMachinesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a StandbyVirtualMachineResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-12-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - standbyVirtualMachinePoolName - Name of the standby virtual machine pool -// - standbyVirtualMachineName - Name of the standby virtual machine -// - options - StandbyVirtualMachinesClientGetOptions contains the optional parameters for the StandbyVirtualMachinesClient.Get -// method. -func (client *StandbyVirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, standbyVirtualMachineName string, options *StandbyVirtualMachinesClientGetOptions) (StandbyVirtualMachinesClientGetResponse, error) { - var err error - const operationName = "StandbyVirtualMachinesClient.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, standbyVirtualMachinePoolName, standbyVirtualMachineName, options) - if err != nil { - return StandbyVirtualMachinesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return StandbyVirtualMachinesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return StandbyVirtualMachinesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *StandbyVirtualMachinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, standbyVirtualMachineName string, options *StandbyVirtualMachinesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines/{standbyVirtualMachineName}" - 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 standbyVirtualMachinePoolName == "" { - return nil, errors.New("parameter standbyVirtualMachinePoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{standbyVirtualMachinePoolName}", url.PathEscape(standbyVirtualMachinePoolName)) - if standbyVirtualMachineName == "" { - return nil, errors.New("parameter standbyVirtualMachineName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{standbyVirtualMachineName}", url.PathEscape(standbyVirtualMachineName)) - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *StandbyVirtualMachinesClient) getHandleResponse(resp *http.Response) (StandbyVirtualMachinesClientGetResponse, error) { - result := StandbyVirtualMachinesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StandbyVirtualMachineResource); err != nil { - return StandbyVirtualMachinesClientGetResponse{}, err - } - return result, nil -} - -// NewListByStandbyVirtualMachinePoolResourcePager - List StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource -// -// Generated from API version 2023-12-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - standbyVirtualMachinePoolName - Name of the standby virtual machine pool -// - options - StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceOptions contains the optional parameters for -// the StandbyVirtualMachinesClient.NewListByStandbyVirtualMachinePoolResourcePager method. -func (client *StandbyVirtualMachinesClient) NewListByStandbyVirtualMachinePoolResourcePager(resourceGroupName string, standbyVirtualMachinePoolName string, options *StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceOptions) *runtime.Pager[StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse] { - return runtime.NewPager(runtime.PagingHandler[StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse]{ - More: func(page StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse) (StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "StandbyVirtualMachinesClient.NewListByStandbyVirtualMachinePoolResourcePager") - 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.listByStandbyVirtualMachinePoolResourceCreateRequest(ctx, resourceGroupName, standbyVirtualMachinePoolName, options) - }, nil) - if err != nil { - return StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse{}, err - } - return client.listByStandbyVirtualMachinePoolResourceHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByStandbyVirtualMachinePoolResourceCreateRequest creates the ListByStandbyVirtualMachinePoolResource request. -func (client *StandbyVirtualMachinesClient) listByStandbyVirtualMachinePoolResourceCreateRequest(ctx context.Context, resourceGroupName string, standbyVirtualMachinePoolName string, options *StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines" - 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 standbyVirtualMachinePoolName == "" { - return nil, errors.New("parameter standbyVirtualMachinePoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{standbyVirtualMachinePoolName}", url.PathEscape(standbyVirtualMachinePoolName)) - 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", "2023-12-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByStandbyVirtualMachinePoolResourceHandleResponse handles the ListByStandbyVirtualMachinePoolResource response. -func (client *StandbyVirtualMachinesClient) listByStandbyVirtualMachinePoolResourceHandleResponse(resp *http.Response) (StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse, error) { - result := StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.StandbyVirtualMachineResourceListResult); err != nil { - return StandbyVirtualMachinesClientListByStandbyVirtualMachinePoolResourceResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/standbyvirtualmachines_client_example_test.go b/sdk/resourcemanager/standbypool/armstandbypool/standbyvirtualmachines_client_example_test.go deleted file mode 100644 index 9b2c64b15a9b..000000000000 --- a/sdk/resourcemanager/standbypool/armstandbypool/standbyvirtualmachines_client_example_test.go +++ /dev/null @@ -1,100 +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 armstandbypool_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/standbypool/armstandbypool" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json -func ExampleStandbyVirtualMachinesClient_NewListByStandbyVirtualMachinePoolResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStandbyVirtualMachinesClient().NewListByStandbyVirtualMachinePoolResourcePager("rgstandbypool", "pool", 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.StandbyVirtualMachineResourceListResult = armstandbypool.StandbyVirtualMachineResourceListResult{ - // Value: []*armstandbypool.StandbyVirtualMachineResource{ - // { - // Name: to.Ptr("pool"), - // Type: to.Ptr("Microsoft.StandbyPool/standbyVirtualMachinePools/virtualMachines"), - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/standbyVirtualMachines/virtualMachine"), - // SystemData: &armstandbypool.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // CreatedBy: to.Ptr("pooluser@microsoft.com"), - // CreatedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // LastModifiedBy: to.Ptr("pooluser@microsoft.com"), - // LastModifiedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // }, - // Properties: &armstandbypool.StandbyVirtualMachineResourceProperties{ - // ProvisioningState: to.Ptr(armstandbypool.ProvisioningStateSucceeded), - // VirtualMachineResourceID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/provider/Microsoft.Compute/virtualMachines/virtualMachine"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/examples/StandbyVirtualMachines_Get.json -func ExampleStandbyVirtualMachinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstandbypool.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStandbyVirtualMachinesClient().Get(ctx, "rgstandbypool", "pool", "virtualMachine", 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.StandbyVirtualMachineResource = armstandbypool.StandbyVirtualMachineResource{ - // Name: to.Ptr("pool"), - // Type: to.Ptr("Microsoft.StandbyPool/standbyVirtualMachinePools/virtualMachines"), - // ID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/standbyVirtualMachines/virtualMachine"), - // SystemData: &armstandbypool.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // CreatedBy: to.Ptr("pooluser@microsoft.com"), - // CreatedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-07T16:33:22.210Z"); return t}()), - // LastModifiedBy: to.Ptr("pooluser@microsoft.com"), - // LastModifiedByType: to.Ptr(armstandbypool.CreatedByTypeUser), - // }, - // Properties: &armstandbypool.StandbyVirtualMachineResourceProperties{ - // ProvisioningState: to.Ptr(armstandbypool.ProvisioningStateSucceeded), - // VirtualMachineResourceID: to.Ptr("/subscriptions/8CC31D61-82D7-4B2B-B9DC-6B924DE7D229/resourceGroups/rgstandbypool/provider/Microsoft.Compute/virtualMachines/virtualMachine"), - // }, - // } -} diff --git a/sdk/resourcemanager/standbypool/armstandbypool/time_rfc3339.go b/sdk/resourcemanager/standbypool/armstandbypool/time_rfc3339.go deleted file mode 100644 index 33bd0cce2a7e..000000000000 --- a/sdk/resourcemanager/standbypool/armstandbypool/time_rfc3339.go +++ /dev/null @@ -1,110 +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 armstandbypool - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -}